diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/vulnerability_report/VulnerabilityReport.jsx b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/vulnerability_report/VulnerabilityReport.jsx index adeb991409..42ac420fc7 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/vulnerability_report/VulnerabilityReport.jsx +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/vulnerability_report/VulnerabilityReport.jsx @@ -32,6 +32,8 @@ const VulnerabilityReport = () => { const [totalApisTested, setTotalApisTested] = useState(0) const [subCategoryMap, setSubCategoryMap] = useState({}) + const issuesLimit = 500 + const pdfRef = useRef() const params = useParams() const testingRunSummaryId = params.summaryId @@ -107,8 +109,8 @@ const VulnerabilityReport = () => { testingRunCountsFromDB = resp.testingRunResults.length }) resultsCount += 50 - if(resultsCount >= 500) { - func.setToast(true, false, "Displaying the vulnerability report with only first 500 issues.") + if(vulnerableTestingRunResults.length >= issuesLimit) { + func.setToast(true, false, "Displaying the vulnerability report with only first " + issuesLimit + " issues.") break } @@ -127,6 +129,10 @@ const VulnerabilityReport = () => { //sampleDataVsCurlMap = { ...sampleDataVsCurlMap, ...resp.sampleDataVsCurlMap } }) resultsCount += 50 + if(vulnerableTestingRunResults.length >= issuesLimit) { + func.setToast(true, false, "Displaying the vulnerability report with only first " + issuesLimit + " issues.") + break + } if (testingRunCountsFromDB < 50 || resultsCount >= 1000) { //EOF: break as no further documents exists break @@ -134,6 +140,12 @@ const VulnerabilityReport = () => { } } + if(vulnerableTestingRunResults.length > issuesLimit) { + while(vulnerableTestingRunResults.length !== issuesLimit) { + vulnerableTestingRunResults.pop() + } + } + const localCategoryMap = LocalStore.getState().categoryMap const localSubCategoryMap = LocalStore.getState().subCategoryMap let shouldFetchSubcategoriesAndCategories = false