Skip to content

Commit

Permalink
StatsHouse UI: fix pack
Browse files Browse the repository at this point in the history
fix clear tag filter after link variable
  • Loading branch information
vauweb committed Nov 7, 2024
1 parent 41408d7 commit be0e910
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,22 @@ export function DashboardVariable() {
setParams((p) => {
p.variables = localVariable.variables;
p.orderVariables = localVariable.orderVariables;
p.orderVariables.forEach((variabeKey) => {
p.variables[variabeKey]?.link.forEach(([plotKey, tagKey]) => {
const plot = p.plots[plotKey];
if (plot) {
if (plot.filterIn[tagKey]) {
delete plot.filterIn[tagKey];
}
if (plot.filterNotIn[tagKey]) {
delete plot.filterNotIn[tagKey];
}
if (plot.groupBy.indexOf(tagKey) > -1) {
plot.groupBy = plot.groupBy.filter((tagGroup) => tagGroup !== tagKey);
}
}
});
});
});
}, [localVariable.orderVariables, localVariable.variables, setParams]);

Expand Down

0 comments on commit be0e910

Please sign in to comment.