Skip to content

Commit

Permalink
Merge pull request #2094 from bcgov/feature/step3through
Browse files Browse the repository at this point in the history
Moved the school completion check to step 3
  • Loading branch information
arcshiftsolutions authored Dec 18, 2024
2 parents 04a465e + ae14cf8 commit d1c8b3e
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,24 +249,10 @@
class="mr-3 mt-4 mb-3"
icon="mdi-check"
text="Next"
:disabled="disableNextButton() || !canMoveForward()"
:disabled="!canMoveForward()"
:click-action="next"
/>
</v-row>
<v-row
v-if="disableNextButton()"
justify="end"
class="my-0"
>
<p
id="schoolNotSubmittedWarning"
class="form-hint mr-3"
>
{{ monitorSdcSchoolCollectionsResponse?.totalSchools - monitorSdcSchoolCollectionsResponse?.schoolsSubmitted }}
school(s) not
submitted
</p>
</v-row>
<ConfirmationDialog ref="confirmRemovalOfCollection">
<template #message />
</ConfirmationDialog>
Expand Down Expand Up @@ -442,11 +428,6 @@ export default defineComponent({
clearFilters() {
this.filters = {};
},
disableNextButton() {
if(this.districtCollectionObject.collectionTypeCode !== 'JULY') {
return this.monitorSdcSchoolCollectionsResponse?.totalSchools - this.monitorSdcSchoolCollectionsResponse?.schoolsSubmitted !== 0;
}
},
filterForErrorsOrWarnings(school) {
const { issuesFilter = [] } = this.filters || {};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<template>
<div class="border">
<v-row v-if="isLoading">
<v-col>
<Spinner />
</v-col>
</v-row>
<div v-else class="border">
<v-tabs
v-model="tab"
color="#38598a"
Expand Down Expand Up @@ -154,7 +159,7 @@
id="step-3-next-button-school"
class="mr-3 mb-3"
icon="mdi-check"
:disabled="!canMoveForward()"
:disabled="disableNextButton() || !canMoveForward()"
text="Verify all program tabs as correct"
:click-action="next"
/>
Expand All @@ -167,6 +172,20 @@
:click-action="next"
/>
</v-row>
<v-row
v-if="disableNextButton()"
justify="end"
class="my-0"
>
<p
id="schoolNotSubmittedWarning"
class="form-hint mr-3"
>
{{ monitorSdcSchoolCollectionsResponse?.totalSchools - monitorSdcSchoolCollectionsResponse?.schoolsSubmitted }}
school(s) not
submitted
</p>
</v-row>
</template>

<script>
Expand All @@ -192,10 +211,12 @@ import SignOffSignatures from '../../../common/SignOffSignatures.vue';
import StudentDifferencesComponent from './StudentDifferencesComponent.vue';
import {DISTRICT_STUDENT_DIFFERENCES} from '../../../../utils/sdc/DistrictCollectionTableConfiguration';
import {LocalDate, LocalDateTime} from '@js-joda/core';
import Spinner from '../../../common/Spinner.vue';
export default {
name: 'StepThreeVerifyData',
components: {
Spinner,
PrimaryButton,
AllStudentsComponent,
CareerProgramsComponent,
Expand Down Expand Up @@ -236,6 +257,8 @@ export default {
data() {
return {
tab: null,
isLoading: true,
monitorSdcSchoolCollectionsResponse: [],
tabs: SDC_VERIFY_TABS,
type: 'SDC',
sdcDistrictCollectionID: this.$route.params.districtCollectionID,
Expand Down Expand Up @@ -269,11 +292,29 @@ export default {
appStore().getInstitutesData().finally(() => {
this.district = this.activeDistrictsMap.get(this.districtCollectionObject.districtID);
});
this.getSdcSchoolCollections();
},
methods: {
canMoveForward(){
return this.isStepComplete || this.hasEditPermission;
},
async getSdcSchoolCollections(){
this.isLoading = true;
await ApiService.apiAxios.get(`${ApiRoutes.sdc.SDC_DISTRICT_COLLECTION}/${this.$route.params.sdcDistrictCollectionID}/sdcSchoolCollectionMonitoring`, {
}).then(response => {
this.monitorSdcSchoolCollectionsResponse = response?.data;
}).catch(error => {
console.error(error);
setFailureAlert(error?.response?.data?.message ? error?.response?.data?.message : 'An error occurred while trying to get sdc school collections. Please try again later.');
}).finally(() => {
this.isLoading = false;
});
},
disableNextButton() {
if(this.districtCollectionObject.collectionTypeCode !== 'JULY') {
return this.monitorSdcSchoolCollectionsResponse?.totalSchools - this.monitorSdcSchoolCollectionsResponse?.schoolsSubmitted !== 0;
}
},
markStepAsComplete(){
let updateCollection = {
districtCollection: this.districtCollectionObject,
Expand Down

0 comments on commit d1c8b3e

Please sign in to comment.