Skip to content

Commit

Permalink
corrected function checkReviewComplete() considering empty fields #1650
Browse files Browse the repository at this point in the history
  • Loading branch information
user committed Jul 16, 2024
1 parent 6f36462 commit 2868578
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dataedit/static/peer_review/opr_contributor.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,19 +631,22 @@ function checkReviewComplete() {
const fields = document.querySelectorAll('.field');
for (let field of fields) {
let fieldName = field.id.slice(6);
const fieldValue = $(field).find('.value').text().replace(/\s+/g, ' ').trim();
const fieldState = getFieldState(fieldName);
let reviewed = current_review["reviews"].find((review) => review.key === fieldName);

if (!reviewed && fieldState !== 'ok') {
if (!reviewed && fieldState !== 'ok' && !isEmptyValue(fieldValue)) {
$('#submit_summary').addClass('disabled');
return;
}
}
$('#submit_summary').removeClass('disabled');
showToast("Success", "You have reviewed all fields an can submit the review to get feedback!", 'success');
showToast("Success", "You have reviewed all fields and can submit the review to get feedback!", 'success');
}




/**
* Shows reviewer Comment and Suggestion Input options
*/
Expand Down

0 comments on commit 2868578

Please sign in to comment.