diff --git a/frontend/src/components/SummaryDeclaration.vue b/frontend/src/components/SummaryDeclaration.vue index 897c066c..bc6e785c 100644 --- a/frontend/src/components/SummaryDeclaration.vue +++ b/frontend/src/components/SummaryDeclaration.vue @@ -441,9 +441,11 @@ import { useAppStore } from '@/store/app.js'; import { useOrganizationStore } from '@/store/ccof/organization.js'; import { useSummaryDeclarationStore } from '@/store/summaryDeclaration.js'; import { useApplicationStore } from '@/store/application.js'; +import { useCcfriAppStore } from '@/store/ccfriApp.js'; import { useReportChangesStore } from '@/store/reportChanges.js'; import { + AFS_STATUSES, PATHS, CHANGE_REQUEST_TYPES, PROGRAM_YEAR_LANGUAGE_TYPES, @@ -529,6 +531,7 @@ export default { 'isEceweComplete', 'applicationMap', ]), + ...mapState(useCcfriAppStore, ['approvableFeeSchedules']), ...mapState(useReportChangesStore, ['changeRequestStore', 'isCREceweComplete', 'isCRLicenseComplete']), languageYearLabel() { return this.getLanguageYearLabel; @@ -809,14 +812,22 @@ export default { unlockCcfri: facility.unlockCcfri, unlockNmf: facility.unlockNmf, unlockRfi: facility.unlockRfi, + unlockAfs: facility.unlockAfs, }; // Create payload with only unlock propteries set to 1. - unlockPayload = Object.fromEntries(Object.entries(unlockPayload).filter(([_, v]) => v == 1)); // Update payload unlock properties from 1 to 0. Object.keys(unlockPayload).forEach((key) => { unlockPayload[key] = '0'; }); + + const afs = this.approvableFeeSchedules?.find( + (item) => item.ccfriApplicationId === facility.ccfriApplicationId, + ); + if (afs?.afsStatus === AFS_STATUSES.UPLOAD_DOCUMENTS) { + unlockPayload.enableAfs = '0'; + } + if (Object.keys(unlockPayload).length > 0) { ccrfiRelockPayload.push({ ...applicationIdPayload, ...unlockPayload }); } diff --git a/frontend/src/components/ccfriApplication/AFS/AfsDecisionCard.vue b/frontend/src/components/ccfriApplication/AFS/AfsDecisionCard.vue new file mode 100644 index 00000000..5bd0df51 --- /dev/null +++ b/frontend/src/components/ccfriApplication/AFS/AfsDecisionCard.vue @@ -0,0 +1,63 @@ + + + + diff --git a/frontend/src/components/ccfriApplication/AFS/ApprovableFeeSchedule.vue b/frontend/src/components/ccfriApplication/AFS/ApprovableFeeSchedule.vue index 8068ef81..e5f2ee3b 100644 --- a/frontend/src/components/ccfriApplication/AFS/ApprovableFeeSchedule.vue +++ b/frontend/src/components/ccfriApplication/AFS/ApprovableFeeSchedule.vue @@ -67,29 +67,13 @@ - -
- Please select one of the following options regarding the approvable fee schedule: -
- - -
- After submission please wait to receive notification confirming your approval to participate in - CCFRI. -
- - -
- After submission please wait to receive confirmation from the ministry on the results of your CCFRI - application. -
-
-
+ el.facilityId === this.facilityId) - : this.navBarList?.find((el) => el.ccfriApplicationId === this.$route.params.urlGuid); + return this.navBarList?.find((el) => el.ccfriApplicationId === this.$route.params.urlGuid); }, filteredUploadedDocuments() { return this.applicationUploadedDocuments?.filter( @@ -193,7 +163,7 @@ export default { }, // Note: CCFRI-3752 - AFS for change request is not in scope at this time. isReadOnly() { - return this.readonly || this.isLoading || (this.isApplicationSubmitted && !this.currentFacility?.unlockAfs); + return this.isLoading || (this.isApplicationSubmitted && !this.currentFacility?.unlockAfs); }, isSupportingDocumentsUploaded() { return this.filteredUploadedDocuments?.length + this.documentsToUpload?.length > 0; @@ -214,6 +184,7 @@ export default { '$route.params.urlGuid': { handler() { this.reloadAfs(); + this.$refs.form?.validate(); }, }, }, @@ -230,15 +201,14 @@ export default { ...mapActions(useSupportingDocumentUploadStore, ['saveUploadedDocuments']), isEmpty, reloadAfs() { - this.afs = this.ccfriApplicationId - ? this.approvableFeeSchedules?.find((item) => item.ccfriApplicationId === this.ccfriApplicationId) - : this.approvableFeeSchedules?.find((item) => item.ccfriApplicationId === this.$route.params.urlGuid); + this.afs = this.approvableFeeSchedules?.find((item) => item.ccfriApplicationId === this.$route.params.urlGuid); }, next() { this.$router.push(this.nextPath); }, validateForm() { this.$refs.form?.validate(); + this.showErrorMessage = true; }, back() { this.$router.push(this.previousPath); @@ -251,9 +221,11 @@ export default { const payload = { afsStatus: this.afs?.afsStatus, }; - await this.updateApplicationCCFRI(this.$route.params.urlGuid, payload); - await this.processDocumentsToUpload(); - await DocumentService.deleteDocuments(this.uploadedDocumentsToDelete); + await Promise.all([ + this.updateApplicationCCFRI(this.$route.params.urlGuid, payload), + this.processDocumentsToUpload(), + DocumentService.deleteDocuments(this.uploadedDocumentsToDelete), + ]); await this.getApplicationUploadedDocuments(); this.setNavBarAfsComplete({ ccfriId: this.$route.params.urlGuid, complete: this.isFormComplete }); if (showMessage) { diff --git a/frontend/src/components/summary/group/AFSSummary.vue b/frontend/src/components/summary/group/AFSSummary.vue index 92b49377..ab2e4533 100644 --- a/frontend/src/components/summary/group/AFSSummary.vue +++ b/frontend/src/components/summary/group/AFSSummary.vue @@ -1,37 +1,62 @@