Simplify config

Summary: Project doc: https://docs.google.com/document/d/1miofxds9DJgWScj0zFyBbdpRH5Rj0T9FqiCapof5-vU

Reviewed By: lblasa

Differential Revision: D48600255

fbshipit-source-id: a57504519000fce4544f6875b2933cd5bcaedba3
This commit is contained in:
Andrey Goncharov
2023-08-30 07:26:35 -07:00
committed by Facebook GitHub Bot
parent e87ec62552
commit 380e99400f
2 changed files with 7 additions and 46 deletions

View File

@@ -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

View File

@@ -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',
},
},
},
},
};