Merged in approval-workflows (pull request #154)
Approval Workflows Approved-by: Tiago Ribeiro
This commit is contained in:
@@ -72,7 +72,7 @@ export async function createApprovalWorkflowOnExamCreation(examAuthor: string, e
|
|||||||
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, isDiagnostic: false }},
|
{ $set: { id: examId, access: "private" }},
|
||||||
{ upsert: true }
|
{ upsert: true }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,13 +73,9 @@ export default function Home({ user, workflow, workflowEntityApprovers }: Props)
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
const editableWorkflow: EditableApprovalWorkflow = {
|
const editableWorkflow: EditableApprovalWorkflow = {
|
||||||
|
...workflow,
|
||||||
id: workflow._id?.toString() ?? "",
|
id: workflow._id?.toString() ?? "",
|
||||||
name: workflow.name,
|
|
||||||
entityId: workflow.entityId,
|
|
||||||
requester: user.id, // should it change to the editor?
|
requester: user.id, // should it change to the editor?
|
||||||
startDate: workflow.startDate,
|
|
||||||
modules: workflow.modules,
|
|
||||||
status: workflow.status,
|
|
||||||
steps: editableSteps,
|
steps: editableSteps,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -260,10 +260,7 @@ export default function Home({ user, initialWorkflow, id, workflowAssignees, wor
|
|||||||
if (examModule && examId) {
|
if (examModule && examId) {
|
||||||
const exam = await getExamById(examModule, examId.trim());
|
const exam = await getExamById(examModule, examId.trim());
|
||||||
if (!exam) {
|
if (!exam) {
|
||||||
toast.error(
|
toast.error("Something went wrong while fetching exam!");
|
||||||
"Unknown Exam ID! Please make sure you selected the right module and entered the right exam ID",
|
|
||||||
{ toastId: "invalid-exam-id" }
|
|
||||||
);
|
|
||||||
setViewExamIsLoading(false);
|
setViewExamIsLoading(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user