From 1e81fe636aada74859f42c41e639c647cfcd1579 Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Tue, 3 Oct 2023 09:13:02 -0700 Subject: [PATCH] Add extraActions fallback to MasterDetai and DataTable Summary: Old MasterDetail and DataTable (pre-power search) are using `extraActions` prop which no longer exists in teh new components. This diff adds a fallback. Reviewed By: ivanmisuno Differential Revision: D49869730 fbshipit-source-id: 4c1a658aa94acc770836f9bf296a3df7d6cdcb3e --- desktop/flipper-plugin/src/ui/MasterDetailWithPowerSearch.tsx | 2 ++ .../src/ui/data-table/DataTableWithPowerSearch.tsx | 3 +++ 2 files changed, 5 insertions(+) diff --git a/desktop/flipper-plugin/src/ui/MasterDetailWithPowerSearch.tsx b/desktop/flipper-plugin/src/ui/MasterDetailWithPowerSearch.tsx index c2c9cce3f..d6b873431 100644 --- a/desktop/flipper-plugin/src/ui/MasterDetailWithPowerSearch.tsx +++ b/desktop/flipper-plugin/src/ui/MasterDetailWithPowerSearch.tsx @@ -85,6 +85,7 @@ export function MasterDetailWithPowerSearch({ sidebarSize, onSelect, actionsTop, + extraActions, enableMenuEntries, enableClear, isPaused, @@ -232,6 +233,7 @@ export function MasterDetailWithPowerSearch({ } actionsTop={actionsTop} + extraActions={extraActions} /> ); diff --git a/desktop/flipper-plugin/src/ui/data-table/DataTableWithPowerSearch.tsx b/desktop/flipper-plugin/src/ui/data-table/DataTableWithPowerSearch.tsx index 8788b3cce..1a9943a9f 100644 --- a/desktop/flipper-plugin/src/ui/data-table/DataTableWithPowerSearch.tsx +++ b/desktop/flipper-plugin/src/ui/data-table/DataTableWithPowerSearch.tsx @@ -87,6 +87,8 @@ type DataTableBaseProps = { scrollable?: boolean; actionsRight?: React.ReactElement; actionsTop?: React.ReactElement; + /** @deprecated **/ + extraActions?: React.ReactElement; onSelect?(record: T | undefined, records: T[]): void; onRowStyle?(record: T): CSSProperties | undefined; tableManagerRef?: RefObject | undefined>; // Actually we want a MutableRefObject, but that is not what React.createRef() returns, and we don't want to put the burden on the plugin dev to cast it... @@ -663,6 +665,7 @@ export function DataTable( )} {props.actionsRight} + {props.extraActions} )}