Skip to content

Commit 5f5f55b

Browse files
committed
feat: enhance WorkloadsWithSBOM and vulnerabilities page with improved UI components and details link
1 parent 2af0464 commit 5f5f55b

File tree

2 files changed

+35
-11
lines changed

2 files changed

+35
-11
lines changed

src/lib/components/WorkloadsWithSBOM.svelte

+24-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
Tooltip,
2222
Tr
2323
} from '@nais/ds-svelte-community';
24-
import { CheckmarkIcon } from '@nais/ds-svelte-community/icons';
24+
import { CheckmarkIcon, LinkIcon } from '@nais/ds-svelte-community/icons';
2525
import type { WorkloadsWithSbomVariables } from './$houdini';
2626
import WorkloadLink from './WorkloadLink.svelte';
2727
@@ -71,6 +71,7 @@
7171
$before: Cursor
7272
) @load {
7373
team(slug: $team) @loading {
74+
slug
7475
workloads(first: 10, orderBy: $orderBy, filter: $filter, after: $after, before: $before)
7576
@paginate(mode: SinglePage)
7677
@loading(count: 10) {
@@ -139,6 +140,21 @@
139140
field: tableSort.orderBy || WorkloadOrderField.VULNERABILITY_SEVERITY_CRITICAL
140141
});
141142
};
143+
144+
const imageUrl = (workload: {
145+
readonly __typename: string | null;
146+
readonly id: string;
147+
readonly name: string;
148+
readonly environment: {
149+
readonly id: string;
150+
readonly name: string;
151+
};
152+
readonly team: {
153+
readonly slug: string;
154+
};
155+
}) => {
156+
return `/team/${workload.team.slug}/${workload.environment.name}/${workload.__typename === 'Application' ? 'app' : 'job'}/${workload.name}/image`;
157+
};
142158
</script>
143159

144160
{#if $query.data?.team}
@@ -154,6 +170,7 @@
154170
<Thead>
155171
<Tr>
156172
<Th sortable={true} sortKey={WorkloadOrderField.NAME}>Workload</Th>
173+
<Th>Details</Th>
157174
<Th sortable={true} sortKey={WorkloadOrderField.ENVIRONMENT} style="width: 142px;"
158175
>Environment</Th
159176
>
@@ -203,6 +220,7 @@
203220
<Td>
204221
<WorkloadLink {workload} />
205222
</Td>
223+
<Td><div class="image-url"><a href={imageUrl(workload)}><LinkIcon /></a></div></Td>
206224
<Td>
207225
{workload.environment.name}
208226
</Td>
@@ -389,4 +407,9 @@
389407
align-items: center;
390408
justify-content: center;
391409
}
410+
.image-url {
411+
display: flex;
412+
align-items: center;
413+
justify-content: center;
414+
}
392415
</style>

src/routes/team/[team]/vulnerabilities/+page.svelte

+11-10
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import Vulnerability from '$lib/components/Vulnerability.svelte';
1111
import WorkloadsWithSbom from '$lib/components/WorkloadsWithSBOM.svelte';
1212
import GraphErrors from '$lib/GraphErrors.svelte';
13-
import { Alert, HelpText, Select, Skeleton } from '@nais/ds-svelte-community';
13+
import { Alert, Heading, HelpText, Select, Skeleton } from '@nais/ds-svelte-community';
1414
import {
1515
TrendDownIcon,
1616
TrendFlatIcon,
@@ -52,13 +52,14 @@
5252
{/if}
5353

5454
<div class="summary">
55-
<h4>
56-
<span>Vulnerability issues</span>
55+
<div class="heading">
56+
<Heading level="2" size="xsmall">Vulnerability summary</Heading>
5757
<HelpText title="Current team vulnerability status"
5858
>If any of the workloads have any vulnerability issues, the icon will show a warning
5959
sign and a details link will show.
6060
</HelpText>
61-
</h4>
61+
</div>
62+
6263
<div style="margin-top: 0.5rem;">
6364
{#if team === PendingValue}
6465
<Skeleton variant="text" style="min-height: 1rem; width: 10%;" />
@@ -87,7 +88,7 @@
8788
</div>
8889
</div>
8990
</Card>
90-
<Card columns={3} style="display: flex; align-items:center;">
91+
<Card columns={3}>
9192
<SummaryCard title="SBOM coverage" color="grey" styled={false}>
9293
{#snippet icon()}
9394
{#if team === PendingValue}
@@ -112,7 +113,7 @@
112113
{/if}
113114
</SummaryCard>
114115
</Card>
115-
<Card columns={3} style="display: flex; align-items:center;">
116+
<Card columns={3}>
116117
<SummaryCard title="Critical vulnerabilities" color={'grey'} styled={false}>
117118
{#snippet icon()}
118119
{#if team === PendingValue}
@@ -155,7 +156,8 @@
155156
</SummaryCard>
156157
</Card>
157158
<Card columns={12}>
158-
<h4>Workloads with SBOM</h4>
159+
<Heading level="3" size="small">Workloads with SBOM</Heading>
160+
159161
<div class="env-filter">
160162
<Select size="small" hideLabel={true} bind:value={selectedEnvironment} label="Environment">
161163
<option value="">All environments</option>
@@ -200,13 +202,12 @@
200202
width: 100%;
201203
min-height: 80px;
202204
}
203-
.summary > h4 {
205+
206+
.heading {
204207
display: flex;
205208
justify-content: space-between;
206209
margin: 0;
207-
font-size: 1rem;
208210
color: var(--color-text-secondary);
209-
font-weight: bold;
210211
}
211212
212213
.vulnerabilitySummary {

0 commit comments

Comments
 (0)