Repository navigation
Validate AUTO_WIFI_ON_INTERVAL range - #828
Merged
Merged
Conversation
The auto-WiFi interval field accepted any text. It now renders as a numeric input constrained to 1-2147483 seconds (the firmware stores the interval in int32 milliseconds, hence the upper bound) and shows an inline error when the value is not a whole number in range. Fixes #524
Per review: instead of a hardcoded range map in the UI, add a Number kind to UserDefineKind with optional min/max fields on UserDefine, set them in TargetUserDefinesFactory (min 1, max 2147483), expose min/max over GraphQL, and have UserDefinesList derive validation purely from the model.
…lowed range Review feedback: the visual error alone did not block submission (a manually typed -11111 was accepted) and min/max were not shown until an error appeared. - UserDefinesValidator: add validateNumericRanges — an out-of-range or non-integer Number user-define now produces a validation error, which blocks the build/flash (same gate as regulatory-domain / binding-phrase validation). - UserDefinesList: helper text now always shows the allowed range, switching to the out-of-range message when invalid. - Add UserDefinesValidator.test.ts covering below-min/above-max/non-integer/disabled.
…ng path) Adds integration-level assertions that an out-of-range numeric user-define surfaces through validate() (the gate ConfiguratorView uses to block the build), not just through the validateNumericRanges sub-method.
…is in UserDefinesValidator
Regenerate GraphQL types so min/max are fetched, emit the build flag for number options, allow 0 and only show helper text on errors.
📦 Build artifacts
|
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.
Fixes #524. Supersedes #789 and keeps its commits.
On top of #789:
min/maxare actually fetchedyarn gql-codegenwith the authenticated API (API_AUTH_TOKEN)