-
Notifications
You must be signed in to change notification settings - Fork 50
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
Conversation
4849960
to
d4f9e3f
Compare
- 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
d4f9e3f
to
6e22699
Compare
/gcbrun |
Temporary Url for review: https://business-create-dev--pr-752-8bzv3tde.web.app SB says, try these:
|
<v-row | ||
v-if="getExistingBusinessInfo.affidavitFile" | ||
no-gutters | ||
> |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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 }) |
There was a problem hiding this comment.
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') | ||
) | ||
}, |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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 | ||
} |
There was a problem hiding this comment.
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() | ||
} | ||
} |
There was a problem hiding this comment.
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 } |
There was a problem hiding this comment.
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() | ||
}) |
There was a problem hiding this comment.
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() | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
There was a problem hiding this 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good Sev!
Issue #: bcgov/entity#23754
Description of changes:
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).