Add string_not_contains operator

Summary: Doc: https://docs.google.com/document/d/1miofxds9DJgWScj0zFyBbdpRH5Rj0T9FqiCapof5-vU/edit#heading=h.pg8svtdjlx7

Reviewed By: lblasa

Differential Revision: D49230139

fbshipit-source-id: 23d0f9f8f50906c940764e3e9e5382ead9be9d35
This commit is contained in:
Andrey Goncharov
2023-09-14 04:48:12 -07:00
committed by Facebook GitHub Bot
parent ceac388eed
commit 3206649a29

View File

@@ -21,6 +21,11 @@ export const dataTablePowerSearchOperators = {
key: 'string_contains',
valueType: 'STRING',
}),
string_not_contains: () => ({
label: 'does not contain',
key: 'string_not_contains',
valueType: 'STRING',
}),
} satisfies {
[key: string]: (...args: any[]) => OperatorConfig;
};
@@ -34,4 +39,8 @@ export const dataTablePowerSearchOperatorProcessorConfig = {
(value as string)
.toLowerCase()
.includes((searchValue as string).toLowerCase()),
string_not_contains: (operator, searchValue, value) =>
!(value as string)
.toLowerCase()
.includes((searchValue as string).toLowerCase()),
} satisfies PowerSearchOperatorProcessorConfig;