-
Notifications
You must be signed in to change notification settings - Fork 16.2k
fix: 'save and go to dashboard' option was disabled after changing the chart type #36122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: 'save and go to dashboard' option was disabled after changing the chart type #36122
Conversation
Code Review Agent Run #5967e5Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've completed my review and didn't find any issues.
Files scanned
| File Path | Reviewed |
|---|---|
| superset-frontend/src/explore/controlUtils/standardizedFormData.ts | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
EnxDev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add some tests for this fix?
|
Suggestions applied and tests added, thanks @alexandrusoare @EnxDev |
|
🎪 Showtime deployed environment on GHA for 141edc3 • Environment: http://52.37.62.176:8080 (admin/admin) |
EnxDev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
SUMMARY
Fixes a bug where the "Save and go to dashboard" option becomes disabled after changing a chart's visualization type.
The Problem:
When a user opens a chart from a dashboard and changes its visualization type (e.g., Line Chart → Bar Chart), the dashboard context is lost. The Save modal then shows a placeholder "Select a dashboard OR create a new one" instead of the actual dashboard name, and the "Save & go to dashboard" option becomes disabled.
Root Cause:
The
dashboardIdfield was being dropped during the form data transformation process when switching visualization types. This happened instandardizedFormData.tswhere:dashboardIdis not a form control, it's just a regular field that stores the dashboard contextgetFormDataFromControls()builds the new form data, it only includes fields that have corresponding controlsdashboardIdwasn't in thepublicControlsarray (fields that should be preserved across viz changes)The Fix:
Two small changes to
superset-frontend/src/explore/controlUtils/standardizedFormData.ts:dashboardIdto thepublicControlsarray so it gets collected during transformationspublicFormDataaftergetFormDataFromControls()so the dashboard context is preserved and not overwrittenBEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
BEFORE: After changing chart type, Save modal shows "Select a dashboard OR create a new one" and "Save & go to dashboard" is disabled and nothing shows on "Add to dashboard" field

AFTER: Save modal correctly displays the dashboard name and "Save & go to dashboard" remains enabled and "Add to dashboard" field shows the proper content

TESTING INSTRUCTIONS
ADDITIONAL INFORMATION