Skip to content

Commit

Permalink
18788 Updated amalgamation -> amalgamationApplication + business name…
Browse files Browse the repository at this point in the history
… options (WIP) (bcgov#598)

* - app version = 5.6.14
- added ResultingBusinessName component
- misc refactor and new code to handle 3 options
- still WIP

* - changed snackbar close text to a white icon

* - added random key to BusinessLookup to reset its state between calls

* - replaced local EntityState with shared EntityStates
- added validation for isHistorical

* - ResultingBusinessName WIP !!!

* - updated imported enums, etc
- updated some enums locally (amalgamation -> amalgamationApplication)
- ResultingBusinessName is still WIP (so don't use it)

---------

Co-authored-by: Severin Beauvais <severin.beauvais@gov.bc.ca>
  • Loading branch information
2 people authored and JazzarKarim committed Feb 23, 2024
1 parent 4e40583 commit c595237
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 87 deletions.
25 changes: 5 additions & 20 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.6.13",
"version": "5.6.14",
"private": true,
"appName": "Create UI",
"sbcName": "SBC Common Components",
Expand Down
1 change: 0 additions & 1 deletion src/components/Amalgamation/ResultingBusinessName.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ export default class ResultingBusinessName extends Mixins(AmalgamationMixin, Nam
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)
Expand Down
1 change: 1 addition & 0 deletions src/components/common/NameRequestInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
</v-row>
</div>
</template>

<template v-else-if="isAmalgamationFiling && !getNameRequestNumber">
<!-- Numbered Amalgamation-->
<div class="section-container">
Expand Down
8 changes: 4 additions & 4 deletions src/mixins/filing-template-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM
}

// restore the amalgamating businesses array
if (draftFiling.amalgamation.amalgamatingBusinesses) {
if (draftFiling.amalgamationApplication.amalgamatingBusinesses) {
this.setAmalgamatingBusinesses([
// *** TODO: remove static items when they are no longer needed for testing
// {
Expand All @@ -253,14 +253,14 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM
// foreignJurisdiction: { country: 'US' },
// role: AmlRoles.AMALGAMATING
// },
...draftFiling.amalgamation.amalgamatingBusinesses
...draftFiling.amalgamationApplication.amalgamatingBusinesses
])
this.refetchAmalgamatingBusinessesInfo()
}

// restore the amalgamation court approval
if (draftFiling.amalgamation.courtApproval) {
this.setAmalgamationCourtApproval(draftFiling.amalgamation.courtApproval)
if (draftFiling.amalgamationApplication.courtApproval) {
this.setAmalgamationCourtApproval(draftFiling.amalgamationApplication.courtApproval)
}

// restore Office Addresses
Expand Down
10 changes: 5 additions & 5 deletions src/router/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const routes = [
meta: {
step: 1,
requiresAuth: true,
filingType: FilingTypes.AMALGAMATION,
filingType: FilingTypes.AMALGAMATION_APPLICATION,
filingSubType: AmalgamationTypes.REGULAR
}
},
Expand All @@ -56,7 +56,7 @@ export const routes = [
meta: {
step: 2,
requiresAuth: true,
filingType: FilingTypes.AMALGAMATION,
filingType: FilingTypes.AMALGAMATION_APPLICATION,
filingSubType: AmalgamationTypes.REGULAR
}
},
Expand All @@ -67,7 +67,7 @@ export const routes = [
meta: {
step: 3,
requiresAuth: true,
filingType: FilingTypes.AMALGAMATION,
filingType: FilingTypes.AMALGAMATION_APPLICATION,
filingSubType: AmalgamationTypes.REGULAR
}
},
Expand All @@ -78,7 +78,7 @@ export const routes = [
meta: {
step: 4,
requiresAuth: true,
filingType: FilingTypes.AMALGAMATION,
filingType: FilingTypes.AMALGAMATION_APPLICATION,
filingSubType: AmalgamationTypes.REGULAR
}
},
Expand All @@ -89,7 +89,7 @@ export const routes = [
meta: {
step: 5,
requiresAuth: true,
filingType: FilingTypes.AMALGAMATION,
filingType: FilingTypes.AMALGAMATION_APPLICATION,
filingSubType: AmalgamationTypes.REGULAR
}
},
Expand Down
75 changes: 19 additions & 56 deletions src/views/AmalgamationRegular/Information.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,7 @@
</template>
</ExpandableHelp>

<v-card
flat
class="mt-5"
>
<NameRequestInfo />
<NameTranslations class="mt-n8" />
</v-card>
<ResultingBusinessName class="mt-5" />
</section>
</div>
</template>
Expand All @@ -64,25 +58,24 @@
import { Component, Mixins, Watch } from 'vue-property-decorator'
import { Getter, Action } from 'pinia-class'
import { useStore } from '@/store/store'
import { CommonMixin } from '@/mixins'
import { RouteNames } from '@/enums'
import { CommonMixin, NameRequestMixin } from '@/mixins'
import { CorrectNameOptions, RouteNames } from '@/enums'
import { ExpandableHelp } from '@bcrs-shared-components/expandable-help'
import AmalgamatingBusinesses from '@/components/Amalgamation/AmalgamatingBusinesses.vue'
import ResultingBusinessName from '@/components/Amalgamation/ResultingBusinessName.vue'
import BusinessTypeHelp from '@/components/Amalgamation/BusinessTypeHelp.vue'
import NameRequestInfo from '@/components/common/NameRequestInfo.vue'
import NameTranslations from '@/components/common/NameTranslations.vue'
@Component({
components: {
AmalgamatingBusinesses,
BusinessTypeHelp,
ExpandableHelp,
NameRequestInfo,
NameTranslations
ResultingBusinessName
}
})
export default class AmalgamationRegularInformation extends Mixins(CommonMixin) {
export default class AmalgamationRegularInformation extends Mixins(CommonMixin, NameRequestMixin) {
@Getter(useStore) getAmalgamatingBusinessesValid!: boolean
@Getter(useStore) getCorrectNameOption!: CorrectNameOptions
@Getter(useStore) getNameTranslationsValid!: boolean
@Getter(useStore) getShowErrors!: boolean
Expand All @@ -99,11 +92,16 @@ export default class AmalgamationRegularInformation extends Mixins(CommonMixin)
'resulting-business-name'
]
/** Whether the Resulting Business Name and Type section is valid. */
get getResultingBusinessNameValid (): boolean {
return (this.getNameTranslationsValid && !!this.getCorrectNameOption)
}
/** Object of valid flags. Must match validComponents above. */
get validFlags (): object {
return {
validAmalgamatingBusinesses: this.getAmalgamatingBusinessesValid,
validNameTranslations: this.getNameTranslationsValid
validResultingBusinessName: this.getResultingBusinessNameValid
}
}
Expand All @@ -121,22 +119,25 @@ export default class AmalgamationRegularInformation extends Mixins(CommonMixin)
this.$root.$on('showSpinner', (flag = false) => { this.showSpinner = flag })
}
/** When amalgamating businesses validity changes, update this step's validity. */
@Watch('getAmalgamatingBusinessesValid')
private onAmalgamatingBusinessesValid (): void {
this.setDefineCompanyStepValidity(
this.amalgamatingBusinessesValid &&
this.getNameTranslationsValid
this.getResultingBusinessNameValid
)
}
@Watch('getNameTranslationsValid', { deep: true })
/** When resulting businesses name validity changes, update this step's validity. */
@Watch('getResultingBusinessNameValid', { deep: true })
private onNameTranslationsValid (): void {
this.setDefineCompanyStepValidity(
this.amalgamatingBusinessesValid &&
this.getNameTranslationsValid
this.getResultingBusinessNameValid
)
}
/** When we route to this step, validate the step and scroll to any errors. */
@Watch('$route')
private async scrollToInvalidComponent (): Promise<void> {
if (this.getShowErrors && this.$route.name === RouteNames.AMALG_REG_INFORMATION) {
Expand Down Expand Up @@ -169,45 +170,7 @@ h2::before {
content: counter(header-counter) '. ';
}
.value.name-request {
width: 100%;
min-width: 24rem;
}
.meta-container {
display: flex;
flex-flow: column nowrap;
position: relative;
> label:first-child {
font-weight: bold;
}
}
@media (min-width: 768px) {
.meta-container {
flex-flow: row nowrap;
> label:first-child {
flex: 0 0 auto;
padding-right: 2rem;
width: 12rem;
}
}
}
// #business-buttons-container {
// .v-btn + .v-btn {
// margin-left: 0.5rem;
// }
// }
header p {
padding-top: 0.5rem;
}
// Vuetify Overrides
:deep(.v-select__selection--comma) {
overflow: inherit;
}
</style>

0 comments on commit c595237

Please sign in to comment.