Add relationship cards to create-app template

Signed-off-by: Tim Hansen <timbonicus@gmail.com>
This commit is contained in:
Tim Hansen
2021-05-24 13:29:27 -06:00
parent 8352c2e7b0
commit f86ab6d492
4 changed files with 54 additions and 3 deletions
+12
View File
@@ -0,0 +1,12 @@
---
'@backstage/create-app': patch
---
Added newer entity relationship cards to the default `@backstage/create-app` template:
- `EntityDependsOnComponentsCard`
- `EntityDependsOnResourcesCard`
- `EntityHasResourcesCard`
- `EntityHasSubcomponentsCard`
The `EntityLinksCard` was also added to the overview page. To apply these to your Backstage application, compare against the updated [EntityPage.tsx](https://github.com/backstage/backstage/blob/371760ca2493c8f63e9b44ecc57cc8488131ba5b/packages/create-app/templates/default-app/packages/app/src/components/catalog/EntityPage.tsx)
@@ -33,3 +33,4 @@ spec:
lifecycle: experimental
owner: team-a
system: artist-engagement-portal
dependsOn: ['resource:artists-db']
@@ -72,7 +72,7 @@ scaffolder:
catalog:
rules:
- allow: [Component, System, API, Group, User, Template, Location]
- allow: [Component, System, API, Group, User, Resource, Location]
locations:
# Backstage example components
- type: url
@@ -86,11 +86,13 @@ catalog:
- type: url
target: https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all-apis.yaml
# Backstage example resources
- type: url
target: https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all-resources.yaml
# Backstage example organization groups
- type: url
target: https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/acme/org.yaml
rules:
- allow: [Group, User]
# Backstage example templates
- type: url
@@ -26,10 +26,15 @@ import {
} from '@backstage/plugin-api-docs';
import {
EntityAboutCard,
EntityDependsOnComponentsCard,
EntityDependsOnResourcesCard,
EntitySystemDiagramCard,
EntityHasComponentsCard,
EntityHasResourcesCard,
EntityHasSubcomponentsCard,
EntityHasSystemsCard,
EntityLayout,
EntityLinksCard,
EntitySwitch,
isComponentType,
isKind,
@@ -78,6 +83,12 @@ const overviewContent = (
<Grid item md={6}>
<EntityAboutCard variant="gridItem" />
</Grid>
<Grid item md={4} xs={12}>
<EntityLinksCard />
</Grid>
<Grid item md={8} xs={12}>
<EntityHasSubcomponentsCard variant="gridItem" />
</Grid>
</Grid>
);
@@ -102,6 +113,17 @@ const serviceEntityPage = (
</Grid>
</EntityLayout.Route>
<EntityLayout.Route path="/dependencies" title="Dependencies">
<Grid container spacing={3} alignItems="stretch">
<Grid item md={6}>
<EntityDependsOnComponentsCard variant="gridItem" />
</Grid>
<Grid item md={6}>
<EntityDependsOnResourcesCard variant="gridItem" />
</Grid>
</Grid>
</EntityLayout.Route>
<EntityLayout.Route path="/docs" title="Docs">
<EntityTechdocsContent />
</EntityLayout.Route>
@@ -118,6 +140,17 @@ const websiteEntityPage = (
{cicdContent}
</EntityLayout.Route>
<EntityLayout.Route path="/dependencies" title="Dependencies">
<Grid container spacing={3} alignItems="stretch">
<Grid item md={6}>
<EntityDependsOnComponentsCard variant="gridItem" />
</Grid>
<Grid item md={6}>
<EntityDependsOnResourcesCard variant="gridItem" />
</Grid>
</Grid>
</EntityLayout.Route>
<EntityLayout.Route path="/docs" title="Docs">
<EntityTechdocsContent />
</EntityLayout.Route>
@@ -224,6 +257,9 @@ const systemPage = (
<Grid item md={6}>
<EntityHasApisCard variant="gridItem" />
</Grid>
<Grid item md={6}>
<EntityHasResourcesCard variant="gridItem" />
</Grid>
</Grid>
</EntityLayout.Route>
<EntityLayout.Route path="/diagram" title="Diagram">