Skip to content

Commit

Permalink
updated functionality to complete review #1798
Browse files Browse the repository at this point in the history
  • Loading branch information
user committed Sep 13, 2024
1 parent 149b4db commit 827c6d4
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions dataedit/static/peer_review/opr_reviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ $('.nav-link').click(clearInputFields);
/**
* Returns name from cookies
* @param {string} name Key to look up in cookie
* @returns {value} Cookie value
*/
function getCookie(name) {
var cookieValue = null;
Expand Down Expand Up @@ -175,7 +174,6 @@ function submitPeerReview() {
alert(getErrorMsg(err));
});
}

/**
* Finish peer review and save to backend
*/
Expand Down Expand Up @@ -304,7 +302,6 @@ function click_field(fieldKey, fieldValue, category) {
function switchCategoryTab(category) {
const currentTab = document.querySelector('.tab-pane.active'); // Get the currently active tab
const tabIdForCategory = getCategoryToTabIdMapping()[category];
console.log("tabID", tabIdForCategory);
if (currentTab.getAttribute('id') !== tabIdForCategory) {
// The clicked field does not belong to the current tab, switch to the next tab
const targetTab = document.getElementById(tabIdForCategory);
Expand Down Expand Up @@ -726,7 +723,6 @@ function saveEntrances() {
commentElement.innerText = document.getElementById("commentarea").value;
}
}

// Color ok/suggestion/rejected
updateFieldColor();
checkReviewComplete();
Expand Down Expand Up @@ -779,7 +775,7 @@ function checkReviewComplete() {
const fieldState = getFieldState(field.fieldName);
const reviewed = current_review["reviews"].find((review) => review.key === field.fieldName);

if (!reviewed && fieldState !== 'ok' && !isEmptyValue(field.fieldValue)) {
if (!reviewed && fieldState !== 'ok' && fieldState !== 'rejected' && !isEmptyValue(field.fieldValue)) {
$('#submit_summary').addClass('disabled');
return;
}
Expand All @@ -790,14 +786,13 @@ function checkReviewComplete() {
}
}


function checkFieldStates() {
const fieldList = getAllFieldsAndValues();

for (const { fieldName, fieldValue } of fieldList) {
if (!isEmptyValue(fieldValue)) {
const fieldState = state_dict[fieldName];
if (fieldState !== 'ok') {
if (fieldState !== 'ok' && fieldState !== 'rejected') {
return false;
}
}
Expand Down

0 comments on commit 827c6d4

Please sign in to comment.