feat(frontend): add unlimited updates toggle to group policy form - #1589
Draft
nurbu wants to merge 1 commit into
Draft
feat(frontend): add unlimited updates toggle to group policy form#1589nurbu wants to merge 1 commit into
nurbu wants to merge 1 commit into
Conversation
Adds a switch to the group edit dialog so admins can mark a group as unlimited without needing to know the 999999 sentinel value. Fixes flatcar#265
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an “Unlimited updates” toggle to the Group Edit dialog’s Policy tab so users can enable the backend’s “no rate limiting” mode without manually entering a sentinel max-updates value.
Changes:
- Added an i18n string for the new “Unlimited updates” switch label.
- Exported the existing “unlimited updates” threshold constant so it can be reused by the edit dialog.
- Added the toggle + conditional disabling/validation for
maxUpdates, and mapped the toggle topolicy_max_updates_per_periodon submit.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| frontend/src/i18n/locales/en/groups.json | Adds a translation key for the new toggle label. |
| frontend/src/components/Groups/GroupItem.tsx | Exports the existing backend threshold constant for reuse. |
| frontend/src/components/Groups/GroupEditDialog/GroupPolicyForm.tsx | Adds the “Unlimited updates” switch and disables the max-updates field when enabled (also raises min to 1). |
| frontend/src/components/Groups/GroupEditDialog/GroupEditDialog.tsx | Wires the toggle into initial values, validation, and submit payload mapping. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "safe_mode_lower": "Safe mode", | ||
| "status_breakdown": "Status Breakdown", | ||
| "track_identifier": "Track (identifier for clients, filled with the group ID if omitted)", | ||
| "unlimited_updates_lower": "Unlimited updates", |
Comment on lines
+72
to
+73
| policy_max_updates_per_period: values.updatesUnlimited | ||
| ? Max_UPDATES_PER_TIME_PERIOD : parseInt(values.maxUpdates), |
Comment on lines
+193
to
+197
| maxUpdates: Yup.number(). when('updatesUnlimited', { | ||
| is: true, | ||
| then: schema => schema.notRequired(), | ||
| otherwise: () => positiveNum(), | ||
| }), |
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.
Adds an 'Unlimited updates' switch to the group edit dialog's Policy tab, so unlimited updates no longer require knowing to type 999999 into the max-updates field manually. The number field disables itself when the switch is on.
Fixes #265