diff --git a/package-lock.json b/package-lock.json index bc63ad4c7..cd3c15374 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "business-create-ui", - "version": "5.8.7", + "version": "5.8.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "business-create-ui", - "version": "5.8.7", + "version": "5.8.8", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/approval-type": "1.0.19", diff --git a/package.json b/package.json index d13f07580..b73bc201d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "business-create-ui", - "version": "5.8.7", + "version": "5.8.8", "private": true, "appName": "Create UI", "sbcName": "SBC Common Components", diff --git a/src/App.vue b/src/App.vue index 5a7543fb4..541940963 100644 --- a/src/App.vue +++ b/src/App.vue @@ -329,7 +329,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi // @Action(useStore) setNameRequest!: (x: NameRequestIF) => void @Action(useStore) setOperatingName!: (x: string) => void @Action(useStore) setParties!: (x: Array) => void - @Action(useStore) setResources!: (x: ResourceIF) => void + // @Action(useStore) setResources!: (x: ResourceIF) => void @Action(useStore) setUserAddress!: (x: AddressIF) => void @Action(useStore) setUserEmail!: (x: string) => void @Action(useStore) setUserFirstName!: (x: string) => void @@ -668,8 +668,8 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi // reset errors in case this method is invoked more than once (ie, retry) this.resetFlags() - // don't check FF during Vitest tests - if (!this.isVitestRunning) { + // only check FF when not in Vitest tests + if (import.meta.env.VITEST === undefined) { // check that current route matches a supported filing type const supportedFilings = await GetFeatureFlag('supported-filings') if (!supportedFilings?.includes(this.$route.meta.filingType)) { @@ -754,31 +754,31 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi switch (this.getFilingType) { case FilingTypes.AMALGAMATION_APPLICATION: if (this.isAmalgamationFilingRegular) { - this.$router.push(RouteNames.AMALG_REG_INFORMATION).catch(() => {}) + this.$router.replace(RouteNames.AMALG_REG_INFORMATION).catch(() => {}) } else if (this.isAmalgamationFilingHorizontal || this.isAmalgamationFilingVertical) { - this.$router.push(RouteNames.AMALG_SHORT_INFORMATION).catch(() => {}) + this.$router.replace(RouteNames.AMALG_SHORT_INFORMATION).catch(() => {}) } else { throw new Error('invalid amalgamation filing type') } return case FilingTypes.CONTINUATION_IN: - this.$router.push(RouteNames.CONTINUATION_IN_BUSINESS_HOME).catch(() => {}) + this.$router.replace(RouteNames.CONTINUATION_IN_BUSINESS_HOME).catch(() => {}) return case FilingTypes.DISSOLUTION: if (this.isTypeFirm) { - this.$router.push(RouteNames.DISSOLUTION_FIRM).catch(() => {}) + this.$router.replace(RouteNames.DISSOLUTION_FIRM).catch(() => {}) } else { - this.$router.push(RouteNames.DISSOLUTION_DEFINE_DISSOLUTION).catch(() => {}) + this.$router.replace(RouteNames.DISSOLUTION_DEFINE_DISSOLUTION).catch(() => {}) } return case FilingTypes.INCORPORATION_APPLICATION: - this.$router.push(RouteNames.INCORPORATION_DEFINE_COMPANY).catch(() => {}) + this.$router.replace(RouteNames.INCORPORATION_DEFINE_COMPANY).catch(() => {}) return case FilingTypes.REGISTRATION: - this.$router.push(RouteNames.REGISTRATION_DEFINE_BUSINESS).catch(() => {}) + this.$router.replace(RouteNames.REGISTRATION_DEFINE_BUSINESS).catch(() => {}) return case FilingTypes.RESTORATION: - this.$router.push(RouteNames.RESTORATION_BUSINESS_NAME).catch(() => {}) + this.$router.replace(RouteNames.RESTORATION_BUSINESS_NAME).catch(() => {}) return default: this.invalidRouteDialog = true diff --git a/src/components/Amalgamation/ResultingBusinessName.vue b/src/components/Amalgamation/ResultingBusinessName.vue index a9e096143..8518c0649 100644 --- a/src/components/Amalgamation/ResultingBusinessName.vue +++ b/src/components/Amalgamation/ResultingBusinessName.vue @@ -140,12 +140,14 @@ export default class ResultingBusinessName extends Mixins(AmalgamationMixin, Nam this.setNameRequestApprovedName(name) // if adopting a business' name, also adopt its legal type + // and update resources (since legal type may have changed) if (this.formType === CorrectNameOptions.CORRECT_AML_ADOPT) { const business = this.getAmalgamatingBusinesses.find(b => (b.type === AmlTypes.LEAR && b.name === name) ) if (business?.type === AmlTypes.LEAR) { this.setEntityType(business.legalType) + this.updateResources() } } } @@ -155,7 +157,9 @@ export default class ResultingBusinessName extends Mixins(AmalgamationMixin, Nam this.setNameRequest(nameRequest) // as we are using a new NR, also use its legal type + // and update resources (since legal type may have changed) this.setEntityType(nameRequest.legalType) + this.updateResources() } /** diff --git a/src/components/common/Actions.vue b/src/components/common/Actions.vue index 21de4b41d..ead2b5fca 100644 --- a/src/components/common/Actions.vue +++ b/src/components/common/Actions.vue @@ -303,7 +303,7 @@ export default class Actions extends Mixins(AmalgamationMixin, CommonMixin, this.setIsFilingPaying(false) } } else { - // don't call window.scrollTo during Vitest tests because jsdom doesn't implement it + // otherwise, smooth-scroll to the top of the page window.scrollTo({ top: 0, behavior: 'smooth' }) } } diff --git a/src/components/common/EffectiveDateTime.vue b/src/components/common/EffectiveDateTime.vue index 36f97de1f..ebe880597 100644 --- a/src/components/common/EffectiveDateTime.vue +++ b/src/components/common/EffectiveDateTime.vue @@ -163,7 +163,7 @@ export default class EffectiveDateTime extends Mixins(DateMixin) { dateTimeForm: FormIF } - @Prop({ default: null }) readonly effectiveDateTime!: EffectiveDateTimeIF + @Prop({ required: true }) readonly effectiveDateTime!: EffectiveDateTimeIF @Prop({ default: 'Incorporation Date and Time' }) readonly label!: string @@ -238,7 +238,7 @@ export default class EffectiveDateTime extends Mixins(DateMixin) { /** Construct the Date Object for storage */ private constructDate (): void { - if (this.isFutureEffective) { + if (this.isFutureEffective && this.dateText) { // Format the selected date string and create Date const dateToValidate = this.yyyyMmDdToDate(this.dateText) diff --git a/src/components/common/SummaryDefineCompany.vue b/src/components/common/SummaryDefineCompany.vue index 907bce38b..9ad1a303f 100644 --- a/src/components/common/SummaryDefineCompany.vue +++ b/src/components/common/SummaryDefineCompany.vue @@ -240,7 +240,6 @@ export default class SummaryDefineCompany extends Vue { /** Whether this section is invalid. */ get invalidSection (): boolean { if (this.isAmalgamationFiling) { - // *** FUTURE: update this for short-form amalgamation (needs to be valid) return (!this.isAmalgamationInformationValid || !this.isDefineCompanyValid) } return !this.isDefineCompanyValid diff --git a/src/main.ts b/src/main.ts index f4de2a357..a609cec73 100644 --- a/src/main.ts +++ b/src/main.ts @@ -78,7 +78,7 @@ async function start () { await KeycloakService.setKeycloakConfigUrl(keycloakConfig) // initialize token service which will do a check-sso to initiate session - // don't start during Vitest tests as it messes up the test JWT + // only do when not in Vitest tests as it messes up the test JWT if (import.meta.env.VITEST === undefined) { console.info('Starting token refresh service...') // eslint-disable-line no-console await KeycloakService.initializeToken() diff --git a/src/mixins/amalgamation-mixin.ts b/src/mixins/amalgamation-mixin.ts index 7eab328ab..5e73eba5a 100644 --- a/src/mixins/amalgamation-mixin.ts +++ b/src/mixins/amalgamation-mixin.ts @@ -6,11 +6,13 @@ import { } from '@/enums' import { AmalgamatingBusinessIF, ContactPointIF, EmptyContactPoint, EmptyNameRequest, NameRequestIF, - NameTranslationIF, OrgPersonIF, PeopleAndRoleIF, RegisteredRecordsAddressesIF, ShareClassIF + NameTranslationIF, OrgPersonIF, PeopleAndRoleIF, RegisteredRecordsAddressesIF, ResourceIF, + ShareClassIF } from '@/interfaces' import { CorrectNameOptions } from '@bcrs-shared-components/enums/' import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module' import { AuthServices, LegalServices } from '@/services' +import { AmalgamationRegResources, AmalgamationShortResources } from '@/resources' /** * Mixin that provides amalgamation rules, etc. @@ -21,6 +23,7 @@ export default class AmalgamationMixin extends Vue { @Getter(useStore) getAddPeopleAndRoleStep!: PeopleAndRoleIF @Getter(useStore) getAmalgamatingBusinesses!: AmalgamatingBusinessIF[] @Getter(useStore) getCurrentDate!: string + @Getter(useStore) getEntityType!: CorpTypeCd @Getter(useStore) isAmalgamationFilingHorizontal!: boolean @Getter(useStore) isAmalgamationFilingRegular!: boolean @Getter(useStore) isAmalgamationFilingVertical!: boolean @@ -37,6 +40,7 @@ export default class AmalgamationMixin extends Vue { @Action(useStore) setNameTranslations!: (x: NameTranslationIF[]) => void @Action(useStore) setOfficeAddresses!: (x: RegisteredRecordsAddressesIF) => void @Action(useStore) setOrgPersonList!: (x: OrgPersonIF[]) => void + @Action(useStore) setResources!: (x: ResourceIF) => void @Action(useStore) setShareClasses!: (x: ShareClassIF[]) => void /** Iterable array of rule functions, in order of processing. */ @@ -400,9 +404,27 @@ export default class AmalgamationMixin extends Vue { } } - // set new resulting business name and type + // set new resulting business name and legal type + // and update resources (since legal type may have changed) this.setNameRequestApprovedName(business.name) this.setEntityType(business.legalType) + this.updateResources() + } + + /** + * Updates the resources, for use when the entity type may have changed. + * NB - this is specific to amalgamation filings. + */ + updateResources (): void { + if (this.isAmalgamationFilingRegular) { + const resources = AmalgamationRegResources.find(x => x.entityType === this.getEntityType) as ResourceIF + this.setResources(resources) + } else if (this.isAmalgamationFilingHorizontal || this.isAmalgamationFilingVertical) { + const resources = AmalgamationShortResources.find(x => x.entityType === this.getEntityType) as ResourceIF + this.setResources(resources) + } else { + throw new Error('invalid amalgamation filing type') + } } // diff --git a/src/mixins/common-mixin.ts b/src/mixins/common-mixin.ts index ac4201c0d..894480603 100644 --- a/src/mixins/common-mixin.ts +++ b/src/mixins/common-mixin.ts @@ -9,11 +9,6 @@ import { getName } from 'country-list' */ @Component({}) export default class CommonMixin extends Vue { - /** Is True if Vitest is running the code. */ - get isVitestRunning (): boolean { - return (import.meta.env.VITEST !== undefined) - } - /** * Compares two objects while omitting specified properties from the comparison. * @param objA the first object to compare diff --git a/src/mixins/filing-template-mixin.ts b/src/mixins/filing-template-mixin.ts index 8c3041812..0e3ae9415 100644 --- a/src/mixins/filing-template-mixin.ts +++ b/src/mixins/filing-template-mixin.ts @@ -50,7 +50,7 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM @Getter(useStore) getDissolutionType!: DissolutionTypes @Getter(useStore) getDocumentDelivery!: DocumentDeliveryIF @Getter(useStore) getEffectiveDateTime!: EffectiveDateTimeIF - @Getter(useStore) getEntityType!: CorpTypeCd + // @Getter(useStore) getEntityType!: CorpTypeCd @Getter(useStore) getFilingId!: number @Getter(useStore) getFolioNumber!: string @Getter(useStore) getIncorporationAgreementStep!: IncorporationAgreementIF @@ -302,7 +302,10 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM } // restore the Amalgamation Court Approval if it's True or False - if (draftFiling.amalgamationApplication.courtApproval !== null) { + if ( + draftFiling.amalgamationApplication.courtApproval === true || + draftFiling.amalgamationApplication.courtApproval === false + ) { this.setAmalgamationCourtApproval(draftFiling.amalgamationApplication.courtApproval) } diff --git a/src/resources/AmalgamationRegular/BC.ts b/src/resources/AmalgamationRegular/BC.ts index 0ed561e03..ac835224a 100644 --- a/src/resources/AmalgamationRegular/BC.ts +++ b/src/resources/AmalgamationRegular/BC.ts @@ -31,7 +31,10 @@ export const AmalgamationRegResourceBc: AmalgamationResourceIF = { }, reviewAndConfirm: { completingPartyStatement: { - certifyStatements: [], + certifyStatements: [ + 'I have relevant knowledge of the business and that I am authorized to make this filing.', + 'I understand that this amalgamation cannot be reversed without a court order.' + ], certifyClause: `Note: It is an offence to make a false or misleading statement in respect of a material fact in a record submitted to the Corporate Registry for filing. See section 427 of the Business Corporations Act.`, diff --git a/src/resources/AmalgamationRegular/BEN.ts b/src/resources/AmalgamationRegular/BEN.ts index d491319e7..639eefe2d 100644 --- a/src/resources/AmalgamationRegular/BEN.ts +++ b/src/resources/AmalgamationRegular/BEN.ts @@ -31,7 +31,10 @@ export const AmalgamationRegResourceBen: AmalgamationResourceIF = { }, reviewAndConfirm: { completingPartyStatement: { - certifyStatements: [], + certifyStatements: [ + 'I have relevant knowledge of the business and that I am authorized to make this filing.', + 'I understand that this amalgamation cannot be reversed without a court order.' + ], certifyClause: `Note: It is an offence to make a false or misleading statement in respect of a material fact in a record submitted to the Corporate Registry for filing. See section 427 of the Business Corporations Act.`, diff --git a/src/resources/AmalgamationRegular/CC.ts b/src/resources/AmalgamationRegular/CC.ts index 090285e62..c07162f42 100644 --- a/src/resources/AmalgamationRegular/CC.ts +++ b/src/resources/AmalgamationRegular/CC.ts @@ -31,7 +31,10 @@ export const AmalgamationRegResourceCc: AmalgamationResourceIF = { }, reviewAndConfirm: { completingPartyStatement: { - certifyStatements: [], + certifyStatements: [ + 'I have relevant knowledge of the business and that I am authorized to make this filing.', + 'I understand that this amalgamation cannot be reversed without a court order.' + ], certifyClause: `Note: It is an offence to make a false or misleading statement in respect of a material fact in a record submitted to the Corporate Registry for filing. See section 427 of the Business Corporations Act.`, diff --git a/src/resources/AmalgamationRegular/ULC.ts b/src/resources/AmalgamationRegular/ULC.ts index ddd6c739a..9aadab1f5 100644 --- a/src/resources/AmalgamationRegular/ULC.ts +++ b/src/resources/AmalgamationRegular/ULC.ts @@ -31,7 +31,10 @@ export const AmalgamationRegResourceUlc: AmalgamationResourceIF = { }, reviewAndConfirm: { completingPartyStatement: { - certifyStatements: [], + certifyStatements: [ + 'I have relevant knowledge of the business and that I am authorized to make this filing.', + 'I understand that this amalgamation cannot be reversed without a court order.' + ], certifyClause: `Note: It is an offence to make a false or misleading statement in respect of a material fact in a record submitted to the Corporate Registry for filing. See section 427 of the Business Corporations Act.`, diff --git a/src/resources/AmalgamationShort/BC.ts b/src/resources/AmalgamationShort/BC.ts index 455e30519..3d97e59fa 100644 --- a/src/resources/AmalgamationShort/BC.ts +++ b/src/resources/AmalgamationShort/BC.ts @@ -33,7 +33,10 @@ export const AmalgamationShortResourceBc: AmalgamationResourceIF = { }, reviewAndConfirm: { completingPartyStatement: { - certifyStatements: [], + certifyStatements: [ + 'I have relevant knowledge of the business and that I am authorized to make this filing.', + 'I understand that this amalgamation cannot be reversed without a court order.' + ], certifyClause: `Note: It is an offence to make a false or misleading statement in respect of a material fact in a record submitted to the Corporate Registry for filing. See section 427 of the Business Corporations Act.`, diff --git a/src/resources/AmalgamationShort/BEN.ts b/src/resources/AmalgamationShort/BEN.ts index 8aaf857ea..c1ae2e3c6 100644 --- a/src/resources/AmalgamationShort/BEN.ts +++ b/src/resources/AmalgamationShort/BEN.ts @@ -33,7 +33,10 @@ export const AmalgamationShortResourceBen: AmalgamationResourceIF = { }, reviewAndConfirm: { completingPartyStatement: { - certifyStatements: [], + certifyStatements: [ + 'I have relevant knowledge of the business and that I am authorized to make this filing.', + 'I understand that this amalgamation cannot be reversed without a court order.' + ], certifyClause: `Note: It is an offence to make a false or misleading statement in respect of a material fact in a record submitted to the Corporate Registry for filing. See section 427 of the Business Corporations Act.`, diff --git a/src/resources/AmalgamationShort/CC.ts b/src/resources/AmalgamationShort/CC.ts index 2155b58ec..55d1fff52 100644 --- a/src/resources/AmalgamationShort/CC.ts +++ b/src/resources/AmalgamationShort/CC.ts @@ -33,7 +33,10 @@ export const AmalgamationShortResourceCc: AmalgamationResourceIF = { }, reviewAndConfirm: { completingPartyStatement: { - certifyStatements: [], + certifyStatements: [ + 'I have relevant knowledge of the business and that I am authorized to make this filing.', + 'I understand that this amalgamation cannot be reversed without a court order.' + ], certifyClause: `Note: It is an offence to make a false or misleading statement in respect of a material fact in a record submitted to the Corporate Registry for filing. See section 427 of the Business Corporations Act.`, diff --git a/src/resources/AmalgamationShort/ULC.ts b/src/resources/AmalgamationShort/ULC.ts index 6b6207b80..0c6e0071e 100644 --- a/src/resources/AmalgamationShort/ULC.ts +++ b/src/resources/AmalgamationShort/ULC.ts @@ -33,7 +33,10 @@ export const AmalgamationShortResourceUlc: AmalgamationResourceIF = { }, reviewAndConfirm: { completingPartyStatement: { - certifyStatements: [], + certifyStatements: [ + 'I have relevant knowledge of the business and that I am authorized to make this filing.', + 'I understand that this amalgamation cannot be reversed without a court order.' + ], certifyClause: `Note: It is an offence to make a false or misleading statement in respect of a material fact in a record submitted to the Corporate Registry for filing. See section 427 of the Business Corporations Act.`, diff --git a/src/store/store.ts b/src/store/store.ts index fe061400d..a0e8814b4 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -602,16 +602,21 @@ export const useStore = defineStore('store', { ) } else { return ( - // *** FUTURE: update this when Resulting Company Name is implemented this.getAmalgamatingBusinessesValid && - !!this.getCorrectNameOption && - this.getNameTranslationsValid + // NB - this is the only valid Correct Name Option for short-form amalgamations: + (this.getCorrectNameOption === CorrectNameOptions.CORRECT_AML_ADOPT) + // NB - there are no name translations for short-form amalgamations ) } }, /** Whether all the amalgamation steps are valid. */ isAmalgamationValid (): boolean { + const isCreateShareStructureValid = ( + this.isAmalgamationFilingHorizontal || + this.isAmalgamationFilingVertical || + this.isCreateShareStructureValid + ) const isFolioNumberValid = !this.isPremiumAccount || this.getFolioNumberValid const isCourtOrderValid = this.isRoleStaff ? this.getCourtOrderStep.valid : true const isCertifyValid = this.getCertifyState.valid && !!this.getCertifyState.certifiedBy @@ -621,7 +626,7 @@ export const useStore = defineStore('store', { this.isAmalgamationInformationValid && this.isDefineCompanyValid && this.isAddPeopleAndRolesValid && - this.isCreateShareStructureValid && + isCreateShareStructureValid && this.getEffectiveDateTime.valid && isFolioNumberValid && this.getAmalgamationCourtApprovalValid && diff --git a/src/views/Amalgamation/BusinessInfo.vue b/src/views/Amalgamation/BusinessInfo.vue index 9b951998c..a039179bf 100644 --- a/src/views/Amalgamation/BusinessInfo.vue +++ b/src/views/Amalgamation/BusinessInfo.vue @@ -1,6 +1,6 @@