Change how custom columsn work

Summary:
Previously the render function was selecting the data from the paylaod object, this mean what was on screen and waht powersearch saw was diffferent.

Now we supply a dotted key path and remove this from render, power search operator also uses this dotted key path so the search works

changelog: UIdebugger added powersearch operators to Framework event table

Reviewed By: aigoncharov

Differential Revision: D51113095

fbshipit-source-id: 3c951c2a8a7a0a35e0aa79a194b979b699f83008
This commit is contained in:
Luke De Feo
2023-11-08 10:30:55 -08:00
committed by Facebook GitHub Bot
parent 03c2828630
commit 4d0a5ff42b

View File

@@ -90,10 +90,9 @@ export function FrameworkEventsTable({
const customColumns = [...customColumnKeys].map( const customColumns = [...customColumnKeys].map(
(customKey: string) => (customKey: string) =>
({ ({
key: customKey, key: `payload.${customKey}` as any,
title: startCase(customKey), title: startCase(customKey),
onRender: (row: AugmentedFrameworkEvent) => row.payload?.[customKey], powerSearchConfig: stringConfig,
powerSearchConfig: enumLikeString,
} as DataTableColumn<AugmentedFrameworkEvent>), } as DataTableColumn<AugmentedFrameworkEvent>),
); );
@@ -169,12 +168,6 @@ const stringConfig = [
]; ];
const idConfig = [dataTablePowerSearchOperators.int_equals()]; const idConfig = [dataTablePowerSearchOperators.int_equals()];
//todo replace with auto mode
const enumLikeString = [
dataTablePowerSearchOperators.string_matches_exactly(true),
dataTablePowerSearchOperators.string_not_matches_exactly(true),
];
const inferredEnum = [ const inferredEnum = [
dataTablePowerSearchOperators.enum_set_is_any_of({}), dataTablePowerSearchOperators.enum_set_is_any_of({}),
dataTablePowerSearchOperators.enum_is({}), dataTablePowerSearchOperators.enum_is({}),