Skip to content

Commit

Permalink
Merge pull request #1848 from bcgov/fix/summerColl
Browse files Browse the repository at this point in the history
UI: Status & stepper fixes for July collection
  • Loading branch information
arcshiftsolutions authored Aug 16, 2024
2 parents 4eb91b6 + 779bbdd commit 5ea9aa4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
35 changes: 17 additions & 18 deletions frontend/src/components/sdcCollection/SDCCollectionSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,19 @@ export default {
},
totalStepsInCollection() {
if(this.isSchoolCollection) {
if(this.sdcDistrictCollectionID){
return this.currentCollectionTypeCode === 'July' ? SDC_STEPS_SUMMER_SCHOOL.length : SDC_STEPS_SCHOOL.length;
} else {
return this.currentCollectionTypeCode === 'July' ? SDC_STEPS_SUMMER_INDP_SCHOOL.length : SDC_STEPS_INDP_SCHOOL.length;
}
return this.SDC_STEPS_SCHOOL_CALC.length
} else {
return this.currentCollectionTypeCode === 'July' ? SDC_STEPS_SUMMER_DISTRICT.length : SDC_STEPS_DISTRICT.length;
return this.SDC_STEPS_DISTRICT_CALC.length;
}
},
SDC_STEPS_DISTRICT_CALC() {
return this.isSummerCollection ? SDC_STEPS_SUMMER_DISTRICT : SDC_STEPS_DISTRICT;
},
SDC_STEPS_SCHOOL_CALC() {
if(this.sdcDistrictCollectionID){
return this.isSummerCollection ? SDC_STEPS_SUMMER_SCHOOL : SDC_STEPS_SCHOOL;
} else {
return this.isSummerCollection ? SDC_STEPS_SUMMER_INDP_SCHOOL : SDC_STEPS_INDP_SCHOOL;
}
},
historicCollectionUrl() {
Expand Down Expand Up @@ -300,6 +306,7 @@ export default {
ApiService.apiAxios.get(url).then(response => {
if(response.data) {
this.setCurrentCollectionTypeCode(capitalize(response.data.collectionTypeCode));
this.isSummerCollection = this.currentCollectionTypeCode === 'July';
this.submissionDate = response.data.submissionDueDate;
let instituteStatusCode;
Expand All @@ -324,24 +331,16 @@ export default {
},
getIndexOfSDCCollectionByStatusCode(statusCode) {
if(this.isSchoolCollection) {
if (this.sdcDistrictCollectionID != null){
return SDC_STEPS_SCHOOL.find(step => step.sdcSchoolCollectionStatusCode.includes(statusCode))?.index;
} else {
return SDC_STEPS_INDP_SCHOOL.find(step => step.sdcSchoolCollectionStatusCode.includes(statusCode))?.index;
}
return this.SDC_STEPS_SCHOOL_CALC.find(step => step.sdcSchoolCollectionStatusCode.includes(statusCode))?.index;
} else {
return SDC_STEPS_DISTRICT.find(step => step.sdcDistrictCollectionStatusCode.includes(statusCode))?.index;
return this.SDC_STEPS_DISTRICT_CALC.find(step => step.sdcDistrictCollectionStatusCode.includes(statusCode))?.index;
}
},
getStepOfSDCCollectionByStatusCode(statusCode) {
if(this.isSchoolCollection) {
if(this.sdcDistrictCollectionID != null){
return SDC_STEPS_SCHOOL.find(step => step.sdcSchoolCollectionStatusCode.includes(statusCode))?.step;
} else {
return SDC_STEPS_INDP_SCHOOL.find(step => step.sdcSchoolCollectionStatusCode.includes(statusCode))?.step;
}
return this.SDC_STEPS_SCHOOL_CALC.find(step => step.sdcSchoolCollectionStatusCode.includes(statusCode))?.step;
} else {
return SDC_STEPS_DISTRICT.find(step => step.sdcDistrictCollectionStatusCode.includes(statusCode))?.step;
return this.SDC_STEPS_DISTRICT_CALC.find(step => step.sdcDistrictCollectionStatusCode.includes(statusCode))?.step;
}
},
loadItems({ page, itemsPerPage }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,9 @@ export default defineComponent({
await sdcCollectionStore().getDistrictCollection(this.$route.params.sdcDistrictCollectionID)
.then(async () => {
this.districtCollectionObject = this.districtCollection;
this.isSummerCollection = this.districtCollectionObject?.collectionTypeCode === 'JULY';
this.districtID = this.districtCollection?.districtID;
this.currentStep = this.getStepOfSDCCollectionByStatusCode(this.districtCollection?.sdcDistrictCollectionStatusCode);
this.isSummerCollection = this.districtCollectionObject?.collectionTypeCode === 'JULY';
await this.getActiveSdcDistrictCollection();
})
.finally(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ export default {
.catch(error => {
console.error(error);
setFailureAlert(error?.response?.data?.message ? error?.response?.data?.message : 'An error occurred while updating status. Please try again later.');
}).finally(() => {
this.$router.go(this.$router.currentRoute);
});
},
next() {
Expand Down

0 comments on commit 5ea9aa4

Please sign in to comment.