diff --git a/frontend/src/components/summary/group/ECEWESummary.vue b/frontend/src/components/summary/group/ECEWESummary.vue index 001ce11e..f89e366b 100644 --- a/frontend/src/components/summary/group/ECEWESummary.vue +++ b/frontend/src/components/summary/group/ECEWESummary.vue @@ -3,7 +3,7 @@

Early Childhood Educator-Wage Enhancement (ECE-WE) - mdi-check-circle-outline + mdi-check-circle-outline mdi-alert-circle-outline Your form is missing required information. Click here to view.

@@ -166,7 +166,7 @@ export default { }, getRoutingPath(){ if(this.isChangeRequest){ - return changeUrl(PATHS.ECEWE_ELIGIBILITY, this.changeRecGuid); + return changeUrl(PATHS.ECEWE_ELIGIBILITY, this.$route.params?.changeRecGuid); } else if(this.eceweFacility){ return pcfUrl(PATHS.ECEWE_ELIGIBILITY, this.programYearId); diff --git a/frontend/src/store/modules/navBar.js b/frontend/src/store/modules/navBar.js index 631f37c7..678b00ab 100644 --- a/frontend/src/store/modules/navBar.js +++ b/frontend/src/store/modules/navBar.js @@ -1,4 +1,4 @@ -import {PATHS} from '@/utils/constants'; +import { PATHS, CHANGE_REQUEST_TYPES } from '@/utils/constants'; import {checkSession} from '@/utils/session'; import ApiService from '@/common/apiService'; import {ApiRoutes} from '@/utils/constants'; @@ -270,14 +270,15 @@ export default { }, actions: { // preload change request details needed for the navBar - async loadChangeRequest({state, commit}, changeRequestId) { + async loadChangeRequest({state, commit, dispatch}, changeRequestId) { if (!state.changeRequestMap.get(changeRequestId)) { checkSession(); try { let response = (await ApiService.apiAxios.get(ApiRoutes.CHANGE_REQUEST + '/' + changeRequestId))?.data; - console.log('THIS IS CHANGE REQUEST RESPONSE = '); - console.log(response); commit('addChangeRequestToStore', {changeRequestId: changeRequestId, changeRequestModel: response}); + let changeNotificationAction = response?.changeActions?.find(item => item.changeType === CHANGE_REQUEST_TYPES.PDF_CHANGE); + if (changeNotificationAction) + await dispatch('reportChanges/loadChangeRequestDocs', changeNotificationAction.changeActionId, { root: true }); } catch(e) { console.log(`Failed to get change request with error - ${e}`); throw e; diff --git a/frontend/src/store/modules/summaryDeclaration.js b/frontend/src/store/modules/summaryDeclaration.js index 6a300fdf..bfec2359 100644 --- a/frontend/src/store/modules/summaryDeclaration.js +++ b/frontend/src/store/modules/summaryDeclaration.js @@ -2,7 +2,6 @@ import ApiService from '@/common/apiService'; import {ApiRoutes} from '@/utils/constants'; import {checkSession} from '@/utils/session'; import { CHANGE_REQUEST_TYPES } from '@/utils/constants'; -//import { isChangeRequest } from '@/utils/common'; function parseLicenseCategories(licenseCategories, rootState) { const uniqueLicenseCategories = [...new Set(licenseCategories.map((item) => item.licenseCategoryId))]; @@ -240,7 +239,8 @@ export default { } // end FOR loop summaryModel.allDocuments = null; - await commit('isLoadingComplete', true ); + if (!changeRecGuid) + commit('isLoadingComplete', true ); } catch (error) { console.log(`Failed to load Summary - ${error}`); throw error; @@ -294,6 +294,7 @@ export default { await Promise.all(changeRequestTypes.map(async changeType => { switch (changeType) { case CHANGE_REQUEST_TYPES.NEW_FACILITY: + await dispatch('loadChangeRequestSummaryForAddNewFacility', payload); break; case CHANGE_REQUEST_TYPES.PARENT_FEE_CHANGE: await dispatch('loadChangeRequestSummaryForMtfi', payload); @@ -312,6 +313,24 @@ export default { } }, + async loadChangeRequestSummaryForAddNewFacility({ state, commit }, payload) { + try { + let summaryModel = state.summaryModel; + let changeRequestECEWE = { + optInECEWE: payload?.optInECEWE, + belongsToUnion: payload?.belongsToUnion, + applicableSector: payload?.applicableSector, + fundingModel: payload?.fundingModel, + confirmation: payload?.confirmation, + }; + summaryModel.ecewe = changeRequestECEWE; + commit('summaryModel', summaryModel); + } catch (error) { + console.log(`Failed to load Summary for change request Add New Facility - ${error}`); + throw error; + } + }, + // Assumption: a change request can only have 1 MTFI change action async loadChangeRequestSummaryForMtfi({ state, commit, rootState }, payload) { try {