Fix a bug
Some checks failed
Running Code Coverage / build (20.x) (push) Failing after 21s

This commit is contained in:
Alexander Burmatov 2024-11-14 01:25:47 +03:00
parent 55db8f7dd5
commit c1df5aaaff
3 changed files with 29 additions and 2 deletions

View File

@ -155,7 +155,8 @@
"low": "Low",
"lowShort": "L",
"unknown": "Unknown",
"unknownShort": "U"
"unknownShort": "U",
"no": "No"
},
"vulnerabilityPackageSection": {
"packagePath": "Package Path",

View File

@ -155,7 +155,8 @@
"low": "Небольших",
"lowShort": "Н",
"unknown": "Неизвестных",
"unknownShort": "Не"
"unknownShort": "Не",
"no": "Нет"
},
"vulnerabilityPackageSection": {
"packagePath": "Путь пакета",

View File

@ -1,5 +1,6 @@
import { isEmpty } from 'lodash';
import React from 'react';
import { useTranslation } from 'react-i18next';
import {
NoneVulnerabilityIcon,
LowVulnerabilityIcon,
@ -35,9 +36,33 @@ const getAllAuthorsOfSignatures = (signatureInfo) => {
const VulnerabilityIconCheck = ({ vulnerabilitySeverity }) => {
let result;
const { t } = useTranslation();
let vulnerabilityStringTitle = '';
if (vulnerabilitySeverity) {
vulnerabilityStringTitle = vulnerabilitySeverity.charAt(0) + vulnerabilitySeverity.substring(1).toLowerCase();
switch (vulnerabilityStringTitle) {
case 'None':
vulnerabilityStringTitle = 'vulnerabilityCountCard.no';
break;
case 'Low':
vulnerabilityStringTitle = 'vulnerabilityCountCard.low';
break;
case 'Medium':
vulnerabilityStringTitle = 'vulnerabilityCountCard.medium';
break;
case 'High':
vulnerabilityStringTitle = 'vulnerabilityCountCard.high';
break;
case 'Critical':
vulnerabilityStringTitle = 'vulnerabilityCountCard.critical';
break;
case 'Unknown':
vulnerabilityStringTitle = 'vulnerabilityCountCard.unknown';
break;
}
vulnerabilityStringTitle = t(vulnerabilityStringTitle);
}
switch (vulnerabilitySeverity) {
case 'NONE':