diff --git a/client/src/components/Common/DelayedInput.vue b/client/src/components/Common/DelayedInput.vue index c22fa9885866..bbd9bc546646 100644 --- a/client/src/components/Common/DelayedInput.vue +++ b/client/src/components/Common/DelayedInput.vue @@ -4,14 +4,13 @@ import { faAngleDoubleDown, faAngleDoubleUp, faSpinner, faTimes } from "@fortawe import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; import { watchImmediate } from "@vueuse/core"; import { BButton, BFormInput, BInputGroup, BInputGroupAppend } from "bootstrap-vue"; -import { computed, ref } from "vue"; +import { ref, watch } from "vue"; import localize from "@/utils/localization"; library.add(faAngleDoubleDown, faAngleDoubleUp, faSpinner, faTimes); interface Props { - modelValue?: string; value?: string; delay?: number; loading?: boolean; @@ -21,7 +20,6 @@ interface Props { } const props = withDefaults(defineProps(), { - modelValue: "", value: "", delay: 1000, loading: false, @@ -30,10 +28,8 @@ const props = withDefaults(defineProps(), { enableAdvanced: false, }); -const currentValue = computed(() => props.modelValue ?? props.value ?? ""); - const emit = defineEmits<{ - (e: "update:modelValue", value: string): void; + (e: "input", value: string): void; (e: "change", value: string): void; (e: "onToggle", showAdvanced: boolean): void; }>(); @@ -62,12 +58,16 @@ function delayQuery(query: string) { } function setQuery(queryNew: string) { - emit("update:modelValue", queryNew); + emit("input", queryNew); emit("change", queryNew); } +watch( + () => queryInput.value, + () => delayQuery(queryInput.value ?? "") +); + function clearBox() { - setQuery(""); queryInput.value = ""; toolInput.value?.focus(); } @@ -77,7 +77,7 @@ function onToggle() { } watchImmediate( - () => currentValue.value, + () => props.value, (newQuery) => { queryInput.value = newQuery; } @@ -94,7 +94,6 @@ watchImmediate( autocomplete="off" :placeholder="placeholder" data-description="filter text input" - @input="delayQuery" @keydown.esc="clearBox" /> diff --git a/client/src/components/Common/FilterMenu.test.ts b/client/src/components/Common/FilterMenu.test.ts index bab978663fcb..a852ed83c39b 100644 --- a/client/src/components/Common/FilterMenu.test.ts +++ b/client/src/components/Common/FilterMenu.test.ts @@ -3,7 +3,7 @@ import { getLocalVue } from "@tests/jest/helpers"; import { mount, type Wrapper } from "@vue/test-utils"; import { HistoryFilters } from "@/components/History/HistoryFilters"; -import { WorkflowFilters } from "@/components/Workflow/List/WorkflowFilters"; +import { WorkflowFilters } from "@/components/Workflow/List/workflowFilters"; import Filtering, { compare, contains, equals, toBool, toDate } from "@/utils/filtering"; import FilterMenu from "./FilterMenu.vue"; diff --git a/client/src/components/Workflow/List/WorkflowCard.vue b/client/src/components/Workflow/List/WorkflowCard.vue index f217a1a76ec2..f06481a74d2e 100644 --- a/client/src/components/Workflow/List/WorkflowCard.vue +++ b/client/src/components/Workflow/List/WorkflowCard.vue @@ -1,6 +1,5 @@