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

20779 Implemented Easy Legal Name Fix #570

Merged
merged 7 commits into from
Apr 22, 2024
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
12 changes: 6 additions & 6 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "business-edit-ui",
"version": "4.8.0",
"version": "4.9.0",
"private": true,
"appName": "Edit UI",
"sbcName": "SBC Common Components",
Expand Down Expand Up @@ -31,7 +31,7 @@
"@bcrs-shared-components/fee-summary": "1.2.5",
"@bcrs-shared-components/folio-number": "1.1.1",
"@bcrs-shared-components/help-business-number": "1.1.1",
"@bcrs-shared-components/interfaces": "1.1.11",
"@bcrs-shared-components/interfaces": "1.1.12",
"@bcrs-shared-components/limited-restoration-panel": "2.0.1",
"@bcrs-shared-components/nature-of-business": "1.2.4",
"@bcrs-shared-components/relationships-panel": "1.0.14",
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export default class App extends Mixins(CommonMixin, FilingTemplateMixin) {
haveData = false

/** The Update Current JS Date timer id. */
private updateCurrentJsDateId = null // may be number or NodeJS.Timeout
private updateCurrentJsDateId = null as any // NodeJS.Timeout

/** The route breadcrumbs list. */
get breadcrumbs (): Array<BreadcrumbIF> {
Expand Down
8 changes: 2 additions & 6 deletions src/components/Alteration/summary/BusinessType.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<v-col cols="8">
<span class="info-text">
Changing from a {{ GetCorpFullDescription(originalLegalType) }} to a
Changing from a {{ GetCorpFullDescription(getOriginalLegalType) }} to a
{{ GetCorpFullDescription(getEntityType) }}
</span>

Expand Down Expand Up @@ -38,17 +38,13 @@
<script lang="ts">
import { FilingTemplateMixin } from '@/mixins'
import { Component, Mixins } from 'vue-property-decorator'
import { CorpTypeCd, GetCorpFullDescription } from '@bcrs-shared-components/corp-type-module/'
import { GetCorpFullDescription } from '@bcrs-shared-components/corp-type-module/'
import { ResourceUtilities } from '@/utils/resource-utils'

@Component({})
export default class BusinessType extends Mixins(FilingTemplateMixin) {
readonly GetCorpFullDescription = GetCorpFullDescription // for template

get originalLegalType (): CorpTypeCd {
return this.getEntitySnapshot?.businessInfo?.legalType
}

get articleInfo (): string {
return ResourceUtilities.articleInfo(this.getEntityType)
}
Expand Down
16 changes: 9 additions & 7 deletions src/components/Conversion/ConversionNOB.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ export default class ConversionNOB extends Mixins(CommonMixin) {
@Action(useStore) setValidComponent!: (x: ActionKvIF) => void

// local variables
protected dropdown = false // v-model for dropdown menu
protected onEditMode = false
protected naicsText = ''
dropdown = false // v-model for dropdown menu
onEditMode = false
naicsText = ''

readonly naicsRules = [
(v: string) => !!v || 'Nature of Business is required',
Expand Down Expand Up @@ -207,12 +207,12 @@ export default class ConversionNOB extends Mixins(CommonMixin) {
}

/** Called when user has clicked the Change button. */
protected onChangeClicked (): void {
onChangeClicked (): void {
this.onEditMode = true
}

/** Called when user has clicked the Done button. */
protected onDoneClicked (): void {
onDoneClicked (): void {
// eslint-disable-next-line no-undef
let validForm = (this.$refs.form as Vue & { validate: () => boolean }).validate()
if (validForm) {
Expand All @@ -227,19 +227,21 @@ export default class ConversionNOB extends Mixins(CommonMixin) {
}

/** Called when user has clicked the Cancel button. */
protected onCancelClicked (): void {
onCancelClicked (): void {
this.onEditMode = false
}

/** Called when user has clicked the Undo button. */
protected onUndoClicked (): void {
onUndoClicked (): void {
const code = this.getSnapshotNaics.naicsCode
const desc = this.getSnapshotNaics.naicsDescription
this.naicsText = null
if (code && desc) {
this.naicsText = this.hasNaicsChanged ? this.naicsText : `${code} - ${desc}`
} else if (desc) {
this.naicsText = desc
} else {
this.naicsText = ''
}
this.setNaics(this.getSnapshotNaics)
}
Expand Down
8 changes: 4 additions & 4 deletions src/components/SpecialResolution/ResolutionSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
<script lang="ts">
import { Component, Mixins, Watch } from 'vue-property-decorator'
import { Action, Getter } from 'pinia-class'
import { FormIF, EntitySnapshotIF } from '@/interfaces/'
import { FormIF } from '@/interfaces/'
import { CommonMixin, DateMixin } from '@/mixins/'
import { HelpSection } from '@/components/common/'
import { DatePicker as DatePickerShared } from '@bcrs-shared-components/date-picker/'
Expand All @@ -163,10 +163,10 @@ import { useStore } from '@/store/store'
}
})
export default class ResolutionSummary extends Mixins(CommonMixin, DateMixin) {
@Getter(useStore) getSpecialResolution!: SpecialResolutionIF
@Getter(useStore) getAppValidate!: boolean
@Getter(useStore) getOriginalLegalName!: string
@Getter(useStore) getSpecialResolution!: SpecialResolutionIF
@Getter(useStore) getSpecialResolutionConfirmValid!: boolean
@Getter(useStore) getEntitySnapshot!: EntitySnapshotIF

@Action(useStore) setSpecialResolution!: (x: SpecialResolutionIF) => void
@Action(useStore) setSpecialResolutionConfirmStateValidity!: (x: boolean) => void
Expand Down Expand Up @@ -226,7 +226,7 @@ export default class ResolutionSummary extends Mixins(CommonMixin, DateMixin) {
/** The company name. */
get companyName (): string {
// old company name need show even they change it
return this.getEntitySnapshot?.businessInfo?.legalName || ''
return this.getOriginalLegalName || ''
}

/** Set validate on file and pay click. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,9 @@ export default class SpecialResolutionSummary extends Mixins(DateMixin, FeeMixin
return `${this.getBusinessNumber || '[Incorporation Number]'} B.C. Ltd.`
}

/** The legal type before changes. */
get originalLegalType (): string {
return this.getEntitySnapshot?.businessInfo?.legalType
}

/** The association type before changes. */
get originalAssociationType (): string {
return this.getEntitySnapshot?.businessInfo?.associationType
return this.getOriginalBusinessInfo?.associationType
}

/** Calculates the sum of special resolution fees. */
Expand Down
14 changes: 7 additions & 7 deletions src/components/common/EntityInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,33 +49,33 @@
import { Component, Mixins } from 'vue-property-decorator'
import { Getter } from 'pinia-class'
import { CommonMixin } from '@/mixins/'
import { BusinessInformationIF, EntitySnapshotIF } from '@/interfaces/'
import { BusinessInformationIF } from '@/interfaces/'
import { ContactPointIF } from '@bcrs-shared-components/interfaces/'
import { GetCorpFullDescription } from '@bcrs-shared-components/corp-type-module/'

import { CorpTypeCd, GetCorpFullDescription } from '@bcrs-shared-components/corp-type-module/'
import { useStore } from '@/store/store'

@Component({})
export default class EntityInfo extends Mixins(CommonMixin) {
// Global getters
@Getter(useStore) getBusinessId!: string
@Getter(useStore) getBusinessInformation!: BusinessInformationIF
@Getter(useStore) getOriginalLegalType!: CorpTypeCd
@Getter(useStore) getOriginalLegalName!: string
@Getter(useStore) getBusinessContact!: ContactPointIF
@Getter(useStore) getEntitySnapshot!: EntitySnapshotIF

/** The original entity type. */
get originalEntityType (): string {
if (this.getEntitySnapshot?.businessInfo) {
return GetCorpFullDescription(this.getEntitySnapshot.businessInfo.legalType)
const legalType = this.getOriginalLegalType
if (legalType) {
return GetCorpFullDescription(legalType)
} else {
return 'Unknown'
}
}

/** The business number (aka tax id). */
get businessNumber (): string {
return this.getBusinessInformation?.taxId
return this.getBusinessInformation.taxId
}
}
</script>
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/ShareStructure/ShareStructures.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export default class ShareStructures extends Mixins(CommonMixin) {
@Action(useStore) setValidComponent!: (x: ActionKvIF) => void

// Local propertiues
protected isEditing = false
protected showResolutionDateDialog = false
isEditing = false
showResolutionDateDialog = false

/** Whether share section is invalid, only when prompted by app. */
get invalidShareSection (): boolean {
Expand Down
6 changes: 3 additions & 3 deletions src/components/common/YourCompany/AssociationType.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ import { Component, Mixins, Watch } from 'vue-property-decorator'
import { Action, Getter } from 'pinia-class'
import { CoopTypes } from '@/enums'
import { CommonMixin } from '@/mixins'
import { ActionKvIF, BusinessInformationIF, EntitySnapshotIF } from '@/interfaces'
import { ActionKvIF, BusinessInformationIF, EmptyBusinessInfo } from '@/interfaces'
import { VuetifyRuleFunction } from '@/types'
import { CoopTypeToDescription } from '@/utils'
import { useStore } from '@/store/store'
Expand All @@ -180,7 +180,7 @@ export default class AssociationType extends Mixins(CommonMixin) {
@Getter(useStore) getComponentValidate!: boolean
@Getter(useStore) getEditLabel!: string
@Getter(useStore) getEditedLabel!: string
@Getter(useStore) getEntitySnapshot!: EntitySnapshotIF
@Getter(useStore) getOriginalBusinessInfo!: BusinessInformationIF
@Getter(useStore) hasAssociationTypeChanged!: boolean

/** Global actions */
Expand Down Expand Up @@ -235,7 +235,7 @@ export default class AssociationType extends Mixins(CommonMixin) {

/** Reset association type value to original */
resetAssociationType () {
this.setBusinessInformation(this.getEntitySnapshot.businessInfo)
this.setBusinessInformation(this.getOriginalBusinessInfo || { ...EmptyBusinessInfo })
this.onComponentValidateChanged()
this.isEditingAssociationType = false
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/common/YourCompany/BusinessContactInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default class BusinessContactInfo extends Mixins(CommonMixin) {
@Action(useStore) setValidComponent!: (x: ActionKvIF) => void

// Local variable
protected isEditingContact = false
isEditingContact = false

/** The section validity state (when prompted by app). */
get invalidSection (): boolean {
Expand All @@ -77,7 +77,7 @@ export default class BusinessContactInfo extends Mixins(CommonMixin) {
}

/** On Contact Info Change event, updates auth db and store. */
protected async onContactInfoChange (contactInfo: ContactPointIF): Promise<void> {
async onContactInfoChange (contactInfo: ContactPointIF): Promise<void> {
// do nothing if contact info was not changed
if (isEqual(contactInfo, this.getBusinessContact)) return

Expand All @@ -90,7 +90,7 @@ export default class BusinessContactInfo extends Mixins(CommonMixin) {
// reset business contact to previous value
const prev = this.getBusinessContact
// toggle for reactivity
this.setBusinessContact({})
this.setBusinessContact({} as ContactPointIF)
this.$nextTick(() => this.setBusinessContact(prev))
}
}
Expand Down
32 changes: 17 additions & 15 deletions src/components/common/YourCompany/ChangeBusinessType.vue
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ import BcRegEntityDetails from '@/components/Alteration/BcRegEntityDetails.vue'
import { BcRegContacts } from '@/components/common/'
import { CommonMixin } from '@/mixins/'
import { CorpTypeCd, GetCorpFullDescription } from '@bcrs-shared-components/corp-type-module/'
import { EntitySnapshotIF, EntityTypeOption, ResourceIF } from '@/interfaces/'
import { EntityTypeOption, ResourceIF } from '@/interfaces/'
import { NameRequestIF } from '@bcrs-shared-components/interfaces'
import { GetFeatureFlag, ResourceUtilities } from '@/utils'
import { useStore } from '@/store/store'
Expand All @@ -304,16 +304,18 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) {
// Global getters
@Getter(useStore) getEditLabel!: string
@Getter(useStore) getEditedLabel!: string
@Getter(useStore) getEntitySnapshot!: EntitySnapshotIF
@Getter(useStore) getEntityType!: CorpTypeCd
@Getter(useStore) getNameRequestLegalName!: string
@Getter(useStore) getNumberOfDirectors!: number
@Getter(useStore) getOriginalLegalName!: string
@Getter(useStore) getOriginalLegalType!: CorpTypeCd
@Getter(useStore) getOriginalNrNumber!: string
@Getter(useStore) getResource!: ResourceIF
@Getter(useStore) hasBusinessNameChanged!: boolean
@Getter(useStore) hasBusinessTypeChanged!: boolean
@Getter(useStore) isBcCompany!: boolean
@Getter(useStore) isBenefitCompany!: boolean
@Getter(useStore) isBcUlcCompany!: boolean
@Getter(useStore) isBenefitCompany!: boolean
@Getter(useStore) isConflictingLegalType!: boolean
@Getter(useStore) isEntityTypeChangedByName!: boolean
@Getter(useStore) isNameChangedByType!: boolean
Expand Down Expand Up @@ -358,7 +360,7 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) {
get isNewName (): boolean {
return (
this.getNameRequestLegalName &&
this.getNameRequestLegalName !== this.getEntitySnapshot?.businessInfo?.legalName
this.getNameRequestLegalName !== this.getOriginalLegalName
)
}

Expand All @@ -377,10 +379,10 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) {

get enableEditButton (): boolean {
// Exclude CCC - Originally: isBcCompany || isBcUlcCompany || isBenefitCompany
if (this.getEntitySnapshot?.businessInfo?.legalType === CorpTypeCd.BC_CCC) {
if (this.getOriginalLegalType === CorpTypeCd.BC_CCC) {
return false
}
return this.supportedEntityTypes?.includes(this.getEntitySnapshot?.businessInfo?.legalType)
return this.supportedEntityTypes?.includes(this.getOriginalLegalType)
}

get nameRequestRequiredError (): boolean {
Expand All @@ -391,9 +393,9 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) {
if (this.isCommunityContribution || this.isUnlimitedLiability) {
return true
}
// Named ULC to BC Limited or BC Benefit require a name request.
if (this.getEntitySnapshot?.businessInfo?.legalType === CorpTypeCd.BC_ULC_COMPANY &&
(this.isBcLimited || this.isBenefitCompany)) {
// Named ULC to BC Limited require a name request.
if (this.getOriginalLegalType === CorpTypeCd.BC_ULC_COMPANY &&
(this.isBcLimited || this.isBenefitCompany)) {
return true
}
return false
Expand All @@ -405,13 +407,13 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) {

/** Reset company type values to original. */
resetType () {
this.setEntityType(this.getEntitySnapshot?.businessInfo?.legalType)
this.setEntityType(this.getOriginalLegalType || null)
// reset name request
this.setNameRequest({
legalType: this.getEntitySnapshot?.businessInfo?.legalType,
nrNum: this.getEntitySnapshot?.businessInfo?.nrNumber
legalType: this.getOriginalLegalType,
nrNum: this.getOriginalNrNumber
} as any)
this.setNameRequestLegalName(this.getEntitySnapshot?.businessInfo?.legalName)
this.setNameRequestLegalName(this.getOriginalLegalName)
this.setNameChangedByType(false)
this.isEditingType = false
this.confirmArticles = false
Expand All @@ -423,13 +425,13 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) {
this.isEditingType = false

if (this.shouldUpdateName()) {
const originalName = this.getEntitySnapshot?.businessInfo.legalName
const originalName = this.getOriginalLegalName
const updatedName = this.getUpdatedName(originalName)

if (originalName !== updatedName) {
this.setNameRequest({
legalType: this.selectedEntityType,
nrNum: this.getEntitySnapshot?.businessInfo?.nrNumber
nrNum: this.getOriginalNrNumber
} as any)
this.setNameRequestLegalName(updatedName)
this.setNameChangedByType(true)
Expand Down
Loading
Loading