Skip to content

Commit 8cf7130

Browse files
committed
Updated displayed count to reflect the filter criteria
1 parent 5f6d6db commit 8cf7130

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

audit_web_client/src/views/reports/DashboardView/RevisionViewer.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,24 @@ const RevisionViewer = ({ className, revisions, setRevisions, counts, revisionFi
274274

275275
const getInvestigatingText = () => {
276276
if (counts?.all?.all) {
277-
return "Inspecting " + formatIndex(currRevisionIdx + 1) + " of " + formatNumber(counts?.all?.all) + " " + getSummary()
277+
console.log(counts)
278+
let prediction_key = focusSelected.prediction_filter
279+
if (!prediction_key in counts) {
280+
console.warn("Unknown prediction key.")
281+
}
282+
283+
let revert_key = focusSelected.revert_filter
284+
if (revert_key === "reverted") {
285+
revert_key = "reverted_damaging"
286+
} else if (revert_key === "any") {
287+
revert_key = "all"
288+
} else if (!revert_key in counts[prediction_key]) {
289+
console.warn("Unknown revert key.")
290+
}
291+
292+
const selected_count = counts[prediction_key][revert_key]
293+
//const selected_count = counts?.all?.all // original, which produces the total number that meet the filter condition
294+
return "Inspecting " + formatIndex(currRevisionIdx + 1) + " of " + formatNumber(selected_count) + " " + getSummary()
278295
}
279296
return "Loading..."
280297
}

0 commit comments

Comments
 (0)