added support for a custom component when entity not found

Signed-off-by: shahar.shmaram <shahar.shmaram@appsflyer.com>
This commit is contained in:
shahar.shmaram
2022-04-21 12:57:36 +03:00
parent 27032df2d1
commit 0cd4f041b7
@@ -260,6 +260,12 @@ export const EntityLayout = (props: EntityLayoutProps) => {
{entity && <RoutedTabs routes={routes} />}
{error && (
<Content>
<Alert severity="error">{error.toString()}</Alert>
</Content>
)}
{!loading && !error && !entity && (
<Content>
{NotFoundComponent ? (
NotFoundComponent
@@ -275,18 +281,6 @@ export const EntityLayout = (props: EntityLayoutProps) => {
</Content>
)}
{!loading && !error && !entity && (
<Content>
<WarningPanel title="Entity not found">
There is no {kind} with the requested{' '}
<Link to="https://backstage.io/docs/features/software-catalog/references">
kind, namespace, and name
</Link>
.
</WarningPanel>
</Content>
)}
<UnregisterEntityDialog
open={confirmationDialogOpen}
entity={entity!}