From 8414e3ea33557b3631e28d85d8f264a3180bf8b5 Mon Sep 17 00:00:00 2001 From: meganwong Date: Mon, 18 Nov 2024 15:18:56 -0800 Subject: [PATCH 1/5] update logic for changing business name --- .../common/YourCompany/ChangeBusinessType.vue | 12 ++++++------ src/views/Alteration.vue | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/common/YourCompany/ChangeBusinessType.vue b/src/components/common/YourCompany/ChangeBusinessType.vue index caddb886..bd1a7c78 100644 --- a/src/components/common/YourCompany/ChangeBusinessType.vue +++ b/src/components/common/YourCompany/ChangeBusinessType.vue @@ -436,19 +436,19 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) { if (this.shouldUpdateName()) { const originalName = this.getOriginalLegalName const updatedName = this.getUpdatedName(originalName) + this.setNameRequest({ + legalType: this.selectedEntityType, + nrNum: this.getOriginalNrNumber + } as any) + this.setNameRequestLegalName(updatedName) if (originalName !== updatedName) { - this.setNameRequest({ - legalType: this.selectedEntityType, - nrNum: this.getOriginalNrNumber - } as any) - this.setNameRequestLegalName(updatedName) this.setNameChangedByType(true) } } } shouldUpdateName (): boolean { - return this.isNumberedCompany && !this.hasBusinessNameChanged + return this.isNumberedCompany } getUpdatedName (originalName: string): string { diff --git a/src/views/Alteration.vue b/src/views/Alteration.vue index f88cd8f4..fbd737ef 100644 --- a/src/views/Alteration.vue +++ b/src/views/Alteration.vue @@ -214,7 +214,7 @@ export default class Alteration extends Mixins(CommonMixin, FeeMixin, FilingTemp } } - @Watch('hasBusinessTypeChanged') + @Watch('hasBusinessNameChanged') onBusinessTypeChanged () { const filingData = this.getFilingData // when altering from BC (or C) to ULC, use specific filing data From 71b5c31c86833c596dadce1060e0ef8ac8b9bea8 Mon Sep 17 00:00:00 2001 From: meganwong Date: Mon, 18 Nov 2024 16:22:56 -0800 Subject: [PATCH 2/5] update patch version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6a6eb466..5f687aa4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "business-edit-ui", - "version": "4.11.6", + "version": "4.11.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "business-edit-ui", - "version": "4.11.6", + "version": "4.11.7", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/action-chip": "1.1.5", diff --git a/package.json b/package.json index b1f69835..5672d4bb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "business-edit-ui", - "version": "4.11.6", + "version": "4.11.7", "private": true, "appName": "Edit UI", "sbcName": "SBC Common Components", From 40ceee6ad97a15cdf0fb35a418aab2911d789400 Mon Sep 17 00:00:00 2001 From: meganwong Date: Mon, 18 Nov 2024 16:33:44 -0800 Subject: [PATCH 3/5] simplify conditional --- src/components/common/YourCompany/ChangeBusinessType.vue | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/common/YourCompany/ChangeBusinessType.vue b/src/components/common/YourCompany/ChangeBusinessType.vue index bd1a7c78..53863d90 100644 --- a/src/components/common/YourCompany/ChangeBusinessType.vue +++ b/src/components/common/YourCompany/ChangeBusinessType.vue @@ -433,7 +433,7 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) { submitTypeChange () { this.setEntityType(this.selectedEntityType) this.isEditingType = false - if (this.shouldUpdateName()) { + if (this.isNumberedCompany) { const originalName = this.getOriginalLegalName const updatedName = this.getUpdatedName(originalName) this.setNameRequest({ @@ -447,10 +447,6 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) { } } - shouldUpdateName (): boolean { - return this.isNumberedCompany - } - getUpdatedName (originalName: string): string { if (this.isUnlimitedLiability) { originalName = originalName.replace(' LTD.', '') From 6dffd0d0df393161918c48388c4a7ed8c29ef8e8 Mon Sep 17 00:00:00 2001 From: meganwong Date: Tue, 19 Nov 2024 09:08:15 -0800 Subject: [PATCH 4/5] Add original watch back --- src/views/Alteration.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/views/Alteration.vue b/src/views/Alteration.vue index fbd737ef..22eddda7 100644 --- a/src/views/Alteration.vue +++ b/src/views/Alteration.vue @@ -215,6 +215,7 @@ export default class Alteration extends Mixins(CommonMixin, FeeMixin, FilingTemp } @Watch('hasBusinessNameChanged') + @Watch('hasBusinessTypeChanged') onBusinessTypeChanged () { const filingData = this.getFilingData // when altering from BC (or C) to ULC, use specific filing data From 0c3c7724c75eb6b818a96cd922bc7447d09ca94e Mon Sep 17 00:00:00 2001 From: meganwong Date: Tue, 19 Nov 2024 14:28:30 -0800 Subject: [PATCH 5/5] add check to see if there is a new nr --- src/components/common/YourCompany/ChangeBusinessType.vue | 8 +++++++- src/components/common/YourCompany/EntityName.vue | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/common/YourCompany/ChangeBusinessType.vue b/src/components/common/YourCompany/ChangeBusinessType.vue index 53863d90..72aa20d2 100644 --- a/src/components/common/YourCompany/ChangeBusinessType.vue +++ b/src/components/common/YourCompany/ChangeBusinessType.vue @@ -306,6 +306,7 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) { @Getter(useStore) getEditedLabel!: string @Getter(useStore) getEntityType!: CorpTypeCd @Getter(useStore) getNameRequestLegalName!: string + @Getter(useStore) getNameRequestNumber!: string @Getter(useStore) getNumberOfDirectors!: number @Getter(useStore) getOriginalLegalName!: string @Getter(useStore) getOriginalLegalType!: CorpTypeCd @@ -415,6 +416,11 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) { return (this.isCommunityContribution && this.getNumberOfDirectors < 3) } + /** True if a new NR number has been entered. */ + get hasNewNr (): boolean { + return !!this.getNameRequestNumber + } + /** Reset company type values to original. */ resetType () { this.setEntityType(this.getOriginalLegalType || null) @@ -433,7 +439,7 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) { submitTypeChange () { this.setEntityType(this.selectedEntityType) this.isEditingType = false - if (this.isNumberedCompany) { + if (this.isNumberedCompany && !this.hasNewNr) { const originalName = this.getOriginalLegalName const updatedName = this.getUpdatedName(originalName) this.setNameRequest({ diff --git a/src/components/common/YourCompany/EntityName.vue b/src/components/common/YourCompany/EntityName.vue index bf634f87..85facf21 100644 --- a/src/components/common/YourCompany/EntityName.vue +++ b/src/components/common/YourCompany/EntityName.vue @@ -450,8 +450,9 @@ export default class EntityName extends Mixins(CommonMixin, NameRequestMixin) { } as any) this.setNameRequestLegalName(this.getOriginalLegalName) + this.setEntityType(this.getOriginalLegalType || null) + if (this.isEntityTypeChangedByName) { - this.setEntityType(this.getOriginalLegalType || null) this.setEntityTypeChangedByName(false) }