feat(dashboard): add confirmation modal and toast notification for reset layout#3200
Open
deekshinowdu-collab wants to merge 1 commit into
Conversation
|
Hi @deekshinowdu-collab — thanks for the PR! 🙌 DevTrack asks contributors to ⭐ star the repo before a PR can be merged. It takes two seconds and is the easiest way to support the project. Once you've starred, the |
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a confirmation dialog and success toast notification flow for the Reset Layout functionality in the Customizable Dashboard. This prevents accidental resets of customized dashboards by prompting the user with a
ConfirmModalbefore resetting the layout in local storage and syncing with the database.Closes #
Type of Change
What Changed
ConfirmModalandtoastfromsonner.isConfirmResetOpenboolean state to control modal visibility.handleResetClick,handleResetConfirm, andhandleResetCancel.handleResetClicktoDashboardLayoutToolbar'sonResetprop.<ConfirmModal>at the bottom of the dashboard layout tree.How to Test
Expected result:
The layout snaps back to its default configuration, and the user receives a success toast notification: "Dashboard layout has been reset to defaults."
Screenshots / Recordings
Checklist
console.log, debug code, or commented-out blocksnpm run lintpasses locallynpm run type-check)Accessibility (UI changes only)
Additional Context
This is a GSSoC Level 1 (
gssoc:level1) issue. It reuses existing styling and the pre-builtConfirmModalandsonnercomponents to maintain project visual standards.