Skip to content

Commit

Permalink
modified: ui/src/components/filter/KestraFilter.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshitDhaduk committed Feb 6, 2025
1 parent 5a46204 commit 5f0f7f9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ui/src/components/filter/KestraFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@
@focus="handleFocus"
data-test-id="KestraFilter__select"
>
<!-- Custom tag rendering -->
<template #tag="{current}">
<el-tag
:disable-transitions="true"
:closable="!current?.persistent"
@close="() => removeItem(current)"
>
<Label :option="current" />
</el-tag>
</template>
<template #label="{value}">
<Label :option="value" />
</template>
Expand Down Expand Up @@ -271,7 +281,9 @@
};
const handleClear = () => {
currentFilters.value = [];
currentFilters.value = currentFilters.value.filter(
(item) => item.persistent
);
triggerSearch();
};
Expand Down Expand Up @@ -585,6 +597,7 @@
};
const removeItem = (value) => {
if(value.persistent) return;
currentFilters.value = currentFilters.value.filter(
(item) => JSON.stringify(item) !== JSON.stringify(value),
);
Expand Down

0 comments on commit 5f0f7f9

Please sign in to comment.