Skip to content

Commit

Permalink
Merge pull request #682 from bcgov/release/v1.26.1
Browse files Browse the repository at this point in the history
Release/v1.26.1
  • Loading branch information
suzalflueck authored Nov 12, 2024
2 parents 9b2579c + f95a571 commit c2b9b44
Show file tree
Hide file tree
Showing 29 changed files with 451 additions and 216 deletions.
60 changes: 42 additions & 18 deletions frontend/src/components/Batch/BatchJobErrorResults.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,40 @@
<template>
<v-card>
<v-card class="p-3">
<v-overlay
v-model="batchLoading"
class="align-center justify-center"
contained
>
<v-progress-circular
v-if="batchLoading"
indeterminate
color="primary"
size="64"
>
Loading...
</v-progress-circular>
</v-overlay>
<div class="d-flex justify-space-between align-center">
<v-card-title> Batch Job #{{ selectedErrorId }} Error(s) </v-card-title>

<!-- Slot for close button -->
<slot name="close"></slot>
</div>

<!-- No results message-->
<p v-if="rows < 1">
<p v-if="totalElements < 1 && !batchLoading">
There are no results to display.<br />
Please select another Job Execution ID.
</p>
<v-data-table

<v-data-table-server
v-model:items-per-page="itemsPerPage"
title="Job/Runs"
:items="batchData"
:headers="batchDataFields"
id="id"
:showFilter="false"
:pagination="true"
class="p-3"
:items="batchData"
:items-length="totalElements"
item-value="id"
@update:options="loadItems"
>
<template v-slot:item.pen="{ item }">
<v-btn
Expand All @@ -35,7 +51,7 @@
<template v-slot:item.schoolOfRecord="{ item }">
<div v-if="item.schoolOfRecord">{{ item.schoolOfRecord }}</div>
</template>
</v-data-table>
</v-data-table-server>
</v-card>
</template>

