Skip to content

Commit

Permalink
19266 - Plugged in Company Name Component (#688)
Browse files Browse the repository at this point in the history
* Plugged in Company Name Component

* Corrected linting issues

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

* Corrected Linting Issues-2

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

* Updated Component Formatting

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

* Updated Version

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

* Updated for V-Card style

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

* Updated linting and space size

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

* Updated linting

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

* Plugged in Company Name Component

* Corrected linting issues

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

* Corrected Linting Issues-2

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

* Updated Component Formatting

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

* Updated for V-Card style

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

* Updated linting and space size

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

* Updated linting

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

* Fixed the validation page issue

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

* combined the variables used in Stepper, added validNameTranslation in step 2

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

* Edited version

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

* Removed duplicate import'

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

* removed BusinessBcValid variables

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

* Trigger CI build, update package-lock.json

* updated the valid flag order

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

* Updated version

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

* Added Unittest for Name Component

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>

---------

Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>
  • Loading branch information
ArwenQin authored May 17, 2024
1 parent c57ae41 commit fd2709b
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 22 deletions.
2 changes: 1 addition & 1 deletion 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.10.9",
"version": "5.10.10",
"private": true,
"appName": "Create UI",
"sbcName": "SBC Common Components",
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 @@ -300,6 +300,7 @@ export default class NameRequestInfo extends Mixins(CommonMixin, DateMixin) {
case NrRequestActionCodes.NEW_BUSINESS: return 'New Business'
case NrRequestActionCodes.RESTORE: return 'Restoration Request'
case NrRequestActionCodes.AMALGAMATE: return 'Amalgamation'
case NrRequestActionCodes.MOVE: return 'Continuation In'
}
return '' // should never happen
}
Expand Down
3 changes: 1 addition & 2 deletions src/components/common/Stepper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export default class Stepper extends Vue {
@Getter(useStore) isAffidavitValid!: boolean
@Getter(useStore) isAmalgamationInformationValid!: boolean
@Getter(useStore) isBusySaving!: boolean
@Getter(useStore) isContinuationInBusinessBcValid!: boolean
@Getter(useStore) isContinuationInBusinessHomeValid!: boolean
@Getter(useStore) isCreateShareStructureValid!: boolean
@Getter(useStore) isDefineCompanyValid!: boolean
Expand All @@ -105,7 +104,7 @@ export default class Stepper extends Vue {
case RouteNames.AMALG_SHORT_REVIEW_CONFIRM: return this.isFilingValid
case RouteNames.CONTINUATION_IN_BUSINESS_HOME: return this.isContinuationInBusinessHomeValid
case RouteNames.CONTINUATION_IN_BUSINESS_BC: return this.isContinuationInBusinessBcValid
case RouteNames.CONTINUATION_IN_BUSINESS_BC: return this.isDefineCompanyValid
case RouteNames.CONTINUATION_IN_PEOPLE_ROLES: return this.isAddPeopleAndRolesValid
case RouteNames.CONTINUATION_IN_SHARE_STRUCTURE: return this.isCreateShareStructureValid
case RouteNames.CONTINUATION_IN_REVIEW_CONFIRM: return this.isFilingValid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ContinuationAuthorizationIF, ExistingBusinessInfoIF } from '@/interface

// TODO: Add properties as needed
export interface ContinuationInStateIF {
businessBcValid: boolean
businessHomeValid: boolean
continuationAuthorization: ContinuationAuthorizationIF
existingBusinessInfo: ExistingBusinessInfoIF
Expand Down
1 change: 0 additions & 1 deletion src/store/state/state-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ export const stateModel: StateModelIF = {
type: null
},
continuationIn: {
businessBcValid: false,
businessHomeValid: false,
continuationAuthorization: null,
existingBusinessInfo: null
Expand Down
8 changes: 0 additions & 8 deletions src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,11 +551,6 @@ export const useStore = defineStore('store', {
return this.getDefineCompanyStep.valid
},

/** Is true when the Continuation In Business BC step is valid. */
isContinuationInBusinessBcValid (): boolean {
return this.getContinuationIn.businessBcValid
},

/** Is true when the Continuation In Business Home step is valid. */
isContinuationInBusinessHomeValid (): boolean {
return this.getContinuationIn.businessHomeValid
Expand Down Expand Up @@ -1160,9 +1155,6 @@ export const useStore = defineStore('store', {
setDefineCompanyStepValidity (valid: boolean) {
this.stateModel.defineCompanyStep.valid = valid
},
setContinuationInBusinessBcValid (valid: boolean) {
this.getContinuationIn.businessBcValid = valid
},
setContinuationInBusinessHomeValid (valid: boolean) {
this.getContinuationIn.businessHomeValid = valid
},
Expand Down
32 changes: 25 additions & 7 deletions src/views/ContinuationIn/ContinuationInBusinessBc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@
<div id="continuation-in-business-bc">
<!-- Company Name -->
<section class="mt-10">
<header id="company-name">
<h2>Company Name</h2>
<header id="company-name-header">
<h2 class="mb-4">
Company Name
</h2>
</header>

<div>** Correct Name component goes here **</div>
<v-card
flat
class="py-2 px-6"
>
<NameRequestInfo />
<NameTranslations />
</v-card>
</section>

<!-- Registered Office Addresses -->
Expand Down Expand Up @@ -111,11 +119,15 @@ import { RouteNames } from '@/enums'
import BusinessContactInfo from '@/components/common/BusinessContactInfo.vue'
import FolioNumber from '@/components/common/FolioNumber.vue'
import OfficeAddresses from '@/components/common/OfficeAddresses.vue'
import NameRequestInfo from '@/components/common/NameRequestInfo.vue'
import NameTranslations from '@/components/common/NameTranslations.vue'
@Component({
components: {
BusinessContactInfo,
FolioNumber,
NameRequestInfo,
NameTranslations,
OfficeAddresses
}
})
Expand All @@ -124,12 +136,13 @@ export default class ContinuationInBusinessBc extends Mixins(CommonMixin) {
@Getter(useStore) getDefineCompanyStep!: DefineCompanyIF
@Getter(useStore) getFolioNumber!: string
@Getter(useStore) getFolioNumberValid!: boolean
@Getter(useStore) getNameTranslationsValid!: boolean
@Getter(useStore) getShowErrors!: boolean
@Getter(useStore) isEntityType!: boolean
@Getter(useStore) isPremiumAccount!: boolean
@Action(useStore) setBusinessContact!: (x: ContactPointIF) => void
@Action(useStore) setContinuationInBusinessBcValid!: (x: boolean) => void
@Action(useStore) setDefineCompanyStepValidity!: (x: boolean) => void
@Action(useStore) setFolioNumber!: (x: string) => void
@Action(useStore) setFolioNumberValidity!: (x: boolean) => void
@Action(useStore) setIgnoreChanges!: (x: boolean) => void
Expand All @@ -140,6 +153,7 @@ export default class ContinuationInBusinessBc extends Mixins(CommonMixin) {
/** Array of valid components. Must match validFlags. */
readonly validComponents = [
'company-name-header',
'office-address-header',
'registered-office-contact-header',
'folio-reference-number-header'
Expand All @@ -148,6 +162,7 @@ export default class ContinuationInBusinessBc extends Mixins(CommonMixin) {
/** Object of valid flags. Must match validComponents. */
get validFlags (): object {
return {
validCompanyNameForm: this.getNameTranslationsValid,
validAddressForm: this.addressFormValid,
validBusinessContactForm: this.businessContactFormValid,
validFolioReferenceNumber: !this.isPremiumAccount || this.getFolioNumberValid
Expand Down Expand Up @@ -201,11 +216,14 @@ export default class ContinuationInBusinessBc extends Mixins(CommonMixin) {
@Watch('addressFormValid', { immediate: true })
@Watch('businessContactFormValid', { immediate: true })
@Watch('getFolioNumberValid', { immediate: true })
private onContinuationInBusinessBcValid (): void {
this.setContinuationInBusinessBcValid(
@Watch('getNameTranslationsValid', { immediate: true })
// Update the overall Define Company Step validity
private onDefineCompanyStepValid (): void {
this.setDefineCompanyStepValidity(
this.addressFormValid &&
this.businessContactFormValid &&
(!this.isPremiumAccount || this.getFolioNumberValid)
(!this.isPremiumAccount || this.getFolioNumberValid) &&
this.getNameTranslationsValid
)
}
Expand Down
5 changes: 4 additions & 1 deletion tests/unit/ContinuationInBusinessBc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import ContinuationInBusinessBc from '@/views/ContinuationIn/ContinuationInBusin
import OfficeAddresses from '@/components/common/OfficeAddresses.vue'
import BusinessContactInfo from '@/components/common/BusinessContactInfo.vue'
import FolioNumber from '@/components/common/FolioNumber.vue'
import NameRequestInfo from '@/components/common/NameRequestInfo.vue'
import NameTranslations from '@/components/common/NameTranslations.vue'

describe('Continuation In Business BC component', () => {
it('renders the component correctly', async () => {
Expand All @@ -28,7 +30,8 @@ describe('Continuation In Business BC component', () => {
const firstSection = wrapper.findAll('section').at(0)
expect(firstSection.find('header').exists()).toBe(true)
expect(firstSection.find('header h2').text()).toBe('Company Name')
// FUTURE: finish this ^^^
expect(firstSection.findComponent(NameRequestInfo).exists()).toBe(true)
expect(firstSection.findComponent(NameTranslations).exists()).toBe(true)

const secondSection = wrapper.findAll('section').at(1)
expect(secondSection.find('header').exists()).toBe(true)
Expand Down

0 comments on commit fd2709b

Please sign in to comment.