Merge pull request #4700 from backstage/rugvip/opternal

core: implement optional external routes and use to toggle "Create Component" button
This commit is contained in:
Patrik Oldsberg
2021-02-26 10:41:27 +01:00
committed by GitHub
12 changed files with 190 additions and 38 deletions
@@ -167,14 +167,16 @@ const CatalogPageContents = () => {
/>
<Content>
<ContentHeader title={selectedTab ?? ''}>
<Button
component={RouterLink}
variant="contained"
color="primary"
to={createComponentLink()}
>
Create Component
</Button>
{createComponentLink && (
<Button
component={RouterLink}
variant="contained"
color="primary"
to={createComponentLink()}
>
Create Component
</Button>
)}
{showAddExampleEntities && (
<Button
className={styles.buttonSpacing}
+1
View File
@@ -18,4 +18,5 @@ import { createExternalRouteRef } from '@backstage/core';
export const createComponentRouteRef = createExternalRouteRef({
id: 'create-component',
optional: true,
});