Add enum_is operator
Summary: Doc: https://docs.google.com/document/d/1miofxds9DJgWScj0zFyBbdpRH5Rj0T9FqiCapof5-vU/edit#heading=h.pg8svtdjlx7 Reviewed By: lblasa, antonk52 Differential Revision: D49230138 fbshipit-source-id: f20a1a053cc6370acec57e63df80691c64bffc90
This commit is contained in:
committed by
Facebook GitHub Bot
parent
1618404d25
commit
61160a2d4b
@@ -86,6 +86,13 @@ export const dataTablePowerSearchOperators = {
|
|||||||
key: 'float_less_or_equal',
|
key: 'float_less_or_equal',
|
||||||
valueType: 'FLOAT',
|
valueType: 'FLOAT',
|
||||||
}),
|
}),
|
||||||
|
// { [enumValue]: enumLabel }
|
||||||
|
enum_is: (enumLabels: Record<string, string>) => ({
|
||||||
|
label: 'is',
|
||||||
|
key: 'enum_is',
|
||||||
|
valueType: 'ENUM',
|
||||||
|
enumLabels,
|
||||||
|
}),
|
||||||
} satisfies {
|
} satisfies {
|
||||||
[key: string]: (...args: any[]) => OperatorConfig;
|
[key: string]: (...args: any[]) => OperatorConfig;
|
||||||
};
|
};
|
||||||
@@ -136,4 +143,6 @@ export const dataTablePowerSearchOperatorProcessorConfig = {
|
|||||||
value < searchValue,
|
value < searchValue,
|
||||||
float_less_or_equal: (_operator, searchValue: number, value: number) =>
|
float_less_or_equal: (_operator, searchValue: number, value: number) =>
|
||||||
value <= searchValue,
|
value <= searchValue,
|
||||||
|
enum_is: (_operator, searchValue: string, value: string) =>
|
||||||
|
searchValue === value,
|
||||||
} satisfies PowerSearchOperatorProcessorConfig;
|
} satisfies PowerSearchOperatorProcessorConfig;
|
||||||
|
|||||||
Reference in New Issue
Block a user