From 3b75b6994b3ff3171261c6de21a2178bd37b0428 Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Tue, 19 Sep 2023 08:19:25 -0700 Subject: [PATCH] Allow disabling power search for certain columns Summary: Doc: https://docs.google.com/document/d/1miofxds9DJgWScj0zFyBbdpRH5Rj0T9FqiCapof5-vU/edit#heading=h.pg8svtdjlx7 Reviewed By: antonk52 Differential Revision: D49373658 fbshipit-source-id: 872bd6ecdce9c3ed7934f86f1954efdff76185b9 --- .../ui/data-table/DataTableWithPowerSearch.tsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/desktop/flipper-plugin/src/ui/data-table/DataTableWithPowerSearch.tsx b/desktop/flipper-plugin/src/ui/data-table/DataTableWithPowerSearch.tsx index f3fb46ac8..95b03df1b 100644 --- a/desktop/flipper-plugin/src/ui/data-table/DataTableWithPowerSearch.tsx +++ b/desktop/flipper-plugin/src/ui/data-table/DataTableWithPowerSearch.tsx @@ -124,11 +124,13 @@ export type DataTableColumn = { visible?: boolean; inversed?: boolean; sortable?: boolean; - powerSearchConfig?: { - [K in keyof typeof dataTablePowerSearchOperators]: ReturnType< - (typeof dataTablePowerSearchOperators)[K] - >; - }; + powerSearchConfig?: + | { + [K in keyof typeof dataTablePowerSearchOperators]: ReturnType< + (typeof dataTablePowerSearchOperators)[K] + >; + } + | false; }; export interface TableRowRenderContext { @@ -240,6 +242,9 @@ export function DataTable( const res: PowerSearchConfig = {fields: {}}; for (const column of columns) { + if (column.powerSearchConfig === false) { + continue; + } const columnFieldConfig: FieldConfig = { label: column.title ?? column.key, key: column.key,