feat(frontend): client-side validation and error feedback on campaign form - #1388
Merged
joelpeace48-cell merged 2 commits intoSep 25, 2026
Conversation
validateCampaignForm checks name length, positive whole-number reward amounts, non-negative max participants, Stellar contract address format for reward token / contract ID, end date in the future (create only) and end date after start date. Refs FinesseStudioLab#1230
Wire validateCampaignForm into CreateCampaign: per-field errors appear on blur or after a submit attempt, inputs get aria-invalid/aria-describedby, and submission is blocked with a summary message until errors are fixed. Closes FinesseStudioLab#1230
|
@Temi-suwa18 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
joelpeace48-cell
merged commit Sep 25, 2026
7491c67
into
FinesseStudioLab:main
9 of 23 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds instant client-side validation and inline error feedback to the campaign form (
frontend/src/CreateCampaign.jsx). The form now catches invalid token amounts, end dates in the past and missing or malformed required fields before anything is sent to the API or the chain.Changes
frontend/src/lib/validateCampaignForm.js(new)A pure function that takes the form values and returns a map from field to error message:
namerewardPerAction0, negatives, decimals and non-numeric input)maxParticipantsrewardToken/contractIdCfollowed by 55 base32 characters)startDate/endDateIn edit mode the "end date in the past" rule is skipped, so admins can still edit campaigns that have already ended.
frontend/src/CreateCampaign.jsxaria-invalid, plusaria-describedbypointing to arole="alert"message.frontend/src/Landing.cssStyles for
.create-campaign-field-errorand invalid inputs, using the existing--dangertoken.Tests
frontend/src/lib/validateCampaignForm.test.jsadds 9 Vitest cases covering every branch above, including the edit-mode past-date exemption.Verification
node_moduleswere installed locally.CreateCampaign.jsxcompiles with esbuild.Notes
rewardPerActionto require a positive value means an explicit0is now rejected. Leaving the field empty still sends0as before.Closes feat(frontend): Add client-side input validation and error feedback on campaign form #1230
Closes feat(frontend): Add full-screen modal gallery for campaign media assets #1231
Closes feat(frontend): Campaign comparison tool (side-by-side reward & task specs) #1232
Closes feat(frontend): Add claim transaction gas estimator widget before wallet signature #1233