chore: Show a confirmation modal when switching attribute stores#40826
chore: Show a confirmation modal when switching attribute stores#40826KevLehman wants to merge 2 commits into
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #40826 +/- ##
===========================================
+ Coverage 69.90% 70.02% +0.12%
===========================================
Files 3337 3337
Lines 123489 123521 +32
Branches 22013 22038 +25
===========================================
+ Hits 86322 86498 +176
+ Misses 33813 33666 -147
- Partials 3354 3357 +3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds a user confirmation step before switching the ABAC attribute store, to prevent accidental irreversible clearing of existing room attribute assignments. It does so by extending the reusable SettingField component with an optional confirmation-modal renderer, and wiring it into the ABAC settings page.
Changes:
- Added new i18n strings for the attribute store switch confirmation modal (title + confirm button).
- Updated ABAC settings page to show a danger
GenericModalbefore applying an attribute store change. - Extended
SettingFieldwith an optionalrenderConfirmModalprop and added unit tests covering confirm/cancel flows.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/i18n/src/locales/en.i18n.json | Adds English strings for the new confirmation modal. |
| apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingsPage.tsx | Wires the attribute store setting to display a confirmation GenericModal. |
| apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingField.tsx | Adds renderConfirmModal support and modal triggering logic inside onChangeValue. |
| apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingField.spec.tsx | Adds tests ensuring modal gating works and dispatch only occurs after confirm. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Proposed changes (including videos or screenshots)
Issue(s)
https://rocketchat.atlassian.net/browse/ABAC3-21
Steps to test or reproduce
Further comments
we're extending the SettingField component so it accepts an optional confirmation param that would render a modal to be shown to the user before performing the actual setting switch.