Skip to content

Commit

Permalink
during changing the rejected button to suggestion, the rejected comme…
Browse files Browse the repository at this point in the history
…nt fields are hidden #1798
  • Loading branch information
Darynarli authored and Darynarli committed Jan 30, 2025
1 parent e1c3f1a commit 0df89cb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions dataedit/static/peer_review/opr_reviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,17 @@ $('#ok-button').bind('click', saveEntrances);
// Suggestion Field View Change
$('#suggestion-button').bind('click', showReviewerOptions);
$('#suggestion-button').bind('click', updateSubmitButtonColor);
$('#suggestion-button').bind('click', hideReviewerCommentOptions);

// Reject Field View Change
$('#rejected-button').bind('click', showReviewerCommentsOptions);
$('#rejected-button').bind('click', updateSubmitButtonColor);
$('#rejected-button').bind('click', hideReviewerOptions);

// Clear Input fields when new tab is selected
// nav items are selected via their class
$('.nav-link').click(clearInputFields);
// field items selector

/**
* Returns name from cookies
* @param {string} name Key to look up in cookie
Expand Down Expand Up @@ -162,7 +165,6 @@ function savePeerReview() {
alert(getErrorMsg(err));
});
}

function deletePeerReview() {
// confirm
if (!confirm("Are you sure?")) {
Expand Down Expand Up @@ -279,7 +281,6 @@ function click_field(fieldKey, fieldValue, category) {

const fieldState = getFieldState(fieldKey);
const fieldWasEvaluated = fieldEvaluations[fieldKey]; // Check if the field has been evaluated

if (fieldState) {
if (fieldState === 'ok' && !fieldWasEvaluated) {
document.getElementById("ok-button").disabled = true;
Expand Down Expand Up @@ -318,7 +319,6 @@ function click_field(fieldKey, fieldValue, category) {
fieldEvaluations[fieldKey] = 'suggestion';
});


reviewItem.forEach(function(div) {
div.style.backgroundColor = '';
});
Expand All @@ -327,6 +327,7 @@ function click_field(fieldKey, fieldValue, category) {
}
clearInputFields();
hideReviewerOptions();
hideReviewerCommentOptions();
}

// Initialize the review buttons state on page load
Expand Down Expand Up @@ -640,7 +641,6 @@ function showToast(title, message, type) {
var bsToast = new bootstrap.Toast(toast);
bsToast.show();
}
console.log(9)
/**
* Saves field review to current review list
*/
Expand Down Expand Up @@ -921,6 +921,8 @@ function showReviewerCommentsOptions() {
*/
function hideReviewerOptions() {
$("#reviewer_remarks").addClass('d-none');
}
function hideReviewerCommentOptions() {
$("#reviewer_comments").addClass('d-none');
}

Expand Down

0 comments on commit 0df89cb

Please sign in to comment.