Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

19750 and 19805 - fixed error handling + fixed party index bug #657

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-create-ui",
"version": "5.9.1",
"version": "5.9.2",
"private": true,
"appName": "Create UI",
"sbcName": "SBC Common Components",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Amalgamation/AmalgamatingBusinesses.vue
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ export default class AmalgamatingBusinesses extends Mixins(AmalgamationMixin, Co

// fetch the new holding/primary business' data and update the prepopulated data
// this will overwrite office addresses, directors, share structure and contact info
this.updatePrepopulatedData(business, true)
await this.updatePrepopulatedData(business, true)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this, the code continued to line 576.

Instead, we needed to wait for updatePrepopulatedData() to finish and possibly throw an error that would be caught by line 571.

} catch (error) {
// eslint-disable-next-line no-console
console.log('Error setting new holding/primary business =', error)
Expand Down
22 changes: 7 additions & 15 deletions src/mixins/filing-template-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM
amalgamatingBusinesses: this.getAmalgamatingBusinesses,
type: this.getAmalgamationType,
nameRequest: {
legalType: this.getEntityType,
correctNameOption: this.getCorrectNameOption
Copy link
Collaborator Author

@severinbeauvais severinbeauvais Feb 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed as it's (re)set on lines 178+ below.

This is a the "decoy" anti-pattern: it looks like it's doing something but it's really not.

legalType: this.getEntityType
},
nameTranslations: this.getNameTranslations,
offices: this.getDefineCompanyStep.officeAddresses,
Expand Down Expand Up @@ -258,7 +257,6 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM

// restore business name data
const nameRequest = draftFiling.amalgamationApplication.nameRequest as NameRequestFilingIF

switch (nameRequest?.correctNameOption) {
case CorrectNameOptions.CORRECT_AML_ADOPT:
this.setCorrectNameOption(CorrectNameOptions.CORRECT_AML_ADOPT)
Expand All @@ -267,16 +265,14 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM
break
case CorrectNameOptions.CORRECT_NEW_NR:
this.setCorrectNameOption(CorrectNameOptions.CORRECT_NEW_NR)
// NB: do not restore Name Request data
// it will be reloaded from NR endpoint in App.vue
// NB: do not restore Name Request data - it will be reloaded from NR endpoint in App.vue
break
case CorrectNameOptions.CORRECT_AML_NUMBERED:
this.setCorrectNameOption(CorrectNameOptions.CORRECT_AML_NUMBERED)
break
default:
// fallback for draft created without Correct Name Option
// NB: do not restore Name Request data
// it will be reloaded from NR endpoint in App.vue
// NB: do not restore Name Request data - it will be reloaded from NR endpoint in App.vue
if (nameRequest.nrNumber) {
this.setCorrectNameOption(CorrectNameOptions.CORRECT_NEW_NR)
}
Expand Down Expand Up @@ -440,16 +436,14 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM
break
case CorrectNameOptions.CORRECT_NEW_NR:
this.setCorrectNameOption(CorrectNameOptions.CORRECT_NEW_NR)
// NB: do not restore Name Request data
// it will be reloaded from NR endpoint in App.vue
// NB: do not restore Name Request data - it will be reloaded from NR endpoint in App.vue
break
case CorrectNameOptions.CORRECT_AML_NUMBERED:
this.setCorrectNameOption(CorrectNameOptions.CORRECT_AML_NUMBERED)
break
default:
// fallback for draft created without Correct Name Option
// NB: do not restore Name Request data
// it will be reloaded from NR endpoint in App.vue
// NB: do not restore Name Request data - it will be reloaded from NR endpoint in App.vue
if (nameRequest.nrNumber) {
this.setCorrectNameOption(CorrectNameOptions.CORRECT_NEW_NR)
}
Expand Down Expand Up @@ -931,8 +925,7 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM
// restore Business Type Confirm
this.setRegistrationBusinessTypeConfirm(draftFiling.registration.businessTypeConfirm || false)

// NB: do not restore Name Request data
// it will be reloaded from NR endpoint in App.vue
// NB: do not restore Name Request data - it will be reloaded from NR endpoint in App.vue

// restore Entity Type
this.setEntityType(draftFiling.registration.nameRequest.legalType)
Expand Down Expand Up @@ -1018,8 +1011,7 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM
break
case CorrectNameOptions.CORRECT_NEW_NR:
this.setCorrectNameOption(CorrectNameOptions.CORRECT_NEW_NR)
// NB: do not restore Name Request data
// it will be reloaded from NR endpoint in App.vue
// NB: do not restore Name Request data - it will be reloaded from NR endpoint in App.vue
break
}

Expand Down
Loading