diff --git a/calm-hub-ui/src/admin/panels/EntitlementsPanel.test.tsx b/calm-hub-ui/src/admin/panels/EntitlementsPanel.test.tsx index cf361038e..ee2cae5c6 100644 --- a/calm-hub-ui/src/admin/panels/EntitlementsPanel.test.tsx +++ b/calm-hub-ui/src/admin/panels/EntitlementsPanel.test.tsx @@ -192,7 +192,9 @@ describe('EntitlementsPanel', () => { await waitFor(() => expect(screen.getByRole('region', { name: /global admin access/i })).toBeInTheDocument() ); - expect(userAccessSvc.getNamespaceUserAccess).toHaveBeenCalledWith('GLOBAL'); + await waitFor(() => + expect(userAccessSvc.getNamespaceUserAccess).toHaveBeenCalledWith('GLOBAL') + ); }); }); diff --git a/calm-hub-ui/src/hub/components/diagram-section/DiagramSection.tsx b/calm-hub-ui/src/hub/components/diagram-section/DiagramSection.tsx index 0abcc03cf..355da682f 100644 --- a/calm-hub-ui/src/hub/components/diagram-section/DiagramSection.tsx +++ b/calm-hub-ui/src/hub/components/diagram-section/DiagramSection.tsx @@ -87,7 +87,7 @@ export function DiagramSection({ data, onItemSelect, hasDetailsPanel, breadcrumb [nodeSearchTerm, nodeTypeFilter, nodeTypes] ); const calmService = useMemo(() => new CalmService(), []); - const defaultLayoutState = useDefaultLayout(data.name, data.id, data.calmType); + const defaultLayoutState = useDefaultLayout(data.name, data.id, data.calmType, data.data as Record | undefined); // Destructured locals so handleSaveLayout/handleResetLayout below can depend // on exactly the (already useCallback-stable) functions they call, rather // than the whole result object — which still changes identity whenever @@ -428,6 +428,26 @@ export function DiagramSection({ data, onItemSelect, hasDetailsPanel, breadcrumb const showLayoutActions = !comparing && activeTab === 'diagram'; const layoutActions = showLayoutActions && (
+ {defaultLayoutState.hasBothSources && ( +
+ + +
+ )} {canSaveLayout && (