From 1182a3ad03d151020f3643c659e780f181d11d3a Mon Sep 17 00:00:00 2001 From: Shreya Date: Mon, 20 Jul 2020 10:15:28 +0530 Subject: [PATCH] Manipulate PBA data to show multiple results of PBAs as separate entries in the report --- .../report-components/security/PostBreach.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/security/PostBreach.js b/monkey/monkey_island/cc/ui/src/components/report-components/security/PostBreach.js index cc9ea1c20..f49995b27 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/security/PostBreach.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/security/PostBreach.js @@ -23,6 +23,17 @@ const subColumns = [ ]; let renderDetails = function (data) { + data.forEach(pba => { + if (typeof pba['result'][0] === "object") { // if `result` has more than one entry + let results = pba['result']; + let details = data.splice(data.indexOf(pba), 1); // remove that pba from `data` + results.forEach(result => { // add back those results to `data` as individual pba entries + let tempDetails = JSON.parse(JSON.stringify(details)); + tempDetails[0]['result'] = result; + data.push(tempDetails[0]); + }); + } + }); let defaultPageSize = data.length > pageSize ? pageSize : data.length; let showPagination = data.length > pageSize; return