Skip to content

Commit

Permalink
14523 Cleanup before further development (#428)
Browse files Browse the repository at this point in the history
* - renamed correction resources
- added resources for BC/CCC/ULC
- deleted obsolete AgreementTypeResource
- updated correction views
- updated unit tests
- enabled Hotjar (for future)
- app version = 3.9.5

* - set deleted legalName and nrNumber to undefined instead of null
- updated unit test
  • Loading branch information
severinbeauvais authored Dec 7, 2022
1 parent 3fce02f commit 9c2ed62
Show file tree
Hide file tree
Showing 25 changed files with 231 additions and 83 deletions.
15 changes: 13 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "business-edit-ui",
"version": "3.9.4",
"version": "3.9.5",
"private": true,
"appName": "Edit UI",
"sbcName": "SBC Common Components",
Expand Down Expand Up @@ -48,6 +48,7 @@
"vue": "^2.7.10",
"vue-affix": "^0.5.2",
"vue-debounce-decorator": "^1.0.1",
"vue-hotjar": "^1.4.0",
"vue-router": "^3.6.5",
"vue-the-mask": "^0.11.1",
"vue2-filters": "^0.14.0",
Expand Down
1 change: 1 addition & 0 deletions public/config/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"BUSINESSES_URL": "https://dev.bcregistry.ca/business/auth/",
"BUSINESS_EDIT_LD_CLIENT_ID": "5f4d47179db2f40a33e88d32",
"DASHBOARD_URL": "https://dev.bcregistry.ca/business/",
"HOTJAR_ID": "",
"KEYCLOAK_CONFIG_PATH": "/local-keycloak-config-url/keycloak.json",
"LEGAL_API_URL": "https://legal-api-dev.apps.silver.devops.gov.bc.ca",
"LEGAL_API_VERSION_2": "/api/v2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export default class CorrectNameToNumber extends Vue {
// delete the current legal name and NR number
this.setNameRequest({
...this.getNameRequest,
legalName: null,
nrNumber: null
legalName: undefined,
nrNumber: undefined
})
this.emitIsSaved(true)
}
Expand Down
9 changes: 9 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Vuetify from 'vuetify/lib'
import Vuelidate from 'vuelidate'
import Affix from 'vue-affix'
import Vue2Filters from 'vue2-filters' // needed by SbcFeeSummary
import Hotjar from 'vue-hotjar'
import * as Sentry from '@sentry/browser'
import * as Integrations from '@sentry/integrations'
import { getVueRouter } from '@/router/'
Expand Down Expand Up @@ -53,8 +54,16 @@ async function start () {
})
}

// initialize Hotjar
const hotjarId: string = window['hotjarId']
if (hotjarId) {
console.info('Initializing Hotjar...') // eslint-disable-line no-console
Vue.use(Hotjar, { id: hotjarId })
}

// initialize Launch Darkly
if (window['ldClientId']) {
console.info('Initializing Launch Darkly...') // eslint-disable-line no-console
await InitLdClient()
}

Expand Down
18 changes: 0 additions & 18 deletions src/resources/Correction/AgreementTypeResource.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CorrectionTypes, FilingCodes, NameRequestTypes } from '@/enums/'
import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module/'
import { ResourceIF } from '@/interfaces/'

