From 342f70924adf5c020991c5e157c6246211dc08eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaspar=20L=C3=B6chte?= Date: Tue, 23 Feb 2021 14:32:49 +0100 Subject: [PATCH] Added suggestions --- CHANGELOG.md | 2 +- gsa/src/gmp/models/__tests__/cpe.js | 8 ++++---- gsa/src/gmp/models/cpe.js | 2 +- gsa/src/web/pages/cpes/details.js | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 333d9d280f..5ba8f2bf8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,8 +18,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - The CVSS v2 BaseScore calculator calculates the score on the client side now. [#2536](https://github.com/greenbone/gsa/pull/2536) ### Fixed +- Added the deprecatedBy field to CPEs [#2751](https://github.com/greenbone/gsa/pull/2751) - Fixed the severity for different advisories [#2611](https://github.com/greenbone/gsa/pull/2611) -- Added the deprecated_by field to CPEs [#2751](https://github.com/greenbone/gsa/pull/2751) ### Removed - Removed Edge <= 18 support [#2691](https://github.com/greenbone/gsa/pull/2691) diff --git a/gsa/src/gmp/models/__tests__/cpe.js b/gsa/src/gmp/models/__tests__/cpe.js index 8d70d900ee..415c9500a5 100644 --- a/gsa/src/gmp/models/__tests__/cpe.js +++ b/gsa/src/gmp/models/__tests__/cpe.js @@ -101,17 +101,17 @@ describe('CPE model tests', () => { expect(isDate(cpe.updateTime)).toBe(true); }); - test('should parse deprecated_by', () => { + test('should parse deprecatedBy', () => { const cpe = Cpe.fromElement({ raw_data: {'cpe-item': {_deprecated_by: 'foo:/bar'}}, }); - expect(cpe.deprecated_by).toEqual('foo:/bar'); + expect(cpe.deprecatedBy).toEqual('foo:/bar'); }); - test('should not parse deprecated_by', () => { + test('should not parse deprecatedBy', () => { const cpe = Cpe.fromElement({raw_data: {'cpe-item': {}}}); - expect(cpe.deprecated_by).toBeUndefined(); + expect(cpe.deprecatedBy).toBeUndefined(); }); }); diff --git a/gsa/src/gmp/models/cpe.js b/gsa/src/gmp/models/cpe.js index dceff3228a..52d6142f4e 100644 --- a/gsa/src/gmp/models/cpe.js +++ b/gsa/src/gmp/models/cpe.js @@ -54,7 +54,7 @@ class Cpe extends Info { if (isDefined(ret.raw_data) && isDefined(ret.raw_data['cpe-item'])) { const cpeItem = ret.raw_data['cpe-item']; if (isDefined(cpeItem._deprecated_by)) { - ret.deprecated_by = cpeItem._deprecated_by; + ret.deprecatedBy = cpeItem._deprecated_by; } } return ret; diff --git a/gsa/src/web/pages/cpes/details.js b/gsa/src/web/pages/cpes/details.js index 2b33898837..fee85bf87e 100644 --- a/gsa/src/web/pages/cpes/details.js +++ b/gsa/src/web/pages/cpes/details.js @@ -69,12 +69,12 @@ const CpeDetails = ({entity, links = true}) => { {nvd_id} )} - {isDefined(deprecated_by) && ( + {isDefined(deprecatedBy) && ( {_('Deprecated By')} - - {deprecated_by} + + {deprecatedBy}