|
3 | 3 | import { percentageFormatter } from '$lib/utils/formatters';
|
4 | 4 | import { severityToColor } from '$lib/utils/vulnerabilities';
|
5 | 5 |
|
6 |
| - import { BodyShort, Loader, Tooltip } from '@nais/ds-svelte-community'; |
| 6 | + import { BodyShort, Loader } from '@nais/ds-svelte-community'; |
7 | 7 |
|
8 | 8 | type VulnerabilitySummary =
|
9 | 9 | | {
|
|
29 | 29 | <div class="vulnerability-summary">
|
30 | 30 | {#if summary !== PendingValue}
|
31 | 31 | {#each categories as category (category)}
|
32 |
| - <Tooltip content={category}> |
33 |
| - <BodyShort |
34 |
| - class="vulnerability-count" |
35 |
| - style="background-color: {severityToColor(category)}" |
36 |
| - > |
37 |
| - {summary[category]} |
38 |
| - </BodyShort> |
39 |
| - </Tooltip> |
| 32 | + <BodyShort class="vulnerability-count" style="background-color: {severityToColor(category)}"> |
| 33 | + {summary[category]} |
| 34 | + </BodyShort> |
| 35 | + <div class="category">{category}</div> |
40 | 36 | {/each}
|
41 | 37 | {:else}
|
42 | 38 | <Loader />
|
|
72 | 68 | {/if}
|
73 | 69 |
|
74 | 70 | <style>
|
| 71 | + .category { |
| 72 | + text-transform: capitalize; |
| 73 | + } |
| 74 | +
|
75 | 75 | .vulnerability-summary {
|
76 |
| - display: flex; |
77 |
| - flex-wrap: wrap; |
78 |
| - gap: 1px; |
| 76 | + display: grid; |
| 77 | + grid-template-columns: auto 1fr; |
| 78 | + align-items: center; |
| 79 | + column-gap: var(--a-spacing-2); |
| 80 | + row-gap: 1px; |
79 | 81 |
|
80 |
| - :global(:first-child > .vulnerability-count) { |
| 82 | + :global(.vulnerability-count:first-of-type) { |
81 | 83 | border-top-left-radius: 4px;
|
82 |
| - border-bottom-left-radius: 4px; |
| 84 | + border-top-right-radius: 4px; |
83 | 85 | }
|
84 | 86 |
|
85 |
| - :global(:last-child > .vulnerability-count) { |
86 |
| - border-top-right-radius: 4px; |
| 87 | + :global(.vulnerability-count:last-of-type) { |
87 | 88 | border-bottom-right-radius: 4px;
|
| 89 | + border-bottom-left-radius: 4px; |
88 | 90 | }
|
89 | 91 |
|
90 | 92 | :global(.vulnerability-count) {
|
91 | 93 | padding: 4px 10px;
|
| 94 | + text-align: center; |
92 | 95 | }
|
93 | 96 | }
|
94 | 97 |
|
|
0 commit comments