Keep exam confidential even after approval workflow is completed
This commit is contained in:
@@ -68,14 +68,14 @@ export async function createApprovalWorkflowOnExamCreation(examAuthor: string, e
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// prettier-ignore
|
// commented because they asked for every exam to stay confidential
|
||||||
if (totalCount === 0) { // current behaviour: if no workflow was found skip approval process
|
/* if (totalCount === 0) { // current behaviour: if no workflow was found skip approval process
|
||||||
await db.collection(examModule).updateOne(
|
await db.collection(examModule).updateOne(
|
||||||
{ id: examId },
|
{ id: examId },
|
||||||
{ $set: { id: examId, access: "private" }},
|
{ $set: { id: examId, access: "private" }},
|
||||||
{ upsert: true }
|
{ upsert: true }
|
||||||
);
|
);
|
||||||
}
|
} */
|
||||||
|
|
||||||
return {
|
return {
|
||||||
successCount,
|
successCount,
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ export default function Home({ user, initialWorkflow, id, workflowAssignees, wor
|
|||||||
const handleApproveStep = () => {
|
const handleApproveStep = () => {
|
||||||
const isLastStep = (selectedStepIndex + 1 === currentWorkflow.steps.length);
|
const isLastStep = (selectedStepIndex + 1 === currentWorkflow.steps.length);
|
||||||
if (isLastStep) {
|
if (isLastStep) {
|
||||||
if (!confirm(`Are you sure you want to approve the last step? Doing so will change the access type of the exam from confidential to private.`)) return;
|
if (!confirm(`Are you sure you want to approve the last step and complete the approval process?`)) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const updatedWorkflow: ApprovalWorkflow = {
|
const updatedWorkflow: ApprovalWorkflow = {
|
||||||
@@ -188,7 +188,7 @@ export default function Home({ user, initialWorkflow, id, workflowAssignees, wor
|
|||||||
|
|
||||||
if (isLastStep) {
|
if (isLastStep) {
|
||||||
setIsPanelOpen(false);
|
setIsPanelOpen(false);
|
||||||
const examModule = currentWorkflow.modules[0];
|
/* const examModule = currentWorkflow.modules[0];
|
||||||
const examId = currentWorkflow.examId;
|
const examId = currentWorkflow.examId;
|
||||||
|
|
||||||
axios
|
axios
|
||||||
@@ -207,7 +207,7 @@ export default function Home({ user, initialWorkflow, id, workflowAssignees, wor
|
|||||||
|
|
||||||
toast.error("Something went wrong, please try again later.");
|
toast.error("Something went wrong, please try again later.");
|
||||||
})
|
})
|
||||||
.finally(reload);
|
.finally(reload); */
|
||||||
} else {
|
} else {
|
||||||
handleStepClick(selectedStepIndex + 1, currentWorkflow.steps[selectedStepIndex + 1]);
|
handleStepClick(selectedStepIndex + 1, currentWorkflow.steps[selectedStepIndex + 1]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user