From a4ef2222e2e807411755ad3cd3fe586ef6a42e6a Mon Sep 17 00:00:00 2001 From: Joao Correia Date: Wed, 26 Feb 2025 16:51:57 +0000 Subject: [PATCH] Keep exam confidential even after approval workflow is completed --- src/lib/createWorkflowsOnExamCreation.ts | 6 +++--- src/pages/approval-workflows/[id]/index.tsx | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/createWorkflowsOnExamCreation.ts b/src/lib/createWorkflowsOnExamCreation.ts index 0f8e1c53..5a102c19 100644 --- a/src/lib/createWorkflowsOnExamCreation.ts +++ b/src/lib/createWorkflowsOnExamCreation.ts @@ -68,14 +68,14 @@ export async function createApprovalWorkflowOnExamCreation(examAuthor: string, e } } - // prettier-ignore - if (totalCount === 0) { // current behaviour: if no workflow was found skip approval process + // commented because they asked for every exam to stay confidential + /* if (totalCount === 0) { // current behaviour: if no workflow was found skip approval process await db.collection(examModule).updateOne( { id: examId }, { $set: { id: examId, access: "private" }}, { upsert: true } ); - } + } */ return { successCount, diff --git a/src/pages/approval-workflows/[id]/index.tsx b/src/pages/approval-workflows/[id]/index.tsx index 4048df94..a898eeb1 100644 --- a/src/pages/approval-workflows/[id]/index.tsx +++ b/src/pages/approval-workflows/[id]/index.tsx @@ -150,7 +150,7 @@ export default function Home({ user, initialWorkflow, id, workflowAssignees, wor const handleApproveStep = () => { const isLastStep = (selectedStepIndex + 1 === currentWorkflow.steps.length); 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 = { @@ -188,7 +188,7 @@ export default function Home({ user, initialWorkflow, id, workflowAssignees, wor if (isLastStep) { setIsPanelOpen(false); - const examModule = currentWorkflow.modules[0]; + /* const examModule = currentWorkflow.modules[0]; const examId = currentWorkflow.examId; axios @@ -207,7 +207,7 @@ export default function Home({ user, initialWorkflow, id, workflowAssignees, wor toast.error("Something went wrong, please try again later."); }) - .finally(reload); + .finally(reload); */ } else { handleStepClick(selectedStepIndex + 1, currentWorkflow.steps[selectedStepIndex + 1]); }