Skip to content

Commit

Permalink
fix(dashboard): new created chart did not have high lighted effect wh…
Browse files Browse the repository at this point in the history
…en using the permalink of chart share in dashboard (#20411)
  • Loading branch information
diegomedina248 authored Jun 19, 2022
1 parent ab9f72f commit c2f01a6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions superset-frontend/src/dashboard/actions/hydrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c2f01a6

Please sign in to comment.