Skip to content

Commit

Permalink
fixed a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
TangoBeeAkto committed Dec 29, 2024
1 parent 24e7e32 commit 39fd83b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 || []
Expand All @@ -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]])
})
}
}
Expand Down Expand Up @@ -505,6 +508,7 @@ const promotedBulkActions = (selectedDataHexIds) => {
"selected": 1
}}
callFromOutside={updateTable}
pageTotalCount={pageTotalCount}
/>
)

Expand Down

0 comments on commit 39fd83b

Please sign in to comment.