Skip to content

Commit

Permalink
Merge pull request #411 from bcgov/report-changes-Viet
Browse files Browse the repository at this point in the history
Report changes Viet - Add new facility change request summary: load ECEWE eligibility from change request instead of PCF, add change notification form + refactor and clean up redundant change request code.
  • Loading branch information
roblo-cgi authored Aug 24, 2023
2 parents c7ef69f + 462ec99 commit 876f2e8
Show file tree
Hide file tree
Showing 16 changed files with 177 additions and 607 deletions.
29 changes: 18 additions & 11 deletions frontend/src/components/SummaryDeclaration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</v-row>
<v-row v-if="!this.isSummaryComplete && !this.isProcessing" justify="center">
<v-card class="py-0 px-3 mx-0 mt-10 rounded-lg col-11" elevation="4">
<v-container class="pa-0">
<v-container class="pa-0 col-12">
<v-row>
<v-col class="pa-0">
<v-card-title class="rounded-t-lg pt-3 pb-3 noticeAlert">
Expand Down Expand Up @@ -134,14 +134,20 @@
</v-expansion-panel>
</div>
</div>
<div v-if="!this.isRenewal">
<div v-if="!this.isRenewal" class="mt-10">
<v-expansion-panel variant="accordion">
<ECEWESummary @isSummaryValid="isFormComplete" :ecewe="this.summaryModel.ecewe"
:ecewe-facility="null" :isProcessing="isProcessing"
:programYearId="summaryModel?.application?.programYearId"
></ECEWESummary>
</v-expansion-panel>
</div>
<v-expansion-panel variant="accordion" v-if="hasChangeNotificationFormDocuments" class="mt-10">
<ChangeNotificationFormSummary
@isSummaryValid="isFormComplete"
:changeNotificationFormDocuments="summaryModel?.changeNotificationFormDocuments">
</ChangeNotificationFormSummary>
</v-expansion-panel>
</v-row>
</v-expansion-panels>
Expand Down Expand Up @@ -327,7 +333,7 @@
</template>
<script>
import {PATHS} from '@/utils/constants';
import { PATHS, CHANGE_REQUEST_TYPES } from '@/utils/constants';
import {mapGetters, mapActions, mapState, mapMutations} from 'vuex';
import alertMixin from '@/mixins/alertMixin';
import NavButton from '@/components/util/NavButton';
Expand All @@ -340,6 +346,7 @@ import NMFSummary from '@/components/summary/group/NMFSummary';
import OrganizationSummary from '@/components/summary/group/OrganizationSummary';
import UploadedDocumentsSummary from '@/components/summary/group/UploadedDocumentsSummary';
import CCOFSummaryFamily from './summary/group/CCOFSummaryFamily.vue';
import ChangeNotificationFormSummary from '@/components/summary/changeRequest/ChangeNotificationFormSummary';
let model = {
agreeConsentCertify: undefined,
Expand All @@ -357,6 +364,7 @@ export default {
CCFRISummary,
ECEWESummary,
CCOFSummaryFamily,
ChangeNotificationFormSummary,
NavButton
},
mixins: [alertMixin],
Expand Down Expand Up @@ -400,7 +408,9 @@ export default {
return facility.facilityInfo.facilityAccountNumber;
});
},
hasChangeNotificationFormDocuments() {
return this.summaryModel?.changeRequestTypes?.includes(CHANGE_REQUEST_TYPES.PDF_CHANGE);
}
},
data() {
return {
Expand All @@ -417,7 +427,7 @@ export default {
};
},
methods: {
...mapActions('summaryDeclaration', ['loadDeclaration', 'loadChangeRequestDeclaration' , 'updateDeclaration', 'loadSummary', 'updateApplicationStatus']),
...mapActions('summaryDeclaration', ['loadDeclaration', 'loadChangeRequestDeclaration' , 'updateDeclaration', 'loadSummary', 'updateApplicationStatus', 'loadChangeRequestSummaryDeclaration']),
...mapMutations('application',['setIsEceweComplete', 'setIsLicenseUploadComplete']),
...mapMutations('navBar', ['setNavBarFacilityComplete', 'setNavBarFundingComplete', 'forceNavBarRefresh',]),
...mapMutations('organization', ['setIsOrganizationComplete']),
Expand All @@ -435,7 +445,7 @@ export default {
this.isLoading = true;
try {
if(this.isChangeRequest){
await this.loadChangeRequestDeclaration(this.$route.params?.changeRecGuid);
await this.loadChangeRequestSummaryDeclaration(this.$route.params?.changeRecGuid);
}
else{
await this.loadDeclaration();
Expand Down Expand Up @@ -664,11 +674,8 @@ export default {
async mounted() {
this.isProcessing = true;
await this.loadSummary(this.$route.params?.changeRecGuid);
if (!this.unlockDeclaration) {
await this.loadData();
this.model = this.$store.state.summaryDeclaration.model ?? model;
}
await this.loadData();
this.model = this.$store.state.summaryDeclaration.model ?? model;
if (this.isRenewal || (this.unlockDeclaration && this.organizationAccountNumber)) {
// Establish the server time
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/SupportingDocumentUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ export default {
return this.isValidForm &&( (newFilesAdded.length > 0) || this.uploadedDocuments?.deletedItems?.length > 0);
},
isNextEnabled() {
if (this.isChangeRequest)
return this.isValidForm;
return this.isValidForm && this.canSubmit;
},
filteredNavBarList() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@

<script>
import { mapState, mapMutations, mapActions, mapGetters } from 'vuex';
import { PATHS, changeUrlGuid } from '@/utils/constants';
import { PATHS, changeUrl } from '@/utils/constants';
import alertMixin from '@/mixins/alertMixin';
import NavButton from '@/components/util/NavButton';
import ChangeFileUpload from './ChangeFileUpload.vue';
Expand Down Expand Up @@ -146,7 +146,7 @@ export default {
},
},
methods: {
...mapMutations('app', ['setCcfriOptInComplete', 'forceNavBarRefresh']),
...mapMutations('app', ['setCcfriOptInComplete']),
...mapMutations('navBar', ['forceNavBarRefresh']),
...mapActions('reportChanges', ['createChangeRequest','getChangeRequestList', 'loadChangeRequestDocs', 'saveUploadedDocuments', 'getChangeRequest']),
...mapMutations('reportChanges', ['setUploadedDocument']),
Expand All @@ -165,6 +165,7 @@ export default {
await this.$refs.childRef.save(false);
await this.$refs.childRef2.save(false);
await this.loadChangeRequestDocs(this.$route.params.urlGuid);
this.forceNavBarRefresh();
if (showNotification) {
this.setSuccessAlert('Success! Request for Information has been saved.');
}
Expand All @@ -179,7 +180,7 @@ export default {
if (this.changeType === CHANGE_TYPES.NEW_FACILITY) {
this.$router.push(this.nextPath);
} else {
this.$router.push(changeUrlGuid(PATHS.CHANGE_NOTIFICATION_DECLARATION, this.$route.params?.changeRecGuid, this.$route.params?.urlGuid, CHANGE_TYPES.CHANGE_NOTIFICATION));
this.$router.push(changeUrl(PATHS.SUMMARY_DECLARATION, this.$route.params?.changeRecGuid, CHANGE_TYPES.CHANGE_NOTIFICATION));
}
},
async validateForm() {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/requestChanges/ReportChanges.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@

<script>
import { mapState, mapMutations, mapActions } from 'vuex';
import { PATHS, CHANGE_TYPES, changeUrlGuid , changeUrl} from '@/utils/constants';
import { PATHS, CHANGE_TYPES, changeUrlGuid , changeUrl } from '@/utils/constants';
import alertMixin from '@/mixins/alertMixin';
import SmallCard from '../guiComponents/SmallCard.vue';
import NavButton from '../util/NavButton.vue';
Expand Down Expand Up @@ -433,7 +433,7 @@ export default {
if (currentCR?.unlockChangeRequest || currentCR?.unlockOtherChangesDocuments) {
this.goToChangeForm(changeActionId, changeRequestId);
} else if (currentCR?.unlockDeclaration) {
this.$router.push(changeUrlGuid(PATHS.CHANGE_NOTIFICATION_DECLARATION, changeRequestId, changeActionId, CHANGE_TYPES.CHANGE_NOTIFICATION));
this.$router.push(changeUrl(PATHS.SUMMARY_DECLARATION, changeRequestId, CHANGE_TYPES.CHANGE_NOTIFICATION));
} else {
this.goToChangeForm(changeActionId, changeRequestId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<v-container fluid>
<v-form ref="form" v-model="isValidForm">
<v-row class="d-flex justify-center">
<span class="text-h5">Child Care Operating Funding Program - Request a Parent Fee Increase</span>
<span class="text-h5">Child Care Operating Funding Program{{ pageTitle }}</span>
</v-row>
<v-row class="d-flex justify-center">
<h2>Summary and Declaration</h2>
Expand Down Expand Up @@ -56,11 +56,12 @@
<v-row v-else no-gutters class="d-flex flex-column mb-2">

<!-- Change Notification Form Summary -->
<div class="d-flex flex-column mb-2 mt-10" v-if="hasChangeRequestType('PDF_CHANGE')">
<div>
THIS IS CHANGE NOTIFICATION FORM
</div>
</div>
<v-expansion-panel variant="accordion" v-if="hasChangeRequestType('PDF_CHANGE')" class="mb-8 mt-8">
<ChangeNotificationFormSummary
@isSummaryValid="isFormComplete"
:changeNotificationFormDocuments="summaryModel?.changeNotificationFormDocuments">
</ChangeNotificationFormSummary>
</v-expansion-panel>
<!-- MTFI Summary -->
<v-row no-gutters class="d-flex flex-column mb-2 mt-10" v-if="hasChangeRequestType('MTFI')">
Expand Down Expand Up @@ -288,17 +289,19 @@
</template>
<script>
import { PATHS, CHANGE_REQUEST_TYPES } from '@/utils/constants';
import {mapGetters, mapActions, mapState, mapMutations} from 'vuex';
import { PATHS, CHANGE_REQUEST_TYPES, CHANGE_TYPES, changeUrlGuid } from '@/utils/constants';
import { mapGetters, mapActions, mapState } from 'vuex';
import alertMixin from '@/mixins/alertMixin';
import NavButton from '@/components/util/NavButton';
import MTFISummary from '@/components/summary/changeRequest/MTFISummary';
import RFISummary from '@/components/summary/group/RFISummary';
import ChangeNotificationFormSummary from '@/components/summary/changeRequest/ChangeNotificationFormSummary';
export default {
components: {
MTFISummary,
ChangeNotificationFormSummary,
RFISummary,
NavButton
},
Expand Down Expand Up @@ -331,6 +334,8 @@ export default {
computed: {
...mapGetters('auth', ['userInfo', 'isMinistryUser']),
...mapGetters('navBar', ['previousPath']),
...mapGetters('reportChanges', ['getChangeNotificationActionId']),
...mapState('navBar', ['changeType']),
...mapState('organization', ['organizationAccountNumber']),
...mapState('summaryDeclaration', ['isSummaryLoading', 'isMainLoading', 'isLoadingComplete']),
...mapState('summaryDeclaration', ['summaryModel', 'model']),
Expand Down Expand Up @@ -362,6 +367,13 @@ export default {
},
isDeclarationBDisplayed() {
return (this.model.enabledDeclarationB || this.hasChangeRequestType('MTFI'));
},
pageTitle() {
let changeRequestTypes = this.summaryModel?.changeRequestTypes;
if (changeRequestTypes?.length === 1) {
return changeRequestTypes?.includes(CHANGE_REQUEST_TYPES.PARENT_FEE_CHANGE) ? ' - Request a Parent Fee Increase' : '';
}
return ''
}
},
methods: {
Expand All @@ -388,6 +400,9 @@ export default {
}
},
previous() {
if (this.changeType === CHANGE_TYPES.CHANGE_NOTIFICATION) {
this.$router.push(changeUrlGuid(PATHS.CHANGE_NOTIFICATION_FORM, this.$route.params?.changeRecGuid, this.getChangeNotificationActionId, CHANGE_TYPES.CHANGE_NOTIFICATION));
}
this.$router.push(this.previousPath);
},
async isFormComplete(formObj, isComplete) {
Expand Down
Loading

0 comments on commit 876f2e8

Please sign in to comment.