-
Notifications
You must be signed in to change notification settings - Fork 49
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
21138 Fetch and display expro data from COLIN + UI updates + fixed misc states and validations, etc #691
Conversation
24e9671
to
742f100
Compare
9d12368
to
6107499
Compare
- added COLIN env config - imported some updated shared components - added COLIN vault keys - added a base class - misc cleanup - added error dialog to Extrapro Registration - re-worked Extrapro Registration components, layout, logic, etc - added rules + validation - added date picker - removed ULC radio group - finished affidavit file upload - changed historical fields to display-only - changed active fields to all editable - added jurisdiction conversions - fixed some Manual Business Info bugs + cleanup - added BN hints - re-worked Summary Business Home Jurisdiction fields, etc - added conditional contact info to Generic Error Dialog - added Colin Business interface - updated Continuation In Filing interface - updated Continuation Authorization interface - updated Existing Business Info interface - updated filing save/restore code - added Colin Services module - added store getters for new (continuation in) entity types - added COLIN keys to Fetch Config - updated unit test
@@ -14,6 +14,8 @@ VUE_APP_SITEMINDER_LOGOUT_URL="https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi" | |||
#vaults API | |||
VUE_APP_AUTH_API_URL="https://auth-api-dev.apps.silver.devops.gov.bc.ca" | |||
VUE_APP_AUTH_API_VERSION="/api/v1" | |||
VUE_APP_COLIN_API_URL="https://colin-api-dev.apps.silver.devops.gov.bc.ca" | |||
VUE_APP_COLIN_API_VERSION="/api/v1" |
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.
For calling COLIN API to fetch expro business info.
package-lock.json
Outdated
"@bcrs-shared-components/certify": "2.1.15", | ||
"@bcrs-shared-components/completing-party": "2.1.30", | ||
"@bcrs-shared-components/confirm-dialog": "1.2.1", | ||
"@bcrs-shared-components/contact-info": "1.2.15", | ||
"@bcrs-shared-components/corp-type-module": "1.0.16", | ||
"@bcrs-shared-components/correct-name": "1.0.46", | ||
"@bcrs-shared-components/court-order-poa": "3.0.11", | ||
"@bcrs-shared-components/date-picker": "1.2.15", | ||
"@bcrs-shared-components/date-picker": "1.2.55", |
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 component now correctly supports disablePicker
prop.
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.
I've updated this again so that DatePicker honour the input rules (which were previously conditional). I tested this in other filings and it looks fine.
"@bcrs-shared-components/interfaces": "1.1.13", | ||
"@bcrs-shared-components/jurisdiction": "1.1.2", | ||
"@bcrs-shared-components/interfaces": "1.1.15", | ||
"@bcrs-shared-components/jurisdiction": "1.1.3", |
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 component now supports readonly
prop + small bugfixes.
:title="errorDialogTitle" | ||
:showContactInfo="false" | ||
@close="errorDialog = false" | ||
/> |
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.
v-if="isBusinessActive" | ||
ref="formRef" | ||
lazy-validation | ||
@submit.prevent | ||
> |
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.
Using a v-form to trigger validation on Vuetify components.
(Also need to call validation explicitly on our own components because they don't support the validation api.)
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.
} | ||
if (jurisdiction?.country === JurisdictionLocation.CA) { | ||
if (jurisdiction?.region === 'FEDERAL') return 'Federal' | ||
return CanJurisdictions.find(can => can.value === jurisdiction?.region)?.text || 'Canada' |
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.
If we can't find the region, I provide a fallback to "Canada" (since the data from COLIN, in Dev at least, is all over the place).
Ditto for "USA", below.
mounted (): void { | ||
// set existing business info object from the store, if it exists | ||
// point business variable to Existing Business Info object from the store, if it exists |
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 is important.
The local business
object variable and the store state (accessing via getters and actions) are pointers to the same memory location. Thus, we don't have to "set" the store variable every time the local business object changes (eg, due to a text field v-model update); it's just the one object that everybody is updating.
status: result.status, | ||
taxId: result.bn?.substring(0, 9) || null | ||
taxId: businessInfo.businessNumber?.substring(0, 9) || null | ||
} | ||
this.setExistingBusinessInfo(this.business) |
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 re-syncs the local object with the store state.
this.$set(this.business, 'affidavitFileKey', psu.key) | ||
this.$set(this.business, 'affidavitFileName', file.name) | ||
this.$set(this.business, 'affidavitFileUrl', psu.preSignedUrl) | ||
} |
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.
We save the File so that the file upload component can re-init when a draft is restored.
We save the Key because the Legal API needs it for later.
We save the Name because the UI displays it in a couple of places.
We save the URL because the UI will need it (future ticket) to show the files are download links on the review page.
<v-form | ||
v-if="jurisdiction && !isMrasJurisdiction" |
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.
Now we show the form for all jurisdictions (ie, it was decided to not use MRAS search so no special handling here).
/gcbrun |
Temporary Url for review: https://business-create-dev--pr-691-nozaqqyw.web.app SB says, try these: Search for active expro: A0073450 |
8e23b22
to
74b791d
Compare
- updated isContinuationInValid getter - added Court Order/POA component to review page - imported fixed shared DatePicker component - updated validation triggers - reactively set homeJurisdiction objects - wait for form to show before validating it - misc logic cleanup - deleted unneeded Empty Existing Business Info object - updated initial value in store state
<!-- *** TODO: remove after testing: --> | ||
({{ item.status?.charAt(0) }}) | ||
<span>{{ item.identifier }}</span> | ||
<span v-if="showBusinessSearchStatus"> ({{ item.status?.charAt(0) }})</span> |
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.
I kept the Active/Historical indicator but feature-flagged it. It's super useful for testing but we don't want to show it in Prod.
:initialValue="business.homeIncorporationDate" | ||
:inputRules="getShowErrors ? incorporationDateRules: []" | ||
:maxDate="getCurrentDate" | ||
@emitDateSync="$set(business, 'homeIncorporationDate', $event)" |
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.
Let me call your attention to this $set
call, which adds the prop "homeIncorporationDate" to the "business" object reactively (since business was initialized to {}
).
Without this, the new date was not recognized by the watcher function and the valid event was not emitted to the parent component.
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.
I see now, this is setting business.homeIncorporationDate
to whatever date is being picked reactively. Sweet.
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.
Simply assigning the value correctly updated the business object but watchers (and computeds, etc) did not react to it, so this was needed. It's because the business object was initialized without properties.
|
||
if (jurisdiction?.group === 0) { | ||
// set property reactively (in case it was null) | ||
this.$set(this.business, 'homeJurisdiction', { |
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 thing again with $set
.
It appears that the Vuetify v-model properties don't need this. It's likely that Vuetify just initialized and sets the properties as above.
jurisdictionText = regions.find(p => p.short === region).name | ||
|
||
// set local property based on jurisdiction value | ||
this.isMrasJurisdiction = MrasJurisdictions.includes(jurisdictionText.toLowerCase()) |
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.
I removed the MRAS-related logic.
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 great Sev 👍 👍
if (this.active && this.getShowErrors) { | ||
await this.$nextTick() // wait for form to finish rendering | ||
this.$refs.manualFormRef?.validate() | ||
this.$refs.incorporationDateRef?.validateForm() |
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.
When the "active" and "getShowErrors" flags change and are both True, this code is executed.
You can see that I call the v-form validation to trigger validations on the Vuetify components, and I explicitly call our custom component's validation.
What caused me some grief here was needing to wait after "active" becomes true so that the template is rendered and the refs are initialized (otherwise they are undefined). It now works correctly and I can explain why (no magic).
@@ -217,7 +218,7 @@ export const stateModel: StateModelIF = { | |||
continuationIn: { | |||
businessHomeValid: false, | |||
continuationAuthorization: null, | |||
existingBusinessInfo: null | |||
existingBusinessInfo: {} as ExistingBusinessInfoIF |
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 allows us to re-reference object properties without an exception, though we might have to $set
them in the object for reactivity.
@@ -2,7 +2,7 @@ | |||
<div id="continuation-in-business-home"> | |||
<!-- Existing Business Information --> | |||
<section class="mt-10"> | |||
<header id="existing-Business-information"> | |||
<header id="existing-business-information"> |
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.
A 1-character bug.
When this section was invalid, the page didn't scroll to it. Turns out, ids are case-sensitive 🤦
Thanks for testing! Yes, Vysakh and I designed this COLIN call and he implemented it 😀 (We did this so that Business Search didn't have to be updated.) |
Issue #: bcgov/entity#21138
Description of changes:
Commit 1:
Commit 2:
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).