Skip to content

Commit

Permalink
12554 Updates address rules + misc fixes (#294)
Browse files Browse the repository at this point in the history
* - updated component id for consistency
- updated component ids to prevent conflicts
- app version = 3.1.18

* - updated proprietor/partner delivery address schema
- removed  mailing "no PO box" logic
- added delivery "no PO box" logic
- fixed invalid checkbox label color
- updated PeopleAndRoles validation per updated rules
- added watcher for Business Contact Info validity
- small store getters cleanup
  • Loading branch information
severinbeauvais authored Jun 10, 2022
1 parent 880d061 commit 618f002
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 34 deletions.
4 changes: 2 additions & 2 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-edit-ui",
"version": "3.1.17",
"version": "3.1.18",
"private": true,
"appName": "Edit UI",
"sbcName": "SBC Common Components",
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/BcRegContacts.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="contact-info" :class="{ 'flex-column': direction === 'col' }">
<div id="bc-reg-contacts" :class="{ 'flex-column': direction === 'col' }">
<div
class="contact-container" :class="{ 'justify-center': direction === 'row' }"
v-for="(contact, i) in contacts" :key="i"
Expand Down Expand Up @@ -46,7 +46,7 @@ export default class BcRegContacts extends Vue {
<style lang="scss" scoped>
@import '@/assets/styles/theme.scss';
.contact-info {
#bc-reg-contacts {
display: flex;
justify-content: space-between;
row-gap: 0.25rem; /* in case direction = row */
Expand Down
24 changes: 16 additions & 8 deletions src/components/common/PeopleAndRoles/OrgPerson.vue
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@
:editing="!orgPerson.isBusinessLookup"
:schema="mailingAddressSchema"
:address="inProgressMailingAddress"
:noPoBox="(isProprietor || isPartner) && isPerson"
@update:address="updateAddress(inProgressMailingAddress, $event)"
@valid="mailingAddressValid = $event"
/>
Expand All @@ -290,7 +289,7 @@
:editing="!orgPerson.isBusinessLookup"
:schema="deliveryAddressSchema"
:address="inProgressDeliveryAddress"
:noPoBox="isDirector"
:noPoBox="noPoBoxDelivery"
@update:address="updateAddress(inProgressDeliveryAddress, $event)"
@valid="deliveryAddressValid = $event"
/>
Expand Down Expand Up @@ -449,7 +448,7 @@ export default class OrgPerson extends Mixins(CommonMixin, OrgPersonMixin) {
* See also PeopleAndRoles.vue::haveRequiredAddresses.
*/
get mailingAddressSchema (): AddressSchemaIF {
// atm, all orgs/persons mailing address can be anywhere in the world
// all orgs/persons mailing address can be anywhere in the world
return DefaultAddressSchema
}
Expand All @@ -458,8 +457,8 @@ export default class OrgPerson extends Mixins(CommonMixin, OrgPersonMixin) {
* See also PeopleAndRoles.vue::haveRequiredAddresses.
*/
get deliveryAddressSchema (): AddressSchemaIF {
// proprietor/partner delivery address must be in BC, Canada
if (this.isProprietor || this.isPartner) return InBcCanadaAddressSchema
// proprietor/partner delivery address can be anywhere in the world
if (this.isProprietor || this.isPartner) return DefaultAddressSchema
// directors delivery address can be anywhere in the world
if (this.isDirector) return DefaultAddressSchema
Expand All @@ -471,6 +470,14 @@ export default class OrgPerson extends Mixins(CommonMixin, OrgPersonMixin) {
return InBcCanadaAddressSchema
}
/** Whether to show the "Address cannot be a PO Box" hint. */
get noPoBoxDelivery (): boolean {
if (this.isDirector) return true
if (this.isProprietor && this.isPerson) return true
if (this.isPartner && this.isPerson) return true
return false
}
/** Whether to disable the "same as" checkbox (to force entry of delivery address). */
get disableSameDeliveryAddress (): boolean {
// proprietor/partner delivery address must be in BC, Canada
Expand Down Expand Up @@ -1033,10 +1040,11 @@ li {
background-color: rgb(55, 164, 71);
color: rgb(255, 255, 255) !important;
font-weight: bold;
}
::v-deep .theme--light.v-label--is-disabled {
color: white !important;
// make label visible on background color
::v-deep .theme--light.v-label--is-disabled {
color: white !important;
}
}
.roles-row {
Expand Down
11 changes: 7 additions & 4 deletions src/components/common/PeopleAndRoles/PeopleAndRoles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -301,17 +301,18 @@ export default class PeopleAndRoles extends Mixins(CommonMixin, DateMixin, OrgPe
// (most restrictive to least restrictive)
// proprietor/partner must have a mailing address and a delivery address
// delivery address must be in BC, Canada
// mailing address can be anywhere in the world
// delivery address can be anywhere in the world
if (this.hasRoleProprietor(party) || this.hasRolePartner(party)) {
return (
!isEmpty(party.mailingAddress) &&
!isEmpty(party.deliveryAddress) &&
(party.deliveryAddress.addressRegion === REGION_BC) &&
(party.deliveryAddress.addressCountry === COUNTRY_CA)
!isEmpty(party.deliveryAddress)
)
}
// director must have a mailing address and a delivery address
// mailing address can be anywhere in the world
// delivery address can be anywhere in the world
if (this.hasRoleDirector(party)) {
return (
!isEmpty(party.mailingAddress) &&
Expand All @@ -320,11 +321,13 @@ export default class PeopleAndRoles extends Mixins(CommonMixin, DateMixin, OrgPe
}
// completing party must have just a mailing address
// mailing address can be anywhere in the world
if (this.hasRoleCompletingParty(party)) {
return !isEmpty(party.mailingAddress)
}
// incorporators must have just a mailing address
// mailing address can be anywhere in the world
if (this.hasRoleIncorporator(party)) {
return !isEmpty(party.mailingAddress)
}
Expand Down
5 changes: 3 additions & 2 deletions src/components/common/YourCompany/BusinessContactInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,11 @@ export default class BusinessContactInfo extends Mixins(CommonMixin) {
* Use "immediate" to pick up all validity conditions
*/
@Watch('isEditingContact', { immediate: true })
private onIsEditingContact (): void {
@Watch('getBusinessContact.email', { immediate: true })
private syncValidity (): void {
const isValid = (
!this.isEditingContact &&
this.getBusinessContact?.email
!!this.getBusinessContact?.email
)
this.setValidComponent({ key: 'isValidContactInfo', value: isValid })
}
Expand Down
8 changes: 6 additions & 2 deletions src/components/common/YourCompany/YourCompany.vue
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
<v-divider class="mx-4 my-1" />

<!-- Business Contact Information -->
<div id="contact-info" class="section-container" :class="{'invalid-section': invalidContactSection}">
<div id="contact-info-section" class="section-container" :class="{'invalid-section': invalidContactSection}">
<BusinessContactInfo
:invalidSection="invalidContactSection"
/>
Expand All @@ -293,7 +293,7 @@
<template v-if="isPremiumAccount && !isTypeFirm">
<v-divider class="mx-4 my-1" />

<div id="folio-number" class="section-container" :class="{'invalid-section': invalidFolioSection}">
<div id="folio-number-section" class="section-container" :class="{'invalid-section': invalidFolioSection}">
<FolioInformation
:invalidSection="invalidFolioSection"
/>
Expand Down Expand Up @@ -575,4 +575,8 @@ export default class YourCompany extends Mixins(
min-width: 0.5rem;
}
}
#contact-info-section {
border-bottom-left-radius: 0 !important;
}
</style>
4 changes: 2 additions & 2 deletions src/enums/componentsCompanyInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export enum ComponentsCompanyInfo {
'name-translation',
'nature-of-business',
'office-addresses',
'contact-info',
'folio-number',
'contact-info-section',
'folio-number-section',
'people-and-roles',
'share-structures',
'company-provisions',
Expand Down
20 changes: 10 additions & 10 deletions src/store/getters/state-getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module/'
import { AddressesIF, IncorporationFilingIF, NameRequestDetailsIF, NameRequestApplicantIF, OrgPersonIF,
ShareClassIF, NameRequestIF, BusinessInformationIF, CertifyIF, NameTranslationIF, FilingDataIF, StateIF,
EffectiveDateTimeIF, ShareStructureIF, FlagsReviewCertifyIF, FlagsCompanyInfoIF, ResolutionsIF, FeesIF,
ResourceIF, EntitySnapshotIF } from '@/interfaces/'
ResourceIF, EntitySnapshotIF, ValidationFlagsIF } from '@/interfaces/'
import { CompletingPartyIF, ContactPointIF, NaicsIF, StaffPaymentIF } from '@bcrs-shared-components/interfaces/'
import { isEqual } from 'lodash'
import { isSame } from '@/utils/'
Expand Down Expand Up @@ -463,24 +463,29 @@ export const isEditing = (state: StateIF): boolean => {
state.stateModel.editingFlags.incorporationAgreement)
}

/** The validation flags. */
export const getValidationFlags = (state: StateIF): ValidationFlagsIF => {
return state.stateModel.validationFlags
}

/** Flag to prompt app level validations. */
export const getAppValidate = (state: StateIF): boolean => {
return state.stateModel.validationFlags.appValidate
return getValidationFlags(state).appValidate
}

/** Flag to prompt component level validations. */
export const getComponentValidate = (state: StateIF): boolean => {
return state.stateModel.validationFlags.componentValidate
return getValidationFlags(state).componentValidate
}

/** The review and certify page validity flags. */
export const getFlagsReviewCertify = (state: StateIF): FlagsReviewCertifyIF => {
return state.stateModel.validationFlags.flagsReviewCertify
return getValidationFlags(state).flagsReviewCertify
}

/** The company info page validity flags. */
export const getFlagsCompanyInfo = (state: StateIF): FlagsCompanyInfoIF => {
return state.stateModel.validationFlags.flagsCompanyInfo
return getValidationFlags(state).flagsCompanyInfo
}

export const getDetailComment = (state: StateIF): string => {
Expand Down Expand Up @@ -777,11 +782,6 @@ export const invalidMinimumShareClass = (state: StateIF): boolean => {
return (currentShareClasses.length < 1)
}

/** Get state of company provisions validity. */
export const getIsCompanyProvisionsValid = (state: StateIF): boolean => {
return state.stateModel.validationFlags.flagsCompanyInfo.isValidCompanyProvisions
}

/** The current filing name. */
export const getFilingName = (state: StateIF): FilingNames => {
if (isCorrectionFiling(state)) return FilingNames.CORRECTION
Expand Down
2 changes: 1 addition & 1 deletion src/views/auth/Signin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Component, Vue } from 'vue-property-decorator'
@Component({})
export default class Signin extends Vue {
protected created () {
protected created (): void {
// navigate to BC Registry login page then return to this app
const loginUrl = sessionStorage.getItem('REGISTRY_HOME_URL') + 'login'
const baseUrl = sessionStorage.getItem('BASE_URL').replace(/\/$/, '') // remove trailing /
Expand Down

0 comments on commit 618f002

Please sign in to comment.