Skip to content

feat(admin): adding uniformity in cancel and back buttons present in FIDO, SMTP & Services#2409

Merged
moabu merged 49 commits intomainfrom
admin-ui-issue-2361-fido
Nov 5, 2025
Merged

feat(admin): adding uniformity in cancel and back buttons present in FIDO, SMTP & Services#2409
moabu merged 49 commits intomainfrom
admin-ui-issue-2361-fido

Conversation

@faisalsiddique4400
Copy link
Contributor

@faisalsiddique4400 faisalsiddique4400 commented Nov 3, 2025

feat(admin): adding uniformity in cancel and back buttons present in FIDO & SMTP & SERVICES

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

Button Updated Behavior
Cancel Resets all fields to their previous values without navigating away. Disabled until a change is made.
Back Navigates to the previous page. If there is no navigation history, returns to Dashboard. Always enabled.
Apply Saves the changes without leaving the page. Enabled only when the form has unsaved changes.

Additional Enhancements

  • Buttons now correctly detect dirty form states.
  • Apply button is dynamically enabled and disabled based on whether changes exist.
  • Cancel button is disabled until a field is modified.
  • Prevents accidental navigation or state loss in multi step configuration pages.

Affected Modules

This change is applied across all forms where configuration changes are possible, including but not limited to:

  • FIDO
  • SMTP
  • SERVICES

Parent issue: #2268

Testing Steps

  1. Open suggested config form.
  2. Modify any field.
  3. Verify that:
    • Apply and Cancel buttons become enabled.
    • Apply saves configuration and stays on page.
    • Cancel reverts values and disables itself afterward.
  4. Back button should navigate appropriately.

Summary by CodeRabbit

  • Bug Fixes & Improvements
    • Validation now runs on mount across FIDO, SMTP, and Services forms.
    • Multiple fields marked required (issuer, endpoints, metadata servers, hints); hints error messages normalized.
    • Submission controls unified into a consistent form footer (Back/Cancel/Apply) tied to dirty/validation/loading state; loading is always a boolean; modal message resets when opened.
  • New Features
    • Optional SMTP "Test" button to validate configuration before saving.

faisalsiddique4400 and others added 30 commits October 30, 2025 13:55
…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
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

1 similar comment
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d8957fd and b99c7d7.

