From 96396900cf6627d58c8df3b64bd27611b648b513 Mon Sep 17 00:00:00 2001 From: jfrer Date: Fri, 12 Jul 2024 15:53:11 +0200 Subject: [PATCH] feat: add select all label; refactor to own component --- src/components/base/MultiSelect.vue | 42 +++++++++++++ .../workflows/timeline/TimelineFilters.vue | 62 ++++--------------- 2 files changed, 53 insertions(+), 51 deletions(-) create mode 100644 src/components/base/MultiSelect.vue diff --git a/src/components/base/MultiSelect.vue b/src/components/base/MultiSelect.vue new file mode 100644 index 0000000..8b44c2c --- /dev/null +++ b/src/components/base/MultiSelect.vue @@ -0,0 +1,42 @@ + + \ No newline at end of file diff --git a/src/components/workflows/timeline/TimelineFilters.vue b/src/components/workflows/timeline/TimelineFilters.vue index 5ec256a..f94297e 100644 --- a/src/components/workflows/timeline/TimelineFilters.vue +++ b/src/components/workflows/timeline/TimelineFilters.vue @@ -2,10 +2,10 @@ import filtersStore from "@/store/filters-store" import workflowsStore from "@/store/workflows-store" import { computed, onMounted, ref, watch } from "vue" -import MultiSelect from "primevue/multiselect" import type { DropdownOption, GroundTruth } from "@/types" import { deduplicateStepIds, mapGtId } from '@/helpers/utils' import { useI18n } from "vue-i18n" +import BaseMultiSelect from "@/components/base/MultiSelect.vue" const { t } = useI18n() @@ -54,41 +54,6 @@ const scriptTypeOptions = computed(() => { }) const selectedScriptTypes = ref([]) -const labellingDropdownLabel = computed(() => { - if (labellingOptions.value.length === selectedLabelling.value.length) { - return t('filter_by_labelling') - } - return null -}) - -const scriptTypeDropdownLabel = computed(() => { - if (scriptTypeOptions.value.length === selectedScriptTypes.value.length) { - return t('filter_by_script_type') - } - return null -}) - -const dateRangeDropdownLabel = computed(() => { - if (dateRangeOptions.value.length === selectedDateRange.value.length) { - return t('filter_by_date_range') - } - return null -}) - -const workflowDropdownLabel = computed(() => { - if (workflowOptions.value.length === selectedWorkflows.value.length) { - return t('filter_by_workflow') - } - return null -}) - -const workflowStepDropdownLabel = computed(() => { - if (workflowStepOptions.value.length === selectedWorkflowSteps.value.length) { - return t('filter_by_processor') - } - return null -}) - const onLabellingChange = (event: any) => { selectedLabelling.value = event selectGTs() @@ -195,52 +160,47 @@ onMounted(() => {