From 95a7cf0ad5f861cca72ba7f58129f9a359b88ff9 Mon Sep 17 00:00:00 2001 From: Shaun Lum Date: Wed, 6 Nov 2024 13:34:36 -0800 Subject: [PATCH] tvr delete fix --- .../Batch/Forms/ArchiveSchoolReportsForm.vue | 21 +++---- .../Batch/Forms/ArchiveStudentsForm.vue | 61 ++++++++++--------- .../components/Batch/Forms/DistrunForm.vue | 8 ++- .../Batch/Forms/DistrunFormYearEndForm.vue | 9 +-- .../Batch/Forms/GraduationAlgorithmForm.vue | 3 + .../Batch/Forms/NongradDistrunForm.vue | 8 ++- .../src/components/Batch/Forms/PSIForm.vue | 9 +-- .../Batch/Forms/RegenerateCertificateForm.vue | 8 ++- .../Forms/RegenerateSchoolReportForm.vue | 10 +-- .../Forms/TranscriptAlgorithmDeleteForm.vue | 18 +++--- .../Batch/Forms/TranscriptAlgorithmForm.vue | 11 ++-- 11 files changed, 92 insertions(+), 74 deletions(-) diff --git a/frontend/src/components/Batch/Forms/ArchiveSchoolReportsForm.vue b/frontend/src/components/Batch/Forms/ArchiveSchoolReportsForm.vue index 4b32ed08..18cf3326 100644 --- a/frontend/src/components/Batch/Forms/ArchiveSchoolReportsForm.vue +++ b/frontend/src/components/Batch/Forms/ArchiveSchoolReportsForm.vue @@ -186,17 +186,9 @@ > - Next - - Download - Submit @@ -237,7 +230,7 @@ export default { watch(group, (newValue) => { batchRequestFormStore.who = newValue; if (newValue == "All Schools") { - batchRequestFormStore.setActivityCode("All"); + batchRequestFormStore.setActivityCode("ALL"); } else { batchRequestFormStore.setActivityCode(null); } @@ -312,6 +305,7 @@ export default { }, data: () => ({ step: 0, + batchLoading: false, dialog: false, selectedConfirmations: [], @@ -355,7 +349,7 @@ export default { }, async submit() { - this.dialog = false; + this.batchLoading = true; const requestTemplate = [ "districts", "gradDateFrom", @@ -379,7 +373,7 @@ export default { requestPayload, this.getBatchRequestCrontime ); - + this.batchLoading = false; if (this.getBatchRequestCrontime) { this.snackbarStore.showSnackbar( "Archive School Reports Process has been successfully scheduled", @@ -394,6 +388,7 @@ export default { 5000 ); } + this.batchLoading = false; this.closeDialogAndResetForm(); this.setActiveTab("batchRuns"); this.updateDashboards(); diff --git a/frontend/src/components/Batch/Forms/ArchiveStudentsForm.vue b/frontend/src/components/Batch/Forms/ArchiveStudentsForm.vue index 7ae246ed..da2edebb 100644 --- a/frontend/src/components/Batch/Forms/ArchiveStudentsForm.vue +++ b/frontend/src/components/Batch/Forms/ArchiveStudentsForm.vue @@ -213,7 +213,8 @@ class="text-none" density="default" @click="submit" - :disabled="v$.$invalid" + :loading="batchLoading" + :disabled="v$.$invalid || batchLoading" >Submit @@ -245,7 +246,7 @@ export default { watch(group, (newValue) => { batchRequestFormStore.who = newValue; if (newValue == "All Students") { - batchRequestFormStore.setActivityCode("All"); + batchRequestFormStore.setActivityCode("ALL"); } else { batchRequestFormStore.setActivityCode(null); } @@ -318,6 +319,7 @@ export default { }, data: () => ({ step: 0, + batchLoading: false, dialog: false, selectedConfirmations: [], }), @@ -380,7 +382,7 @@ export default { this.step = step; }, async submit() { - this.dialog = false; + this.batchLoading = true; const requestTemplate = [ "credentialTypeCode", "districts", @@ -400,37 +402,38 @@ export default { this.getBatchRequest, requestTemplate ); - try { - let response = await BatchProcessingService.runArchiveStudents( - requestPayload, - this.getBatchRequestCrontime - ); - - if (this.getBatchRequestCrontime) { - this.snackbarStore.showSnackbar( - "Archive student batch process has been successfully scheduled", - 5000 + if (this.group == "All Students") + try { + let response = await BatchProcessingService.runArchiveStudents( + requestPayload, + this.getBatchRequestCrontime ); - } else { + this.batchLoading = false; + if (this.getBatchRequestCrontime) { + this.snackbarStore.showSnackbar( + "Archive student batch process has been successfully scheduled", + 5000 + ); + } else { + this.snackbarStore.showSnackbar( + "Batch " + + response.data.batchId + + "- Archive student batch process submitted", + "success", + 5000 + ); + } + this.closeDialogAndResetForm(); + this.setActiveTab("batchRuns"); + this.updateDashboards(); + } catch (error) { + // handle the error and show the notification this.snackbarStore.showSnackbar( - "Batch " + - response.data.batchId + - "- Archive student batch process submitted", - "success", + "An error occurred: " + error.message, + "danger", 5000 ); } - this.closeDialogAndResetForm(); - this.setActiveTab("batchRuns"); - this.updateDashboards(); - } catch (error) { - // handle the error and show the notification - this.snackbarStore.showSnackbar( - "An error occurred: " + error.message, - "danger", - 5000 - ); - } }, }, }; diff --git a/frontend/src/components/Batch/Forms/DistrunForm.vue b/frontend/src/components/Batch/Forms/DistrunForm.vue index 95a0069f..bab668a5 100644 --- a/frontend/src/components/Batch/Forms/DistrunForm.vue +++ b/frontend/src/components/Batch/Forms/DistrunForm.vue @@ -58,7 +58,8 @@ class="text-none" density="default" @click="submit" - :disabled="v$.$invalid" + :loading="batchLoading" + :disabled="v$.$invalid || batchLoading" >Submit @@ -166,6 +167,7 @@ export default { data: () => ({ snackbarStore: useSnackbarStore(), step: 0, + batchLoading: false, dialog: false, groupSelected: "", transcriptTypes: [], @@ -320,7 +322,7 @@ export default { this.step = step; }, async submit() { - this.dialog = false; + this.batchLoading = true; try { const requestTemplate = [ "pens", @@ -346,6 +348,7 @@ export default { requestPayload, this.getBatchRequestCrontime ); + this.batchLoading = false; if (response) { if (this.getBatchRequestCrontime) { this.snackbarStore.showSnackbar( @@ -362,6 +365,7 @@ export default { ); } } + this.setActiveTab("batchRuns"); this.closeDialogAndResetForm(); this.updateDashboards(); } catch (error) { diff --git a/frontend/src/components/Batch/Forms/DistrunFormYearEndForm.vue b/frontend/src/components/Batch/Forms/DistrunFormYearEndForm.vue index 52aaa754..4de97073 100644 --- a/frontend/src/components/Batch/Forms/DistrunFormYearEndForm.vue +++ b/frontend/src/components/Batch/Forms/DistrunFormYearEndForm.vue @@ -113,7 +113,8 @@ class="text-none" density="default" @click="submit" - :disabled="v$.$invalid" + :loading="batchLoading" + :disabled="v$.$invalid || batchLoading" >Submit @@ -191,6 +192,7 @@ export default { }, data: () => ({ step: 0, + batchLoading: false, dialog: false, }), computed: { @@ -254,7 +256,7 @@ export default { this.step = step; }, async submit() { - this.dialog = false; + this.batchLoading = true; const requestTemplate = [ "credentialTypeCode", "districts", @@ -279,7 +281,7 @@ export default { requestPayload, this.getBatchRequestCrontime ); - + this.batchLoading = false; if (this.getBatchRequestCrontime) { this.snackbarStore.showSnackbar( "Year-End Credentials and Transcript Distribution Run has been successfully scheduled", @@ -295,7 +297,6 @@ export default { ); } this.closeDialogAndResetForm(); - this.setActiveTab("batchRuns"); this.updateDashboards(); } catch (error) { diff --git a/frontend/src/components/Batch/Forms/GraduationAlgorithmForm.vue b/frontend/src/components/Batch/Forms/GraduationAlgorithmForm.vue index fa6dcbd8..7c96b5b4 100644 --- a/frontend/src/components/Batch/Forms/GraduationAlgorithmForm.vue +++ b/frontend/src/components/Batch/Forms/GraduationAlgorithmForm.vue @@ -267,6 +267,7 @@ export default { }, data: () => ({ step: 0, + batchLoading: false, dialog: false, snackbarStore: useSnackbarStore(), batchProcessingStore: useBatchProcessingStore(), @@ -327,6 +328,7 @@ export default { this.step = step; }, async submit() { + this.batchLoading = true; try { this.batchLoading = true; const requestTemplate = [ @@ -368,6 +370,7 @@ export default { } this.closeDialogAndResetForm(); this.setActiveTab("batchRuns"); + this.updateDashboards(); } catch (error) { // handle the error and show the notification this.snackbarStore.showSnackbar( diff --git a/frontend/src/components/Batch/Forms/NongradDistrunForm.vue b/frontend/src/components/Batch/Forms/NongradDistrunForm.vue index 3f7aa7dc..36478a7f 100644 --- a/frontend/src/components/Batch/Forms/NongradDistrunForm.vue +++ b/frontend/src/components/Batch/Forms/NongradDistrunForm.vue @@ -114,7 +114,8 @@ class="text-none" density="default" @click="submit" - :disabled="v$.$invalid" + :loading="batchLoading" + :disabled="v$.$invalid || batchLoading" >Submit @@ -192,6 +193,7 @@ export default { }, data: () => ({ step: 0, + batchLoading: false, dialog: false, snackbarStore: useSnackbarStore(), }), @@ -256,7 +258,7 @@ export default { this.step = step; }, async submit() { - this.dialog = false; + this.batchLoading = true; const requestTemplate = [ "credentialTypeCode", "districts", @@ -281,7 +283,7 @@ export default { requestPayload, this.getBatchRequestCrontime ); - + this.batchLoading = false; if (this.getBatchRequestCrontime) { this.snackbarStore.showSnackbar( "Non-Graduate Transcript Distribution Run has been successfully scheduled", diff --git a/frontend/src/components/Batch/Forms/PSIForm.vue b/frontend/src/components/Batch/Forms/PSIForm.vue index b7f696b5..ad1b3d09 100644 --- a/frontend/src/components/Batch/Forms/PSIForm.vue +++ b/frontend/src/components/Batch/Forms/PSIForm.vue @@ -110,7 +110,8 @@ class="text-none" density="default" @click="submit" - :disabled="v$.$invalid" + :loading="batchLoading" + :disabled="v$.$invalid || batchLoading" >Submit @@ -205,6 +206,7 @@ export default { }, data: () => ({ step: 0, + batchLoading: false, dialog: false, snackbarStore: useSnackbarStore(), }), @@ -266,7 +268,7 @@ export default { this.step = step; }, async submit() { - this.dialog = false; + this.batchLoading = true; try { const requestTemplate = [ "credentialTypeCode", @@ -293,7 +295,7 @@ export default { this.getPsiTrasmissionMode, this.getBatchRequestCrontime ); - + this.batchLoading = false; if (this.getBatchRequestCrontime) { this.snackbarStore.showSnackbar( "PSI Run FTP / Paper has been successfully scheduled", @@ -309,7 +311,6 @@ export default { ); } this.closeDialogAndResetForm(); - this.setActiveTab("batchRuns"); this.updateDashboards(); } catch (error) { diff --git a/frontend/src/components/Batch/Forms/RegenerateCertificateForm.vue b/frontend/src/components/Batch/Forms/RegenerateCertificateForm.vue index 3c99b24a..a0ecf441 100644 --- a/frontend/src/components/Batch/Forms/RegenerateCertificateForm.vue +++ b/frontend/src/components/Batch/Forms/RegenerateCertificateForm.vue @@ -129,7 +129,8 @@ class="text-none" density="default" @click="submit" - :disabled="v$.$invalid" + :loading="batchLoading" + :disabled="v$.$invalid || batchLoading" >Submit @@ -240,6 +241,7 @@ export default { data: () => ({ snackbarStore: useSnackbarStore(), step: 0, + batchLoading: false, dialog: false, }), computed: { @@ -273,7 +275,7 @@ export default { this.step = step; }, async submit() { - this.dialog = false; + this.batchLoading = true; const requestTemplate = [ "districts", "pens", @@ -293,7 +295,7 @@ export default { requestPayload, this.getBatchRequestCrontime ); - + this.batchLoading = false; if (this.getBatchRequestCrontime) { this.snackbarStore.showSnackbar( "User Request Certificate Regeneration has been successfully scheduled", diff --git a/frontend/src/components/Batch/Forms/RegenerateSchoolReportForm.vue b/frontend/src/components/Batch/Forms/RegenerateSchoolReportForm.vue index 6dc691a8..e71d9143 100644 --- a/frontend/src/components/Batch/Forms/RegenerateSchoolReportForm.vue +++ b/frontend/src/components/Batch/Forms/RegenerateSchoolReportForm.vue @@ -145,7 +145,8 @@ class="text-none" density="default" @click="submit" - :disabled="v$.$invalid" + :loading="batchLoading" + :disabled="v$.$invalid || batchLoading" >Submit @@ -179,7 +180,7 @@ export default { watch(group, (newValue) => { batchRequestFormStore.who = newValue; if (newValue == "All Schools") { - batchRequestFormStore.setActivityCode("All"); + batchRequestFormStore.setActivityCode("ALL"); } else { batchRequestFormStore.setActivityCode(null); } @@ -257,6 +258,7 @@ export default { }, data: () => ({ step: 0, + batchLoading: false, dialog: false, snackbarStore: useSnackbarStore(), batchProcessingStore: useBatchProcessingStore(), @@ -297,7 +299,7 @@ export default { this.step = step; }, async submit() { - this.dialog = false; + this.batchLoading = true; try { const requestTemplate = [ "districts", @@ -321,7 +323,7 @@ export default { requestPayload, this.getBatchRequestCrontime ); - + this.batchLoading = false; if (this.getBatchRequestCrontime) { this.snackbarStore.showSnackbar( "User Request School Report Regeneration has been successfully scheduled", diff --git a/frontend/src/components/Batch/Forms/TranscriptAlgorithmDeleteForm.vue b/frontend/src/components/Batch/Forms/TranscriptAlgorithmDeleteForm.vue index dd3762d3..b03a7919 100644 --- a/frontend/src/components/Batch/Forms/TranscriptAlgorithmDeleteForm.vue +++ b/frontend/src/components/Batch/Forms/TranscriptAlgorithmDeleteForm.vue @@ -138,7 +138,8 @@ class="text-none" density="default" @click="submit" - :disabled="v$.$invalid" + :loading="batchLoading" + :disabled="v$.$invalid || batchLoading" >Submit @@ -170,11 +171,6 @@ export default { const group = ref(batchRequestFormStore.who); watch(group, (newValue) => { batchRequestFormStore.who = newValue; - if (newValue == "All Students") { - batchRequestFormStore.setActivityCode("ALL"); - } else { - batchRequestFormStore.setActivityCode(null); - } }); return { @@ -234,6 +230,7 @@ export default { }, data: () => ({ step: 0, + batchLoading: false, dialog: false, snackbarStore: useSnackbarStore(), batchProcessingStore: useBatchProcessingStore(), @@ -295,7 +292,7 @@ export default { this.step = step; }, async submit() { - this.dialog = false; + this.batchLoading = true; try { const requestTemplate = [ "credentialTypeCode", @@ -307,6 +304,7 @@ export default { "programs", "psiCodes", "quantity", + "activityCode", "reportTypes", "schoolCategoryCodes", "schoolOfRecords", @@ -316,11 +314,15 @@ export default { this.getBatchRequest, requestTemplate ); + requestPayload.reportTypes = ["ACHV"]; + if (this.group == "All Students") { + requestPayload.activityCode = "ALL"; + } let response = await BatchProcessingService.runTVR_DELETE( requestPayload, this.getBatchRequestCrontime ); - + this.batchLoading = false; if (this.getBatchRequestCrontime) { this.snackbarStore.showSnackbar( "Transcript verification report delete has been successfully scheduled", diff --git a/frontend/src/components/Batch/Forms/TranscriptAlgorithmForm.vue b/frontend/src/components/Batch/Forms/TranscriptAlgorithmForm.vue index a262a2c6..3e675255 100644 --- a/frontend/src/components/Batch/Forms/TranscriptAlgorithmForm.vue +++ b/frontend/src/components/Batch/Forms/TranscriptAlgorithmForm.vue @@ -138,7 +138,8 @@ class="text-none" density="default" @click="submit" - :disabled="v$.$invalid" + :loading="batchLoading" + :disabled="v$.$invalid || batchLoading" >Submit @@ -251,6 +252,7 @@ export default { }, data: () => ({ step: 0, + batchLoading: false, dialog: false, snackbarStore: useSnackbarStore(), }), @@ -312,7 +314,7 @@ export default { this.step = step; }, async submit() { - this.dialog = false; + this.batchLoading = true; try { const requestTemplate = [ "districts", @@ -336,8 +338,7 @@ export default { requestPayload, this.getBatchRequestCrontime ); - - this.activeTab = "batchRuns"; + this.batchLoading = false; if (this.getBatchRequestCrontime) { this.snackbarStore.showSnackbar( "Transcript verification report has been successfully scheduled", @@ -350,7 +351,9 @@ export default { 5000 ); } + this.setActiveTab("batchRuns"); this.closeDialogAndResetForm(); + this.updateDashboards(); } catch (error) { // handle the error and show the notification this.snackbarStore.showSnackbar(