Merge pull request #32287 from karpfslp/header-in-entity-layout-should-always-be-shown

fix: header in EntityLayout should always be shown
This commit is contained in:
Fredrik Adelöw
2026-01-12 12:11:28 +01:00
committed by GitHub
2 changed files with 15 additions and 10 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-catalog': patch
---
Header in EntityLayout should always be shown.
Monitoring the loading status caused flickering when the refresh() method of the Async Entity was invoked.
@@ -102,21 +102,13 @@ export const EntityLayout = (props: EntityLayoutProps) => {
UNSTABLE_contextMenuOptions,
contextMenuItems,
children,
header,
NotFoundComponent,
parentEntityRelations,
} = props;
const { kind } = useRouteRefParams(entityRouteRef);
const { entity, loading, error } = useAsyncEntity();
const header = props.header ?? (
<EntityHeader
parentEntityRelations={parentEntityRelations}
UNSTABLE_contextMenuOptions={UNSTABLE_contextMenuOptions}
UNSTABLE_extraContextMenuItems={UNSTABLE_extraContextMenuItems}
contextMenuItems={contextMenuItems}
/>
);
const routes = useElementFilter(
children,
elements =>
@@ -150,7 +142,14 @@ export const EntityLayout = (props: EntityLayoutProps) => {
return (
<Page themeId={entity?.spec?.type?.toString() ?? 'home'}>
{!loading && header}
{header ?? (
<EntityHeader
parentEntityRelations={parentEntityRelations}
UNSTABLE_contextMenuOptions={UNSTABLE_contextMenuOptions}
UNSTABLE_extraContextMenuItems={UNSTABLE_extraContextMenuItems}
contextMenuItems={contextMenuItems}
/>
)}
{loading && <Progress />}