Skip to content

Commit

Permalink
Summary Dec Add new Facility - fix bug ECEWE eligibility to load from…
Browse files Browse the repository at this point in the history
… Change Request instead of main PCF
  • Loading branch information
vietle-cgi committed Aug 24, 2023
1 parent d303c73 commit 3a8b56a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/summary/group/ECEWESummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<v-form ref="eceweSummaryForm" v-model="isValidForm">
<v-expansion-panel-header>
<h4 style="color:#003466;">Early Childhood Educator-Wage Enhancement (ECE-WE)
<v-icon v-if="isValidForm" color="green" large>mdi-check-circle-outline</v-icon>
<v-icon v-if="isValidForm && !this.isProcessing" color="green" large>mdi-check-circle-outline</v-icon>
<v-icon v-if="!isValidForm && !this.isProcessing" color="#ff5252" large>mdi-alert-circle-outline</v-icon>
<span v-if="!isValidForm && !this.isProcessing" style="color:#ff5252;">Your form is missing required information. Click here to view.</span>
</h4>
Expand Down Expand Up @@ -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);
Expand Down
9 changes: 5 additions & 4 deletions frontend/src/store/modules/navBar.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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;
Expand Down
23 changes: 21 additions & 2 deletions frontend/src/store/modules/summaryDeclaration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))];
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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 {
Expand Down

0 comments on commit 3a8b56a

Please sign in to comment.