Skip to content

Commit be0e910

Browse files
committed
StatsHouse UI: fix pack
fix clear tag filter after link variable
1 parent 41408d7 commit be0e910

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

statshouse-ui/src/components2/Dashboard/DashboardSettings/DashboardVariable.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,22 @@ export function DashboardVariable() {
8484
setParams((p) => {
8585
p.variables = localVariable.variables;
8686
p.orderVariables = localVariable.orderVariables;
87+
p.orderVariables.forEach((variabeKey) => {
88+
p.variables[variabeKey]?.link.forEach(([plotKey, tagKey]) => {
89+
const plot = p.plots[plotKey];
90+
if (plot) {
91+
if (plot.filterIn[tagKey]) {
92+
delete plot.filterIn[tagKey];
93+
}
94+
if (plot.filterNotIn[tagKey]) {
95+
delete plot.filterNotIn[tagKey];
96+
}
97+
if (plot.groupBy.indexOf(tagKey) > -1) {
98+
plot.groupBy = plot.groupBy.filter((tagGroup) => tagGroup !== tagKey);
99+
}
100+
}
101+
});
102+
});
87103
});
88104
}, [localVariable.orderVariables, localVariable.variables, setParams]);
89105

0 commit comments

Comments
 (0)