Skip to content

Commit

Permalink
Removed duplicate functions & unused getter.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamespaologarcia committed Nov 29, 2023
1 parent c978e6c commit 0abe3ac
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 35 deletions.
15 changes: 3 additions & 12 deletions src/components/existing-request/existing-request-display.vue
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,7 @@
:approvedName="approvedName && approvedName.name"
:emailAddress="nr && nr.applicants && nr.applicants.emailAddress"
:disabled="disableUnfurnished"
@incorporateRegisterYourBusiness="incorporateRegisterYourBusiness()"
@amalgamateYourBusiness="amalgamateYourBusiness()"
@affiliateYourBusiness="affiliateYourBusiness()"
@goToSocietiesOnline="goToSocietiesOnline()"
@goToCorpOnline="goToCorpOnline()"
@goToEntityDashboard="goToEntityDashboard(nr.corpNum)"
Expand Down Expand Up @@ -369,7 +368,6 @@ export default class ExistingRequestDisplay extends Mixins(
@Getter getNrId!: number
@Getter getNrState!: NrState
@Getter isMobile!: boolean
@Getter isAmalgamation!: boolean
// Global actions
@Action editExistingRequest!: ActionBindingIF
@Action setDisplayedComponent!: ActionBindingIF
Expand Down Expand Up @@ -774,15 +772,8 @@ export default class ExistingRequestDisplay extends Mixins(
this.setConditionsModalVisible(true)
}
/** Called to incorporate/register the business. */
async incorporateRegisterYourBusiness (): Promise<void> {
// safety check
if (!this.isNrApprovedOrConditional) return
return this.affiliateOrLogin()
}
async amalgamateYourBusiness (): Promise<void> {
/** Called to incorporate/register/amalgamate the business. */
async affiliateYourBusiness (): Promise<void> {
// safety check
if (!this.isNrApprovedOrConditional) return
Expand Down
8 changes: 4 additions & 4 deletions src/components/existing-request/nr-approved-gray-box.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class="register-btn mt-30"
min-width="20rem"
:disabled="disabled"
@click="$emit('incorporateRegisterYourBusiness')"
@click="$emit('affiliateYourBusiness')"
>
<strong>Register Your Business</strong>
</v-btn>
Expand All @@ -26,7 +26,7 @@
class="incorporate-now-btn mt-30"
min-width="20rem"
:disabled="disabled"
@click="$emit('incorporateRegisterYourBusiness')"
@click="$emit('affiliateYourBusiness')"
>
<strong>Incorporate Your Business</strong>
</v-btn>
Expand Down Expand Up @@ -72,7 +72,7 @@
class="amalgamate-now-btn mt-30"
min-width="20rem"
:disabled="disabled"
@click="$emit('amalgamateYourBusiness')"
@click="$emit('affiliateYourBusiness')"
>
<strong>Amalgamate Now</strong>
</v-btn>
Expand Down Expand Up @@ -225,7 +225,7 @@ export default class NrApprovedGrayBox extends Mixins(CommonMixin) {
}
get showOpenExternalIcon (): boolean {
if (this.showAmalgamateNowButton && !this.isSupportedAmalgamation(this.getNr.requestTypeCd)) return true
if (this.showAmalgamateNowButton && !this.isSupportedAmalgamation(this.getNr.entity_type_cd)) return true
if (this.showAlterNowButton && !this.isSupportedAlteration(this.getNr.requestTypeCd)) return true
return false
}
Expand Down
40 changes: 21 additions & 19 deletions src/mixins/nr-affiliation-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,27 +141,29 @@ export class NrAffiliationMixin extends Mixins(CommonMixin) {
let businessRequest = {} as BusinessRequest
const nrNumber = nr.nrNum
if (!this.isFirm(nr)) {
name = FilingTypes.INCORPORATION_APPLICATION
legalType = this.entityTypeToCorpType(nr.entity_type_cd)
businessRequest = {
filing: {
business: { legalType },
header: { accountId, name },
incorporationApplication: {
nameRequest: { legalType, nrNumber }
if (nr.request_action_cd === 'AML') {
name = FilingTypes.AMALGAMATION
legalType = nr.legalType
businessRequest = {
filing: {
business: { legalType },
header: { accountId, name },
amalgamation: {
type: AmalgamationTypes.REGULAR,
nameRequest: { legalType, nrNumber }
}
}
}
}
} else if (nr.request_action_cd === 'AML') {
name = FilingTypes.AMALGAMATION
legalType = nr.legalType
businessRequest = {
filing: {
business: { legalType },
header: { accountId, name },
amalgamation: {
type: AmalgamationTypes.REGULAR,
nameRequest: { legalType, nrNumber }
} else {
name = FilingTypes.INCORPORATION_APPLICATION
legalType = this.entityTypeToCorpType(nr.entity_type_cd)
businessRequest = {
filing: {
business: { legalType },
header: { accountId, name },
incorporationApplication: {
nameRequest: { legalType, nrNumber }
}
}
}
}
Expand Down

0 comments on commit 0abe3ac

Please sign in to comment.