From a27f4580a3d0d90a7341427f1bdd893246733c09 Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Thu, 14 Sep 2023 04:48:12 -0700 Subject: [PATCH] Add string_set_contains_any_of operator Summary: Doc: https://docs.google.com/document/d/1miofxds9DJgWScj0zFyBbdpRH5Rj0T9FqiCapof5-vU/edit#heading=h.pg8svtdjlx7 Reviewed By: lblasa Differential Revision: D49230134 fbshipit-source-id: aa8c4494e707dfbf70568517a50c1f5803fce32a --- .../data-table/DataTableDefaultPowerSearchOperators.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/desktop/flipper-plugin/src/ui/data-table/DataTableDefaultPowerSearchOperators.tsx b/desktop/flipper-plugin/src/ui/data-table/DataTableDefaultPowerSearchOperators.tsx index 4fd186b37..08ba6f668 100644 --- a/desktop/flipper-plugin/src/ui/data-table/DataTableDefaultPowerSearchOperators.tsx +++ b/desktop/flipper-plugin/src/ui/data-table/DataTableDefaultPowerSearchOperators.tsx @@ -36,6 +36,11 @@ export const dataTablePowerSearchOperators = { key: 'string_not_matches_exactly', valueType: 'STRING', }), + string_set_contains_any_of: () => ({ + label: 'contains any of', + key: 'string_set_contains_any_of', + valueType: 'STRING_SET', + }), } satisfies { [key: string]: (...args: any[]) => OperatorConfig; }; @@ -57,4 +62,7 @@ export const dataTablePowerSearchOperatorProcessorConfig = { value === searchValue, string_not_matches_exactly: (operator, searchValue, value) => value !== searchValue, + // See PowerSearchStringSetTerm + string_set_contains_any_of: (operator, searchValue: string[], value) => + searchValue.some((item) => (value as string).toLowerCase().includes(item)), } satisfies PowerSearchOperatorProcessorConfig;