feat: add confirmation warning for category group unlinking impact#853
feat: add confirmation warning for category group unlinking impact#853
Conversation
📝 WalkthroughWalkthroughThe pull request adds a confirmation dialog using SweetAlert2 to the track unlinking function, requiring user confirmation before removing a category from a group. A corresponding localized warning message is added to the English language file. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/components/forms/event-category-group-form.js (1)
100-106: Localize the modal cancel button text as well.
confirmButtonTextis translated, but cancel falls back to SweetAlert’s default label. AddingcancelButtonTextkeeps the dialog fully i18n-consistent.Suggested update
Swal.fire({ title: T.translate("general.are_you_sure"), text: T.translate("edit_event_category_group.unlink_track_warning"), type: "warning", showCancelButton: true, - confirmButtonText: T.translate("general.yes") + confirmButtonText: T.translate("general.yes"), + cancelButtonText: T.translate("general.cancel") }).then((result) => {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/forms/event-category-group-form.js` around lines 100 - 106, The Swal.fire call in the unlink confirmation modal (inside event-category-group-form.js where Swal.fire is invoked) localizes confirmButtonText but not the cancel button; update the Swal.fire options to include cancelButtonText: T.translate("general.cancel") (or the appropriate i18n key) and ensure showCancelButton: true is present so the cancel button uses the translated label.src/i18n/en.json (1)
1320-1320: Polish the warning copy for readability and consistency.The new message works, but a small wording/capitalization tweak would read cleaner in the modal.
Suggested copy update
- "unlink_track_warning": "if you remove a category from the category group, any activities linked to that category will automatically be removed from the selection plan. Do you want to continue?", + "unlink_track_warning": "If you remove a category from this category group, any activities linked to that category will be automatically removed from the selection plan. Do you want to continue?",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/i18n/en.json` at line 1320, Update the i18n string keyed by "unlink_track_warning" to improve capitalization and readability: change the value to start with a capital "If" and simplify the middle clause to read like "Any activities linked to that category will be removed from the selection plan." so the full message becomes something like "If you remove a category from the category group, any activities linked to that category will be removed from the selection plan. Do you want to continue?" Replace the existing value for "unlink_track_warning" in src/i18n/en.json accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/components/forms/event-category-group-form.js`:
- Around line 100-106: The Swal.fire call in the unlink confirmation modal
(inside event-category-group-form.js where Swal.fire is invoked) localizes
confirmButtonText but not the cancel button; update the Swal.fire options to
include cancelButtonText: T.translate("general.cancel") (or the appropriate i18n
key) and ensure showCancelButton: true is present so the cancel button uses the
translated label.
In `@src/i18n/en.json`:
- Line 1320: Update the i18n string keyed by "unlink_track_warning" to improve
capitalization and readability: change the value to start with a capital "If"
and simplify the middle clause to read like "Any activities linked to that
category will be removed from the selection plan." so the full message becomes
something like "If you remove a category from the category group, any activities
linked to that category will be removed from the selection plan. Do you want to
continue?" Replace the existing value for "unlink_track_warning" in
src/i18n/en.json accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c5d27bdf-678e-471a-9deb-daa0de8eeb68
📒 Files selected for processing (2)
src/components/forms/event-category-group-form.jssrc/i18n/en.json
ref https://app.clickup.com/t/86b8rp3vh
Summary by CodeRabbit
New Features
Localization