Skip to content

Commit

Permalink
- added temp API URL to example env file
Browse files Browse the repository at this point in the history
- added temp API URL to vaults env file
- fixed misc code issues
- changed DocumentMixin hook from created() to beforeCreate() to avoid type conflict
- updated getBusinessLegalName to return operating name for firms
  • Loading branch information
severinbeauvais committed Oct 4, 2023
1 parent da2b05b commit bc69d15
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 53 deletions.
18 changes: 10 additions & 8 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# Base Path Openshift: /businesses/create Firebase: /
VUE_APP_PATH="/"

#vaults Shared
# vaults Shared
VUE_APP_ADDRESS_COMPLETE_KEY=

#vaults web-url
# vaults web-url
VUE_APP_REGISTRY_HOME_URL="https://dev.bcregistry.gov.bc.ca/"
VUE_APP_AUTH_WEB_URL="https://dev.account.bcregistry.gov.bc.ca/"
VUE_APP_BUSINESSES_URL="https://dev.account.bcregistry.gov.bc.ca/"
VUE_APP_DASHBOARD_URL="https://dev.business.bcregistry.gov.bc.ca/"
VUE_APP_SITEMINDER_LOGOUT_URL="https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi"

#vaults API
# vaults API
VUE_APP_AUTH_API_URL="https://auth-api-dev.apps.silver.devops.gov.bc.ca"
VUE_APP_AUTH_API_VERSION="/api/v1"
# for Legal Name feature branch only:
VUE_APP_LEGAL_API_URL="https://business-api-dy4loprnwa-nn.a.run.app"
#VUE_APP_LEGAL_API_URL="https://legal-api-dev.apps.silver.devops.gov.bc.ca"
VUE_APP_LEGAL_API_VERSION_2="/api/v2"
VUE_APP_NAICS_API_URL="https://legal-api-dev.apps.silver.devops.gov.bc.ca"
VUE_APP_NAICS_API_VERSION_2="/api/v2"
Expand All @@ -26,22 +28,22 @@ VUE_APP_REGISTRIES_SEARCH_API_URL="https://bcregistry-dev.apigee.net/registry-se
VUE_APP_REGISTRIES_SEARCH_API_VERSION="/api/v1"
VUE_APP_REGISTRIES_SEARCH_API_KEY=

#vaults launchdarkly
# vaults launchdarkly
VUE_APP_BUSINESS_CREATE_LD_CLIENT_ID="642af8daefad6f134479c602"

#vaults keycloak
# vaults keycloak
VUE_APP_KEYCLOAK_AUTH_URL="https://dev.loginproxy.gov.bc.ca/auth"
VUE_APP_KEYCLOAK_REALM="bcregistry"
VUE_APP_KEYCLOAK_CLIENTID="entity-web"

#vaults sentry
# vaults sentry
VUE_APP_SENTRY_DSN=

#vaults hotjar
# vaults hotjar
VUE_APP_HOTJAR_ID=
VUE_APP_IA_SURVEY_ID=

#vaults webchat
# vaults webchat
VUE_APP_GENESYS_ENV=
VUE_APP_GENESYS_URL=
VUE_APP_GENESYS_ID=
Expand Down
22 changes: 13 additions & 9 deletions devops/vaults.env
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# Base Path Openshift: /businesses/create Firebase:
VUE_APP_PATH="/"

#vaults Shared
# vaults Shared
VUE_APP_ADDRESS_COMPLETE_KEY="op://canadapost/$APP_ENV/address-key/ADDRESS_COMPLETE_KEY"

#vaults web-url
# vaults web-url
VUE_APP_REGISTRY_HOME_URL="op://web-url/$APP_ENV/registry/REGISTRY_HOME_URL"
VUE_APP_AUTH_WEB_URL="op://web-url/$APP_ENV/auth-web/AUTH_WEB_URL"
VUE_APP_BUSINESSES_URL="op://web-url/$APP_ENV/business/BUSINESSES_URL"
VUE_APP_DASHBOARD_URL="op://web-url/$APP_ENV/business/DASHBOARD_URL"
VUE_APP_SITEMINDER_LOGOUT_URL="op://web-url/$APP_ENV/siteminder/SITEMINDER_LOGOUT_URL"

