fix(frontend): validate threshold selection before advancing round (#383)#587
Open
lgelauff wants to merge 3 commits into
Open
fix(frontend): validate threshold selection before advancing round (#383)#587lgelauff wants to merge 3 commits into
lgelauff wants to merge 3 commits into
Conversation
…ng round (#383) Add a guard in submitRound() that blocks form submission and shows an i18n error when the threshold dropdown is visible but nothing is selected. Adds en.json key and qqq.json translator note. Based on work by Oyelakin Mercy in #384. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The threshold guard used `!formData.value.threshold`, which would also
block a legitimate 0.0 ("advance all") selection — the backend's
get_threshold_map explicitly offers 0.0 as a threshold option. Check for
null/empty (nothing selected) explicitly instead.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What & why
Fixes the frontend half of #383: when a coordinator advances into a new round, the form shows a threshold dropdown. Submitting without picking a threshold sent an empty value to the backend, which surfaced as a raw network/500 error instead of clear feedback.
This adds a pre-flight guard in
submitRound()so the bad request is never sent — the coordinator gets an i18n error and stays on the form.Changes
RoundNew.vue— guard insubmitRound(): if the threshold dropdown is shown but nothing is selected, showmontage-required-thresholdand abort submission.en.json/qqq.json— new i18n key + translator note.== null || === '') rather than falsiness, because0.0("advance all") is a valid threshold that the backend'sget_threshold_mapoffers — a!thresholdcheck would wrongly block it.Relationship to other work
Testing
npm run lintclean.0.0option) → submits normally.Opening as draft for review.