From b29d32679748f410e6e61a65d59fae34a2d5a2d8 Mon Sep 17 00:00:00 2001 From: jorgep Date: Fri, 13 Oct 2023 12:26:37 +0200 Subject: [PATCH] ref #6104 vnSelectFilter added --- src/components/common/VnLog.vue | 92 +++++++----------------- src/components/common/VnSelectFilter.vue | 5 +- test/cypress/integration/vnLog.spec.js | 4 +- 3 files changed, 30 insertions(+), 71 deletions(-) diff --git a/src/components/common/VnLog.vue b/src/components/common/VnLog.vue index 049613670..b0583b884 100644 --- a/src/components/common/VnLog.vue +++ b/src/components/common/VnLog.vue @@ -13,6 +13,7 @@ import VnAvatar from '../ui/VnAvatar.vue'; import VnJsonValue from '../common/VnJsonValue.vue'; import FetchData from '../FetchData.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; +import VnSelectFilter from './VnSelectFilter.vue'; const stateStore = useStateStore(); const validationsStore = useValidator(); @@ -120,7 +121,6 @@ const validDate = new RegExp( /T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(.[0-9]+)?(Z)?$/.source ); -const filteredActions = ref([]); const filteredWorkers = ref([]); function castJsonValue(value) { @@ -361,40 +361,13 @@ async function clearFilter() { changeInput.value = undefined; dateFrom.value = undefined; dateTo.value = undefined; + userRadio.value = undefined; Object.keys(checkboxOptions.value).forEach( (opt) => (checkboxOptions.value[opt].selected = false) ); await applyFilter(); } -function filterFn(val, update, abortFn, type) { - if (!val) { - update(() => { - if (type === 'actions') filteredActions.value = actions.value; - if (type === 'workers') filteredWorkers.value = workers.value; - }); - return; - } - - update(() => { - const needle = val.toLowerCase(); - if (type === 'actions') - filteredActions.value = actions.value.filter((item) => - validations[item].locale.name.includes(needle) - ); - if (type === 'workers') { - if (isNaN(needle)) - filteredWorkers.value = workers.value.filter( - (item) => - item.name.toLowerCase().includes(needle) || - item.nickname.toLowerCase().includes(needle) - ); - else - filteredWorkers.value = workers.value.filter((item) => item.id == needle); - } - }); -} - setLogTree();