From 67a5e1771cfa7e7b7b7c9ea58e26e88d7b396184 Mon Sep 17 00:00:00 2001 From: Severin Beauvais Date: Tue, 23 Jan 2024 14:15:16 -0800 Subject: [PATCH] - app version = 5.7.0 - framework for short-form amalgamations - misc cleanup and updates - WIP --- package-lock.json | 4 +- package.json | 2 +- src/App.vue | 49 +++- src/components/common/Actions.vue | 2 +- src/components/common/CardHeader.vue | 17 +- src/components/common/ListPeopleAndRoles.vue | 6 +- src/components/common/ListShareClass.vue | 8 +- src/components/common/Stepper.vue | 12 +- .../common/SummaryDefineCompany.vue | 33 ++- src/enums/routeNames.ts | 20 +- src/enums/views.ts | 12 +- .../resource-interfaces/resource-interface.ts | 6 +- src/mixins/amalgamation-mixin.ts | 2 + src/resources/AmalgamationRegular/BC.ts | 37 +-- src/resources/AmalgamationRegular/BEN.ts | 73 +---- src/resources/AmalgamationRegular/CC.ts | 48 +--- src/resources/AmalgamationRegular/ULC.ts | 47 +--- src/resources/AmalgamationRegular/steps.ts | 22 +- src/resources/AmalgamationShort/BC.ts | 42 +++ src/resources/AmalgamationShort/BEN.ts | 42 +++ src/resources/AmalgamationShort/CC.ts | 42 +++ src/resources/AmalgamationShort/ULC.ts | 42 +++ src/resources/AmalgamationShort/index.ts | 4 + src/resources/AmalgamationShort/steps.ts | 41 +++ src/resources/Restoration/BC.ts | 2 +- src/resources/Restoration/BEN.ts | 2 +- src/resources/Restoration/CC.ts | 2 +- src/resources/Restoration/ULC.ts | 2 +- src/resources/index.ts | 18 +- src/router/routes.ts | 264 ++---------------- .../routes/amalgamation-regular-routes.ts | 55 ++++ .../routes/amalgamation-short-routes.ts | 45 +++ src/router/routes/dissolution-routes.ts | 59 ++++ src/router/routes/incorporation-routes.ts | 75 +++++ src/router/routes/index.ts | 6 + src/router/routes/registration-route.ts | 35 +++ src/router/routes/restoration-routes.ts | 45 +++ src/store/store.ts | 72 +++-- .../BusinessInfo.vue | 72 ++++- .../Information.vue | 14 +- .../PeopleRoles.vue | 12 +- .../ReviewConfirm.vue | 15 +- .../ShareStructure.vue | 8 +- src/views/index.ts | 10 +- ...ec.ts => AmalgamationBusinessInfo.spec.ts} | 13 +- ...pec.ts => AmalgamationInformation.spec.ts} | 6 +- ...pec.ts => AmalgamationPeopleRoles.spec.ts} | 6 +- ...c.ts => AmalgamationReviewConfirm.spec.ts} | 9 +- ....ts => AmalgamationShareStructure.spec.ts} | 6 +- tests/unit/amalgamation-mixin.spec.ts | 3 +- 50 files changed, 880 insertions(+), 589 deletions(-) create mode 100644 src/resources/AmalgamationShort/BC.ts create mode 100644 src/resources/AmalgamationShort/BEN.ts create mode 100644 src/resources/AmalgamationShort/CC.ts create mode 100644 src/resources/AmalgamationShort/ULC.ts create mode 100644 src/resources/AmalgamationShort/index.ts create mode 100644 src/resources/AmalgamationShort/steps.ts create mode 100644 src/router/routes/amalgamation-regular-routes.ts create mode 100644 src/router/routes/amalgamation-short-routes.ts create mode 100644 src/router/routes/dissolution-routes.ts create mode 100644 src/router/routes/incorporation-routes.ts create mode 100644 src/router/routes/index.ts create mode 100644 src/router/routes/registration-route.ts create mode 100644 src/router/routes/restoration-routes.ts rename src/views/{AmalgamationRegular => Amalgamation}/BusinessInfo.vue (70%) rename src/views/{AmalgamationRegular => Amalgamation}/Information.vue (92%) rename src/views/{AmalgamationRegular => Amalgamation}/PeopleRoles.vue (83%) rename src/views/{AmalgamationRegular => Amalgamation}/ReviewConfirm.vue (96%) rename src/views/{AmalgamationRegular => Amalgamation}/ShareStructure.vue (97%) rename tests/unit/{AmalgRegBusinessInfo.spec.ts => AmalgamationBusinessInfo.spec.ts} (77%) rename tests/unit/{AmalgRegInformation.spec.ts => AmalgamationInformation.spec.ts} (92%) rename tests/unit/{AmalgRegPeopleRoles.spec.ts => AmalgamationPeopleRoles.spec.ts} (87%) rename tests/unit/{AmalgRegReviewConfirm.spec.ts => AmalgamationReviewConfirm.spec.ts} (94%) rename tests/unit/{AmalgRegShareStructure.spec.ts => AmalgamationShareStructure.spec.ts} (92%) diff --git a/package-lock.json b/package-lock.json index 49db6d82d..6fb4bc197 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "business-create-ui", - "version": "5.6.43", + "version": "5.7.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "business-create-ui", - "version": "5.6.43", + "version": "5.7.0", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/approval-type": "1.0.19", diff --git a/package.json b/package.json index f52776a85..ce17fa94d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "business-create-ui", - "version": "5.6.43", + "version": "5.7.0", "private": true, "appName": "Create UI", "sbcName": "SBC Common Components", diff --git a/src/App.vue b/src/App.vue index cd7cbd6c8..b37fbbaf9 100644 --- a/src/App.vue +++ b/src/App.vue @@ -156,8 +156,9 @@ lg="9" >
-

