Update customizable dashboard to handle unsaved changes
What does this MR do and why?
This MR updates the analytics customizable dashboard editor to handle unsaved changes. When a user makes any changes that are unsaved and clicks on a Cancel
a confirmation modal will be rendered asking them if they are sure if they want to discard their unsaved changes. Related issue [Bug] Handle unsaved changes in analytics dashb... (#410349 - closed).
Note: There is a follow-up MR to handle when a user navigates from the page Handle unsaved dashboard changed when a user na... (!132640 - merged).
Note: Product analytics is an experimental feature hidden behind a default off feature flag.
Screenshots or screen recordings
Recording
Screen_Recording_2023-09-25_at_12.38.59
Screenshots
Modal did not exist before.
State | Screenshot |
---|---|
New dashboard | |
Edit dashboard |
How to set up and validate locally
- Be sure to run
yarn
when switching branch to have the correct @cubejs-client dependency installed - Follow these instructions to setup Product Analytics in GDK.
- Onboard
Product Analytics
by setting up the feature at Project > Analytics > Analytics dashboards. - Follow the alert prompt on Project > Analytics > Analytics dashboards to enable customizable dashboards.
- Navigate back to Project > Analytics > Analytics dashboards and click on
New dashboard
. - Click
Cancel
and confirm that no dialog is shown. - Click on
New dashboard
again and this time make some changes. - Click
Cancel
and confirm that a dialog is shown. - Save the new dashboard you just made and click on
Edit
once it has been saved. - Click
Cancel
and confirm that no dialog is shown. - Click on
Edit
and make some changes. - Click
Cancel
and confirm that a dialog is shown. - Clicking on
Discard changes
should revert the dashboard to its original state.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #410349 (closed)