Merge pull request #237 from shariquerik/task-filter-fix
fix: Changing operator from between to equal is not working
This commit is contained in:
commit
4cd0db89b1
@ -1 +1 @@
|
|||||||
Subproject commit 0c0212cc5bbac151cffc6dc73dfbdf7b69d45ec2
|
Subproject commit b5cc6c0cd36ee25e8e945e8c91d8b5c035fb5e44
|
||||||
@ -13,7 +13,7 @@
|
|||||||
"@vueuse/core": "^10.3.0",
|
"@vueuse/core": "^10.3.0",
|
||||||
"@vueuse/integrations": "^10.3.0",
|
"@vueuse/integrations": "^10.3.0",
|
||||||
"feather-icons": "^4.28.0",
|
"feather-icons": "^4.28.0",
|
||||||
"frappe-ui": "^0.1.61",
|
"frappe-ui": "^0.1.63",
|
||||||
"gemoji": "^8.1.0",
|
"gemoji": "^8.1.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mime": "^4.0.1",
|
"mime": "^4.0.1",
|
||||||
|
|||||||
@ -67,7 +67,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="value" class="w-full">
|
<div id="value" class="w-full">
|
||||||
<component
|
<component
|
||||||
:is="getValSelect(f)"
|
:is="getValueControl(f)"
|
||||||
v-model="f.value"
|
v-model="f.value"
|
||||||
@change.stop="(v) => updateValue(v, f)"
|
@change.stop="(v) => updateValue(v, f)"
|
||||||
:placeholder="__('John Doe')"
|
:placeholder="__('John Doe')"
|
||||||
@ -100,7 +100,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="value" class="!min-w-[140px]">
|
<div id="value" class="!min-w-[140px]">
|
||||||
<component
|
<component
|
||||||
:is="getValSelect(f)"
|
:is="getValueControl(f)"
|
||||||
v-model="f.value"
|
v-model="f.value"
|
||||||
@change="(v) => updateValue(v, f)"
|
@change="(v) => updateValue(v, f)"
|
||||||
:placeholder="__('John Doe')"
|
:placeholder="__('John Doe')"
|
||||||
@ -242,7 +242,7 @@ function convertFilters(data, allFilters) {
|
|||||||
let f = []
|
let f = []
|
||||||
for (let [key, value] of Object.entries(allFilters)) {
|
for (let [key, value] of Object.entries(allFilters)) {
|
||||||
let field = data.find((f) => f.fieldname === key)
|
let field = data.find((f) => f.fieldname === key)
|
||||||
if (typeof value !== 'object') {
|
if (typeof value !== 'object' || !value) {
|
||||||
value = ['=', value]
|
value = ['=', value]
|
||||||
if (field?.fieldtype === 'Check') {
|
if (field?.fieldtype === 'Check') {
|
||||||
value = ['equals', value[1] ? 'Yes' : 'No']
|
value = ['equals', value[1] ? 'Yes' : 'No']
|
||||||
@ -273,7 +273,7 @@ function getOperators(fieldtype, fieldname) {
|
|||||||
{ label: __('In'), value: 'in' },
|
{ label: __('In'), value: 'in' },
|
||||||
{ label: __('Not In'), value: 'not in' },
|
{ label: __('Not In'), value: 'not in' },
|
||||||
{ label: __('Is'), value: 'is' },
|
{ label: __('Is'), value: 'is' },
|
||||||
]
|
],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (fieldname === '_assign') {
|
if (fieldname === '_assign') {
|
||||||
@ -298,7 +298,7 @@ function getOperators(fieldtype, fieldname) {
|
|||||||
{ label: __('>'), value: '>' },
|
{ label: __('>'), value: '>' },
|
||||||
{ label: __('<='), value: '<=' },
|
{ label: __('<='), value: '<=' },
|
||||||
{ label: __('>='), value: '>=' },
|
{ label: __('>='), value: '>=' },
|
||||||
]
|
],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (typeSelect.includes(fieldtype)) {
|
if (typeSelect.includes(fieldtype)) {
|
||||||
@ -309,7 +309,7 @@ function getOperators(fieldtype, fieldname) {
|
|||||||
{ label: __('In'), value: 'in' },
|
{ label: __('In'), value: 'in' },
|
||||||
{ label: __('Not In'), value: 'not in' },
|
{ label: __('Not In'), value: 'not in' },
|
||||||
{ label: __('Is'), value: 'is' },
|
{ label: __('Is'), value: 'is' },
|
||||||
]
|
],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (typeLink.includes(fieldtype)) {
|
if (typeLink.includes(fieldtype)) {
|
||||||
@ -322,7 +322,7 @@ function getOperators(fieldtype, fieldname) {
|
|||||||
{ label: __('In'), value: 'in' },
|
{ label: __('In'), value: 'in' },
|
||||||
{ label: __('Not In'), value: 'not in' },
|
{ label: __('Not In'), value: 'not in' },
|
||||||
{ label: __('Is'), value: 'is' },
|
{ label: __('Is'), value: 'is' },
|
||||||
]
|
],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (typeCheck.includes(fieldtype)) {
|
if (typeCheck.includes(fieldtype)) {
|
||||||
@ -336,7 +336,7 @@ function getOperators(fieldtype, fieldname) {
|
|||||||
{ label: __('In'), value: 'in' },
|
{ label: __('In'), value: 'in' },
|
||||||
{ label: __('Not In'), value: 'not in' },
|
{ label: __('Not In'), value: 'not in' },
|
||||||
{ label: __('Is'), value: 'is' },
|
{ label: __('Is'), value: 'is' },
|
||||||
]
|
],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (typeDate.includes(fieldtype)) {
|
if (typeDate.includes(fieldtype)) {
|
||||||
@ -351,13 +351,13 @@ function getOperators(fieldtype, fieldname) {
|
|||||||
{ label: __('<='), value: '<=' },
|
{ label: __('<='), value: '<=' },
|
||||||
{ label: __('Between'), value: 'between' },
|
{ label: __('Between'), value: 'between' },
|
||||||
{ label: __('Timespan'), value: 'timespan' },
|
{ label: __('Timespan'), value: 'timespan' },
|
||||||
]
|
],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return options
|
return options
|
||||||
}
|
}
|
||||||
|
|
||||||
function getValSelect(f) {
|
function getValueControl(f) {
|
||||||
const { field, operator } = f
|
const { field, operator } = f
|
||||||
const { fieldtype, options } = field
|
const { fieldtype, options } = field
|
||||||
if (operator == 'is') {
|
if (operator == 'is') {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user