feat(admin): adding uniformity in cancel and back buttons present in Logging#2416
Conversation
📝 WalkthroughWalkthroughIntegrates Formik/Yup validation into LoggingPage, replaces GluuCommitFooter with GluuFormFooter across multiple dialogs/forms, adds logging and SSA utility initializers and validation schemas, introduces constants for logging levels/layouts, and adds debounced search and date-to-epoch utility for SSA. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Component
participant Formik
participant YupSchema
participant GluuFormFooter
User->>Component: Mount / open dialog
Component->>Formik: init with get*InitialValues()
Formik->>YupSchema: attach validationSchema (validateOnMount)
User->>Component: Edit field
Component->>Formik: setFieldValue / onBlur -> markTouched
Formik->>YupSchema: validate field
alt valid
Formik->>Component: clear error
else invalid
Formik->>Component: show error message
end
User->>GluuFormFooter: Click Apply/Cancel/Back
GluuFormFooter->>Formik: submit / reset / navigate
Formik->>YupSchema: final validate
Formik->>Component: submit result -> update centralized state
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
admin-ui/plugins/auth-server/components/Configuration/Defaults/LoggingPage.js(12 hunks)admin-ui/plugins/auth-server/components/Configuration/Defaults/utils.js(1 hunks)admin-ui/plugins/auth-server/components/Configuration/Defaults/validations.js(1 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.
🔇 Additional comments (11)
admin-ui/plugins/auth-server/components/Configuration/Defaults/utils.js (2)
1-2: LGTM! Constants are well-defined.The log level and layout constants are appropriately defined and will provide consistent values across validation and UI components.
4-10: LGTM! Safe and clean initial values extraction.The function correctly uses optional chaining to safely extract initial form values from the logging configuration object, preventing errors when logging is null or undefined.
admin-ui/plugins/auth-server/components/Configuration/Defaults/validations.js (1)
1-10: LGTM! Comprehensive validation schema.The Yup validation schema correctly enforces:
- Required fields with appropriate constraints (oneOf for log levels and layouts)
- Clear error messages for validation failures
- Optional boolean toggles
This will provide robust form validation aligned with the logging configuration requirements.
admin-ui/plugins/auth-server/components/Configuration/Defaults/LoggingPage.js (8)
7-10: LGTM! Imports align with the refactoring.The new imports for validation schema, utilities, and GluuFormFooter correctly support the centralized form management approach and standardized button behavior described in the PR objectives.
35-35: LGTM! Well-optimized toggle callback.The useCallback with an empty dependency array and the functional setState pattern ensures a stable reference and correct state updates.
54-63: LGTM! Submit handler correctly prepares commit data.The handler appropriately merges values, identifies changed fields, and triggers the commit dialog flow. The dependency array correctly includes
logging.
91-97: LGTM! Formik configuration is well-structured.The configuration correctly:
- Enables reinitialization to sync with updated logging state
- Validates on mount to catch initial validation errors
- Integrates the centralized validation schema
This ensures a robust form state management implementation.
106-130: LGTM! Excellent validation UX and accessibility enhancements.The field now includes:
- Visual required indicator for users
- Touch-based validation feedback via onBlur
- Proper ARIA attributes for screen readers
- Clear error message display
These changes significantly improve the form's usability and accessibility.
139-163: LGTM! Consistent validation pattern applied.The loggingLayout field correctly mirrors the validation and accessibility enhancements applied to loggingLevel, ensuring a consistent user experience across required fields.
219-219: LGTM! Using the memoized toggle callback.The commit dialog handler now uses the memoized
toggleCommitDialogcallback, which is cleaner and prevents unnecessary re-renders.
199-210: Back button navigation is correctly implemented.Verification confirms that
GluuFormFooternavigates to/home/dashboardwhen the Back button is clicked, since noonBackprop is provided. The implementation matches the learnings requirement.
admin-ui/plugins/auth-server/components/Configuration/Defaults/LoggingPage.js
Show resolved
Hide resolved
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
7e95546
into
admin-ui-issue-2361-scripts
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (5)
admin-ui/app/routes/Apps/Gluu/GluuFormFooter.tsx(3 hunks)admin-ui/plugins/auth-server/components/JsonViewer/JsonViewerDialog.js(2 hunks)admin-ui/plugins/auth-server/components/Ssa/SsaAddPage.js(13 hunks)admin-ui/plugins/auth-server/components/Ssa/utils.js(1 hunks)admin-ui/plugins/auth-server/components/Ssa/validations.js(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 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.
📚 Learning: 2025-11-03T08:47:33.943Z
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.
Applied to files:
admin-ui/app/routes/Apps/Gluu/GluuFormFooter.tsxadmin-ui/plugins/auth-server/components/JsonViewer/JsonViewerDialog.jsadmin-ui/plugins/auth-server/components/Ssa/SsaAddPage.js
… 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 Logging
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
Improvements
UX