Skip to content

Commit

Permalink
integrated tab status updates taking into account empty fields into t…
Browse files Browse the repository at this point in the history
…he updateTabProgressIndicatorClasses() function #1650
  • Loading branch information
user committed Jun 17, 2024
1 parent 980448b commit ca773c2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dataedit/static/peer_review/opr_reviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -937,8 +937,12 @@ function updateTabProgressIndicatorClasses() {
if (!tab) continue;

let fieldsInTab = Array.from(document.querySelectorAll('#' + tabName + ' .field'));
let values = getAllFieldsAndValues();

let allOk = fieldsInTab.every((field) => field.classList.contains('field-ok'));
let allOk = fieldsInTab.every((field, index) => {
let currentValue = values[index].fieldValue;
return isEmptyValue(currentValue) || field.classList.contains('field-ok');
});

if (allOk) {
tab.classList.add('status--done');
Expand All @@ -948,6 +952,7 @@ function updateTabProgressIndicatorClasses() {
}
}


summaryTab.addEventListener('click', function() {
toggleReviewControls(false);
reviewContent.classList.toggle("tab-pane--100");
Expand Down

0 comments on commit ca773c2

Please sign in to comment.