Skip to content

Commit

Permalink
Function to translate the Origin possiblities ...
Browse files Browse the repository at this point in the history
  • Loading branch information
y0urself committed Nov 24, 2020
1 parent a3f8364 commit 34466a4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gsa/src/web/pages/nvts/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {TAG_NA} from 'gmp/models/nvt';

import PropTypes from 'web/utils/proptypes';

import {na} from 'web/utils/render';
import {na, getCVSSOrigin} from 'web/utils/render';

import DetailsBlock from 'web/entity/block';

Expand Down Expand Up @@ -80,7 +80,7 @@ const NvtDetails = ({entity, links = true}) => {
)}
<TableRow>
<TableData>{_('CVSS Origin')}</TableData>
<TableData>{na(severityOrigin)}</TableData>
<TableData>{na(getCVSSOrigin(severityOrigin))}</TableData>
</TableRow>
</TableBody>
</InfoTable>
Expand Down
20 changes: 20 additions & 0 deletions gsa/src/web/utils/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,26 @@ export const renderYesNo = value => {
}
};

export const getCVSSOrigin = origin => {
switch (origin) {
case 'Third Party':
case 'third party':
case 'ThirdParty':
case 'Third party':
return _('Thrid Party');
case 'Vendor':
case 'vendor':
return _('Vendor');
case 'Greenbone':
case 'greenbone':
return _('Greenbone');
case 'NVD':
return _('NVD');
default:
return origin;
}
};

const getPermissionTypeName = type => {
switch (type) {
case 'aggregates':
Expand Down

0 comments on commit 34466a4

Please sign in to comment.