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

23754 Updated ULC Information section #752

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

severinbeauvais
Copy link
Collaborator

@severinbeauvais severinbeauvais commented Oct 22, 2024

Issue #: bcgov/entity#23754

Description of changes:

  • app version = 5.12.10
  • misc cleanup
  • added conditional to Auth Info on step 1
  • moved ULC Info out of Extrapro Registraion component
  • moved ULC Info out of Manual Business Info component
  • created ULC Information component
  • moved Upload Affidavit code into new ULC Info component
  • moved a store getter into the only component that uses it
  • added ULC Info component to step 0 + updated validation, etc
  • added / updated unit tests

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the bcrs-entities-create-ui license (Apache 2.0).

- misc cleanup
- added conditional to Auth Info on step 1
- moved ULC Info out of Extrapro Registraion component
- moved ULC Info out of Manual Business Info component
- created ULC Information component
- moved Upload Affidavit code into new ULC Info component
- moved a store getter into the only component that uses it
- added ULC Info component to step 0 + updated validation, etc
- added / updated unit tests
@severinbeauvais
Copy link
Collaborator Author

/gcbrun

@bcregistry-sre
Copy link
Collaborator

bcregistry-sre commented Oct 23, 2024

@bcgov bcgov deleted a comment from bcregistry-sre Oct 23, 2024
<v-row
v-if="getExistingBusinessInfo.affidavitFile"
no-gutters
>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Only show this section if an affidavit file (ULC Info) exists.

@@ -0,0 +1,258 @@
<template>
<div
v-if="getExistingBusinessInfo"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Safety check on this component so we don't try to de-reference this object (ie, for computeds) if this object doesn't exist.

}

/** Watches for changes to affidavit file object and emits form validity. */
@Watch('getExistingBusinessInfo.affidavitFile', { deep: true, immediate: true })
Copy link
Collaborator Author

@severinbeauvais severinbeauvais Oct 23, 2024

Choose a reason for hiding this comment

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

Use "deep" in case any of the objet properties change.

Use "immediate" so this fires when the component is created/mounted. This way, this component emits its validity initially.

(previousJurisdiction?.country === JurisdictionLocation.CA) &&
(previousJurisdiction?.region === 'AB')
)
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was used by a single component so I moved it there.

<section class="mt-10">
<header id="name-header">
<section
id="name-section"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The id is used for scrolling to the section, so I think it makes more sense to scroll to the section element instead of the header element.

// Refs
$refs!: {
ulcInformation: UnlimitedLiabilityCorporationInformation
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need this so we can reach into this child component and call one of its methods.

if (!val) {
this.$refs.ulcInformation.onRemoveClicked()
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Without this, the "affidavit" file info remains in the business info object (and we end up saving it, too).

null,
null,
null,
{ isUlcInfoRequired: () => true }
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Overriding this computed (getter) turned out to be easier than setting the state variables so that this computed returned True :)

expect(wrapper.findComponent(UploadAffidavit).exists()).toBe(true)

wrapper.destroy()
})
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved to new test suite for new component that includes this code. (UploadAffidavit was absorbed into the new component.)

expect(wrapper.findComponent(UploadAffidavit).exists()).toBe(true)

wrapper.destroy()
})
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same comment as above.

Copy link
Collaborator

@ArwenQin ArwenQin left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks Severin

Copy link
Collaborator

@ketaki-deodhar ketaki-deodhar left a comment

Choose a reason for hiding this comment

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

Looks good Sev!

@severinbeauvais severinbeauvais merged commit 2d148dd into bcgov:main Oct 23, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants