From a6e7c934f52acc33086b5dd4d3696c15aada9080 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 390ad6189..45eac8149 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