use new api for enum

Summary: Also fixed time column

Reviewed By: aigoncharov

Differential Revision: D51255567

fbshipit-source-id: 70a708a0e502eeaf1e51b8ace41dc588b9c0543d
This commit is contained in:
Luke De Feo
2023-11-13 06:02:32 -08:00
committed by Facebook GitHub Bot
parent 437e67cd7f
commit 9dea899701

View File

@@ -71,23 +71,27 @@ function createColumnConfig(
); );
}, },
powerSearchConfig: { powerSearchConfig: {
operators: [ type: 'enum',
dataTablePowerSearchOperators.enum_set_is_any_of(logLevelEnumLabels), inferEnumOptionsFromData: true,
dataTablePowerSearchOperators.enum_set_is_none_of(logLevelEnumLabels),
],
}, },
}, },
{ {
key: 'date', key: 'date',
title: 'Time', title: 'Time',
width: 120, width: 120,
powerSearchConfig: {
type: 'dateTime',
},
}, },
{ {
key: 'pidStr', key: 'pidStr',
title: 'PID', title: 'PID',
width: 60, width: 60,
visible: true, visible: true,
powerSearchConfig: enumPowerSearchConfig, powerSearchConfig: {
type: 'enum',
inferEnumOptionsFromData: true,
},
}, },
{ {
key: 'tid', key: 'tid',
@@ -99,7 +103,10 @@ function createColumnConfig(
key: 'tag', key: 'tag',
title: 'Tag', title: 'Tag',
width: 160, width: 160,
powerSearchConfig: enumPowerSearchConfig, powerSearchConfig: {
type: 'enum',
inferEnumOptionsFromData: true,
},
}, },
{ {
key: 'app', 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 { function getRowStyle(entry: DeviceLogEntry): CSSProperties | undefined {
return (logTypes[entry.type]?.style as any) ?? baseRowStyle; return (logTypes[entry.type]?.style as any) ?? baseRowStyle;
} }