Hotfix: fixed filter when searching by id #1063

Merged
jon merged 6 commits from Hotfix-TicketFilter into master 2024-12-11 13:35:56 +00:00
3 changed files with 22 additions and 5 deletions
Showing only changes of commit a6f970cec8 - Show all commits

View File

@ -51,10 +51,6 @@ const props = defineProps({
type: Object,
default: null,
},
staticParams: {
type: Array,
default: () => [],
},
exprBuilder: {
type: Function,
default: null,
@ -67,6 +63,10 @@ const props = defineProps({
type: Function,
default: undefined,
},
beforeSearch: {
type: Function,
default: undefined,
},
});
const searchText = ref();
@ -103,7 +103,7 @@ async function search() {
const staticParams = Object.entries(store.userParams);
arrayData.reset(['skip', 'page']);
const filter = {
let filter = {
Outdated
Review

if (!searchText.value)

if (!searchText.value)
params: {
...Object.fromEntries(staticParams),
search: searchText.value,
@ -117,6 +117,7 @@ async function search() {
};
delete filter.params.search;
}
if (props.beforeSearch) filter = props.beforeSearch(filter);
await arrayData.applyFilter(filter);
}
</script>

View File

@ -18,6 +18,13 @@ const { t } = useI18n();
url: 'Tickets/filter',
label: t('card.search'),
info: t('card.searchInfo'),
beforeSearch: (filter) => {
if (filter.params.search) {
delete filter.params.from;
delete filter.params.to;
}
return filter;
},
}"
/>
</template>

View File

@ -455,6 +455,15 @@ function setReference(data) {
data-key="TicketList"
:label="t('Search ticket')"
:info="t('You can search by ticket id or alias')"
:before-search="
(filter) => {
if (filter.params.search) {
delete filter.params.from;
delete filter.params.to;
}
return filter;
}
"
/>
<RightMenu>
<template #right-panel>