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

18788 Incremental work on business name options #600

Merged
merged 1 commit into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
22 changes: 11 additions & 11 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "business-create-ui",
"version": "5.6.18",
"version": "5.6.19",
"private": true,
"appName": "Create UI",
"sbcName": "SBC Common Components",
Expand All @@ -23,7 +23,7 @@
"@bcrs-shared-components/confirm-dialog": "1.2.1",
"@bcrs-shared-components/contact-info": "1.2.15",
"@bcrs-shared-components/corp-type-module": "1.0.11",
"@bcrs-shared-components/correct-name": "1.0.33",
"@bcrs-shared-components/correct-name": "1.0.36",
"@bcrs-shared-components/court-order-poa": "3.0.11",
"@bcrs-shared-components/date-picker": "1.2.15",
"@bcrs-shared-components/document-delivery": "1.2.0",
Expand All @@ -35,7 +35,7 @@
"@bcrs-shared-components/interfaces": "1.1.5",
"@bcrs-shared-components/jurisdiction": "1.0.1",
"@bcrs-shared-components/limited-restoration-panel": "1.0.5",
"@bcrs-shared-components/mixins": "1.1.33",
"@bcrs-shared-components/mixins": "1.1.34",
"@bcrs-shared-components/nature-of-business": "1.2.14",
"@bcrs-shared-components/relationships-panel": "1.0.9",
"@bcrs-shared-components/staff-comments": "1.3.15",
Expand Down
6 changes: 6 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,12 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
this.nameRequestInvalidErrorDialog = true
})

//
// The NR checks below are sort-of a duplicate of code in BusinessName.vue and
// ResultingBusinessName.vue, but we assume the other checks passed if the user
// was able to add the NR to this filing, so these checks should be sufficient.
//