export const BenefitCompanyStatementResource: ResourceIF = {
export const BenCorrectionResource: ResourceIF = {
entityReference: 'Company',
contactLabel: 'Registered Office',
displayName: null, // not used
Expand Down
37 changes: 37 additions & 0 deletions src/resources/Correction/CommunityContributionCompany.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { CorrectionTypes, FilingCodes, NameRequestTypes } from '@/enums/'
import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module/'
import { ResourceIF } from '@/interfaces/'

export const CccCorrectionResource: ResourceIF = {
entityReference: 'Company',
contactLabel: 'Registered Office',
displayName: null, // not used
entityType: CorpTypeCd.BC_CCC,
addressLabel: 'Registered Office',
title: 'Benefit Company Statement',
description: 'This company is a benefit company and, as such, has purposes that include conducting its business in' +
' a responsible and sustainable manner and promoting one or more public benefits.',
filingData: {
filingTypeCode: FilingCodes.CORRECTION,
entityType: CorpTypeCd.BC_CCC,
priority: false
},
changeData: {
nameChangeOptions: [
CorrectionTypes.CORRECT_NEW_NR,
CorrectionTypes.CORRECT_NAME_TO_NUMBER,
CorrectionTypes.CORRECT_NAME
],
orgPersonInfo: {
orgPersonLabel: 'Directors',
subtitle: null // not used
},
nameRequestTypes: [
NameRequestTypes.CHANGE_OF_NAME,
NameRequestTypes.CONVERSION
]
},
certifyClause: 'Note: It is an offence to make a false or misleading statement in respect ' +
'of a material fact in a record submitted to the Corporate Registry for filing. ' +
'See section 427 of the Business Corporations Act.'
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CorrectionTypes, FilingCodes, NameRequestTypes } from '@/enums/'
import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module/'
import { ResourceIF } from '@/interfaces/'

export const GeneralPartnershipResource: ResourceIF = {
export const GpCorrectionResource: ResourceIF = {
entityReference: 'Business',
contactLabel: 'Business',
displayName: null, // not used
Expand Down
37 changes: 37 additions & 0 deletions src/resources/Correction/LimitedCompany.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { CorrectionTypes, FilingCodes, NameRequestTypes } from '@/enums/'
import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module/'
import { ResourceIF } from '@/interfaces/'

export const BcCorrectionResource: ResourceIF = {
entityReference: 'Company',
contactLabel: 'Registered Office',
displayName: null, // not used
entityType: CorpTypeCd.BC_COMPANY,
addressLabel: 'Registered Office',
title: 'Benefit Company Statement',
description: 'This company is a benefit company and, as such, has purposes that include conducting its business in' +
' a responsible and sustainable manner and promoting one or more public benefits.',
filingData: {
filingTypeCode: FilingCodes.CORRECTION,
entityType: CorpTypeCd.BC_COMPANY,
priority: false
},
changeData: {
nameChangeOptions: [
CorrectionTypes.CORRECT_NEW_NR,
CorrectionTypes.CORRECT_NAME_TO_NUMBER,
CorrectionTypes.CORRECT_NAME
],
orgPersonInfo: {
orgPersonLabel: 'Directors',
subtitle: null // not used
},
nameRequestTypes: [
NameRequestTypes.CHANGE_OF_NAME,
NameRequestTypes.CONVERSION
]
},
certifyClause: 'Note: It is an offence to make a false or misleading statement in respect ' +
'of a material fact in a record submitted to the Corporate Registry for filing. ' +
'See section 427 of the Business Corporations Act.'
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CorrectionTypes, FilingCodes, NameRequestTypes } from '@/enums/'
import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module/'
import { ResourceIF } from '@/interfaces/'

export const SoleProprietorshipResource: ResourceIF = {
export const SpCorrectionResource: ResourceIF = {
entityReference: 'Business',
contactLabel: 'Business',
displayName: null, // not used
Expand Down
37 changes: 37 additions & 0 deletions src/resources/Correction/UnlimitedLiabilityCompany.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { CorrectionTypes, FilingCodes, NameRequestTypes } from '@/enums/'
import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module/'
import { ResourceIF } from '@/interfaces/'

export const UlcCorrectionResource: ResourceIF = {
entityReference: 'Company',
contactLabel: 'Registered Office',
displayName: null, // not used
entityType: CorpTypeCd.BC_ULC_COMPANY,
addressLabel: 'Registered Office',
title: 'Benefit Company Statement',
description: 'This company is a benefit company and, as such, has purposes that include conducting its business in' +
' a responsible and sustainable manner and promoting one or more public benefits.',
filingData: {
filingTypeCode: FilingCodes.CORRECTION,
entityType: CorpTypeCd.BC_ULC_COMPANY,
priority: false
},
changeData: {
nameChangeOptions: [
CorrectionTypes.CORRECT_NEW_NR,
CorrectionTypes.CORRECT_NAME_TO_NUMBER,
CorrectionTypes.CORRECT_NAME
],
orgPersonInfo: {
orgPersonLabel: 'Directors',
subtitle: null // not used
},
nameRequestTypes: [
NameRequestTypes.CHANGE_OF_NAME,
NameRequestTypes.CONVERSION
]
},
certifyClause: 'Note: It is an offence to make a false or misleading statement in respect ' +
'of a material fact in a record submitted to the Corporate Registry for filing. ' +
'See section 427 of the Business Corporations Act.'
}
10 changes: 6 additions & 4 deletions src/resources/Correction/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export * from './AgreementTypeResource'
export * from './BenefitCompanyStatementResource'
export * from './GeneralPartnershipResource'
export * from './SoleProprietorshipResource'
export * from './BenefitCompany'
export * from './CommunityContributionCompany'
export * from './GeneralPartnership'
export * from './LimitedCompany'
export * from './SoleProprietorship'
export * from './UnlimitedLiabilityCompany'
2 changes: 1 addition & 1 deletion src/resources/SpecialResolution/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './CooperativeResource'
export * from './Cooperative'
6 changes: 6 additions & 0 deletions src/utils/FetchConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ export async function FetchConfig (): Promise<any> {
console.info('Set Siteminder Logout Url to: ' + siteminderLogoutUrl)
}

const hotjarId: string = response.data['HOTJAR_ID']
if (hotjarId) {
(<any>window).hotjarId = hotjarId
console.info('Set Hotjar ID.')
}

const addressCompleteKey: string = response.data['ADDRESS_COMPLETE_KEY']
if (addressCompleteKey) {
(<any>window).addressCompleteKey = addressCompleteKey
Expand Down
14 changes: 12 additions & 2 deletions src/views/Correction.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<BenCorrection
v-if="isEntityTypeBEN"
v-if="isBcBenCccUlc"
:correctionFiling="correctionFiling"
@fetchError="emitFetchError($event)"
@haveData="emitHaveData($event)"
Expand Down Expand Up @@ -40,7 +40,10 @@ export default class Correction extends Mixins(CommonMixin) {
// Global getters
@Getter getBusinessId!: string
@Getter isRoleStaff!: boolean
@Getter isEntityTypeBC!: boolean
@Getter isEntityTypeBEN!: boolean
@Getter isEntityTypeCCC!: boolean
@Getter isEntityTypeULC!: boolean
@Getter isEntityTypeFirm!: boolean
// Global actions
Expand All @@ -49,6 +52,13 @@ export default class Correction extends Mixins(CommonMixin) {
protected correctionFiling: CorrectionFilingIF = null
/** True is the entity type is BC/BEN/CCC/ULC. */
get isBcBenCccUlc (): boolean {
return (
this.isEntityTypeBC || this.isEntityTypeBEN || this.isEntityTypeCCC || this.isEntityTypeULC
)
}
/** True if user is authenticated. */
get isAuthenticated (): boolean {
return Boolean(sessionStorage.getItem(SessionStorageKeys.KeyCloakToken))
Expand Down Expand Up @@ -116,7 +126,7 @@ export default class Correction extends Mixins(CommonMixin) {
// set entity type for misc functionality to work
// do not proceed if this isn't a BEN or SP/GP correction
this.setEntityType(filing.business?.legalType)
if (!this.isEntityTypeBEN && !this.isEntityTypeFirm) {
if (!this.isBcBenCccUlc && !this.isEntityTypeFirm) {
throw new Error('Invalid correction type')
}
Expand Down
23 changes: 18 additions & 5 deletions src/views/Correction/BenCorrection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,16 @@

<script lang="ts">
import { Component, Emit, Mixins, Prop, Watch } from 'vue-property-decorator'
import { Action } from 'vuex-class'
import { Action, Getter } from 'vuex-class'
import { Articles } from '@/components/Alteration/'
import { CertifySection, Detail, PeopleAndRoles, ShareStructures, StaffPayment, YourCompany, CompletingParty }
from '@/components/common/'
import { CommonMixin, DateMixin, FeeMixin, FilingTemplateMixin } from '@/mixins/'
import { AuthServices, LegalServices } from '@/services/'
import { StaffPaymentOptions } from '@bcrs-shared-components/enums/'
import { ActionBindingIF, CorrectionFilingIF, EntitySnapshotIF } from '@/interfaces/'
import { BenefitCompanyStatementResource } from '@/resources/Correction/'
import { ActionBindingIF, CorrectionFilingIF, EntitySnapshotIF, ResourceIF } from '@/interfaces/'
import { BcCorrectionResource, BenCorrectionResource, CccCorrectionResource, UlcCorrectionResource }
from '@/resources/Correction/'
@Component({
components: {
Expand All @@ -77,6 +78,12 @@ import { BenefitCompanyStatementResource } from '@/resources/Correction/'
}
})
export default class BenCorrection extends Mixins(CommonMixin, DateMixin, FeeMixin, FilingTemplateMixin) {
// Global getters
@Getter isEntityTypeBC!: boolean
@Getter isEntityTypeBEN!: boolean
@Getter isEntityTypeCCC!: boolean
@Getter isEntityTypeULC!: boolean
// Global actions
@Action setHaveUnsavedChanges!: ActionBindingIF
@Action setCertifyStatementResource!: ActionBindingIF
Expand All @@ -91,8 +98,14 @@ export default class BenCorrection extends Mixins(CommonMixin, DateMixin, FeeMix
}
/** The resource object for a correction filing. */
get correctionResource (): any {
return BenefitCompanyStatementResource
get correctionResource (): ResourceIF {
switch (true) {
case this.isEntityTypeBC: return BcCorrectionResource
case this.isEntityTypeBEN: return BenCorrectionResource
case this.isEntityTypeCCC: return CccCorrectionResource
case this.isEntityTypeULC: return UlcCorrectionResource
}
throw new Error(`Invalid Correction Resource entity type = ${this.getEntityType}`)
}
/**
Expand Down
Loading

0 comments on commit 9c2ed62

Please sign in to comment.