Skip to content

Commit 78edf00

Browse files
fix: align Severity & Score nullable fields
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
1 parent e014d27 commit 78edf00

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

client/src/app/pages/advisory-details/vulnerabilities-by-advisory.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
Tr,
1515
} from "@patternfly/react-table";
1616

17+
import { extendedSeverityFromSeverity } from "@app/api/models";
1718
import type { AdvisoryVulnerabilitySummary } from "@app/client";
1819
import { SeverityShieldAndText } from "@app/components/SeverityShieldAndText";
1920
import { SimplePagination } from "@app/components/SimplePagination";
@@ -160,8 +161,8 @@ export const VulnerabilitiesByAdvisory: React.FC<
160161
>
161162
{item.severity && (
162163
<SeverityShieldAndText
163-
value={item.severity}
164-
score={item.score}
164+
value={extendedSeverityFromSeverity(item.severity)}
165+
score={item.score ?? null}
165166
showLabel
166167
showScore
167168
/>

client/src/app/pages/advisory-list/advisory-table.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ export const AdvisoryTable: React.FC = () => {
126126
>
127127
{item.average_severity && (
128128
<SeverityShieldAndText
129-
value={item.average_severity as Severity}
129+
value={extendedSeverityFromSeverity(
130+
item.average_severity as Severity,
131+
)}
130132
score={item.average_score}
131133
showLabel
132134
showScore

client/src/stories/v2.1/pages/search.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ export const SearchPage: React.FC = () => {
321321
<Split>
322322
<SplitItem isFilled>{item.name}</SplitItem>
323323
<SplitItem>
324-
<SeverityShieldAndText value="medium" hideLabel />
324+
<SeverityShieldAndText value="medium" score={5} />
325325
</SplitItem>
326326
</Split>
327327
</CardTitle>

client/src/stories/v2.1/product-list.stories.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ const ProductList: React.FC<{ products: IProduct[] }> = ({ products }) => {
281281
{vuln.average_severity && (
282282
<SeverityShieldAndText
283283
value={vuln.average_severity}
284+
score={5}
284285
/>
285286
)}
286287
</Td>
@@ -311,6 +312,7 @@ const ProductList: React.FC<{ products: IProduct[] }> = ({ products }) => {
311312
{adv.average_severity && (
312313
<SeverityShieldAndText
313314
value={adv.average_severity}
315+
score={5}
314316
/>
315317
)}
316318
</Td>

0 commit comments

Comments
 (0)