JCelento opened a new pull request, #37697: URL: https://github.com/apache/superset/pull/37697
### SUMMARY Adds dashboard version history: a snapshot is created on each save, and users can list versions and restore any one with a single click. Restore updates layout and metadata, syncs chart–dashboard links, and removes orphaned chart components; the UI refreshes without a full page reload. **Backend:** New `dashboard_versions` table and `DashboardVersion` model; `DashboardVersionDAO` (create, list, retention); snapshot-after-save in `UpdateDashboardCommand`; `RestoreDashboardVersionCommand`; API endpoints `GET .../versions`, `PUT .../versions/<id>` (description), `POST .../restore/<version_id>`. **Frontend:** History button in dashboard Header (edit mode); HistoryModal to list versions (number, comment, author, date) and restore with confirmation; optional version description editing; restore triggers re-hydration via `dashboardRestoreKey` (no full reload). Includes a fix for the hydration effect dependency array so it does not re-run in a loop when dashboard/charts refs change. Design and scope are documented in `docs/adr/0001-dashboard-version-history.md`. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF <!--- Skip this if not applicable --> ### TESTING INSTRUCTIONS 1. Open a dashboard in edit mode and save at least once. 2. Click the History button in the header and confirm the version list appears (version number, comment if set, author, date). 3. Restore an older version: click Restore, confirm; the dashboard should update to that version without a full page reload. 4. Optionally edit a version description in the modal and save; confirm it persists. 5. Run backend tests: `pytest superset/dashboards/ tests/unit_tests/dashboards/ -v` 6. Run frontend tests: `npm run test -- DashboardPage.hydration.test.tsx`, `npm run test -- HistoryModal`, `npm run test -- DashboardRestore.integration` ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [x] Changes UI - [x] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [x] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [x] Introduces new feature or API - [ ] Removes existing feature or API -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
