Skip to content

fix(frontend): validate threshold selection before advancing round (#383)#587

Open
lgelauff wants to merge 3 commits into
masterfrom
fix/threshold-validation-frontend-383
Open

fix(frontend): validate threshold selection before advancing round (#383)#587
lgelauff wants to merge 3 commits into
masterfrom
fix/threshold-validation-frontend-383

Conversation

@lgelauff

Copy link
Copy Markdown
Collaborator

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 in submitRound(): if the threshold dropdown is shown but nothing is selected, show montage-required-threshold and abort submission.
  • en.json / qqq.json — new i18n key + translator note.
  • The guard checks for "nothing selected" explicitly (== null || === '') rather than falsiness, because 0.0 ("advance all") is a valid threshold that the backend's get_threshold_map offers — a !threshold check would wrongly block it.

Relationship to other work

Testing

  • npm run lint clean.
  • Manual: advance a round with the threshold dropdown visible and nothing selected → inline error, no request sent. Selecting any threshold (including the 0.0 option) → submits normally.

Opening as draft for review.

lgelauff and others added 2 commits June 7, 2026 15:11
…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>
@lgelauff lgelauff marked this pull request as ready for review June 18, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Network error shown when creating ranking round without threshold selection

1 participant