fardin-developer opened a new pull request, #31809: URL: https://github.com/apache/superset/pull/31809
Fixes #31344 ## Description This PR fixes a bug where the "Undo" button displays actions from a previously edited dashboard after switching to a new one. The issue occurred because the dashboardLayout.past array, which stores the undo history, was not cleared when switching between dashboards or entering edit mode. ## BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF ### Before [https://drive.google.com/file/d/1ddAJXwsBFAmTHtpjKqo-fRAzk6fu4aek/view?usp=sharing](url) ### After [https://drive.google.com/file/d/1fvomN09d4G_87We-YfOaAurMTTcQ7dAO/view?usp=sharing](url) ## Key Changes: Reset Dashboard History: Introduced the resetDashboardPast function to ensure the dashboardLayout.past array is cleared when toggling edit mode. Edit Button Update: Updated the "Edit Dashboard" button to call the resetDashboardPast function via boundActionCreators.clearDashboardHistory() when clicked. ## Reproduction Steps - Navigate to a dashboard (Dashboard A). - Click "Edit" and make changes. Save the dashboard. - Navigate to the dashboard list and select another dashboard (Dashboard B). - Click "Edit" on Dashboard B. - Press the "Undo" button. ### Expected Behavior: - The undo button should be disabled when first editing Dashboard B. - Undo actions should not reflect changes made in Dashboard A. -- 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]
