Add enum_set_is_nullish_or_any_of operator
Summary: Doc: https://docs.google.com/document/d/1miofxds9DJgWScj0zFyBbdpRH5Rj0T9FqiCapof5-vU/edit#heading=h.pg8svtdjlx7 Reviewed By: antonk52 Differential Revision: D49410967 fbshipit-source-id: 699e620ce1076793597702711758809fc149389e
This commit is contained in:
committed by
Facebook GitHub Bot
parent
a6fdc127a2
commit
e6f1e7a74f
@@ -112,6 +112,13 @@ export const dataTablePowerSearchOperators = {
|
||||
valueType: 'ENUM',
|
||||
enumLabels,
|
||||
}),
|
||||
// TODO: Support logical operations (AND, OR, NOT) to combine primitive operators instead of adding new complex operators!
|
||||
enum_set_is_nullish_or_any_of: (enumLabels: Record<string, string>) => ({
|
||||
label: 'is nullish or any of',
|
||||
key: 'enum_set_is_nullish_or_any_of',
|
||||
valueType: 'ENUM_SET',
|
||||
enumLabels,
|
||||
}),
|
||||
enum_set_is_any_of: (enumLabels: Record<string, string>) => ({
|
||||
label: 'is any of',
|
||||
key: 'enum_set_is_any_of',
|
||||
@@ -219,6 +226,11 @@ export const dataTablePowerSearchOperatorProcessorConfig = {
|
||||
searchValue === value,
|
||||
enum_is_not: (_operator, searchValue: string, value: string) =>
|
||||
searchValue !== value,
|
||||
enum_set_is_nullish_or_any_of: (
|
||||
_operator,
|
||||
searchValue: string[],
|
||||
value?: string | null,
|
||||
) => value == null || searchValue.some((item) => value === item),
|
||||
enum_set_is_any_of: (_operator, searchValue: string[], value: string) =>
|
||||
searchValue.some((item) => value === item),
|
||||
enum_set_is_none_of: (_operator, searchValue: string[], value: string) =>
|
||||
|
||||
Reference in New Issue
Block a user