Skip to content

Commit

Permalink
fix: exclude mode handling
Browse files Browse the repository at this point in the history
  • Loading branch information
briangregoryholmes committed Nov 22, 2024
1 parent 68383e1 commit 5276410
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
if (selectedItems.size === allItems.size) {
setItems([]);
} else {
setItems(Array.from(allItems));
setItems(Array.from(allItems), excludeMode);
}
}}
type="plain"
Expand Down
27 changes: 17 additions & 10 deletions web-common/src/features/workspaces/VisualExploreEditing.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,12 @@
selectedItems={subsets[type]}
excludeMode={excludeMode[type]}
mode={fields[type]}
onSelectAll={async () => {
await updateProperties({ [type]: "*" });
}}
onSelectExpression={async () => {
await updateProperties({ [type]: { expr: "*" } });
}}
setItems={async (items, exclude) => {
const deleteKeys = [["defaults", type]];
if (type === "dimensions") {
Expand All @@ -404,12 +410,6 @@
await updateProperties({ [type]: items }, deleteKeys);
}
}}
onSelectAll={async () => {
await updateProperties({ [type]: "*" });
}}
onSelectExpression={async () => {
await updateProperties({ [type]: { expr: "*" } });
}}
onExpressionBlur={async (value) => {
const deleteKeys = [["defaults", type]];
if (type === "dimensions") {
Expand All @@ -430,10 +430,17 @@
deleteKeys.push(["defaults", "comparison_mode"]);
}

await updateProperties(
{ [type]: Array.from(subsets[type]) },
deleteKeys,
);
if (excludeMode[type]) {
await updateProperties(
{ [type]: { exclude: Array.from(subsets[type]) } },
deleteKeys,
);
} else {
await updateProperties(
{ [type]: Array.from(subsets[type]) },
deleteKeys,
);
}
}}
/>
{/each}
Expand Down

0 comments on commit 5276410

Please sign in to comment.