|
335 | 335 | </v-container>
|
336 | 336 | </template>
|
337 | 337 | <script>
|
338 |
| -import _ from 'lodash'; |
| 338 | +import { isEmpty } from 'lodash'; |
339 | 339 | import { mapState, mapActions } from 'pinia';
|
340 | 340 | import { useAuthStore } from '@/store/auth.js';
|
341 | 341 | import { useAppStore } from '@/store/app.js';
|
@@ -545,39 +545,23 @@ export default {
|
545 | 545 | this.unlockEcewe ||
|
546 | 546 | this.unlockLicenseUpload ||
|
547 | 547 | this.unlockSupportingDocuments ||
|
548 |
| - this.unlockCCFRIList.length > 0 || |
549 |
| - this.unlockNMFList.length > 0 || |
550 |
| - this.unlockRFIList.length > 0 || |
551 |
| - this.unlockAFSList.length > 0 |
| 548 | + !isEmpty(this.unlockCCFRIList) || |
| 549 | + !isEmpty(this.unlockNMFList) || |
| 550 | + !isEmpty(this.unlockRFIList) || |
| 551 | + !isEmpty(this.unlockAFSList) |
552 | 552 | );
|
553 | 553 | },
|
554 | 554 | unlockCCFRIList() {
|
555 |
| - let unlockList = []; |
556 |
| - this.navBarList?.forEach((facility) => { |
557 |
| - if (facility.unlockCcfri) unlockList.push(facility.ccfriApplicationId); |
558 |
| - }); |
559 |
| - return unlockList; |
| 555 | + return this.getUnlockCCFRIList(this.navBarList); |
560 | 556 | },
|
561 | 557 | unlockNMFList() {
|
562 |
| - let unlockList = []; |
563 |
| - this.navBarList?.forEach((facility) => { |
564 |
| - if (facility.unlockNmf) unlockList.push(facility.ccfriApplicationId); |
565 |
| - }); |
566 |
| - return unlockList; |
| 558 | + return this.getUnlockNMFList(this.navBarList); |
567 | 559 | },
|
568 | 560 | unlockRFIList() {
|
569 |
| - let unlockList = []; |
570 |
| - this.navBarList?.forEach((facility) => { |
571 |
| - if (facility.unlockRfi) unlockList.push(facility.ccfriApplicationId); |
572 |
| - }); |
573 |
| - return unlockList; |
| 561 | + return this.getUnlockRFIList(this.navBarList); |
574 | 562 | },
|
575 | 563 | unlockAFSList() {
|
576 |
| - const unlockList = []; |
577 |
| - this.navBarList?.forEach((facility) => { |
578 |
| - if (facility.unlockAfs && facility.enableAfs) unlockList.push(facility.ccfriApplicationId); |
579 |
| - }); |
580 |
| - return unlockList; |
| 564 | + return this.getUnlockAFSList(this.navBarList); |
581 | 565 | },
|
582 | 566 | isCCOFApproved() {
|
583 | 567 | return this.applicationType === 'RENEW' || this.ccofStatus === this.CCOF_STATUS_APPROVED;
|
@@ -764,10 +748,10 @@ export default {
|
764 | 748 | this.goToCCOFFunding(programYearId, facilityList);
|
765 | 749 | else if (application?.unlockEcewe) this.goToECEWE(programYearId);
|
766 | 750 | else if (application?.unlockSupportingDocuments) this.goToSupportingDocumentUpload(programYearId);
|
767 |
| - else if (unlockCCFRIList?.length > 0) this.goToCCFRI(unlockCCFRIList[0], application); |
768 |
| - else if (unlockNMFList?.length > 0) this.goToNMF(unlockNMFList[0], programYearId); |
769 |
| - else if (unlockRFIList?.length > 0) this.goToRFI(unlockRFIList[0], programYearId); |
770 |
| - else if (unlockAFSList?.length > 0) this.goToAFS(unlockAFSList[0], programYearId); |
| 751 | + else if (!isEmpty(unlockCCFRIList)) this.goToCCFRI(unlockCCFRIList[0], application); |
| 752 | + else if (!isEmpty(unlockNMFList)) this.goToNMF(unlockNMFList[0], programYearId); |
| 753 | + else if (!isEmpty(unlockRFIList)) this.goToRFI(unlockRFIList[0], programYearId); |
| 754 | + else if (!isEmpty(unlockAFSList)) this.goToAFS(unlockAFSList[0], programYearId); |
771 | 755 | else if (application?.unlockDeclaration) this.goToSummaryDeclaration(programYearId);
|
772 | 756 | },
|
773 | 757 | actionRequiredFacilityRoute(ccfriApplicationId) {
|
@@ -816,28 +800,28 @@ export default {
|
816 | 800 | return application?.applicationStatus === 'SUBMITTED' && unlockAFSList?.includes(ccfriApplicationId);
|
817 | 801 | },
|
818 | 802 | getUnlockCCFRIList(facilityList) {
|
819 |
| - let unlockList = []; |
| 803 | + const unlockList = []; |
820 | 804 | facilityList?.forEach((facility) => {
|
821 | 805 | if (facility.unlockCcfri) unlockList.push(facility.ccfriApplicationId);
|
822 | 806 | });
|
823 | 807 | return unlockList;
|
824 | 808 | },
|
825 | 809 | getUnlockNMFList(facilityList) {
|
826 |
| - let unlockList = []; |
| 810 | + const unlockList = []; |
827 | 811 | facilityList?.forEach((facility) => {
|
828 | 812 | if (facility.unlockNmf) unlockList.push(facility.ccfriApplicationId);
|
829 | 813 | });
|
830 | 814 | return unlockList;
|
831 | 815 | },
|
832 | 816 | getUnlockRFIList(facilityList) {
|
833 |
| - let unlockList = []; |
| 817 | + const unlockList = []; |
834 | 818 | facilityList?.forEach((facility) => {
|
835 | 819 | if (facility.unlockRfi) unlockList.push(facility.ccfriApplicationId);
|
836 | 820 | });
|
837 | 821 | return unlockList;
|
838 | 822 | },
|
839 | 823 | getUnlockAFSList(facilityList) {
|
840 |
| - let unlockList = []; |
| 824 | + const unlockList = []; |
841 | 825 | facilityList?.forEach((facility) => {
|
842 | 826 | if (facility.unlockAfs && facility.enableAfs) unlockList.push(facility.ccfriApplicationId);
|
843 | 827 | });
|
|
0 commit comments