Skip to content

Commit

Permalink
dynamic percentage of fields that have state ok for reviewer page #1247
Browse files Browse the repository at this point in the history
  • Loading branch information
user committed Oct 16, 2023
1 parent b508c4a commit 607c8c0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions dataedit/static/peer_review/opr_reviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ function getTotalFieldCount() {


function calculateOkPercentage(stateDict) {
let totalCount = Object.keys(stateDict).length;
let totalCount = getTotalFieldCount();
let okCount = 0;

for (let key in stateDict) {
Expand All @@ -894,13 +894,15 @@ function calculateOkPercentage(stateDict) {
}
}

return (okCount / totalCount) * 100;
let percentage = (okCount / totalCount) * 100;
return percentage.toFixed(2);
}

function updatePercentageDisplay() {
document.getElementById("percentageDisplay").textContent = calculateOkPercentage(state_dict).toFixed(2);
document.getElementById("percentageDisplay").textContent = calculateOkPercentage(state_dict);
}


function updateTabProgressIndicatorClasses() {
const tabNames = ['general', 'spatiotemporal', 'source', 'license', 'contributor', 'resource'];

Expand Down

0 comments on commit 607c8c0

Please sign in to comment.