Skip to content

Commit

Permalink
18159 Fixed name input error message for non-xpro (#729)
Browse files Browse the repository at this point in the history
* - app version = 5.2.10
- fixed Name Input error message logic

* - BUG FIX: added missing corp type / entity type conversions

* - a bunch of fixed for GHA warnings
  • Loading branch information
severinbeauvais authored Oct 16, 2023
1 parent 9c98f0e commit bf44782
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 38 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": "name-request",
"version": "5.2.9",
"version": "5.2.10",
"private": true,
"appName": "Name Request UI",
"sbcName": "SBC Common Components",
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/applicant-info-1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ export default class ApplicantInfo1 extends Mixins(ActionMixin) {
// proceed only if we have any roles (ie, logged in), and not staff
if (this.getKeycloakRoles.length > 0 && !this.isRoleStaff) {
// pre-populate submitting party name
const userInfo = await AuthServices.fetchUserInfo().catch(e => null)
const userInfo = await AuthServices.fetchUserInfo().catch(() => null)
if (userInfo) {
this.setApplicantDetails([
{ name: 'firstName', value: userInfo.firstname || '' },
Expand All @@ -621,7 +621,7 @@ export default class ApplicantInfo1 extends Mixins(ActionMixin) {
if (currentAccount) {
const accountId = JSON.parse(currentAccount)?.id
if (accountId) {
const orgInfo = await AuthServices.fetchOrgInfo(accountId).catch(e => null)
const orgInfo = await AuthServices.fetchOrgInfo(accountId).catch(() => null)
if (orgInfo) {
const mailingAddress = orgInfo.mailingAddress
if (mailingAddress.street) {
Expand Down
1 change: 1 addition & 0 deletions src/components/common/nested-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export default class NestedSelect extends Vue {
}
@Emit('change')
// eslint-disable-next-line @typescript-eslint/no-unused-vars
emitChangeEvent (item: any): void {}
}
</script>
Expand Down
6 changes: 3 additions & 3 deletions src/components/common/request-details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
<!-- If there's no contact person (agent / lawyer / etc.) the applicant is the contact -->
<li>{{ `${applicantName}` }}</li>
<li>
{{ `${applicant.addrLine1 ? applicant.addrLine1 : ''} ${applicant.addrLine2 ? applicant.addrLine2 : ''}` }}
{{ `${applicant.addrLine1 || ''} ${applicant.addrLine2 || ''}` }}
</li>
<li>
{{ `${applicant.city ? applicant.city : ''}, ${applicant.stateProvinceCd ? applicant.stateProvinceCd : ''}` }}
{{ `${applicant.city || ''}, ${applicant.stateProvinceCd || ''}` }}
</li>
<li>
{{ `${applicant.countryTypeCd === Location.CA ? 'Canada' : applicant.countryTypeCd},
${applicant.postalCd ? applicant.postalCd : ''}` }}
${applicant.postalCd || ''}` }}
</li>
</ul>
</v-col>
Expand Down
1 change: 1 addition & 0 deletions src/components/dialogs/name-check-issues.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export default class NameCheckIssuesDialog extends Vue {
// Global getter
@Getter isMobile!: boolean
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@Emit() proceed (val: boolean) { }
}
</script>
Expand Down
32 changes: 14 additions & 18 deletions src/components/dialogs/pick-entity-or-conversion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
</button>
</template>
<div
v-for="(blurb, i) in entityBlurbs(conversion.value)"
:key="`blurb-${i}`"
v-for="(blurb, j) in entityBlurbs(conversion.value)"
:key="`blurb-${j}`"
>
<span>{{ blurb }}</span>
</div>
Expand Down Expand Up @@ -131,14 +131,12 @@
{{ entity.text }}
</button>
</template>
<template>
<div
v-for="(blurb, index) in entityBlurbs(entity.value)"
:key="`blurb-${index}`"
>
<span :class="{ 'tooltip-bullet': index !== 0}">{{ blurb }}</span>
</div>
</template>
<div
v-for="(blurb, index) in entityBlurbs(entity.value)"
:key="`blurb-${index}`"
>
<span :class="{ 'tooltip-bullet': index !== 0}">{{ blurb }}</span>
</div>
</v-tooltip>
</td>
</tr>
Expand Down Expand Up @@ -191,14 +189,12 @@
{{ entity.text }}
</button>
</template>
<template>
<div
v-for="(blurb, index) in entityBlurbs(entity.value)"
:key="`blurb-xpro-${index}`"
>
<span :class="{ 'tooltip-bullet': index !== 0}">{{ blurb }}</span>
</div>
</template>
<div
v-for="(blurb, index) in entityBlurbs(entity.value)"
:key="`blurb-xpro-${index}`"
>
<span :class="{ 'tooltip-bullet': index !== 0}">{{ blurb }}</span>
</div>
</v-tooltip>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ export default class ExistingRequestDisplay extends Mixins(
}
protected created (): void {
this.$root.$on('paymentComplete', (flag = false) => { this.pendingPayment = null })
this.$root.$on('paymentComplete', () => { this.pendingPayment = null })
}
protected destroyed (): void {
Expand Down
21 changes: 15 additions & 6 deletions src/components/new-request/business-lookup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,23 @@
<!-- Customize the results template -->
<template #item="{ item }">
<v-row class="business-lookup-result pt-1">
<v-col cols="3" class="result-identifier">
{{ item.identifier }}
<v-col
cols="3"
class="result-identifier"
>
{{ item.identifier }}
</v-col>
<v-col cols="7" class="result-name">
{{ item.name }}
<v-col
cols="7"
class="result-name"
>
{{ item.name }}
</v-col>
<v-col cols="2" class="result-btn">
Select
<v-col
cols="2"
class="result-btn"
>
Select
</v-col>
</v-row>
</template>
Expand Down
11 changes: 7 additions & 4 deletions src/components/new-request/name-input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,14 @@ export default class NameInput extends Vue {
get message (): string[] {
if (this.getErrors.includes('name')) {
if (this.isMrasSearch) {
return ['Please enter a corporation number to search for']
} else {
return ['Please enter the business\'s full legal name in home jurisdiction']
if (this.isXproFlow) {
if (this.isMrasJurisdiction && !this.getHasNoCorpNum) {
return ['Please enter a corporation number to search for']
} else {
return ['Please enter the business\'s full legal name in home jurisdiction']
}
}
return ['Please enter a name for the business']
}
if (this.getErrors.includes('length')) {
Expand Down
23 changes: 22 additions & 1 deletion src/mixins/common-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,37 @@ export class CommonMixin extends Vue {
*/
entityTypeToCorpType (entityType: EntityTypes): CorpTypeCd {
switch (entityType) {
case EntityTypes.A: return CorpTypeCd.EXTRA_PRO_A // same as XUL
case EntityTypes.BC: return CorpTypeCd.BENEFIT_COMPANY
case EntityTypes.CC: return CorpTypeCd.BC_CCC
case EntityTypes.CP: return CorpTypeCd.COOP
case EntityTypes.CR: return CorpTypeCd.BC_COMPANY
case EntityTypes.DBA: return CorpTypeCd.SOLE_PROP // same as FR
case EntityTypes.FI: return CorpTypeCd.FINANCIAL
case EntityTypes.FR: return CorpTypeCd.SOLE_PROP
case EntityTypes.GP: return CorpTypeCd.PARTNERSHIP
case EntityTypes.LL: return CorpTypeCd.LL_PARTNERSHIP
case EntityTypes.LLC: return CorpTypeCd.LIMITED_CO // same as RLC
case EntityTypes.LP: return CorpTypeCd.LIM_PARTNERSHIP
case EntityTypes.PA: return CorpTypeCd.PRIVATE_ACT
case EntityTypes.PAR: return CorpTypeCd.PARISHES
case EntityTypes.RLC: return CorpTypeCd.LIMITED_CO
case EntityTypes.SO: return CorpTypeCd.SOCIETY
case EntityTypes.UL: return CorpTypeCd.BC_ULC_COMPANY
case EntityTypes.XCP: return CorpTypeCd.XPRO_COOP
case EntityTypes.XCR: return CorpTypeCd.XPRO_CORPORATION
case EntityTypes.XL: return CorpTypeCd.XPRO_LL_PARTNR // same as XLL
case EntityTypes.XLL: return CorpTypeCd.XPRO_LL_PARTNR
case EntityTypes.XLP: return CorpTypeCd.XPRO_LIM_PARTNR
case EntityTypes.XP: return CorpTypeCd.XPRO_LIM_PARTNR // same as XLP
case EntityTypes.XSO: return CorpTypeCd.XPRO_SOCIETY
case EntityTypes.XUL: return CorpTypeCd.EXTRA_PRO_A
default: return null
}
}

/**
* Entities UI codes to Name Request Code
* Entities UI codes to Name Request Code.
* @example ULC --> UL
*/
corpTypeToEntityType (entityType: CorpTypeCd): EntityTypes {
Expand All @@ -87,9 +100,17 @@ export class CommonMixin extends Vue {
case CorpTypeCd.BC_ULC_COMPANY: return EntityTypes.UL
case CorpTypeCd.COOP: return EntityTypes.CP
case CorpTypeCd.EXTRA_PRO_A: return EntityTypes.XUL
case CorpTypeCd.FINANCIAL: return EntityTypes.FI
case CorpTypeCd.PARTNERSHIP: return EntityTypes.GP
case CorpTypeCd.LIMITED_CO: return EntityTypes.RLC
case CorpTypeCd.LIM_PARTNERSHIP: return EntityTypes.LP
case CorpTypeCd.LL_PARTNERSHIP: return EntityTypes.LL
case CorpTypeCd.PRIVATE_ACT: return EntityTypes.PA
case CorpTypeCd.PARISHES: return EntityTypes.PAR
case CorpTypeCd.SOCIETY: return EntityTypes.SO
case CorpTypeCd.SOLE_PROP: return EntityTypes.FR
case CorpTypeCd.XPRO_COOP: return EntityTypes.XCP
case CorpTypeCd.XPRO_CORPORATION: return EntityTypes.XCR
case CorpTypeCd.XPRO_LIM_PARTNR: return EntityTypes.XLP
case CorpTypeCd.XPRO_LL_PARTNR: return EntityTypes.XLL
case CorpTypeCd.XPRO_SOCIETY: return EntityTypes.XSO
Expand Down

0 comments on commit bf44782

Please sign in to comment.