📒 Files selected for processing (8)
  • admin-ui/app/routes/Apps/Gluu/GluuCommitDialog.tsx (3 hunks)
  • admin-ui/app/routes/Apps/Gluu/GluuFormFooter.tsx (1 hunks)
  • admin-ui/plugins/fido/components/DynamicConfiguration.tsx (5 hunks)
  • admin-ui/plugins/fido/components/StaticConfiguration.tsx (14 hunks)
  • admin-ui/plugins/scim/components/ScimConfiguration.tsx (1 hunks)
  • admin-ui/plugins/services/Components/Configuration/CachePage.js (2 hunks)
  • admin-ui/plugins/services/Components/Configuration/PersistenceDetail.js (2 hunks)
  • admin-ui/plugins/smtp-management/components/SmtpManagement/SmtpForm.tsx (4 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.926Z
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.926Z
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.926Z
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/plugins/services/Components/Configuration/PersistenceDetail.js
  • admin-ui/plugins/fido/components/DynamicConfiguration.tsx
  • admin-ui/app/routes/Apps/Gluu/GluuFormFooter.tsx
  • admin-ui/plugins/services/Components/Configuration/CachePage.js
🔇 Additional comments (11)
admin-ui/app/routes/Apps/Gluu/GluuCommitDialog.tsx (1)

53-61: LGTM! Modal reset logic improved.

The use of useRef to track the previous modal state ensures that userMessage is reset only when the modal transitions from closed to open, preventing unnecessary resets on every render. This is a solid improvement.

admin-ui/app/routes/Apps/Gluu/GluuFormFooter.tsx (1)

56-56: LGTM! Sensible default value.

Setting disableBack = false as the default provides a more convenient API while maintaining backward compatibility with existing usages.

Based on learnings.

admin-ui/plugins/scim/components/ScimConfiguration.tsx (1)

91-91: LGTM! Defensive boolean handling.

Using the nullish coalescing operator ensures that isLoading always receives a boolean value, even if isSubmitting is undefined or null.

admin-ui/plugins/services/Components/Configuration/PersistenceDetail.js (1)

126-128: LGTM! Appropriate footer for read-only page.

Since this is a read-only database information page, showing only the Back button without Cancel or Apply is the correct choice.

Based on learnings.

admin-ui/plugins/fido/components/DynamicConfiguration.tsx (2)

308-319: LGTM! Double-toggle issue resolved.

The previous critical issue has been fixed correctly. With applyButtonType="button" and onApply={toggle}, the Apply button only opens the confirmation dialog without submitting the form. The actual submission occurs through the GluuCommitDialog's onAccept handler.


33-33: Verify the impact of validateOnMount.

Enabling validateOnMount: true means the form will show validation errors immediately on page load before the user interacts with any field. This could be jarring UX if required fields start showing errors right away.

Please confirm this is intentional and aligns with the desired user experience. If the intent is to enable the Apply button based on validity, consider using validateOnChange and validateOnBlur instead, or ensure your validation schema doesn't mark untouched fields as errors.

admin-ui/plugins/smtp-management/components/SmtpManagement/SmtpForm.tsx (2)

71-80: LGTM! Robust validation before submission.

The async validation logic in submitForm properly validates the form, marks all invalid fields as touched, and displays a user-friendly error message before allowing submission. This prevents incomplete data from being submitted.


58-58: Verify the impact of validateOnMount.

Enabling validateOnMount: true will show validation errors immediately when the form loads, which may negatively impact user experience if required fields display errors before any user interaction.

Please confirm this behavior is intentional and consistent with UX requirements across the admin UI. Consider whether validation should only trigger on user interaction (validateOnChange / validateOnBlur) instead.

admin-ui/plugins/fido/components/StaticConfiguration.tsx (3)

368-379: LGTM! Double-toggle issue resolved.

The previous critical issue has been addressed correctly. The Apply button uses applyButtonType="button" with onApply={toggle}, ensuring the confirmation dialog opens without auto-submitting the form.


95-118: LGTM! Metadata servers transformation wrapper implemented correctly.

The metadataServersFormik wrapper elegantly handles the bidirectional transformation between {key, value} (used by GluuProperties) and {url, rootCert} (used in form values). The setFieldValue wrapper correctly passes through the shouldValidate flag to maintain Formik's validation behavior.

The useMemo dependencies are appropriate - formik.values and formik.setFieldValue are the actual dependencies used within the memoized computation.


54-54: Verify the impact of validateOnMount.

Setting validateOnMount: true will immediately show validation errors when the form loads, potentially before the user has interacted with any field. This could result in a poor user experience if required fields are flagged as invalid from the start.

Please confirm this is the intended behavior and aligns with UX standards across the admin UI. If the goal is to control button enablement, consider whether validateOnChange and validateOnBlur would provide a better user experience.

@faisalsiddique4400
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b99c7d7 and 2ea443e.

📒 Files selected for processing (1)
  • admin-ui/plugins/services/Components/Configuration/CachePage.js (2 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.926Z
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.926Z
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.926Z
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/plugins/services/Components/Configuration/CachePage.js
🔇 Additional comments (2)
admin-ui/plugins/services/Components/Configuration/CachePage.js (2)

5-5: LGTM!

The import statement correctly updates to GluuFormFooter to support the new footer component migration.


238-241: Modal close timing is now correct.

The previous issue regarding modal close timing has been properly addressed. The modal now closes before submission begins, providing better UX.

@faisalsiddique4400
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Base automatically changed from admin-ui-issue-2361-scim to main November 5, 2025 11:29
Signed-off-by: Faisal Siddique <71010439+faisalsiddique4400@users.noreply.github.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 5, 2025

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 5, 2025

@moabu moabu merged commit 8659c56 into main Nov 5, 2025
8 checks passed
@moabu moabu deleted the admin-ui-issue-2361-fido branch November 5, 2025 19:10
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.

3 participants