From dd978a399230aef64cdc3bc135b2a16de363ab2f Mon Sep 17 00:00:00 2001 From: Diego Medina Date: Thu, 16 Jun 2022 14:24:15 -0300 Subject: [PATCH] fix(dashboard): new created chart did not have high lighted effect when using the permalink of chart share in dashboard --- 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 4174d9780ba64..ccc8288e6158e 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;