Skip to content

Commit

Permalink
tvr delete fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shaunlumbcgov committed Nov 6, 2024
1 parent 1b3f475 commit 95a7cf0
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 74 deletions.
21 changes: 8 additions & 13 deletions frontend/src/components/Batch/Forms/ArchiveSchoolReportsForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,25 +186,18 @@
>
<v-spacer />
<!-- Right Action Button -->
<v-btn v-if="step < 3" @click="step++" color="bcGovBlue"
<v-btn v-if="step < 1" @click="step++" color="bcGovBlue"
>Next</v-btn
>
<v-btn
v-else-if="getBatchRequest.localDownload == 'Y'"
color="bcGovBlue"
variant="text"
@click="submit"
>
Download
</v-btn>
<v-btn
v-else
color="error"
variant="flat"
class="text-none"
density="default"
@click="submit"
:disabled="v$.$invalid"
:loading="batchLoading"
:disabled="v$.$invalid || batchLoading"
>Submit</v-btn
>
</div>
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -312,6 +305,7 @@ export default {
},
data: () => ({
step: 0,
batchLoading: false,
dialog: false,
selectedConfirmations: [],
Expand Down Expand Up @@ -355,7 +349,7 @@ export default {
},
async submit() {
this.dialog = false;
this.batchLoading = true;
const requestTemplate = [
"districts",
"gradDateFrom",
Expand All @@ -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",
Expand All @@ -394,6 +388,7 @@ export default {
5000
);
}
this.batchLoading = false;
this.closeDialogAndResetForm();
this.setActiveTab("batchRuns");
this.updateDashboards();
Expand Down
61 changes: 32 additions & 29 deletions frontend/src/components/Batch/Forms/ArchiveStudentsForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@
class="text-none"
density="default"
@click="submit"
:disabled="v$.$invalid"
:loading="batchLoading"
:disabled="v$.$invalid || batchLoading"
>Submit</v-btn
>
</div>
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -318,6 +319,7 @@ export default {
},
data: () => ({
step: 0,
batchLoading: false,
dialog: false,
selectedConfirmations: [],
}),
Expand Down Expand Up @@ -380,7 +382,7 @@ export default {
this.step = step;
},
async submit() {
this.dialog = false;
this.batchLoading = true;
const requestTemplate = [
"credentialTypeCode",
"districts",
Expand All @@ -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
);
}
},
},
};
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/components/Batch/Forms/DistrunForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
class="text-none"
density="default"
@click="submit"
:disabled="v$.$invalid"
:loading="batchLoading"
:disabled="v$.$invalid || batchLoading"
>Submit</v-btn
>
</div>
Expand Down Expand Up @@ -166,6 +167,7 @@ export default {
data: () => ({
snackbarStore: useSnackbarStore(),
step: 0,
batchLoading: false,
dialog: false,
groupSelected: "",
transcriptTypes: [],
Expand Down Expand Up @@ -320,7 +322,7 @@ export default {
this.step = step;
},
async submit() {
this.dialog = false;
this.batchLoading = true;
try {
const requestTemplate = [
"pens",
Expand All @@ -346,6 +348,7 @@ export default {
requestPayload,
this.getBatchRequestCrontime
);
this.batchLoading = false;
if (response) {
if (this.getBatchRequestCrontime) {
this.snackbarStore.showSnackbar(
Expand All @@ -362,6 +365,7 @@ export default {
);
}
}
this.setActiveTab("batchRuns");
this.closeDialogAndResetForm();
this.updateDashboards();
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@
class="text-none"
density="default"
@click="submit"
:disabled="v$.$invalid"
:loading="batchLoading"
:disabled="v$.$invalid || batchLoading"
>Submit</v-btn
>
</div>
Expand Down Expand Up @@ -191,6 +192,7 @@ export default {
},
data: () => ({
step: 0,
batchLoading: false,
dialog: false,
}),
computed: {
Expand Down Expand Up @@ -254,7 +256,7 @@ export default {
this.step = step;
},
async submit() {
this.dialog = false;
this.batchLoading = true;
const requestTemplate = [
"credentialTypeCode",
"districts",
Expand All @@ -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",
Expand All @@ -295,7 +297,6 @@ export default {
);
}
this.closeDialogAndResetForm();
this.setActiveTab("batchRuns");
this.updateDashboards();
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ export default {
},
data: () => ({
step: 0,
batchLoading: false,
dialog: false,
snackbarStore: useSnackbarStore(),
batchProcessingStore: useBatchProcessingStore(),
Expand Down Expand Up @@ -327,6 +328,7 @@ export default {
this.step = step;
},
async submit() {
this.batchLoading = true;
try {
this.batchLoading = true;
const requestTemplate = [
Expand Down Expand Up @@ -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(
Expand Down
8 changes: 5 additions & 3 deletions frontend/src/components/Batch/Forms/NongradDistrunForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@
class="text-none"
density="default"
@click="submit"
:disabled="v$.$invalid"
:loading="batchLoading"
:disabled="v$.$invalid || batchLoading"
>Submit</v-btn
>
</div>
Expand Down Expand Up @@ -192,6 +193,7 @@ export default {
},
data: () => ({
step: 0,
batchLoading: false,
dialog: false,
snackbarStore: useSnackbarStore(),
}),
Expand Down Expand Up @@ -256,7 +258,7 @@ export default {
this.step = step;
},
async submit() {
this.dialog = false;
this.batchLoading = true;
const requestTemplate = [
"credentialTypeCode",
"districts",
Expand All @@ -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",
Expand Down
9 changes: 5 additions & 4 deletions frontend/src/components/Batch/Forms/PSIForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@
class="text-none"
density="default"
@click="submit"
:disabled="v$.$invalid"
:loading="batchLoading"
:disabled="v$.$invalid || batchLoading"
>Submit</v-btn
>
</div>
Expand Down Expand Up @@ -205,6 +206,7 @@ export default {
},
data: () => ({
step: 0,
batchLoading: false,
dialog: false,
snackbarStore: useSnackbarStore(),
}),
Expand Down Expand Up @@ -266,7 +268,7 @@ export default {
this.step = step;
},
async submit() {
this.dialog = false;
this.batchLoading = true;
try {
const requestTemplate = [
"credentialTypeCode",
Expand All @@ -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",
Expand All @@ -309,7 +311,6 @@ export default {
);
}
this.closeDialogAndResetForm();
this.setActiveTab("batchRuns");
this.updateDashboards();
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@
class="text-none"
density="default"
@click="submit"
:disabled="v$.$invalid"
:loading="batchLoading"
:disabled="v$.$invalid || batchLoading"
>Submit</v-btn
>
</div>
Expand Down Expand Up @@ -240,6 +241,7 @@ export default {
data: () => ({
snackbarStore: useSnackbarStore(),
step: 0,
batchLoading: false,
dialog: false,
}),
computed: {
Expand Down Expand Up @@ -273,7 +275,7 @@ export default {
this.step = step;
},
async submit() {
this.dialog = false;
this.batchLoading = true;
const requestTemplate = [
"districts",
"pens",
Expand All @@ -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",
Expand Down
Loading

0 comments on commit 95a7cf0

Please sign in to comment.