Skip to content

Commit

Permalink
Merge pull request #599 from meawong/23604-Changing-the-business-twic…
Browse files Browse the repository at this point in the history
…e-does-not-refresh-company-name

23604 update logic for changing business name
  • Loading branch information
meawong authored Nov 19, 2024
2 parents 80d6163 + 0c3c772 commit 0371bdf
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
22 changes: 12 additions & 10 deletions src/components/common/YourCompany/ChangeBusinessType.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -433,24 +439,20 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) {
submitTypeChange () {
this.setEntityType(this.selectedEntityType)
this.isEditingType = false
if (this.shouldUpdateName()) {
if (this.isNumberedCompany && !this.hasNewNr) {
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
}
getUpdatedName (originalName: string): string {
if (this.isUnlimitedLiability) {
originalName = originalName.replace(' LTD.', '')
Expand Down
3 changes: 2 additions & 1 deletion src/components/common/YourCompany/EntityName.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
1 change: 1 addition & 0 deletions src/views/Alteration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ export default class Alteration extends Mixins(CommonMixin, FeeMixin, FilingTemp
}
}
@Watch('hasBusinessNameChanged')
@Watch('hasBusinessTypeChanged')
onBusinessTypeChanged () {
const filingData = this.getFilingData
Expand Down

0 comments on commit 0371bdf

Please sign in to comment.