Expand All @@ -58,9 +74,12 @@ export default {
batchData: [],
perPage: 10,
rows: 0,
totalElements: 0,
itemsPerPage: 10,
currentPage: 0,
userSelectedPage: 0,
batchLoading: false,
batchDataFields: [
{
key: "pen",
Expand Down Expand Up @@ -96,10 +115,6 @@ export default {
computed: {
...mapGetters("auth", ["token"]),
currentPageChange() {
return this.userSelectedPage;
},
},
created() {
this.loadStudent = sharedMethods.loadStudent;
Expand All @@ -109,13 +124,22 @@ export default {
selectedErrorId: function () {
this.getAdminDashboardData(this.selectedErrorId, 0);
},
currentPageChange: function () {
if (this.userSelectedPage !== null) {
this.getAdminDashboardData(this.selectedErrorId, this.userSelectedPage);
}
},
},
methods: {
loadItems({ page, itemsPerPage, sortBy }) {
this.batchLoading = true;
BatchProcessingService.getBatchErrors(this.selectedErrorId, page - 1)
.then((response) => {
this.batchData = response.data.errorList;
this.totalElements = response.data.totalElements;
this.batchLoading = false;
})
.catch((error) => {
if (error.response.status) {
this.batchLoading = false;
}
});
},
getAdminDashboardData(batchId, page) {
this.batchData = [];
this.rows = 0;
Expand Down
33 changes: 19 additions & 14 deletions frontend/src/components/Batch/BatchJobSearchResults.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
<template>
<v-card class="p-3">
<v-overlay
v-model="batchLoading"
class="align-center justify-center"
contained
>
<v-progress-circular
v-if="batchLoading"
indeterminate
color="primary"
size="64"
>
Loading...
</v-progress-circular>
</v-overlay>
<div class="d-flex justify-space-between align-center">
<v-card-title> Batch Job #{{ selectedBatchId }} students </v-card-title>

<!-- Slot for close button -->
<slot name="close"></slot>
</div>
<v-progress-circular
v-if="isLoading"
indeterminate
color="primary"
size="64"
>
Loading...
</v-progress-circular>

<!-- No results message-->
<p v-if="rows < 1">
<p v-if="totalElements < 1 && !batchLoading">
There are no results to display.<br />
Please select another Job Execution ID.
</p>
Expand All @@ -26,7 +32,7 @@
:headers="batchDataFields"
:items="batchData"
:items-length="totalElements"
:loading="loading"
:loading="batchLoading"
item-value="id"
@update:options="loadItems"
>
Expand Down Expand Up @@ -60,7 +66,6 @@ export default {
batchData: [],
perPage: 10,
rows: 0,
loading: false,
totalElements: 0,
itemsPerPage: 10,
currentPage: 0,
Expand Down Expand Up @@ -129,7 +134,7 @@ export default {
})
.catch((error) => {
if (error.response.status) {
this.isBatchLoading = false;
this.batchLoading = false;
}
});
},
Expand All @@ -146,13 +151,13 @@ export default {
StudentService.getBatchHistory(batchId, page)
.then((response) => {
this.batchData = response.data.content;
this.rows = response.data.totalElements;
this.totalElements = response.data.totalElements;
this.itemsPerPage = response.data.size;
this.batchLoading = false;
})
.catch((error) => {
if (error.response.status) {
this.isBatchLoading = false;
this.BatchLoading = false;
}
});
},
Expand Down
18 changes: 16 additions & 2 deletions frontend/src/components/Batch/BatchRoutines.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
<template>
<div>
<v-container>
<v-overlay
v-model="isBatchRoutinesLoading"
class="align-center justify-center"
contained
>
<v-progress-circular
v-if="isBatchRoutinesLoading"
indeterminate
color="primary"
size="64"
>
</v-progress-circular>
</v-overlay>
<v-data-table
:headers="scheduledRoutinesFields"
:items="batchRoutines"
Expand Down Expand Up @@ -45,7 +58,7 @@
{{ snackbarMessage }}
<v-btn text @click="snackbarVisible = false">Close</v-btn>
</v-snackbar>
</div>
</v-container>
</template>

<script>
Expand Down Expand Up @@ -153,6 +166,7 @@ export default {
computed: {
...mapState(useBatchProcessingStore, {
batchRoutines: "getBatchRoutines",
isBatchRoutinesLoading: "getIsGettingBatchRoutinesLoading",
}),
...mapState(useAccessStore, ["hasPermissions"]),
},
Expand Down
22 changes: 14 additions & 8 deletions frontend/src/components/Batch/BatchRuns.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
<template>
<v-container>
<v-overlay
v-model="isBatchJobsLoading"
class="align-center justify-center"
contained
>
<v-progress-circular
v-if="isBatchJobsLoading"
indeterminate
color="primary"
size="64"
>
</v-progress-circular>
</v-overlay>
<v-row>
<!-- First Column (col-5 for medium screens, col-12 for small screens) -->
<v-col :cols="12" :md="isBatchShowing || isErrorShowing ? 7 : 12">
Expand Down Expand Up @@ -324,6 +337,7 @@ export default {
computed: {
...mapState(useBatchProcessingStore, {
batchRuns: "getBatchRuns",
isBatchJobsLoading: "getIsGettingBatchJobsLoading",
}),
},
methods: {
Expand All @@ -335,14 +349,6 @@ export default {
rerunBatch(bid) {
BatchProcessingService.rerunBatch(bid).then((response) => {
if (response) {
// this.$bvToast.toast(
// "Created a new batch job based on batch #" + bid,
// {
// title: "NEW BATCH JOB STARTED",
// variant: "success",
// noAutoHide: true,
// }
// );
this.snackbarStore.showSnackbar(
"Created a new batch job based on batch #" + bid,
"success",
Expand Down
43 changes: 24 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,6 +355,7 @@ export default {
},
async submit() {
this.batchLoading = true;
const requestTemplate = [
"districts",
"gradDateFrom",
Expand All @@ -378,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 @@ -393,9 +394,13 @@ export default {
5000
);
}
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
Loading

0 comments on commit c2b9b44

Please sign in to comment.