From 446147b9fe295d68fca1e109b3d121446e6309d7 Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Mon, 2 Oct 2023 08:27:37 -0700 Subject: [PATCH] Split SimpleOperatorConfig Reviewed By: lblasa Differential Revision: D49822512 fbshipit-source-id: 82fc6a72cd5ff3b5f9d577baea49367b4f2521fd --- .../src/ui/PowerSearch/PowerSearchConfig.tsx | 40 +++++++++++++++---- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchConfig.tsx b/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchConfig.tsx index 5364fa5a1..1455aa35e 100644 --- a/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchConfig.tsx +++ b/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchConfig.tsx @@ -9,11 +9,13 @@ // Mostly matches https://www.internalfb.com/code/www/html/intern/js/ui/PowerSearch/PowerSearchExampleConfig.js -export type SimpleFilterValueType = - | 'NO_VALUE' - | 'INTEGER' - | 'STRING' - | 'STRING_SET'; +export type NullishFilterValueType = 'NO_VALUE'; + +export type StringFilterValueType = 'STRING'; + +export type StringSetFilterValueType = 'STRING_SET'; + +export type IntegerFilterValueType = 'INTEGER'; export type FloatFilterValueType = 'FLOAT'; @@ -21,8 +23,27 @@ export type EnumFilterValueType = 'ENUM' | 'ENUM_SET'; export type AbsoluteDateFilterValueType = 'ABSOLUTE_DATE'; -export type SimpleOperatorConfig = { - valueType: SimpleFilterValueType; +export type NullishOperatorConfig = { + valueType: NullishFilterValueType; + key: string; + label: string; +}; + +export type StringOperatorConfig = { + valueType: StringFilterValueType; + key: string; + label: string; + handleUnknownValues?: boolean; +}; + +export type StringSetOperatorConfig = { + valueType: StringSetFilterValueType; + key: string; + label: string; +}; + +export type IntegerOperatorConfig = { + valueType: IntegerFilterValueType; key: string; label: string; }; @@ -51,7 +72,10 @@ export type AbsoluteDateOperatorConfig = { }; export type OperatorConfig = - | SimpleOperatorConfig + | NullishOperatorConfig + | StringOperatorConfig + | StringSetOperatorConfig + | IntegerOperatorConfig | FloatOperatorConfig | EnumOperatorConfig | AbsoluteDateOperatorConfig;