From 54e8e6fd03db136fd854dc211c1e8f32a52f7e5f Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Mon, 9 Mar 2020 16:18:16 +0100 Subject: [PATCH 1/3] Fix check for emptyCollectionList in report parser for hosts --- gsa/src/gmp/models/report/parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gsa/src/gmp/models/report/parser.js b/gsa/src/gmp/models/report/parser.js index e3af712f8f..71895a433c 100644 --- a/gsa/src/gmp/models/report/parser.js +++ b/gsa/src/gmp/models/report/parser.js @@ -402,7 +402,7 @@ export const parseOperatingSystems = (report, filter) => { export const parseHosts = (report, filter) => { const {host: hosts, results, hosts: hosts_count} = report; - if (!isDefined(hosts_count)) { + if (!isDefined(hosts)) { return emptyCollectionList(filter); } From 26f98a078bb4c2ecd4ba97329ec2595ed461cc75 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Mon, 9 Mar 2020 16:19:05 +0100 Subject: [PATCH 2/3] Update Changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50310686b2..8fb43ad938 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Lower memory usage when getting a report [#1857](https://github.com/greenbone/gvmd/pull/1857) ### Fixed -- Fixed report DetailsContent counts in tabs [#2004](https://github.com/greenbone/gsa/pull/2004) +- Fixed report DetailsContent counts in tabs [#2004](https://github.com/greenbone/gsa/pull/2004) [#2023](https://github.com/greenbone/gsa/pull/2023) - Fixed auto_delete_value of 0 for tasks and audits [#1987](https://github.com/greenbone/gsa/pull/1987) - Fixed bulk tagging by user selection (send IDs as array) [#1985](https://github.com/greenbone/gsa/pull/1985) - Fixed pluralizing type 'vulnerability' [#1984](https://github.com/greenbone/gsa/pull/1984) From 4a2989b970a5e244b9c57aff03e0c37f57fd632d Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Mon, 9 Mar 2020 16:38:11 +0100 Subject: [PATCH 3/3] Update tests --- gsa/src/web/pages/reports/__mocks__/mockdeltareport.js | 3 +++ gsa/src/web/pages/reports/__mocks__/mockreport.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gsa/src/web/pages/reports/__mocks__/mockdeltareport.js b/gsa/src/web/pages/reports/__mocks__/mockdeltareport.js index 86ce67ce4c..601b8e974f 100644 --- a/gsa/src/web/pages/reports/__mocks__/mockdeltareport.js +++ b/gsa/src/web/pages/reports/__mocks__/mockdeltareport.js @@ -20,6 +20,8 @@ import {setLocale} from 'gmp/locale/lang'; import Report from 'gmp/models/report'; +import {host1, host2} from './mockreport'; + setLocale('en'); // Task @@ -100,6 +102,7 @@ export const getMockDeltaReport = () => { result_count: {__text: 2, full: 2, filtered: 2}, results: {result: [result1, result2]}, hosts: {count: 2}, + host: [host1, host2], }; const entity = Report.fromElement({ diff --git a/gsa/src/web/pages/reports/__mocks__/mockreport.js b/gsa/src/web/pages/reports/__mocks__/mockreport.js index 22fbc75cea..34ec1e245f 100644 --- a/gsa/src/web/pages/reports/__mocks__/mockreport.js +++ b/gsa/src/web/pages/reports/__mocks__/mockreport.js @@ -109,7 +109,7 @@ const result3 = { }; // Hosts -const host1 = { +export const host1 = { ip: '123.456.78.910', asset: {_asset_id: '123'}, start: '2019-06-03T11:00:22Z', @@ -153,7 +153,7 @@ const host1 = { ], }; -const host2 = { +export const host2 = { ip: '109.876.54.321', start: '2019-06-03T11:15:14Z', end: '2019-06-03T11:31:23Z',