diff --git a/.changeset/healthy-comics-drive.md b/.changeset/healthy-comics-drive.md index 3847274eda..4b532dc853 100644 --- a/.changeset/healthy-comics-drive.md +++ b/.changeset/healthy-comics-drive.md @@ -2,4 +2,5 @@ '@backstage/plugin-catalog': patch --- -Display the owner and system as links to the entity pages in the about card. +Display the owner, system, and domain as links to the entity pages in the about card. +Only display fields in the about card that are applicable to the entity kind. diff --git a/plugins/catalog/src/components/AboutCard/AboutContent.tsx b/plugins/catalog/src/components/AboutCard/AboutContent.tsx index d0c25c69b6..178debb42a 100644 --- a/plugins/catalog/src/components/AboutCard/AboutContent.tsx +++ b/plugins/catalog/src/components/AboutCard/AboutContent.tsx @@ -37,9 +37,15 @@ type Props = { export const AboutContent = ({ entity }: Props) => { const classes = useStyles(); + const isSystem = entity.kind.toLowerCase() === 'system'; + const isDomain = entity.kind.toLowerCase() === 'domain'; + const isResource = entity.kind.toLowerCase() === 'resource'; const [partOfSystemRelation] = getEntityRelations(entity, RELATION_PART_OF, { kind: 'system', }); + const [partOfDomainRelation] = getEntityRelations(entity, RELATION_PART_OF, { + kind: 'domain', + }); const ownedByRelations = getEntityRelations(entity, RELATION_OWNED_BY); return ( @@ -57,28 +63,48 @@ export const AboutContent = ({ entity }: Props) => { ))} - - {partOfSystemRelation && ( - - )} - - - + {isSystem && ( + + {partOfDomainRelation && ( + + )} + + )} + {!isSystem && !isDomain && ( + + {partOfSystemRelation && ( + + )} + + )} + {!isSystem && !isDomain && ( + + )} + {!isSystem && !isDomain && !isResource && ( + + )}