adding uniformity in cancel and back buttons present in Scopes#2430
adding uniformity in cancel and back buttons present in Scopes#2430moabu merged 1 commit intoadmin-ui-issue-2361-usersfrom
Conversation
📝 WalkthroughWalkthroughRefactors Scopes UI components to implement a confirm-on-submit modal workflow with declarative panel visibility logic. Introduces new helper utilities for scope initialization and validation, updates type definitions to use ExtendedScopeAttributes, and restructures ScopeForm with improved Formik integration and derived state management. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Form as ScopeForm
participant Formik
participant Modal as GluuCommitDialog
User->>Form: Submit form
Form->>Formik: Validate form values
Formik-->>Form: Validation result
rect rgb(200, 220, 240)
Note over Form,Modal: New confirm-on-submit flow
Form->>Form: Build payload<br/>Store in pendingScope
Form->>Modal: Open modal<br/>(show modifications)
end
User->>Modal: Confirm/Accept
Modal->>Form: handleDialogAccept triggered
Form->>Form: Augment payload<br/>with action_message
Form->>Form: Call original submit
rect rgb(220, 240, 220)
Note over Form,User: Success path
Form->>Form: Reset modal & state
Form->>User: Navigate back
end
User->>Modal: Cancel/Decline
Modal->>Form: Close modal
Form->>Form: Reset pending state
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (6)
admin-ui/plugins/auth-server/components/Scopes/ScopeForm.tsx(6 hunks)admin-ui/plugins/auth-server/components/Scopes/ScopeListPage.tsx(6 hunks)admin-ui/plugins/auth-server/components/Scopes/helper/utils.ts(1 hunks)admin-ui/plugins/auth-server/components/Scopes/helper/validations.ts(1 hunks)admin-ui/plugins/auth-server/components/Scopes/types/componentTypes.ts(1 hunks)admin-ui/plugins/auth-server/components/Scopes/types/formTypes.ts(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: faisalsiddique4400
Repo: GluuFederation/flex PR: 2404
File: admin-ui/app/routes/Apps/Gluu/Gluuformfooter.tsx:70-77
Timestamp: 2025-11-03T08:47:33.943Z
Learning: In the admin-ui forms (Gluuformfooter component), the Back button should always navigate to '/home/dashboard' rather than using history-based navigation (navigate(-1)), as clarified by faisalsiddique4400 in PR #2404.
🪛 Biome (2.1.2)
admin-ui/plugins/auth-server/components/Scopes/ScopeForm.tsx
[error] 533-536: Static Elements should not be interactive.
To add interactivity such as a mouse or key event listener to a static element, give the element an appropriate role value.
(lint/a11y/noStaticElementInteractions)
[error] 534-534: Use a button element instead of an a element.
Anchor elements should only be used for default sections or page navigation
Check this thorough explanation to better understand the context.
(lint/a11y/useValidAnchor)
[error] 582-585: Static Elements should not be interactive.
To add interactivity such as a mouse or key event listener to a static element, give the element an appropriate role value.
(lint/a11y/noStaticElementInteractions)
[error] 583-583: Use a button element instead of an a element.
Anchor elements should only be used for default sections or page navigation
Check this thorough explanation to better understand the context.
(lint/a11y/useValidAnchor)
🔇 Additional comments (1)
admin-ui/plugins/auth-server/components/Scopes/ScopeForm.tsx (1)
155-161: Back navigation must target dashboardProduct guidance for admin UI forms requires the Back action to always navigate to
/home/dashboard. Falling back to history-based navigation brings back the very inconsistency this PR is meant to eliminate. Please route directly to the dashboard instead.- if (window.history.length > 1) { - navigate(-1) - } else { - navigate('/auth-server/scopes') - } + navigate('/home/dashboard')Based on learnings
⛔ Skipped due to learnings
Learnt from: faisalsiddique4400 Repo: GluuFederation/flex PR: 2418 File: admin-ui/plugins/user-management/components/UserForm.tsx:290-297 Timestamp: 2025-11-06T08:23:20.931Z Learning: In the UserForm component (admin-ui/plugins/user-management/components/UserForm.tsx), the Back button should fall back to '/user/usersmanagement' when browser history is unavailable, not '/home/dashboard', as this keeps users in the user management context. This aligns with the new requirement that users should be redirected to the respective listing screen of the component rather than the dashboard.Learnt from: faisalsiddique4400 Repo: GluuFederation/flex PR: 2404 File: admin-ui/app/routes/Apps/Gluu/Gluuformfooter.tsx:70-77 Timestamp: 2025-11-03T08:47:33.943Z Learning: In the admin-ui forms (Gluuformfooter component), the Back button should always navigate to '/home/dashboard' rather than using history-based navigation (navigate(-1)), as clarified by faisalsiddique4400 in PR #2404.Learnt from: faisalsiddique4400 Repo: GluuFederation/flex PR: 2415 File: admin-ui/plugins/auth-server/components/Ssa/SsaAddPage.tsx:148-153 Timestamp: 2025-11-05T19:57:35.134Z Learning: In the SSA Add page (admin-ui/plugins/auth-server/components/Ssa/SsaAddPage.tsx), the Back button should fall back to '/auth-server/config/ssa' when browser history is unavailable, not '/home/dashboard', as this keeps users in the SSA management context.Learnt from: kdhttps Repo: GluuFederation/flex PR: 2378 File: admin-ui/plugins/admin/components/Cedarling/CedarlingConfigPage.tsx:93-104 Timestamp: 2025-11-07T12:55:26.222Z Learning: In the Cedarling configuration feature (admin-ui/plugins/admin/components/Cedarling/CedarlingConfigPage.tsx), the sync role to scopes mappings operation depends on the `auiPolicyStoreUrl`. The backend fetches content from this URL and syncs roles based on the response. Therefore, the audit log for the sync operation should include the `auiPolicyStoreUrl` in its payload to provide proper audit context.
… Users and Whole Home Module (#2418) * fix(admin-ui): unable to add Custom and Module properties in Scripts page (#2401) * code rabbit suggestions * code rabbit suggestions * code rabbit suggestions * pagination count issues fixed * fix(admin-ui): unable to map permission to a role using GUI (#2400) * fix(admin-ui): adding uniformity in cancel and back buttons present in SCIM forms (#2361) * Code rabbit suggestions * Code rabbit suggestions * Code rabbit suggestions * Code rabbit suggestions * Code rabbit suggestions * Code rabbit suggestions * buttons swapping * Code Rabbit fixes * Code Rabbit fixes * Code Rabbit fixes * Code Rabbit fixes * Code Rabbit fixes * Code Rabbit fixes * feat(admin): adding uniformity in cancel and back buttons present in Jans Lock (#2405) * feat(admin): adding uniformity in cancel and back buttons present in Jans Lock * feat(admin): adding uniformity in cancel and back buttons present in Jans Lock * Code Rabbit fixes * Saperating footer components * Code rabbit changes * Code rabbit changes * Code rabbit changes * Code rabbit changes * file notations fixes * file notations fixes * Rename Gluuformfooter.tsx to GluuFormFooter.tsx Signed-off-by: Faisal Siddique <71010439+faisalsiddique4400@users.noreply.github.com> * code rabbit fixes * code rabbit fixes * code rabbit fixes * feat(admin): adding uniformity in cancel and back buttons present in FIDO * feat(admin): adding uniformity in cancel and back buttons present in FIDO * code rabbit changes * code rabbit changes * feat(admin): adding uniformity in cancel and back buttons present in SMTP * feat(admin): adding uniformity in cancel and back buttons present in SMTP (#2410) * feat(admin): adding uniformity in cancel and back buttons present in Services * commit text not getting rollover issue * feat(admin): adding uniformity in cancel and back buttons present in SERVICES (#2411) * feat(admin): adding uniformity in cancel and back buttons present in SMTP * feat(admin): adding uniformity in cancel and back buttons present in Services * commit text not getting rollover issue --------- Signed-off-by: Faisal Siddique <71010439+faisalsiddique4400@users.noreply.github.com> * feat(admin): adding uniformity in cancel and back buttons present in Script * Code rabbit changes * Code rabbit changes * Code rabbit changes * Code rabbit changes * Code rabbit changes * Code rabbit changes * Code rabbit changes * feat(admin): adding uniformity in cancel and back buttons present in Logging (#2416) * feat(admin): adding uniformity in cancel and back buttons present in Logging * feat(admin): adding uniformity in cancel and back buttons present in SSA * Code rabbit changes * SSA Layout fixed * SSA Layout fixed * SSA Layout fixed * Comments on the PR resolved * Comments on the PR resolved * Comments on the PR resolved * Comments on the PR resolved * adding uniformity in cancel and back buttons present in Scopes (#2430) * a minor enhancement on iteration * SSA implemented with TS * Implementing new formFooter in User management * FormFooter in Users and Webhook done * FormFooter in Jans Assets done * FormFooter in Jans Assets done and dynamic navigations * Enhanced the password validations * Minor adjustments * Minor fixes(#2471) * Minor fixes(#2471) * Minor fixes(#2471) * Minor fixes(#2471) * Minor fixes(#2471) --------- Signed-off-by: Faisal Siddique <71010439+faisalsiddique4400@users.noreply.github.com>
feat(admin): adding uniformity in cancel and back buttons present in Scopes
Summary
This update introduces consistent behavior for Cancel, Back, and Apply buttons across Admin UI forms, including correct enabling and disabling based on form state.
Improvements
Additional Enhancements
Affected Modules
This change is applied across all forms where configuration changes are possible, including but not limited to:
Parent issue: #2268
Testing Steps
Summary by CodeRabbit
New Features
Bug Fixes
Refactor