Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions google-apps-script/AdminSync.gs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ function adminUpdate_(sheet, payload) {
}

var normalized = adminValidateChanges_(changes);
var currentDecision = clean_(current[COL.FINAL_DECISION - 1]);
if (normalized.finalDecision !== currentDecision) {
normalized.notificationStatus = 'Not Sent';
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
sheet.getRange(rowNumber, COL.INTAKE_STATUS, 1, 9).setValues([[
normalized.intakeStatus,
sheetText_(normalized.reviewer1),
Expand Down
24 changes: 21 additions & 3 deletions scripts/test_sheets_sync.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -666,9 +666,27 @@ assert.equal(acceptedRow[21], "Sent");
assert.equal(brevoRequests.length, 2, "acceptance notification must use the same Brevo path");
assert.equal(brevoRequests[1].body.subject, "[PBAST10] Abstract accepted — brevo-submission-1");

acceptedRow[19] = "Reject";
acceptedRow[20] = "None";
acceptedRow[21] = "Not sent";
const rejectionUpdate = JSON.parse(context.adminUpdate_(tracker, {
submissionId: "brevo-submission-1",
expectedFingerprint: context.adminFingerprint_(acceptedRow),
changes: {
intakeStatus: "Checked",
reviewer1: "",
reviewer1Decision: "",
reviewer2: "",
reviewer2Decision: "",
finalDecision: "Reject",
finalPresentationType: "None",
notificationStatus: "Sent",
notes: "",
},
}).body);
assert.equal(rejectionUpdate.ok, true);
assert.equal(
rejectionUpdate.row.notificationStatus,
"Not Sent",
"changing the final decision must reset a prior delivery status",
);
const rejection = callAppsScript({
action: "admin-rejection-email",
submissionId: "brevo-submission-1",
Expand Down
Loading