Skip to content

Commit

Permalink
Merge branch 'release/v1.26.1' of https://github.com/bcgov/EDUC-GRAD-…
Browse files Browse the repository at this point in the history
…ADMIN into vuetify-mt
  • Loading branch information
michaeltangbcgov committed Nov 6, 2024
2 parents fad8ce6 + 6ba7e8f commit bdf6e27
Show file tree
Hide file tree
Showing 20 changed files with 199 additions and 143 deletions.
39 changes: 20 additions & 19 deletions frontend/src/components/Batch/Forms/ArchiveSchoolReportsForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<v-stepper-window>
<v-stepper-window-item value="0">
<v-row>
<v-col sm="2"> Report Type </v-col>
<v-col sm="2">Report Type </v-col>
<v-col sm="10">
<v-select
v-model="reportType"
Expand All @@ -70,15 +70,21 @@
item-title="text"
item-value="value"
label="Select a report type"
variant="outlined"
class="mt-2"
></v-select>
</v-col>
</v-row>
<v-row>
<v-select
v-model="group"
:items="['School', 'All Schools']"
label="Select a group"
></v-select>
<v-col>
<v-select
class="mt-2"
v-model="group"
:items="['School', 'All Schools']"
label="Select a group"
variant="outlined"
></v-select>
</v-col>
</v-row>
<v-row v-if="group == 'School'">
<SchoolInput>
Expand Down Expand Up @@ -186,25 +192,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 +236,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 +311,7 @@ export default {
},
data: () => ({
step: 0,
batchLoading: false,
dialog: false,
selectedConfirmations: [],
Expand Down Expand Up @@ -355,7 +355,7 @@ export default {
},
async submit() {
this.dialog = false;
this.batchLoading = true;
const requestTemplate = [
"districts",
"gradDateFrom",
Expand All @@ -379,7 +379,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 +394,7 @@ export default {
5000
);
}
this.batchLoading = false;
this.closeDialogAndResetForm();
this.setActiveTab("batchRuns");
this.updateDashboards();
Expand Down
64 changes: 34 additions & 30 deletions frontend/src/components/Batch/Forms/ArchiveStudentsForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@
<v-stepper-window-item value="0">
<v-row>
<v-select
class="mt-2"
v-model="group"
:items="['School', 'All Students']"
label="Select a Group"
label="Select a group"
></v-select>
</v-row>
<v-row v-if="group == 'School'">
Expand Down Expand Up @@ -213,7 +214,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 +247,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 +320,7 @@ export default {
},
data: () => ({
step: 0,
batchLoading: false,
dialog: false,
selectedConfirmations: [],
}),
Expand Down Expand Up @@ -380,7 +383,7 @@ export default {
this.step = step;
},
async submit() {
this.dialog = false;
this.batchLoading = true;
const requestTemplate = [
"credentialTypeCode",
"districts",
Expand All @@ -400,37 +403,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
12 changes: 7 additions & 5 deletions frontend/src/components/Batch/Forms/DistrunFormYearEndForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
<v-select
v-model="getGroup"
:items="['School Category']"
label="Select a Group"
label="Select a group"
variant="outlined"
></v-select>
</v-row>
<v-row v-if="getGroup == 'School Category'">
Expand Down Expand Up @@ -113,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 @@ -191,6 +193,7 @@ export default {
},
data: () => ({
step: 0,
batchLoading: false,
dialog: false,
}),
computed: {
Expand Down Expand Up @@ -254,7 +257,7 @@ export default {
this.step = step;
},
async submit() {
this.dialog = false;
this.batchLoading = true;
const requestTemplate = [
"credentialTypeCode",
"districts",
Expand All @@ -279,7 +282,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 +298,6 @@ export default {
);
}
this.closeDialogAndResetForm();
this.setActiveTab("batchRuns");
this.updateDashboards();
} catch (error) {
Expand Down
13 changes: 10 additions & 3 deletions frontend/src/components/Batch/Forms/DistrunUserForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@
<v-row>
<v-col>
<v-select
class="mt-2"
variant="outlined"
v-model="group"
:items="groupItems"
label="Select group"
Expand Down Expand Up @@ -214,7 +216,8 @@
variant="flat"
class="text-none"
density="default"
:disabled="v$.$invalid"
:loading="batchLoading"
:disabled="v$.$invalid || batchLoading"
@click="submit"
>
Download
Expand All @@ -226,7 +229,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 @@ -413,6 +417,7 @@ export default {
snackbarStore: useSnackbarStore(),
step: 0,
dialog: false,
batchLoading: false,
groupSelected: "",
transcriptTypes: [],
certificateTypes: [],
Expand Down Expand Up @@ -569,7 +574,7 @@ export default {
this.step = step;
},
async submit() {
this.dialog = false;
this.batchLoading = true;
try {
const requestTemplate = [
"credentialTypeCode",
Expand Down Expand Up @@ -603,6 +608,7 @@ export default {
this.getBatchRequestCrontime
);
if (response) {
this.batchLoading = false;
if (this.getBatchRequestCrontime) {
this.snackbarStore.showSnackbar(
"User distribution batch request has been successfully scheduled",
Expand All @@ -618,6 +624,7 @@ export default {
);
}
}
this.setActiveTab("batchRuns");
this.closeDialogAndResetForm();
this.updateDashboards();
} catch (error) {
Expand Down
Loading

0 comments on commit bdf6e27

Please sign in to comment.