Skip to content

Commit 5ea9aa4

Browse files
Merge pull request #1848 from bcgov/fix/summerColl
UI: Status & stepper fixes for July collection
2 parents 4eb91b6 + 779bbdd commit 5ea9aa4

File tree

3 files changed

+18
-21
lines changed

3 files changed

+18
-21
lines changed

frontend/src/components/sdcCollection/SDCCollectionSummary.vue

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,19 @@ export default {
227227
},
228228
totalStepsInCollection() {
229229
if(this.isSchoolCollection) {
230-
if(this.sdcDistrictCollectionID){
231-
return this.currentCollectionTypeCode === 'July' ? SDC_STEPS_SUMMER_SCHOOL.length : SDC_STEPS_SCHOOL.length;
232-
} else {
233-
return this.currentCollectionTypeCode === 'July' ? SDC_STEPS_SUMMER_INDP_SCHOOL.length : SDC_STEPS_INDP_SCHOOL.length;
234-
}
230+
return this.SDC_STEPS_SCHOOL_CALC.length
235231
} else {
236-
return this.currentCollectionTypeCode === 'July' ? SDC_STEPS_SUMMER_DISTRICT.length : SDC_STEPS_DISTRICT.length;
232+
return this.SDC_STEPS_DISTRICT_CALC.length;
233+
}
234+
},
235+
SDC_STEPS_DISTRICT_CALC() {
236+
return this.isSummerCollection ? SDC_STEPS_SUMMER_DISTRICT : SDC_STEPS_DISTRICT;
237+
},
238+
SDC_STEPS_SCHOOL_CALC() {
239+
if(this.sdcDistrictCollectionID){
240+
return this.isSummerCollection ? SDC_STEPS_SUMMER_SCHOOL : SDC_STEPS_SCHOOL;
241+
} else {
242+
return this.isSummerCollection ? SDC_STEPS_SUMMER_INDP_SCHOOL : SDC_STEPS_INDP_SCHOOL;
237243
}
238244
},
239245
historicCollectionUrl() {
@@ -300,6 +306,7 @@ export default {
300306
ApiService.apiAxios.get(url).then(response => {
301307
if(response.data) {
302308
this.setCurrentCollectionTypeCode(capitalize(response.data.collectionTypeCode));
309+
this.isSummerCollection = this.currentCollectionTypeCode === 'July';
303310
this.submissionDate = response.data.submissionDueDate;
304311
305312
let instituteStatusCode;
@@ -324,24 +331,16 @@ export default {
324331
},
325332
getIndexOfSDCCollectionByStatusCode(statusCode) {
326333
if(this.isSchoolCollection) {
327-
if (this.sdcDistrictCollectionID != null){
328-
return SDC_STEPS_SCHOOL.find(step => step.sdcSchoolCollectionStatusCode.includes(statusCode))?.index;
329-
} else {
330-
return SDC_STEPS_INDP_SCHOOL.find(step => step.sdcSchoolCollectionStatusCode.includes(statusCode))?.index;
331-
}
334+
return this.SDC_STEPS_SCHOOL_CALC.find(step => step.sdcSchoolCollectionStatusCode.includes(statusCode))?.index;
332335
} else {
333-
return SDC_STEPS_DISTRICT.find(step => step.sdcDistrictCollectionStatusCode.includes(statusCode))?.index;
336+
return this.SDC_STEPS_DISTRICT_CALC.find(step => step.sdcDistrictCollectionStatusCode.includes(statusCode))?.index;
334337
}
335338
},
336339
getStepOfSDCCollectionByStatusCode(statusCode) {
337340
if(this.isSchoolCollection) {
338-
if(this.sdcDistrictCollectionID != null){
339-
return SDC_STEPS_SCHOOL.find(step => step.sdcSchoolCollectionStatusCode.includes(statusCode))?.step;
340-
} else {
341-
return SDC_STEPS_INDP_SCHOOL.find(step => step.sdcSchoolCollectionStatusCode.includes(statusCode))?.step;
342-
}
341+
return this.SDC_STEPS_SCHOOL_CALC.find(step => step.sdcSchoolCollectionStatusCode.includes(statusCode))?.step;
343342
} else {
344-
return SDC_STEPS_DISTRICT.find(step => step.sdcDistrictCollectionStatusCode.includes(statusCode))?.step;
343+
return this.SDC_STEPS_DISTRICT_CALC.find(step => step.sdcDistrictCollectionStatusCode.includes(statusCode))?.step;
345344
}
346345
},
347346
loadItems({ page, itemsPerPage }) {

frontend/src/components/sdcCollection/sdcDistrictCollection/SDCDistrictCollectionView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,9 @@ export default defineComponent({
365365
await sdcCollectionStore().getDistrictCollection(this.$route.params.sdcDistrictCollectionID)
366366
.then(async () => {
367367
this.districtCollectionObject = this.districtCollection;
368+
this.isSummerCollection = this.districtCollectionObject?.collectionTypeCode === 'JULY';
368369
this.districtID = this.districtCollection?.districtID;
369370
this.currentStep = this.getStepOfSDCCollectionByStatusCode(this.districtCollection?.sdcDistrictCollectionStatusCode);
370-
this.isSummerCollection = this.districtCollectionObject?.collectionTypeCode === 'JULY';
371371
await this.getActiveSdcDistrictCollection();
372372
})
373373
.finally(() => {

frontend/src/components/sdcCollection/sdcDistrictCollection/StepFiveSubmitToMinistry.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,6 @@ export default {
152152
.catch(error => {
153153
console.error(error);
154154
setFailureAlert(error?.response?.data?.message ? error?.response?.data?.message : 'An error occurred while updating status. Please try again later.');
155-
}).finally(() => {
156-
this.$router.go(this.$router.currentRoute);
157155
});
158156
},
159157
next() {

0 commit comments

Comments
 (0)