{{ getFilingName }}

+

{{ header }}

+

void @Action(useStore) setLastAnnualReportDate!: (x: string) => void @Action(useStore) setLastDirectorChangeDate!: (x: string) => void - @Action(useStore) setNameRequest!: (x: NameRequestIF) => void + // @Action(useStore) setNameRequest!: (x: NameRequestIF) => void @Action(useStore) setParties!: (x: Array) => void @Action(useStore) setResources!: (x: ResourceIF) => void @Action(useStore) setUserAddress!: (x: AddressIF) => void @@ -389,6 +393,19 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi return crumbs } + /** The page header (title). */ + get header (): string { + if (this.isAmalgamationFilingRegular) { + return `${this.getFilingName} (Regular)` + } else if (this.isAmalgamationFilingHorizontal) { + return `${this.getFilingName} (Horizontal Short-form)` + } else if (this.isAmalgamationFilingVertical) { + return `${this.getFilingName} (Vertical Short-form)` + } else { + return this.getFilingName + } + } + /** Data for fee summary component. */ get feeFilingData (): Array { let filingData = [] as Array @@ -733,7 +750,13 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi if (this.$route.meta.filingType !== this.getFilingType) { switch (this.getFilingType) { case FilingTypes.AMALGAMATION_APPLICATION: - this.$router.push(RouteNames.AMALG_REG_INFORMATION).catch(() => {}) + if (this.isAmalgamationFilingRegular) { + this.$router.push(RouteNames.AMALG_REG_INFORMATION).catch(() => {}) + } else if (this.isAmalgamationFilingHorizontal || this.isAmalgamationFilingVertical) { + this.$router.push(RouteNames.AMALG_SHORT_INFORMATION).catch(() => {}) + } else { + throw new Error('invalid amalgamation filing type') + } return case FilingTypes.DISSOLUTION: if (this.isTypeFirm) { @@ -884,12 +907,19 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi let resources: ResourceIF switch (this.getFilingType) { case FilingTypes.AMALGAMATION_APPLICATION: + // *** TODO: review/clean up this code draftFiling = { ...this.buildAmalgamationFiling(), ...draftFiling } this.parseAmalgamationDraft(draftFiling) - resources = AmalgamationRegResources.find(x => x.entityType === this.getEntityType) as ResourceIF + if (this.isAmalgamationFilingRegular) { + resources = AmalgamationRegResources.find(x => x.entityType === this.getEntityType) as ResourceIF + } else if (this.isAmalgamationFilingHorizontal || this.isAmalgamationFilingVertical) { + resources = AmalgamationShortResources.find(x => x.entityType === this.getEntityType) as ResourceIF + } else { + throw new Error('invalid amalgamation filing type') + } break case FilingTypes.INCORPORATION_APPLICATION: draftFiling = { @@ -968,7 +998,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi } // ensure types match - if (nrResponse.legalType !== this.getEntityType) { + if ((nrResponse.legalType as unknown as CorpTypeCd) !== this.getEntityType) { console.log('NR legal type doesn\'t match entity type') // eslint-disable-line no-console this.nameRequestInvalidType = NameRequestStates.INVALID this.nameRequestInvalidErrorDialog = true @@ -1252,6 +1282,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi // enable validation when review pages are shown if ( this.isRouteName(RouteNames.AMALG_REG_REVIEW_CONFIRM) || + this.isRouteName(RouteNames.AMALG_SHORT_REVIEW_CONFIRM) || this.isRouteName(RouteNames.DISSOLUTION_REVIEW_CONFIRM) || this.isRouteName(RouteNames.INCORPORATION_REVIEW_CONFIRM) || this.isRouteName(RouteNames.REGISTRATION_REVIEW_CONFIRM) || diff --git a/src/components/common/Actions.vue b/src/components/common/Actions.vue index afaeec0ad..c87072c30 100644 --- a/src/components/common/Actions.vue +++ b/src/components/common/Actions.vue @@ -139,7 +139,7 @@ export default class Actions extends Mixins(AmalgamationMixin, CommonMixin, get isSummaryStep (): boolean { return ( - this.$route.name === RouteNames.AMALG_REG_REVIEW_CONFIRM || + this.$route.name === RouteNames.AMALGAMATION_REVIEW_CONFIRM || this.$route.name === RouteNames.DISSOLUTION_REVIEW_CONFIRM || this.$route.name === RouteNames.INCORPORATION_REVIEW_CONFIRM || this.$route.name === RouteNames.REGISTRATION_REVIEW_CONFIRM || diff --git a/src/components/common/CardHeader.vue b/src/components/common/CardHeader.vue index e6c342702..6c3766bc6 100644 --- a/src/components/common/CardHeader.vue +++ b/src/components/common/CardHeader.vue @@ -1,9 +1,18 @@ @@ -12,8 +21,8 @@ import { Component, Prop, Vue } from 'vue-property-decorator' @Component({}) export default class CardHeader extends Vue { - @Prop({ required: true }) readonly icon!: string - @Prop({ required: true }) readonly label!: string + @Prop({ default: null }) readonly icon!: string + @Prop({ default: null }) readonly label!: string } diff --git a/src/components/common/ListPeopleAndRoles.vue b/src/components/common/ListPeopleAndRoles.vue index f5e367e9c..35bdf32f5 100644 --- a/src/components/common/ListPeopleAndRoles.vue +++ b/src/components/common/ListPeopleAndRoles.vue @@ -9,21 +9,25 @@ mdi-information-outline This step is unfinished. + Return to this step to finish it + Return to this step to finish it + Return to this step to finish it + mdi-information-outline This step is unfinished. + + Return to this step to finish it + @Getter(useStore) getValidateSteps!: boolean @Getter(useStore) isAddPeopleAndRolesValid!: boolean @Getter(useStore) isAffidavitValid!: boolean + @Getter(useStore) isAmalgamationInformationValid!: boolean @Getter(useStore) isBusySaving!: boolean @Getter(useStore) isCreateShareStructureValid!: boolean @Getter(useStore) isDefineCompanyValid!: boolean @@ -91,11 +91,11 @@ export default class Stepper extends Vue { /** Returns true if the step route is valid. */ isValid (route: RouteNames): boolean { switch (route) { - case RouteNames.AMALG_REG_INFORMATION: return this.isAmalgamationInformationRegValid - case RouteNames.AMALG_REG_BUSINESS_INFO: return this.isDefineCompanyValid - case RouteNames.AMALG_REG_PEOPLE_ROLES: return this.isAddPeopleAndRolesValid - case RouteNames.AMALG_REG_SHARE_STRUCTURE: return this.isCreateShareStructureValid - case RouteNames.AMALG_REG_REVIEW_CONFIRM: return this.isFilingValid + case RouteNames.AMALGAMATION_INFORMATION: return this.isAmalgamationInformationValid + case RouteNames.AMALGAMATION_BUSINESS_INFO: return this.isDefineCompanyValid + case RouteNames.AMALGAMATION_PEOPLE_ROLES: return this.isAddPeopleAndRolesValid + case RouteNames.AMALGAMATION_SHARE_STRUCTURE: return this.isCreateShareStructureValid + case RouteNames.AMALGAMATION_REVIEW_CONFIRM: return this.isFilingValid case RouteNames.DISSOLUTION_AFFIDAVIT: return this.isAffidavitValid case RouteNames.DISSOLUTION_DEFINE_DISSOLUTION: return this.isDissolutionDefineDissolutionValid diff --git a/src/components/common/SummaryDefineCompany.vue b/src/components/common/SummaryDefineCompany.vue index f5b49bd55..440e949fb 100644 --- a/src/components/common/SummaryDefineCompany.vue +++ b/src/components/common/SummaryDefineCompany.vue @@ -9,17 +9,29 @@ mdi-information-outline This step is unfinished. -