betodealmeida opened a new pull request #12007: URL: https://github.com/apache/incubator-superset/pull/12007
### SUMMARY <!--- Describe the change below, including rationale and design decisions --> The layout of dashboards is stored in the `position_json` attribute, containing the position and ID of charts. When a dashboard layout hasn't been modified the attribute is empty, and the relationship between which charts are contained in a given dashboard exists only in the `dashboard_slices` table and **is not exported**. With this PR, if `position_json` is empty we add a default position to the attribute, so that the relationship between dashboards and charts is present in the export bundle. This doesn't change the layout, but allows us to extract the relationship when importing the dashboard together with the charts. One alternative to this PR would be explicitly listing the UUIDs of charts when we export a dashboard, eg: ```yaml # dashboards/some_dashboard.yaml dashboard_title: Test Import [copy] description: null css: '' slug: null uuid: a1a7dd04-d113-46b8-8cb9-29b9eef280f4 chart_uuids: - foo - bar ``` But since most dashboards will have the `position_json` attribute set, it seems more efficient to populate it when it's empty. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF <!--- Skip this if not applicable --> N/A ### TEST PLAN <!--- What steps should be taken to verify the changes --> Exported dash, verified the YAML file, and imported again, ensuring that layout was not altered. ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Changes UI - [ ] Requires DB Migration. - [ ] Confirm DB Migration upgrade and downgrade tested. - [ ] 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
