Skip to content

Commit

Permalink
Merge pull request #2842 from greenbone/mergify/bp/master/pr-2791
Browse files Browse the repository at this point in the history
Don't show empty sections in result details (bp #2791)
  • Loading branch information
swaterkamp authored Apr 7, 2021
2 parents f23bcc9 + 2592f30 commit 40db5ae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Changed

- Don't show empty sections in result details [#2791](https://github.com/greenbone/gsa/pull/2791)
- Move error message and adjust design on login page [#2780](https://github.com/greenbone/gsa/pull/2780)
- Refactored useFormValidation hook [#2704](https://github.com/greenbone/gsa/pull/2704)
- Updated copyright and footer layout [#2687](https://github.com/greenbone/gsa/pull/2687)
Expand Down
2 changes: 2 additions & 0 deletions gsa/src/gmp/models/__tests__/nvt.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ describe('nvt Model tests', () => {
const nvt1 = Nvt.fromElement({tags: 'bv=/A:P|st=vf'});
const nvt2 = Nvt.fromElement({});
const nvt3 = Nvt.fromElement({nvt: {tags: 'bv=/A:P|st=vf'}});
const nvt4 = Nvt.fromElement({nvt: {tags: 'bv='}});
const res = {
bv: '/A:P',
st: 'vf',
Expand All @@ -74,6 +75,7 @@ describe('nvt Model tests', () => {
expect(nvt1.tags).toEqual(res);
expect(nvt2.tags).toEqual({});
expect(nvt3.tags).toEqual(res);
expect(nvt4.tags.bv).toBeUndefined();
});

test('should parse refs', () => {
Expand Down
3 changes: 2 additions & 1 deletion gsa/src/gmp/models/nvt.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ const parseTags = tags => {
const splitted = tags.split('|');
for (const t of splitted) {
const [key, value] = split(t, '=', 1);
newTags[key] = value;
const newValue = isEmpty(value) ? undefined : value;
newTags[key] = newValue;
}
}

Expand Down

0 comments on commit 40db5ae

Please sign in to comment.