You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2022/06/19 14:17:28 UTC
[superset] branch master updated: fix(dashboard): new created chart did not have high lighted effect when using the permalink of chart share in dashboard (#20411)
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new c2f01a676c fix(dashboard): new created chart did not have high lighted effect when using the permalink of chart share in dashboard (#20411)
c2f01a676c is described below
commit c2f01a676c5e5eb53b98a6a609674c8342f8a0ac
Author: Diego Medina <di...@gmail.com>
AuthorDate: Sun Jun 19 11:17:06 2022 -0300
fix(dashboard): new created chart did not have high lighted effect when using the permalink of chart share in dashboard (#20411)
---
superset-frontend/src/dashboard/actions/hydrate.js | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/superset-frontend/src/dashboard/actions/hydrate.js b/superset-frontend/src/dashboard/actions/hydrate.js
index 4174d9780b..ccc8288e61 100644
--- a/superset-frontend/src/dashboard/actions/hydrate.js
+++ b/superset-frontend/src/dashboard/actions/hydrate.js
@@ -127,6 +127,8 @@ export const hydrateDashboard =
const dashboardFilters = {};
const slices = {};
const sliceIds = new Set();
+ const slicesFromExploreCount = new Map();
+
chartData.forEach(slice => {
const key = slice.slice_id;
const form_data = {
@@ -182,6 +184,10 @@ export const hydrateDashboard =
(newSlicesContainer.parents || []).slice(),
);
+ const count = (slicesFromExploreCount.get(slice.slice_id) ?? 0) + 1;
+ chartHolder.id = `${CHART_TYPE}-explore-${slice.slice_id}-${count}`;
+ slicesFromExploreCount.set(slice.slice_id, count);
+
layout[chartHolder.id] = chartHolder;
newSlicesContainer.children.push(chartHolder.id);
chartIdToLayoutId[chartHolder.meta.chartId] = chartHolder.id;