Feat:Add Warning modals#453
Conversation
📝 WalkthroughWalkthroughTwo Bootstrap modals are added to ChangesActivation Gating Modals and Flowchart Fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Hi @Kuldeeep18, Please review and merge this PR. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@frontend/campaign-builder.html`:
- Around line 1230-1253: Add accessible naming and title linkage for both modal
dialogs: give the close buttons in activationErrorModal and
activationWarningModal an accessible label, and connect each modal to its
heading via aria-labelledby using the existing modal-title elements. Update the
modal root elements and the btn-close controls so screen readers can identify
the dialog purpose and the close action without relying on visual text.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: a6642162-b6e9-4b58-9b9b-13b9fff9f17d
📒 Files selected for processing (1)
frontend/campaign-builder.html
| <div class="modal fade" id="activationErrorModal" tabindex="-1"> | ||
| <div class="modal-dialog"> | ||
| <div class="modal-content"> | ||
| <div class="modal-header"> | ||
| <h5 class="modal-title">Cannot Activate</h5> | ||
| <button type="button" class="btn-close" data-bs-dismiss="modal"></button> | ||
| </div> | ||
| <div class="modal-body"> | ||
| Cannot activate campaign with no sequence steps. | ||
| </div> | ||
| <div class="modal-footer"> | ||
| <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="modal fade" id="activationWarningModal" tabindex="-1"> | ||
| <div class="modal-dialog"> | ||
| <div class="modal-content"> | ||
| <div class="modal-header"> | ||
| <h5 class="modal-title">Confirm Activation</h5> | ||
| <button type="button" class="btn-close" data-bs-dismiss="modal"></button> | ||
| </div> |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Add accessible labels/relationships to both modals.
The close buttons (Line 1235, Line 1252) have no accessible name, and the modals are missing aria-labelledby linkage to titles, which hurts screen-reader usability.
Suggested patch
-<div class="modal fade" id="activationErrorModal" tabindex="-1">
+<div class="modal fade" id="activationErrorModal" tabindex="-1" aria-labelledby="activationErrorModalLabel" aria-hidden="true">
@@
- <h5 class="modal-title">Cannot Activate</h5>
- <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
+ <h5 class="modal-title" id="activationErrorModalLabel">Cannot Activate</h5>
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
@@
-<div class="modal fade" id="activationWarningModal" tabindex="-1">
+<div class="modal fade" id="activationWarningModal" tabindex="-1" aria-labelledby="activationWarningModalLabel" aria-hidden="true">
@@
- <h5 class="modal-title">Confirm Activation</h5>
- <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
+ <h5 class="modal-title" id="activationWarningModalLabel">Confirm Activation</h5>
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <div class="modal fade" id="activationErrorModal" tabindex="-1"> | |
| <div class="modal-dialog"> | |
| <div class="modal-content"> | |
| <div class="modal-header"> | |
| <h5 class="modal-title">Cannot Activate</h5> | |
| <button type="button" class="btn-close" data-bs-dismiss="modal"></button> | |
| </div> | |
| <div class="modal-body"> | |
| Cannot activate campaign with no sequence steps. | |
| </div> | |
| <div class="modal-footer"> | |
| <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="modal fade" id="activationWarningModal" tabindex="-1"> | |
| <div class="modal-dialog"> | |
| <div class="modal-content"> | |
| <div class="modal-header"> | |
| <h5 class="modal-title">Confirm Activation</h5> | |
| <button type="button" class="btn-close" data-bs-dismiss="modal"></button> | |
| </div> | |
| <div class="modal fade" id="activationErrorModal" tabindex="-1" aria-labelledby="activationErrorModalLabel" aria-hidden="true"> | |
| <div class="modal-dialog"> | |
| <div class="modal-content"> | |
| <div class="modal-header"> | |
| <h5 class="modal-title" id="activationErrorModalLabel">Cannot Activate</h5> | |
| <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> | |
| </div> | |
| <div class="modal-body"> | |
| Cannot activate campaign with no sequence steps. | |
| </div> | |
| <div class="modal-footer"> | |
| <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="modal fade" id="activationWarningModal" tabindex="-1" aria-labelledby="activationWarningModalLabel" aria-hidden="true"> | |
| <div class="modal-dialog"> | |
| <div class="modal-content"> | |
| <div class="modal-header"> | |
| <h5 class="modal-title" id="activationWarningModalLabel">Confirm Activation</h5> | |
| <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> | |
| </div> |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@frontend/campaign-builder.html` around lines 1230 - 1253, Add accessible
naming and title linkage for both modal dialogs: give the close buttons in
activationErrorModal and activationWarningModal an accessible label, and connect
each modal to its heading via aria-labelledby using the existing modal-title
elements. Update the modal root elements and the btn-close controls so screen
readers can identify the dialog purpose and the close action without relying on
visual text.
Pull Request
🔗 Related Issue
Closes #448
📝 Summary of Changes
Added validation checks and modals to the campaign activation toggle to prevent activating incomplete or empty campaigns.
#status-toggleevent listener logic incampaign-builder.htmlto trigger these modals appropriately.renderFlowchartfunction.🏷️ Type of Change
🧪 Testing
Steps to test:
📸 Screenshots (if applicable)
✅ Checklist
Summary by CodeRabbit
New Features
Bug Fixes