#vaults API
# vaults API
VUE_APP_AUTH_API_URL="op://API/$APP_ENV/auth-api/AUTH_API_URL"
VUE_APP_AUTH_API_VERSION="op://API/$APP_ENV/auth-api/AUTH_API_VERSION"
VUE_APP_LEGAL_API_URL="op://API/$APP_ENV/legal-api/LEGAL_API_URL"
# for Legal Name feature branch only:
VUE_APP_LEGAL_API_URL="op://API/$APP_ENV/legal-api/LEGAL_NAME_API_URL"
#VUE_APP_LEGAL_API_URL="op://API/$APP_ENV/legal-api/LEGAL_API_URL"
VUE_APP_LEGAL_API_VERSION_2="op://API/$APP_ENV/legal-api/LEGAL_API_VERSION_2"
VUE_APP_NAICS_API_URL="op://API/$APP_ENV/naics-api/NAICS_API_URL"
VUE_APP_NAICS_API_VERSION_2="op://API/$APP_ENV/naics-api/NAICS_API_VERSION"
Expand All @@ -25,23 +27,25 @@ VUE_APP_PAY_API_VERSION="op://API/$APP_ENV/pay-api/PAY_API_VERSION"
VUE_APP_REGISTRIES_SEARCH_API_URL="op://API/$APP_ENV/registries-search-api/REGISTRIES_SEARCH_API_URL"
VUE_APP_REGISTRIES_SEARCH_API_VERSION="op://API/$APP_ENV/registries-search-api/REGISTRIES_SEARCH_API_VERSION"
VUE_APP_REGISTRIES_SEARCH_API_KEY="op://API/$APP_ENV/registries-search-api/REGISTRIES_SEARCH_API_KEY"
#for feature-legal-name builds
VUE_APP_LEGAL_NAME_API_URL="op://API/$APP_ENV/legal-api/LEGAL_NAME_API_URL"

#vaults launchdarkly
# vaults launchdarkly
VUE_APP_BUSINESS_CREATE_LD_CLIENT_ID="op://launchdarkly/$APP_ENV/business-create/BUSINESS_CREATE_LD_CLIENT_ID"

#vaults keycloak
# vaults keycloak
VUE_APP_KEYCLOAK_AUTH_URL="op://keycloak/$APP_ENV/base/KEYCLOAK_AUTH_BASE_URL"
VUE_APP_KEYCLOAK_REALM="op://keycloak/$APP_ENV/base/KEYCLOAK_REALMNAME"
VUE_APP_KEYCLOAK_CLIENTID="op://keycloak/$APP_ENV/entity-web/UI_KEYCLOAK_RESOURCE_NAME"

#vaults sentry
# vaults sentry
VUE_APP_SENTRY_DSN="op://sentry/$APP_ENV/entity/SENTRY_DSN"

#vaults hotjar (hotjar id - ready to use)
# vaults hotjar (hotjar id - ready to use)
VUE_APP_HOTJAR_ID=
VUE_APP_IA_SURVEY_ID="op://hotjar/$APP_ENV/shared/IA_SURVEY_ID"

