Compare commits

...

2 Commits

Author SHA1 Message Date
Med Mouine
58f3fa8625 clean up 2024-04-30 10:47:41 -04:00
Med Mouine
29f40da1f1 prs and actions 2024-04-30 10:42:43 -04:00
3 changed files with 1444 additions and 1101 deletions

View File

@ -40,9 +40,11 @@
"@backstage/plugin-techdocs-react": "^1.2.3",
"@backstage/plugin-user-settings": "^0.8.5",
"@backstage/theme": "^0.5.3",
"@bestsellerit/backstage-plugin-harbor": "^0.3.1",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@roadiehq/backstage-plugin-argo-cd": "^2.6.4",
"@roadiehq/backstage-plugin-github-pull-requests": "^2.5.25",
"@veecode-platform/backstage-plugin-github-workflows": "^0.2.70",
"history": "^5.0.0",
"react": "^18.0.2",

View File

@ -67,30 +67,10 @@ import {
isGithubAvailable,
isGithubWorkflowsAvailable,
} from '@veecode-platform/backstage-plugin-github-workflows';
const WorkflowsContent = (
<EntitySwitch>
<EntitySwitch.Case if={isGithubActionsAvailable}>
<GithubWorkflowsList />
</EntitySwitch.Case>
<EntitySwitch.Case>
<EmptyState
title="No CI/CD available for this entity"
missing="info"
description="You need to add an annotation to your component if you want to enable CI/CD for it. You can read more about annotations in Backstage by clicking the button below."
action={
<Button
variant="contained"
color="primary"
href="https://backstage.io/docs/features/software-catalog/well-known-annotations"
>
Read more
</Button>
}
/>
</EntitySwitch.Case>
</EntitySwitch>
);
import {
EntityGithubPullRequestsContent,
EntityGithubPullRequestsOverviewCard,
} from '@roadiehq/backstage-plugin-github-pull-requests';
const techdocsContent = (
<EntityTechdocsContent>
@ -101,8 +81,6 @@ const techdocsContent = (
);
const cicdContent = (
// This is an example of how you can implement your company's logic in entity page.
// You can for example enforce that all components of type 'service' should use GitHubActions
<EntitySwitch>
<EntitySwitch.Case if={isGithubActionsAvailable}>
<EntityGithubActionsContent />
@ -125,7 +103,29 @@ const cicdContent = (
</EntitySwitch.Case>
</EntitySwitch>
);
const workflowsContent = (
<EntitySwitch>
<EntitySwitch.Case if={isGithubActionsAvailable}>
<GithubWorkflowsList />
</EntitySwitch.Case>
<EntitySwitch.Case>
<EmptyState
title="No CI/CD available for this entity"
missing="info"
description="You need to add an annotation to your component if you want to enable CI/CD for it. You can read more about annotations in Backstage by clicking the button below."
action={
<Button
variant="contained"
color="primary"
href="https://backstage.io/docs/features/software-catalog/well-known-annotations"
>
Read more
</Button>
}
/>
</EntitySwitch.Case>
</EntitySwitch>
);
const entityWarningContent = (
<>
<EntitySwitch>
@ -155,35 +155,37 @@ const entityWarningContent = (
);
const overviewContent = (
<Grid container spacing={3} alignItems="stretch">
<Grid container spacing={1} alignItems="stretch">
{entityWarningContent}
<Grid item md={6} xs={12}>
<EntityAboutCard variant="gridItem" />
</Grid>
<EntitySwitch>
<EntitySwitch.Case if={e => Boolean(isArgocdAvailable(e))}>
<Grid item sm={4}>
<EntitySwitch.Case if={isArgocdAvailable}>
<Grid item md={6} xs={12}>
<EntityArgoCDOverviewCard />
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
<EntitySwitch>
<EntitySwitch.Case if={isGithubWorkflowsAvailable}>
<Grid item lg={8} xs={12}>
<Grid item md={6} xs={12}>
<GithubWorkflowsCard />
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
<Grid item md={6}>
<EntityAboutCard variant="gridItem" />
<EntityGithubPullRequestsOverviewCard />
</Grid>
<Grid item md={6} xs={12}>
<EntityHasSubcomponentsCard variant="gridItem" />
</Grid>
<Grid item md={6} xs={12}>
<EntityCatalogGraphCard variant="gridItem" height={400} />
</Grid>
<Grid item md={4} xs={12}>
<Grid item md={6} xs={12}>
<EntityLinksCard />
</Grid>
<Grid item md={8} xs={12}>
<EntityHasSubcomponentsCard variant="gridItem" />
</Grid>
</Grid>
);
@ -192,7 +194,9 @@ const serviceEntityPage = (
<EntityLayout.Route path="/" title="Overview">
{overviewContent}
</EntityLayout.Route>
<EntityLayout.Route path="/pull-requests" title="Pull Requests">
<EntityGithubPullRequestsContent />
</EntityLayout.Route>
<EntityLayout.Route path="/ci-cd" title="CI/CD">
{cicdContent}
</EntityLayout.Route>
@ -201,9 +205,8 @@ const serviceEntityPage = (
path="/workflows"
title="Workflows"
>
{WorkflowsContent}
{workflowsContent}
</EntityLayout.Route>
<EntityLayout.Route path="/api" title="API">
<Grid container spacing={3} alignItems="stretch">
<Grid item md={6}>
@ -238,16 +241,6 @@ const websiteEntityPage = (
{overviewContent}
</EntityLayout.Route>
<EntityLayout.Route path="/ci-cd" title="CI/CD">
{cicdContent}
</EntityLayout.Route>
<EntityLayout.Route
if={isGithubAvailable}
path="/workflows"
title="Workflows"
>
{WorkflowsContent}
</EntityLayout.Route>
<EntityLayout.Route path="/dependencies" title="Dependencies">
<Grid container spacing={3} alignItems="stretch">
<Grid item md={6}>
@ -289,11 +282,9 @@ const componentPage = (
<EntitySwitch.Case if={isComponentType('service')}>
{serviceEntityPage}
</EntitySwitch.Case>
<EntitySwitch.Case if={isComponentType('website')}>
{websiteEntityPage}
</EntitySwitch.Case>
<EntitySwitch.Case>{defaultEntityPage}</EntitySwitch.Case>
</EntitySwitch>
);

File diff suppressed because it is too large Load Diff