Skip to content

Commit

Permalink
Adding SecurityChampionCard
Browse files Browse the repository at this point in the history
  • Loading branch information
hakonfro committed Nov 26, 2024
1 parent 32e8662 commit 5af253e
Showing 1 changed file with 50 additions and 39 deletions.
89 changes: 50 additions & 39 deletions packages/app/src/components/catalog/EntityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,22 @@ import { ReportIssue } from '@backstage/plugin-techdocs-module-addons-contrib';
import { EntityLinguistCard } from '@backstage-community/plugin-linguist';
import { EntityLighthouseContent } from '@backstage-community/plugin-lighthouse';
import {
EntityKubernetesContent,
isKubernetesAvailable,
EntityKubernetesContent,
isKubernetesAvailable,
} from '@backstage/plugin-kubernetes';
import { EntityGrafanaAlertsCard, EntityGrafanaDashboardsCard, EntityOverviewDashboardViewer, isAlertSelectorAvailable, isDashboardSelectorAvailable, isOverviewDashboardAvailable } from '@k-phoen/backstage-plugin-grafana';
import {
EntityGrafanaAlertsCard,
EntityGrafanaDashboardsCard,
EntityOverviewDashboardViewer,
isAlertSelectorAvailable,
isDashboardSelectorAvailable,
isOverviewDashboardAvailable,
} from '@k-phoen/backstage-plugin-grafana';
import { RiScPage } from '@kartverket/backstage-plugin-risk-scorecard';
import { SecurityMetricsPage } from '@kartverket/backstage-plugin-security-metrics-frontend';
import {
SecurityMetricsPage,
SecurityChampionCard,
} from '@kartverket/backstage-plugin-security-metrics-frontend';

const techdocsContent = (
<EntityTechdocsContent>
Expand All @@ -85,7 +95,9 @@ const grafanaContent = (
</EntitySwitch.Case>
</EntitySwitch>
<EntitySwitch>
<EntitySwitch.Case if={entity => Boolean(isDashboardSelectorAvailable(entity))}>
<EntitySwitch.Case
if={entity => Boolean(isDashboardSelectorAvailable(entity))}
>
<Grid item md={6}>
<EntityGrafanaDashboardsCard />
</Grid>
Expand Down Expand Up @@ -165,7 +177,10 @@ const overviewContent = (
<Grid item md={6} xs={12}>
<EntityCatalogGraphCard variant="gridItem" height={400} />
</Grid>
<Grid item md={12}>
<Grid item xs={4}>
<SecurityChampionCard />
</Grid>
<Grid item md={8}>
<EntityLinguistCard />
</Grid>
<Grid item md={4} xs={12}>
Expand Down Expand Up @@ -215,13 +230,12 @@ const serviceEntityPage = (
</EntityLayout.Route>

<EntityLayout.Route path="/risc" title="ROS">
<RiScPage />
<RiScPage />
</EntityLayout.Route>

<EntityLayout.Route path="/securityMetrics" title="Sikkerhetsmetrikker">
<SecurityMetricsPage />
<SecurityMetricsPage />
</EntityLayout.Route>

</EntityLayout>
);

Expand Down Expand Up @@ -255,13 +269,12 @@ const websiteEntityPage = (
</EntityLayout.Route>

<EntityLayout.Route path="/risc" title="Risk Scorecard">
<RiScPage />
<RiScPage />
</EntityLayout.Route>

<EntityLayout.Route path="/securityMetrics" title="Sikkerhetsmetrikker">
<SecurityMetricsPage />
<SecurityMetricsPage />
</EntityLayout.Route>

</EntityLayout>
);

Expand All @@ -270,15 +283,14 @@ const opsEntityPage = (
<EntityLayout.Route path="/" title="Overview">
{overviewContent}
</EntityLayout.Route>

<EntityLayout.Route path="/risc" title="Risk Scorecard">
<RiScPage />
<RiScPage />
</EntityLayout.Route>

<EntityLayout.Route path="/securityMetrics" title="Sikkerhetsmetrikker">
<SecurityMetricsPage />
<SecurityMetricsPage />
</EntityLayout.Route>

</EntityLayout>
);

Expand All @@ -299,13 +311,13 @@ const defaultEntityPage = (
{techdocsContent}
</EntityLayout.Route>

<EntityLayout.Route
path="/kubernetes"
title="Kubernetes"
if={isKubernetesAvailable}
>
<EntityKubernetesContent />
</EntityLayout.Route>
<EntityLayout.Route
path="/kubernetes"
title="Kubernetes"
if={isKubernetesAvailable}
>
<EntityKubernetesContent />
</EntityLayout.Route>
</EntityLayout>
);

Expand All @@ -327,7 +339,6 @@ const componentPage = (
</EntitySwitch>
);


const apiPage = (
<EntityLayout>
<EntityLayout.Route path="/" title="Overview">
Expand Down Expand Up @@ -389,15 +400,15 @@ const groupPage = (
</Grid>
<Grid item xs={12} md={6}>
<EntityOwnershipCard
variant="gridItem"
entityFilterKind={[
'Domain',
'System',
'Component',
'API',
'Template',
'Resource',
]}
variant="gridItem"
entityFilterKind={[
'Domain',
'System',
'Component',
'API',
'Template',
'Resource',
]}
/>
</Grid>
<Grid item xs={12}>
Expand All @@ -419,17 +430,17 @@ const systemPage = (
<Grid item md={6} xs={12}>
<EntityCatalogGraphCard variant="gridItem" height={400} />
</Grid>
<Grid item md={4} xs={12}>
<EntityLinksCard />
<Grid item md={4}>
<SecurityChampionCard />
</Grid>
<Grid item md={8}>
<EntityHasComponentsCard variant="gridItem" />
</Grid>
<Grid item md={6}>
<EntityHasApisCard variant="gridItem" />
</Grid>
<Grid item md={6}>
<EntityHasResourcesCard variant="gridItem" />
<Grid item md={6} xs={12}>
<EntityLinksCard />
</Grid>
</Grid>
</EntityLayout.Route>
Expand All @@ -454,11 +465,11 @@ const systemPage = (
</EntityLayout.Route>

<EntityLayout.Route path="/risc" title="ROS">
<RiScPage />
<RiScPage />
</EntityLayout.Route>

<EntityLayout.Route path="/securityMetrics" title="Sikkerhetsmetrikker">
<SecurityMetricsPage />
<SecurityMetricsPage />
</EntityLayout.Route>
</EntityLayout>
);
Expand Down

0 comments on commit 5af253e

Please sign in to comment.