From 9dea899701d062ba6ad9d9c74c92480eea248ace Mon Sep 17 00:00:00 2001 From: Luke De Feo Date: Mon, 13 Nov 2023 06:02:32 -0800 Subject: [PATCH] use new api for enum Summary: Also fixed time column Reviewed By: aigoncharov Differential Revision: D51255567 fbshipit-source-id: 70a708a0e502eeaf1e51b8ace41dc588b9c0543d --- desktop/plugins/public/logs/index.tsx | 28 +++++++++++++-------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/desktop/plugins/public/logs/index.tsx b/desktop/plugins/public/logs/index.tsx index 87d124e25..e865a884e 100644 --- a/desktop/plugins/public/logs/index.tsx +++ b/desktop/plugins/public/logs/index.tsx @@ -71,23 +71,27 @@ function createColumnConfig( ); }, powerSearchConfig: { - operators: [ - dataTablePowerSearchOperators.enum_set_is_any_of(logLevelEnumLabels), - dataTablePowerSearchOperators.enum_set_is_none_of(logLevelEnumLabels), - ], + type: 'enum', + inferEnumOptionsFromData: true, }, }, { key: 'date', title: 'Time', width: 120, + powerSearchConfig: { + type: 'dateTime', + }, }, { key: 'pidStr', title: 'PID', width: 60, visible: true, - powerSearchConfig: enumPowerSearchConfig, + powerSearchConfig: { + type: 'enum', + inferEnumOptionsFromData: true, + }, }, { key: 'tid', @@ -99,7 +103,10 @@ function createColumnConfig( key: 'tag', title: 'Tag', width: 160, - powerSearchConfig: enumPowerSearchConfig, + powerSearchConfig: { + type: 'enum', + inferEnumOptionsFromData: true, + }, }, { key: 'app', @@ -120,15 +127,6 @@ function createColumnConfig( ]; } -const enumPowerSearchConfig = { - inferEnumOptionsFromData: true, - - operators: [ - dataTablePowerSearchOperators.enum_set_is_any_of({}), - dataTablePowerSearchOperators.enum_set_is_none_of({}), - ], -}; - function getRowStyle(entry: DeviceLogEntry): CSSProperties | undefined { return (logTypes[entry.type]?.style as any) ?? baseRowStyle; }