|
|
@ -227,6 +227,44 @@ export async function validateCondition( |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
|
|
[UITypes.User, UITypes.CreatedBy, UITypes.LastModifiedBy].includes( |
|
|
|
|
|
|
|
column.uidt, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
const userIds = Array.isArray(data[field]) |
|
|
|
|
|
|
|
? data[field].map((user) => user.id) |
|
|
|
|
|
|
|
: data[field]?.id |
|
|
|
|
|
|
|
? [data[field].id] |
|
|
|
|
|
|
|
: []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const filterValues = filter.value.split(',').map((v) => v.trim()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (filter.comparison_op) { |
|
|
|
|
|
|
|
case 'anyof': |
|
|
|
|
|
|
|
res = userIds.some((id) => filterValues.includes(id)); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 'nanyof': |
|
|
|
|
|
|
|
res = !userIds.some((id) => filterValues.includes(id)); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 'allof': |
|
|
|
|
|
|
|
res = filterValues.every((id) => userIds.includes(id)); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 'nallof': |
|
|
|
|
|
|
|
res = !filterValues.every((id) => userIds.includes(id)); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 'empty': |
|
|
|
|
|
|
|
case 'blank': |
|
|
|
|
|
|
|
res = userIds.length === 0; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 'notempty': |
|
|
|
|
|
|
|
case 'notblank': |
|
|
|
|
|
|
|
res = userIds.length > 0; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
res = false; // Unsupported operation for User fields
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
switch (filter.comparison_op) { |
|
|
|
switch (filter.comparison_op) { |
|
|
|
case 'eq': |
|
|
|
case 'eq': |
|
|
|
res = val == filter.value; |
|
|
|
res = val == filter.value; |
|
|
@ -312,6 +350,7 @@ export async function validateCondition( |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
switch (filter.logical_op) { |
|
|
|
switch (filter.logical_op) { |
|
|
|
case 'or': |
|
|
|
case 'or': |
|
|
|