// ensure NR was found
if (!nrResponse) {
this.nameRequestInvalidType = NameRequestStates.NOT_FOUND
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 @@ -260,7 +260,7 @@ export default class AmalgamatingBusinesses extends Mixins(AmalgamationMixin, Co
/** Called when Jurisdiction menu item is changed. */
onJurisdictionChange (jurisdiction: any): void {
this.jurisdiction = jurisdiction
this.isCan = jurisdiction.group === 0
this.isCan = (jurisdiction.group === 0)
this.jurisdictionErrorMessage = this.jurisdiction ? '' : 'Home jurisdiction is required'
this.isMrasJurisdiction = MrasJurisdictions.includes(
this.jurisdiction.text.toLowerCase()
Expand Down
6 changes: 4 additions & 2 deletions src/components/Amalgamation/BusinessTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ export default class BusinessTable extends Mixins(AmalgamationMixin) {
readonly AmlTypes = AmlTypes
readonly GetCorpFullDescription = GetCorpFullDescription
@Action(useStore) setDefineCompanyStepValidity!: (x: boolean) => void
@Action(useStore) spliceAmalgamatingBusiness!: (x: number) => void
/**
Expand Down Expand Up @@ -173,7 +172,10 @@ export default class BusinessTable extends Mixins(AmalgamationMixin) {
@Watch('businesses', { deep: true, immediate: true })
@Emit('valid')
private emitValidity (): boolean {
return this.businesses.every(business => business.status === AmlStatuses.OK)
return (
(this.businesses.length > 0) &&
this.businesses.every(business => business.status === AmlStatuses.OK)
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Table is invalid if empty 😉

}
}
</script>
Expand Down
37 changes: 15 additions & 22 deletions src/components/Amalgamation/ResultingBusinessName.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
>
<!-- Editing Mode -->
<div
v-if="!isNewName"
v-if="!getCorrectNameOption"
class="section-container"
:class="{ 'invalid-section': invalidSection }"
>
Expand All @@ -27,6 +27,7 @@
>
<CorrectName
actionTxt="choose the resulting business name"
:amalgamatingBusinesses="getAmalgamatingBusinesses"
:businessId="getBusinessId"
:companyName="companyName"
:correctionNameChoices="correctionNameChoices"
Expand All @@ -46,7 +47,7 @@
<!-- Display Mode -->
<template v-else>
<NameRequestInfo />
<NameTranslations class="mt-n8" />
<NameTranslations />

<v-btn
text
Expand All @@ -67,11 +68,11 @@
import { Component, Mixins } from 'vue-property-decorator'
import { Getter, Action } from 'pinia-class'
import { useStore } from '@/store/store'
import { NameRequestMixin } from '@/mixins'
import { EmptyNameRequest, NameRequestIF } from '@/interfaces/'
import { NameRequestMixin } from '@/mixins/'
import { AmalgamatingBusinessIF, EmptyNameRequest, NameRequestIF, NameTranslationIF } from '@/interfaces/'
import { LegalServices } from '@/services/'
import { CorrectNameOptions, NrRequestActionCodes } from '@bcrs-shared-components/enums/'
import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module'
import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module/'
import { CorrectName } from '@bcrs-shared-components/correct-name/'
import NameRequestInfo from '@/components/common/NameRequestInfo.vue'
import NameTranslations from '@/components/common/NameTranslations.vue'
Expand All @@ -84,6 +85,7 @@ import NameTranslations from '@/components/common/NameTranslations.vue'
}
})
export default class ResultingBusinessName extends Mixins(NameRequestMixin) {
@Getter(useStore) getAmalgamatingBusinesses!: AmalgamatingBusinessIF[]
@Getter(useStore) getBusinessId!: string
@Getter(useStore) getBusinessLegalName!: string
@Getter(useStore) getCorrectNameOption!: CorrectNameOptions
Expand All @@ -96,10 +98,9 @@ export default class ResultingBusinessName extends Mixins(NameRequestMixin) {
@Action(useStore) setCorrectNameOption!: (x: CorrectNameOptions) => void
@Action(useStore) setNameRequest!: (x: NameRequestIF) => void
@Action(useStore) setNameRequestApprovedName!: (x: string) => void
@Action(useStore) setNameTranslations!: (x: NameTranslationIF[]) => void
// Local properties
businessNameOption = null as string
// businessNameOption = this.getNameRequestNumber ? 'named' : 'numbered'
formType = null as CorrectNameOptions
readonly correctionNameChoices = [
Expand All @@ -112,25 +113,23 @@ export default class ResultingBusinessName extends Mixins(NameRequestMixin) {
get companyName (): string {
return (this.getNameRequestApprovedName || this.getBusinessLegalName)
}
/** This section's validity state (when prompted by app). */
get invalidSection (): boolean {
return (this.getShowErrors && !this.getCorrectNameOption)
}
/** Called when component is created. */
created (): void {
// this.businessNameOption = this.getNameRequestNumber ? 'named' : 'numbered'
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not needed. Business name option comes from store/draft.

/**
* Fetches and validation a NR.
* @param nrNum the NR number
* @param businessId the business id
* @param businessId the business id (not used here but needed in method signature)
* @param phone the phone number to match
* @param email the email address to match
* @returns a promise to return the NR, or throws a printable error
*/
async fetchAndValidateNr (nrNum: string, businessId: string, phone: string, email: string): Promise<NameRequestIF> {
async fetchAndValidateNr (
nrNum: string, businessId: string, phone: string, email: string
): Promise<NameRequestIF> {
const nameRequest = await LegalServices.fetchValidContactNr(nrNum, phone, email)
if (!nameRequest) throw new Error('Error fetching Name Request')
Expand All @@ -149,19 +148,13 @@ export default class ResultingBusinessName extends Mixins(NameRequestMixin) {
this.setNameRequest(nameRequest)
}
/** Whether a new business legal name was entered. */
get isNewName (): boolean {
// Approved Name is null when we start
// and is set when a name option is selected
return !!this.getNameRequestApprovedName
}
/** Reset company name values to original. */
/** Resets company name values to original when Cancel was clicked. */
resetName (): void {
// clear out existing data
this.setNameRequest(EmptyNameRequest)
this.setNameRequestApprovedName(null)
this.setCorrectNameOption(null)
this.setNameTranslations([])
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It didn't make sense to me to leave the name translations if you Undo your business name choice.

// reset flag
this.formType = null
Expand Down
2 changes: 1 addition & 1 deletion src/components/Restoration/BusinessName.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export default class BusinessName extends Mixins(CommonMixin, DateMixin, NameReq
return !!this.getNameRequestApprovedName
}
/** Reset company name values to original. */
/** Resets company name values to original when Cancel was clicked. */
resetName (): void {
// clear out existing data
this.setNameRequest(EmptyNameRequest)
Expand Down
1 change: 1 addition & 0 deletions src/components/common/AddNameTranslation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<v-text-field
id="name-translation-input"
v-model="nameTranslation"
autofocus
filled
persistent-hint
label="Enter Name Translation"
Expand Down
Loading
Loading