Skip to content

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 image
Edit dashboard image

How to set up and validate locally

  1. Be sure to run yarn when switching branch to have the correct @cubejs-client dependency installed
  2. Follow these instructions to setup Product Analytics in GDK.
  3. Onboard Product Analytics by setting up the feature at Project > Analytics > Analytics dashboards.
  4. Follow the alert prompt on Project > Analytics > Analytics dashboards to enable customizable dashboards.
  5. Navigate back to Project > Analytics > Analytics dashboards and click on New dashboard.
  6. Click Cancel and confirm that no dialog is shown.
  7. Click on New dashboard again and this time make some changes.
  8. Click Cancel and confirm that a dialog is shown.
  9. Save the new dashboard you just made and click on Edit once it has been saved.
  10. Click Cancel and confirm that no dialog is shown.
  11. Click on Edit and make some changes.
  12. Click Cancel and confirm that a dialog is shown.
  13. 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.

Related to #410349 (closed)

Edited by Jiaan Louw

Merge request reports