Skip to content

Commit

Permalink
fix: Remove positions from json_metadata (#17766)
Browse files Browse the repository at this point in the history
* Remove positions from json_metadata

* Update superset-frontend/src/dashboard/components/PropertiesModal/index.tsx

Co-authored-by: Kamil Gabryjelski <kamil.gabryjelski@gmail.com>

* Indent

Co-authored-by: Kamil Gabryjelski <kamil.gabryjelski@gmail.com>
(cherry picked from commit 274fb37)
  • Loading branch information
geido authored and eschutho committed Dec 20, 2021
1 parent 398a01f commit f4661d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,15 @@ const PropertiesModal = ({

form.setFieldsValue(dashboardInfo);
setDashboardInfo(dashboardInfo);
setJsonMetadata(metadata ? jsonStringify(metadata) : '');
setOwners(owners);
setRoles(roles);
setColorScheme(metadata.color_scheme);

// temporary fix to remove positions from dashboards' metadata
if (metadata?.positions) {
delete metadata.positions;
}
setJsonMetadata(metadata ? jsonStringify(metadata) : '');
},
[form],
);
Expand Down
3 changes: 3 additions & 0 deletions superset/dashboards/dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ def set_dash_metadata( # pylint: disable=too-many-locals
}
md["default_filters"] = json.dumps(applicable_filters)

# positions have its own column, no need to store it in metadata
md.pop("positions", None)

# The css and dashboard_title properties are not part of the metadata
# TODO (geido): remove by refactoring/deprecating save_dash endpoint
if data.get("css") is not None:
Expand Down

0 comments on commit f4661d6

Please sign in to comment.