mirror of
https://github.com/abhinavxd/libredesk.git
synced 2026-09-21 18:13:29 +00:00
use constants from filterConfig for operators.
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
<!-- Value -->
|
||||
<div class="flex-1">
|
||||
<div v-if="modelFilter.field && modelFilter.operator">
|
||||
<template v-if="modelFilter.operator !== 'set' && modelFilter.operator !== 'not set'">
|
||||
<template v-if="modelFilter.operator !== OPERATOR.SET && modelFilter.operator !== OPERATOR.NOT_SET">
|
||||
<SelectTag
|
||||
v-if="getFieldType(modelFilter) === FIELD_TYPE.MULTI_SELECT"
|
||||
v-model="modelFilter.value"
|
||||
@@ -95,7 +95,7 @@
|
||||
<DateFilterValue
|
||||
v-else-if="getFieldType(modelFilter) === FIELD_TYPE.DATE"
|
||||
v-model="modelFilter.value"
|
||||
:range="modelFilter.operator === 'between'"
|
||||
:range="modelFilter.operator === OPERATOR.BETWEEN"
|
||||
/>
|
||||
|
||||
<Input
|
||||
@@ -143,7 +143,7 @@ import { Plus } from 'lucide-vue-next'
|
||||
import { Button } from '@shared-ui/components/ui/button'
|
||||
import { Input } from '@shared-ui/components/ui/input'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { FIELD_TYPE } from '@/constants/filterConfig'
|
||||
import { FIELD_TYPE, OPERATOR } from '@/constants/filterConfig'
|
||||
import CloseButton from '@/components/button/CloseButton.vue'
|
||||
import SelectComboBox from '@/components/combobox/SelectCombobox.vue'
|
||||
import SelectTag from '@shared-ui/components/ui/select/SelectTag.vue'
|
||||
@@ -223,7 +223,7 @@ watch(
|
||||
|
||||
const changeOperator = (filter, newOperator) => {
|
||||
if (filter.operator === newOperator) return
|
||||
if (filter.operator === 'between' || newOperator === 'between') {
|
||||
if (filter.operator === OPERATOR.BETWEEN || newOperator === OPERATOR.BETWEEN) {
|
||||
filter.value = ''
|
||||
}
|
||||
filter.operator = newOperator
|
||||
|
||||
Reference in New Issue
Block a user