Skip to content

Commit

Permalink
Added suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
y0urself committed Feb 23, 2021
1 parent 79f1b9c commit 342f709
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions gsa/src/gmp/models/__tests__/cpe.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
2 changes: 1 addition & 1 deletion gsa/src/gmp/models/cpe.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions gsa/src/web/pages/cpes/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ const CpeDetails = ({entity, links = true}) => {
<TableData>{nvd_id}</TableData>
</TableRow>
)}
{isDefined(deprecated_by) && (
{isDefined(deprecatedBy) && (
<TableRow>
<TableData>{_('Deprecated By')}</TableData>
<TableData>
<DetailsLink id={deprecated_by} type="cpe" textOnly={!links}>
{deprecated_by}
<DetailsLink id={deprecatedBy} type="cpe" textOnly={!links}>
{deprecatedBy}
</DetailsLink>
</TableData>
</TableRow>
Expand Down

0 comments on commit 342f709

Please sign in to comment.