Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed the update after batch submission #681

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,10 @@ export default {
this.batchLoading = false;
this.closeDialogAndResetForm();
this.setActiveTab("batchRuns");
this.updateDashboards();
//add a wait before updating dashboard
setTimeout(() => {
this.updateDashboards();
}, 2000);
} catch (error) {
this.snackbarStore.showSnackbar(
"An error occurred: " + error.message,
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/components/Batch/Forms/ArchiveStudentsForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,10 @@ export default {
}
this.closeDialogAndResetForm();
this.setActiveTab("batchRuns");
this.updateDashboards();
//add a wait before updating dashboard
setTimeout(() => {
this.updateDashboards();
}, 2000);
} catch (error) {
// handle the error and show the notification
this.snackbarStore.showSnackbar(
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/components/Batch/Forms/DistrunForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,10 @@ export default {
}
this.setActiveTab("batchRuns");
this.closeDialogAndResetForm();
this.updateDashboards();
//add a wait before updating dashboard
setTimeout(() => {
this.updateDashboards();
}, 2000);
} catch (error) {
// handle the error and show the notification
console.error("Error:", error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,10 @@ export default {
}
this.closeDialogAndResetForm();
this.setActiveTab("batchRuns");
this.updateDashboards();
//add a wait before updating dashboard
setTimeout(() => {
this.updateDashboards();
}, 2000);
} catch (error) {
this.snackbarStore.showSnackbar(
"An error occurred: " + error.message,
Expand Down
10 changes: 8 additions & 2 deletions frontend/src/components/Batch/Forms/DistrunUserForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@
</v-row>

<v-row v-if="group == 'Student'">
<StudentInput></StudentInput>
<StudentInput
runType="DISTRUNUSER"
:credentialType="credentialSelected"
></StudentInput>
</v-row>
<v-row v-if="group == 'School Category'">
<DistrictInput></DistrictInput>
Expand Down Expand Up @@ -626,7 +629,10 @@ export default {
}
this.setActiveTab("batchRuns");
this.closeDialogAndResetForm();
this.updateDashboards();
//add a wait before updating dashboard
setTimeout(() => {
this.updateDashboards();
}, 2000);
} catch (error) {
// handle the error and show the notification
console.error("Error:", error);
Expand Down
13 changes: 11 additions & 2 deletions frontend/src/components/Batch/Forms/FormInputs/StudentInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export default {
this.clearPenStudentInfo();
const result = await this.v$.$validate();
if (!result) {
this.penLoading = false;
return;
}
this.penValidating = false;
Expand All @@ -163,8 +164,10 @@ export default {
let student = await StudentService.getStudentByPen(this.pen);
if (student.data && student.data.length === 0) {
this.validationMessage = "Student not found";
this.penLoading = false;
return false;
}
let studentID = student.data[0].studentID;

let studentGRADStatus = await StudentService.getGraduationStatus(
student.data[0].studentID
Expand All @@ -186,13 +189,15 @@ export default {
if (studentGRADStatus.data.studentStatusName == "Merged") {
this.validationMessage =
this.pen + " is a merged student and not permitted";
this.penLoading = false;
return;
}
if (this.runType == "CERT_REGEN") {
//when User is entereing PENs for the REGEN process, error if the student has a null PROGRAM COMPLETION DATE
if (!studentGRADStatus.data.programCompletionDate) {
this.validationMessage =
"Error: Cannot regenerate a certificate for this student - this student has not completed their program";
this.penLoading = false;
return;
}
}
Expand All @@ -204,7 +209,7 @@ export default {
) {
let certificate =
await GraduationReportService.getStudentCertificates(studentID);
if (certificate.data.length) {
if (certificate?.data.length) {
//check that certificate has does not have a null distribution date

if (
Expand All @@ -213,17 +218,20 @@ export default {
) {
this.validationMessage =
"Cannot reprint certificate for this student. Distribution date is null";
this.penLoading = false;
return;
}
} else {
if (this.credentialType == "RC") {
this.validationMessage =
"Cannot reprint certificate for this student.";
this.penLoading = false;
return;
}
if (this.credentialType == "OC") {
this.validationMessage =
"Cannot print certificate for this student,this student does not have a certificate.";
this.penLoading = false;
return;
}
}
Expand All @@ -246,15 +254,16 @@ export default {
},
},
props: {
credentialType: String,
runType: String,
credentialType: String,
},

computed: {
computed: {
...mapState(useBatchRequestFormStore, [
"getBatchRequest",
"getBatchRunTime",
"getCredential",
]),
},
isEmpty() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,13 @@ export default {
5000
);
}

this.closeDialogAndResetForm();
this.setActiveTab("batchRuns");
this.updateDashboards();
//add a wait before updating dashboard
setTimeout(() => {
this.updateDashboards();
}, 2000);
} catch (error) {
// handle the error and show the notification
this.snackbarStore.showSnackbar(
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/components/Batch/Forms/NongradDistrunForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,10 @@ export default {
}
this.closeDialogAndResetForm();
this.setActiveTab("batchRuns");
this.updateDashboards();
//add a wait before updating dashboard
setTimeout(() => {
this.updateDashboards();
}, 2000);
} catch (error) {
this.snackbarStore.showSnackbar(
"An error occurred: " + error.message,
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/components/Batch/Forms/PSIForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,10 @@ export default {
}
this.closeDialogAndResetForm();
this.setActiveTab("batchRuns");
this.updateDashboards();
//add a wait before updating dashboard
setTimeout(() => {
this.updateDashboards();
}, 2000);
} catch (error) {
this.snackbarStore.showSnackbar(
"An error occurred: " + error.message,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,10 @@ export default {
}
this.closeDialogAndResetForm();
this.setActiveTab("batchRuns");
this.updateDashboards();
//add a wait before updating dashboard
setTimeout(() => {
this.updateDashboards();
}, 2000);
} catch (error) {
this.snackbarStore.showSnackbar(
"An error occurred: " + error.message,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,10 @@ export default {
}
this.closeDialogAndResetForm();
this.setActiveTab("batchRuns");
this.updateDashboards();
//add a wait before updating dashboard
setTimeout(() => {
this.updateDashboards();
}, 2000);
} catch (error) {
this.snackbarStore.showSnackbar(
"An error occurred: " + error.message,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,10 @@ export default {
}
this.closeDialogAndResetForm();
this.setActiveTab("batchRuns");
this.updateDashboards();
//add a wait before updating dashboard
setTimeout(() => {
this.updateDashboards();
}, 2000);
} catch (error) {
// handle the error and show the notification
this.snackbarStore.showSnackbar(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,10 @@ export default {
}
this.setActiveTab("batchRuns");
this.closeDialogAndResetForm();
this.updateDashboards();
//add a wait before updating dashboard
setTimeout(() => {
this.updateDashboards();
}, 2000);
} catch (error) {
// handle the error and show the notification
this.snackbarStore.showSnackbar(
Expand Down
Loading