From a1e73465de0090f9841793e7ac26c620a493150a Mon Sep 17 00:00:00 2001 From: Simon Chaumet Date: Fri, 29 Nov 2024 14:48:02 +0100 Subject: [PATCH] perf(pci-private-network): remove blocking on pending for subnets ref: TAPC-1826 Signed-off-by: Simon Chaumet --- .../DatagridHeaderActions.component.tsx | 5 +++ .../localZone/PrivateNetworkLZ.page.tsx | 44 ++++++++----------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/packages/manager/apps/pci-private-network/src/components/datagrid-header-actions/DatagridHeaderActions.component.tsx b/packages/manager/apps/pci-private-network/src/components/datagrid-header-actions/DatagridHeaderActions.component.tsx index dab686c9aaab..9ac75528edc7 100644 --- a/packages/manager/apps/pci-private-network/src/components/datagrid-header-actions/DatagridHeaderActions.component.tsx +++ b/packages/manager/apps/pci-private-network/src/components/datagrid-header-actions/DatagridHeaderActions.component.tsx @@ -5,12 +5,14 @@ import { OsdsPopover, OsdsPopoverContent, OsdsSearchBar, + OsdsSpinner, } from '@ovhcloud/ods-components/react'; import { ODS_BUTTON_SIZE, ODS_BUTTON_VARIANT, ODS_ICON_NAME, ODS_ICON_SIZE, + ODS_SPINNER_SIZE, } from '@ovhcloud/ods-components'; import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming'; import { @@ -33,6 +35,7 @@ type Props = { pagination: PaginationState; setPagination: (pagination: PaginationState) => void; onCreate?: () => void; + isLoading?: boolean; }; const DataGridHeaderActions: FC = ({ @@ -41,6 +44,7 @@ const DataGridHeaderActions: FC = ({ pagination, setPagination, onCreate, + isLoading, }) => { const { filters, addFilter, removeFilter } = useColumnFilters(); const [searchField, setSearchField] = useState(''); @@ -91,6 +95,7 @@ const DataGridHeaderActions: FC = ({ {createLabel}
+ {isLoading && } { name={PrivateNetworkTabName.LOCAL_ZONE_TAB_NAME} > - {isPending ? ( -
- -
- ) : ( - <> - navigate('../new')} - pagination={pagination} - setPagination={setPagination} - columnFilters={columnFilters} - /> -
- -
- - )} + navigate('../new')} + pagination={pagination} + setPagination={setPagination} + columnFilters={columnFilters} + isLoading={isPending} + /> +
+ +
);