add is operand on number field (#16022)
Co-authored-by: martmull <martmull@hotmail.fr>
This commit is contained in:
+1
@@ -16,6 +16,7 @@ describe('getOperandsForFilterType', () => {
|
||||
];
|
||||
|
||||
const numberOperands = [
|
||||
RecordFilterOperand.IS,
|
||||
RecordFilterOperand.GREATER_THAN_OR_EQUAL,
|
||||
RecordFilterOperand.LESS_THAN_OR_EQUAL,
|
||||
];
|
||||
|
||||
+1
@@ -73,6 +73,7 @@ export const FILTER_OPERANDS_MAP = {
|
||||
...emptyOperands,
|
||||
],
|
||||
NUMBER: [
|
||||
RecordFilterOperand.IS,
|
||||
RecordFilterOperand.GREATER_THAN_OR_EQUAL,
|
||||
RecordFilterOperand.LESS_THAN_OR_EQUAL,
|
||||
...emptyOperands,
|
||||
|
||||
+5
@@ -134,6 +134,11 @@ describe('buildValueFromFilter', () => {
|
||||
|
||||
describe('NUMBER field type', () => {
|
||||
const testCases = [
|
||||
{
|
||||
operand: ViewFilterOperand.IS,
|
||||
value: '5',
|
||||
expected: 5,
|
||||
},
|
||||
{
|
||||
operand: ViewFilterOperand.GREATER_THAN_OR_EQUAL,
|
||||
value: '5',
|
||||
|
||||
+2
@@ -157,6 +157,8 @@ const computeValueFromFilterNumber = (
|
||||
return Number(value) - 1;
|
||||
case ViewFilterOperand.IS_NOT_EMPTY:
|
||||
return Number(value);
|
||||
case ViewFilterOperand.IS:
|
||||
return Number(value);
|
||||
case ViewFilterOperand.IS_EMPTY:
|
||||
return undefined;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user