fix: assigned to filter was not working
This commit is contained in:
parent
5b682cc2d7
commit
a976c0b7f2
@ -39,7 +39,7 @@
|
|||||||
type="select"
|
type="select"
|
||||||
:value="f.operator"
|
:value="f.operator"
|
||||||
@change="(e) => updateOperator(e, f)"
|
@change="(e) => updateOperator(e, f)"
|
||||||
:options="getOperators(f.field.fieldtype)"
|
:options="getOperators(f.field.fieldtype, f.field.fieldname)"
|
||||||
placeholder="Operator"
|
placeholder="Operator"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -193,7 +193,7 @@ function convertFilters(data, allFilters) {
|
|||||||
return new Set(f)
|
return new Set(f)
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOperators(fieldtype) {
|
function getOperators(fieldtype, fieldname) {
|
||||||
let options = []
|
let options = []
|
||||||
if (typeString.includes(fieldtype)) {
|
if (typeString.includes(fieldtype)) {
|
||||||
options.push(
|
options.push(
|
||||||
@ -205,6 +205,12 @@ function getOperators(fieldtype) {
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (fieldname === '_assign') {
|
||||||
|
options = [
|
||||||
|
{ label: 'Like', value: 'like' },
|
||||||
|
{ label: 'Not Like', value: 'not like' },
|
||||||
|
]
|
||||||
|
}
|
||||||
if (typeNumber.includes(fieldtype)) {
|
if (typeNumber.includes(fieldtype)) {
|
||||||
options.push(
|
options.push(
|
||||||
...[
|
...[
|
||||||
@ -351,9 +357,6 @@ function parseFilters(filters) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function transformIn(f) {
|
function transformIn(f) {
|
||||||
if (f.fieldname === '_assign') {
|
|
||||||
f.operator = f.operator === 'is' ? 'like' : 'not like'
|
|
||||||
}
|
|
||||||
if (f.operator.includes('like') && !f.value.includes('%')) {
|
if (f.operator.includes('like') && !f.value.includes('%')) {
|
||||||
f.value = `%${f.value}%`
|
f.value = `%${f.value}%`
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user