#vaults webchat
# vaults webchat
VUE_APP_GENESYS_ENV="op://webchat/$APP_ENV/base/GENESYS_ENV"
VUE_APP_GENESYS_URL="op://webchat/$APP_ENV/base/GENESYS_URL"
VUE_APP_GENESYS_ID="op://webchat/$APP_ENV/business-create-ui/GENESYS_ID"
Expand Down
1 change: 1 addition & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
// FUTURE: change this to a single setter/object?
this.setAdminFreeze(business.adminFreeze)
{
// store operating name if it exists (only used for firms atm)
const alternateName = business.alternateNames?.find(x => x.identifier === business.identifier)
if (alternateName) this.setOperatingName(alternateName.operatingName)
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Dissolution/AssociationDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,12 @@ export default class AssociationDetails extends Mixins(CommonMixin, DateMixin) {
/** The entity name. */
get entityName (): string {
return this.getBusinessLegalName || GetCorpNumberedDescription(this.getEntityType)
return this.getBusinessLegalName || GetCorpNumberedDescription(this.getEntityType as any)
}
/** The entity description. */
get entityDescription (): string {
return GetCorpFullDescription(this.getEntityType)
return GetCorpFullDescription(this.getEntityType as any)
}
/** The business start date. */
Expand Down
4 changes: 2 additions & 2 deletions src/components/Dissolution/CompleteAffidavit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ export default class CompleteAffidavit extends Mixins(CommonMixin, DocumentMixin
/** The entity name. */
get entityName (): string {
return this.getBusinessLegalName || GetCorpNumberedDescription(this.getEntityType)
return this.getBusinessLegalName || GetCorpNumberedDescription(this.getEntityType as any)
}
get entityTitle (): string {
Expand Down Expand Up @@ -374,7 +374,7 @@ export default class CompleteAffidavit extends Mixins(CommonMixin, DocumentMixin
name: this.uploadAffidavitDoc.name,
lastModified: this.uploadAffidavitDoc.lastModified,
size: this.uploadAffidavitDoc.size
}
} as File
this.setAffidavit({
...this.getAffidavitStep,
affidavitFile,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Incorporation/UploadRules.vue
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ export default class UploadRules extends Mixins(CommonMixin, DocumentMixin) {
name: this.uploadRulesDoc.name,
lastModified: this.uploadRulesDoc.lastModified,
size: this.uploadRulesDoc.size
}
} as File
this.setRules({
...this.getCreateRulesStep,
rulesFile,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Restoration/BusinessName.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default class BusinessName extends Mixins(CommonMixin, DateMixin, NameReq
// Global actions
@Action(useStore) setBusinessNameValid!: (x: boolean) => void
@Action(useStore) setCorrectNameOption!: (x: CorrectNameOptions) => void
@Action(useStore) setNameRequest!: (x: string) => void
@Action(useStore) setNameRequest!: (x: NameRequestIF) => void
@Action(useStore) setNameRequestApprovedName!: (x: string) => void
// Local variable
Expand Down
9 changes: 6 additions & 3 deletions src/components/common/EntityInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,25 +126,28 @@ export default class EntityInfo extends Mixins(DateMixin) {
/** The entity legal name (old name, new name, or numbered description). */
get entityLegalName (): string {
const numberedDescription = GetCorpNumberedDescription(this.getEntityType)
const numberedDescription = GetCorpNumberedDescription(this.getEntityType as any)
// name comes from different places depending on filing type
switch (this.getFilingType) {
case FilingTypes.DISSOLUTION:
// *** TODO: does this apply to firms?
return (this.getBusinessLegalName || numberedDescription)
case FilingTypes.INCORPORATION_APPLICATION:
return (this.getNameRequestApprovedName || numberedDescription)
case FilingTypes.REGISTRATION:
return (this.getNameRequestApprovedName || numberedDescription)
case FilingTypes.RESTORATION:
// *** TODO: does this apply to firms?
// *** TODO: should the following be getNameRequestApprovedName (as in BreadCrumbResource)?
return (this.getBusinessLegalName || numberedDescription)
}
return '' // should never happen
}
/** The entity description. */
/** The entity description. */
get entityDescription (): string {
const corpTypeDescription = GetCorpFullDescription(this.getEntityType)
const corpTypeDescription = GetCorpFullDescription(this.getEntityType as any)
if (this.isTypeSoleProp && this.getTempId) {
return `${corpTypeDescription} / Doing Business As (DBA)`
Expand Down
3 changes: 2 additions & 1 deletion src/mixins/document-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export default class DocumentMixin extends Vue {

pdfjsLib: any

async created () {
// use beforeCreate() instead of created() to avoid type conflict with components that use this mixin
async beforeCreate (): Promise<void> {
// NB: we load the lib and worker this way to avoid a memory leak (esp in unit tests)
// NB: must use legacy build for unit tests not running in Node 18+
this.pdfjsLib = pdfjs
Expand Down
19 changes: 7 additions & 12 deletions src/resources/BreadCrumbResource.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { FilingTypes } from '@/enums'
import { CorpTypeCd } from '@bcrs-shared-components/enums/'
import { BreadcrumbIF } from '@/interfaces'
import { createPinia, setActivePinia } from 'pinia'
import { useStore } from '@/store/store'
Expand All @@ -10,22 +9,18 @@ const store = useStore()

/** Returns legal name. */
function getLegalName (): string {
const getFilingType: FilingTypes = store.getFilingType
const getBusinessLegalName: string = store.getBusinessLegalName
const getNameRequestApprovedName: string = store.getNameRequestApprovedName

switch (getFilingType) {
case FilingTypes.DISSOLUTION: return getBusinessLegalName
case FilingTypes.INCORPORATION_APPLICATION: return getNameRequestApprovedName
case FilingTypes.REGISTRATION: return getNameRequestApprovedName
case FilingTypes.RESTORATION: return getNameRequestApprovedName
// name comes from different places depending on filing type
switch (store.getFilingType) {
case FilingTypes.DISSOLUTION: return store.getBusinessLegalName
case FilingTypes.INCORPORATION_APPLICATION: return store.getNameRequestApprovedName
case FilingTypes.REGISTRATION: return store.getNameRequestApprovedName
case FilingTypes.RESTORATION: return store.getNameRequestApprovedName
}
}

/** Returns numbered entity name. */
function getNumberedEntityName (): string {
const getEntityType = store.getEntityType as CorpTypeCd
return GetCorpNumberedDescription(getEntityType)
return GetCorpNumberedDescription(store.getEntityType as any)
}

/** Returns URL param string with Account ID if present, else empty string. */
Expand Down
14 changes: 5 additions & 9 deletions src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,9 @@ export const useStore = defineStore('store', {
}
},

/** The Business Legal Name. */
/** The Business Legal Name (or Operating Name if this is a firm). */
getBusinessLegalName (): string {
if (this.isTypeFirm) return this.stateModel.operatingName
return this.stateModel.business.legalName
},

Expand Down Expand Up @@ -300,11 +301,6 @@ export const useStore = defineStore('store', {
return this.stateModel.nameRequestApprovedName
},

/** The Operating Name. */
getOperatingName (): string {
return this.stateModel.operatingName
},

/** The Correct Name Option. */
getCorrectNameOption (): CorrectNameOptions {
return this.stateModel.correctNameOption
Expand Down Expand Up @@ -884,6 +880,9 @@ export const useStore = defineStore('store', {
setFoundingDate (foundingDate: string) {
this.stateModel.business.foundingDate = foundingDate
},
setOperatingName (name: string) {
this.stateModel.operatingName = name
},
setFilingType (filingType: FilingTypes) {
this.stateModel.tombstone.filingType = filingType
},
Expand Down Expand Up @@ -991,9 +990,6 @@ export const useStore = defineStore('store', {
setNameRequestApprovedName (name: string) {
this.stateModel.nameRequestApprovedName = name
},
setOperatingName (name: string) {
this.stateModel.operatingName = name
},
setCorrectNameOption (option: CorrectNameOptions) {
this.stateModel.correctNameOption = option
},
Expand Down
9 changes: 6 additions & 3 deletions src/utils/FetchConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,18 @@ export async function FetchConfig (): Promise<any> {
const dashboardUrl: string = import.meta.env.VUE_APP_DASHBOARD_URL
sessionStorage.setItem('DASHBOARD_URL', dashboardUrl)

const legalApiUrl: string = (import.meta.env.VUE_APP_LEGAL_API_URL + import.meta.env.VUE_APP_LEGAL_API_VERSION_2 + '/')
const legalApiUrl: string = (
import.meta.env.VUE_APP_LEGAL_API_URL + import.meta.env.VUE_APP_LEGAL_API_VERSION_2 + '/'
)
// set base URL for axios calls
axios.defaults.baseURL = legalApiUrl

const naicsUrl: string = (import.meta.env.VUE_APP_NAICS_API_URL + import.meta.env.VUE_APP_NAICS_API_VERSION_2 + '/')
sessionStorage.setItem('NAICS_URL', naicsUrl)

const registriesSearchApiUrl: string =
(import.meta.env.VUE_APP_REGISTRIES_SEARCH_API_URL + import.meta.env.VUE_APP_REGISTRIES_SEARCH_API_VERSION + '/')
const registriesSearchApiUrl: string = (
import.meta.env.VUE_APP_REGISTRIES_SEARCH_API_URL + import.meta.env.VUE_APP_REGISTRIES_SEARCH_API_VERSION + '/'
)
sessionStorage.setItem('REGISTRIES_SEARCH_API_URL', registriesSearchApiUrl)

const businessApiKey: string = import.meta.env.VUE_APP_REGISTRIES_SEARCH_API_KEY
Expand Down
4 changes: 2 additions & 2 deletions src/views/Dissolution/DissolutionDefineDissolution.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ export default class DissolutionDefineDissolution extends Mixins(CommonMixin) {
@Action(useStore) setCustodianValidity!: (x: boolean) => void
get corpDescription (): string {
return GetCorpFullDescription(this.getEntityType)
return GetCorpFullDescription(this.getEntityType as any)
}
/** The entity name. */
get entityName (): string {
return this.getBusinessLegalName || GetCorpNumberedDescription(this.getEntityType)
return this.getBusinessLegalName || GetCorpNumberedDescription(this.getEntityType as any)
}
/** The entity designation. */
Expand Down

0 comments on commit bc69d15

Please sign in to comment.