From 39fd83b726d2be661989459441d6d3e697dcc477 Mon Sep 17 00:00:00 2001 From: Umesh Kumar <166806589+TangoBeeAkto@users.noreply.github.com> Date: Sun, 29 Dec 2024 23:22:39 +0530 Subject: [PATCH] fixed a bug --- .../apps/dashboard/components/tables/GithubServerTable.js | 6 ++++++ .../pages/testing/SingleTestRunPage/SingleTestRunPage.js | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/components/tables/GithubServerTable.js b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/components/tables/GithubServerTable.js index 6498b96088..335f60064f 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/components/tables/GithubServerTable.js +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/components/tables/GithubServerTable.js @@ -130,6 +130,12 @@ function GithubServerTable(props) { } } + useEffect(() => { + if(Number.isInteger(props?.pageTotalCount)) { + setTotal(props?.pageTotalCount) + } + }, [props?.pageTotalCount, data]) + const handleSelectedTab = (x) => { const tableTabs = props.tableTabs ? props.tableTabs : props.tabs if(tableTabs){ diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/SingleTestRunPage/SingleTestRunPage.js b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/SingleTestRunPage/SingleTestRunPage.js index 200198dacd..9a75c819a3 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/SingleTestRunPage/SingleTestRunPage.js +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/SingleTestRunPage/SingleTestRunPage.js @@ -135,6 +135,7 @@ function SingleTestRunPage() { const [testingRunResultSummariesObj, setTestingRunResultSummariesObj] = useState({}) const [allResultsLength, setAllResultsLength] = useState(undefined) const [currentSummary, setCurrentSummary] = useState('') + const [pageTotalCount, setPageTotalCount] = useState(0) const tableTabMap = { vulnerable: "VULNERABLE", @@ -271,6 +272,7 @@ function SingleTestRunPage() { }) testRunResultsRes = ignoredTestRunResults totalIgnoredIssuesCount = ignoredTestRunResults.length + setPageTotalCount(selectedTab === 'ignored_issues' ? totalIgnoredIssuesCount : testRunCountMap[tableTabMap[selectedTab]]) } else { await api.fetchTestingRunResults(localSelectedTestRun.testingRunResultSummaryHexId, tableTabMap[selectedTab], sortKey, sortOrder, skip, limit, filters, queryValue).then(({ testingRunResults, issueslist, errorEnums }) => { issuesList = issueslist || [] @@ -281,12 +283,13 @@ function SingleTestRunPage() { setMissingConfigs(transform.getMissingConfigs(testRunResultsRes)) } }) - await api.fetchTestRunResultsCount(localSelectedTestRun.testingRunResultSummaryHexId).then(({testCountMap}) => { + api.fetchTestRunResultsCount(localSelectedTestRun.testingRunResultSummaryHexId).then(({testCountMap}) => { testRunCountMap = testCountMap || [] testRunCountMap['VULNERABLE'] = Math.abs(testRunCountMap['VULNERABLE']-issuesList.length) testRunCountMap['IGNORED_ISSUES'] = (issuesList.length || 0) const orderedValues = tableTabsOrder.map(key => testCountMap[tableTabMap[key]] || 0) setTestRunResultsCount(orderedValues) + setPageTotalCount(testRunCountMap[tableTabMap[selectedTab]]) }) } } @@ -505,6 +508,7 @@ const promotedBulkActions = (selectedDataHexIds) => { "selected": 1 }} callFromOutside={updateTable} + pageTotalCount={pageTotalCount} /> )