Skip to content

Commit

Permalink
Merge pull request #2110 from bcgov/feature/EDX-3085-3087
Browse files Browse the repository at this point in the history
Changes to address 3085 & 3087.
  • Loading branch information
eckermania authored Dec 27, 2024
2 parents fbb9108 + 94b1a83 commit 4b7ef68
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 12 deletions.
3 changes: 2 additions & 1 deletion frontend/src/components/common/SignOffSignatures.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default {
required: true
}
},
emits: [],
emits: ['refresh-collection-store'],
data() {
return {
isLoading: true,
Expand Down Expand Up @@ -176,6 +176,7 @@ export default {
setFailureAlert(error?.response?.data?.message ? error?.response?.data?.message : 'An error occurred while submitting signature for sign-off. Please try again later.');
}).finally(async () => {
await this.refreshDistrictCollection();
this.$emit('refresh-collection-store');
});
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,49 @@
<template>
<div :class="isCollectionActive ? 'border' : ''">
<div>
<div v-if="isLoading">
<v-row>
<v-col class="d-flex justify-center">
<v-progress-circular
class="mt-16"
:size="70"
:width="7"
color="primary"
indeterminate
:active="isLoading"
/>
</v-col>
</v-row>
</div>
<div v-else>
<v-row
v-if="isCollectionActive"
class="mb-3"
>
<v-col>
<v-col v-if="isCollectionSignedOff">
<v-alert
id="collection-submission"
class="justify-start"
type="success"
variant="tonal"
text="Thank you for completing the 1701 collection process for your district."
/>
</v-col>
<v-col v-else>
<v-alert
id="collection-submission"
class="justify-start"
type="info"
variant="tonal"
text="Thank you for completing the 1701 collection process for your district. It is now ready for your final review and sign-off. Please use the Signatures tab for signing off."
/>
</v-col>
</v-row>
</v-row>
<StepThreeVerifyData
:district-collection-object="districtCollectionObject"
:is-final-sign-off="true"
:is-collection-active="isCollectionActive"
:show-final-submission-tabs="true"
@refresh-collection-store="refreshStore"
/>
</div>
</div>
Expand All @@ -29,6 +53,8 @@
import alertMixin from '../../../mixins/alertMixin';
import StepThreeVerifyData from './stepThreeVerifyData/StepThreeVerifyData.vue';
import {sdcCollectionStore} from '../../../store/modules/sdcCollection';
import {mapState} from 'pinia';
export default {
name: 'StepSevenFinalSubmission',
Expand All @@ -54,19 +80,36 @@ export default {
emits: [],
data() {
return {
isCollectionSignedOff: false,
signOffStatus: 'COMPLETED',
isLoading: false,
};
},
computed: {
},
async mounted() {
...mapState(sdcCollectionStore, ['districtCollection']),
},
mounted() {
this.isCollectionSignedOff = this.signOffStatus === this.districtCollectionObject.sdcDistrictCollectionStatusCode;
},
created() {
},
methods: {
methods: {
refreshStore() {
this.refreshDistrictCollection();
},
async refreshDistrictCollection() {
this.isLoading = !this.isLoading;
await sdcCollectionStore().getDistrictCollection(this.districtCollectionObject.sdcDistrictCollectionID).then(async () => {
this.isCollectionSignedOff = this.signOffStatus === this.districtCollection.sdcDistrictCollectionStatusCode;
this.isLoading = !this.isLoading;
}).catch(e => {
console.error(e);
}).finally(() => {
this.isLoading = false;
});
}
}
};
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
:district="district"
:district-collection-object="districtCollectionObject"
:is-collection-active="isCollectionActive"
@refresh-collection-store="refreshStore"
/>
</v-window-item>
</v-window>
Expand Down Expand Up @@ -253,7 +254,7 @@ export default {
default: false
}
},
emits: ['next', 'previous'],
emits: ['next', 'previous', 'refresh-collection-store'],
data() {
return {
tab: null,
Expand Down Expand Up @@ -336,6 +337,9 @@ export default {
this.markStepAsComplete();
}
},
refreshStore() {
this.$emit('refresh-collection-store');
},
getTabLabel: getSdcVerifyTabLabel
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,13 @@
</v-window-item>
</v-window>
</div>

<v-row justify="end">
<PrimaryButton
id="step-4-next-button-district"
class="mr-3 mb-3"
:disabled="disableNextButton() || apiError || !hasEditPermission()"
icon="mdi-check"
text="Verify as Correct"
:text=" isIndependentSchool() ? 'Next': 'Verify as Correct' "
:click-action="next"
/>
</v-row>
Expand Down Expand Up @@ -113,6 +112,8 @@ import DuplicateTab from '../../common/DuplicateTab.vue';
import {PERMISSION} from '../../../utils/constants/Permission';
import {mapState} from 'pinia';
import {authStore} from '../../../store/modules/auth';
import { appStore } from '../../../store/modules/app';
import {SCHOOL_CATEGORY_CODES} from '../../../utils/constants/SchoolCategoryCodeTypes';
export default defineComponent({
name: 'ProvincialDuplicatesStep',
Expand All @@ -136,6 +137,8 @@ export default defineComponent({
emits: ['next', 'refresh-store'],
data() {
return {
independentArray: [SCHOOL_CATEGORY_CODES.INDEPEND, SCHOOL_CATEGORY_CODES.INDP_FNS],
school: {},
apiError: false,
editOptionsOpen: [],
nonAllowableDuplicates: [],
Expand All @@ -153,11 +156,15 @@ export default defineComponent({
},
computed: {
...mapState(authStore, ['userInfo']),
...mapState(appStore, ['activeSchoolsMap']),
PROVINCIAL_DUPLICATES() {
return SCHOOL_PROVINCIAL_DUPLICATES;
}
},
async created() {
appStore().getInstitutesData().finally(() => {
this.school = this.activeSchoolsMap.get(this.schoolCollectionObject.schoolID);
});
sdcCollectionStore().getCodes().then(() => {
this.getProvincialDuplicates();
});
Expand Down Expand Up @@ -199,6 +206,12 @@ export default defineComponent({
next() {
this.markSchoolStepAsComplete();
},
isIndependentSchool() {
if(this.independentArray.includes(this.school.schoolCategoryCode)) {
return true;
}
return false;
}
}
});
</script>
Expand Down

0 comments on commit 4b7ef68

Please sign in to comment.