Skip to content

Commit

Permalink
feat: align counter component with Snyk UI (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanbuck-snyk committed Apr 17, 2024
1 parent d95bd01 commit 0b0841f
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 237 deletions.
17 changes: 3 additions & 14 deletions src/components/SnykEntityComponent/SnykOverviewComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useAsync } from "react-use";
import { Alert } from '@mui/material';

import { Grid } from "@mui/material";
import { SnykCircularCounter } from "./components/SnykCircularCountersComponent";
import { SnykCounter } from "./components/SnykCountersComponent";
import { IssuesCount as IssuesCountType } from "../../types/types";
import { useEntity } from "@backstage/plugin-catalog-react";
import { UnifiedIssues } from "../../types/unifiedIssuesTypes";
Expand Down Expand Up @@ -129,18 +129,8 @@ export const SnykOverviewComponent = ({ entity }: { entity: Entity }) => {
if (loading) {
return (
<InfoCard
title="Loading..."
deepLink={{ title: "Retrieving Vulnerabilities from Snyk", link: "" }}
title="Snyk Issues"
>
<SnykCircularCounter
issuesCount={{
critical: 0,
high: 0,
medium: 0,
low: 0,
}}
loading={loading}
/>
<Progress />
</InfoCard>
);
Expand All @@ -162,8 +152,7 @@ export const SnykOverviewComponent = ({ entity }: { entity: Entity }) => {

return (
<InfoCard title="Snyk Issues" deepLink={linkInfo}>
<SnykCircularCounter issuesCount={issuesCount} loading={loading} />
</InfoCard>
<SnykCounter issuesCount={issuesCount} /> </InfoCard>
);
};

Expand Down
20 changes: 7 additions & 13 deletions src/components/SnykEntityComponent/SnykTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useAsync } from "react-use";
import { Alert } from "@material-ui/lab";
import { IssuesTable } from "./components/SnykIssuesComponent";
import { DepGraphInfo } from "./components/SnykDepGraphComponent";
import { SnykCircularCounter } from "./components/SnykCircularCountersComponent";
import { SnykCounter } from "./components/SnykCountersComponent";
import {
ProjectGetResponseType,
DepgraphGetResponseType,
Expand Down Expand Up @@ -125,25 +125,22 @@ export const generateSnykTabForProject = (
>
<Grid item xs={4}>
<InfoCard title="Vulnerabilities">
<SnykCircularCounter
<SnykCounter
issuesCount={issuesCount}
loading={loading}
/>
</InfoCard>
</Grid>
<Grid item xs={4}>
<InfoCard title="License Issues">
<SnykCircularCounter
<SnykCounter
issuesCount={licenseIssuesCount}
loading={loading}
/>
</InfoCard>
</Grid>
<Grid item xs={4}>
<InfoCard title="Ignored Issues">
<SnykCircularCounter
<SnykCounter
issuesCount={ignoredIssuesCount}
loading={loading}
/>
</InfoCard>
</Grid>
Expand Down Expand Up @@ -213,25 +210,22 @@ export const generateSnykTabForProject = (
>
<Grid item xs={4}>
<InfoCard title="Vulnerabilities">
<SnykCircularCounter
<SnykCounter
issuesCount={issuesCount}
loading={loading}
/>
</InfoCard>
</Grid>
<Grid item xs={4}>
<InfoCard title="License Issues">
<SnykCircularCounter
<SnykCounter
issuesCount={licenseIssuesCount}
loading={loading}
/>
</InfoCard>
</Grid>
<Grid item xs={4}>
<InfoCard title="Ignored Issues">
<SnykCircularCounter
<SnykCounter
issuesCount={ignoredIssuesCount}
loading={loading}
/>
</InfoCard>
</Grid>
Expand Down

This file was deleted.

Loading

0 comments on commit 0b0841f

Please sign in to comment.