From 380e99400f456946b42a8d45037964df7c7574d3 Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Wed, 30 Aug 2023 07:26:35 -0700 Subject: [PATCH] Simplify config Summary: Project doc: https://docs.google.com/document/d/1miofxds9DJgWScj0zFyBbdpRH5Rj0T9FqiCapof5-vU Reviewed By: lblasa Differential Revision: D48600255 fbshipit-source-id: a57504519000fce4544f6875b2933cd5bcaedba3 --- .../src/ui/PowerSearch/PowerSearchConfig.tsx | 19 ++++------- .../PowerSearch/PowerSearchExampleConfig.tsx | 34 ------------------- 2 files changed, 7 insertions(+), 46 deletions(-) diff --git a/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchConfig.tsx b/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchConfig.tsx index 0bc887d52..18c03fe30 100644 --- a/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchConfig.tsx +++ b/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchConfig.tsx @@ -7,11 +7,14 @@ * @format */ -// Mostly mateches https://www.internalfb.com/code/www/html/intern/js/ui/PowerSearch/PowerSearchExampleConfig.js +// Mostly matches https://www.internalfb.com/code/www/html/intern/js/ui/PowerSearch/PowerSearchExampleConfig.js -export type SimpleFilterValueType = 'NESTED' | 'NO_VALUE' | 'INTEGER' | 'FLOAT'; - -export type StringFilterValueType = 'STRING_SET' | 'STRING'; +export type SimpleFilterValueType = + | 'NO_VALUE' + | 'INTEGER' + | 'FLOAT' + | 'STRING_SET' + | 'STRING'; export type EnumFilterValueType = 'ENUM_SET' | 'ENUM'; @@ -27,13 +30,6 @@ export type SimpleOperatorConfig = { label: string; }; -export type StringOperatorConfig = { - valueType: StringFilterValueType; - key: string; - label: string; - allowArbitraryEntries?: boolean; -}; - export type EnumOperatorConfig = { valueType: EnumFilterValueType; key: string; @@ -75,7 +71,6 @@ export type TimeOperatorConfig = { export type OperatorConfig = | SimpleOperatorConfig - | StringOperatorConfig | EnumOperatorConfig | AbsoluteDateOperatorConfig | RelativeDateOperatorConfig diff --git a/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchExampleConfig.tsx b/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchExampleConfig.tsx index 1f67d420b..9f1e49cac 100644 --- a/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchExampleConfig.tsx +++ b/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchExampleConfig.tsx @@ -83,7 +83,6 @@ const operators = { label: 'is any of (arbitrary allowed)', key: 'ent_class_any_with_arbitrary_strings', valueType: 'STRING_SET', - allowArbitraryEntries: true, }, caller_is: { label: 'is', @@ -111,7 +110,6 @@ const operators = { label: 'does not contain', key: 'predictive_not_contain', valueType: 'STRING', - allowArbitraryEntries: true, }, newer_than_relative_date: { key: 'newer_than_relative_date', @@ -260,37 +258,5 @@ export const powerSearchExampleConfig: PowerSearchConfig = { unread: operators.unread, }, }, - NESTED_FIELD: { - key: 'NESTED_FIELD', - label: '', - operators: { - AND: { - key: 'AND', - label: 'All of', - valueType: 'NESTED', - }, - NOT: { - key: 'NOT', - label: 'None of', - valueType: 'NESTED', - }, - OR: { - key: 'OR', - label: 'Any of', - valueType: 'NESTED', - }, - }, - }, - CONTEXT_TOKEN: { - key: 'CONTEXT_TOKEN', - label: 'Context Token', - operators: { - CONTEXT_TOKEN: { - key: 'CONTEXT_TOKEN', - label: '', - valueType: 'NO_VALUE', - }, - }, - }, }, };