Skip to content
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

15601 Legal Name changes #575

Merged
merged 10 commits into from
Oct 10, 2023

Conversation

severinbeauvais
Copy link
Collaborator

@severinbeauvais severinbeauvais commented Oct 4, 2023

Issue #: bcgov/entity#15601

Description of changes:

Commit 1:

  • app version = 5.6.0

Commit 2:

  • updated Legal API URL (temporary)
  • save operating name from business info
  • added operating name to state
  • added alternate names array to business inteface
  • added operating name store getter and setter
  • initialized operating name in state

Commit 3:

  • added temp API URL to example env file
  • 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

Commits 4-5-6:

  • updated EntityInfo unit tests
  • added ids to some AssociationDetails elements
  • added AssociationDetails unit tests
  • updated App unit tests

Commits 7-8-9-10:

  • deleted obsolete nginx config
  • commented out invalid comment in Dockerfile
  • updated firebase config to allow connecting to Legal API temp URL
  • renamed jest-wrapper-factory -> vitest-wrapper-factory

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).

- save operating name from business info
- added operating name to state
- added alternate names array to business inteface
- added operating name store getter and setter
- initialized operating name in state
@severinbeauvais severinbeauvais self-assigned this Oct 4, 2023
@severinbeauvais severinbeauvais changed the base branch from main to feature-legal-name October 4, 2023 21:01
@@ -361,7 +362,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
readonly window = window

/** The Update Current JS Date timer id. */
private updateCurrentJsDateId = 0
private updateCurrentJsDateId = null as any // NodeJS.Timeout
Copy link
Collaborator Author

@severinbeauvais severinbeauvais Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node complains that this variable is not a number (though I think it is a number in the browser) so I just typed it as any.

In browser:
image

@@ -810,7 +811,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
// NB: will throw if API error
let draftFiling = await LegalServices.fetchFirstTask(businessId)

this.setFilingType(draftFiling.header.name)
this.setFilingType(draftFiling.header.name as FilingTypes)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed warning because name is a string.

@@ -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)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a mismatch between CorpTypeCd in GetCorpNumberedDescription() and CorpTypeCd from getEntityType that I couldn't figure out quickly so I just typed it as any.

@@ -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
Copy link
Collaborator Author

@severinbeauvais severinbeauvais Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getFilingType was only used once so I moved it there.

getBusinessLegalName was only needed in some cases so I moved it there.

getNameRequestApprovedName was only needed in some cases so I moved it there.

^^ Although it looked nice to assign variables ahead of time, in all cases some variables weren't used, so I simplified this.

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 + '/'
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line was too long.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably need to fix lint at some point to make it not run the project if there was a lint error. I remember I created a ticket for that back when I did the Vite work but no idea when will we be able to get to that ticket.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all we need to do is change lint warnings to errors. But this is a problem for another day. (Hope you agree!)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, for sure Sev! I also found the ticket: bcgov/entity#17320

A problem for another day 🙌

(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 + '/'
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parentheses not used consistently.

VUE_APP_LEGAL_API_URL="https://legal-api-dev.apps.silver.devops.gov.bc.ca"
# 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"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be updated when merging to main branch.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@argush3 ^^

... Whatever we end up doing for the new Legal (Name) API URL ...

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"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be updated when merging to main branch.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@argush3 ^^

... Whatever we end up doing for the new Legal (Name) API URL ...

- 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

describe('Breadcrumbs for firms', () => {
it('computes breadcrumbs correctly for a SP registration', () => {
const wrapper = shallowWrapperFactory(
Copy link
Collaborator Author

@severinbeauvais severinbeauvais Oct 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to shallow-mount App.vue (meaning the Breadcrumb sub-component is stubbed, not fully rendered) and I check the breadcrumbs computed instead.

@bcgov bcgov deleted a comment from bcregistry-sre Oct 6, 2023
@severinbeauvais severinbeauvais marked this pull request as ready for review October 6, 2023 22:23
@severinbeauvais severinbeauvais changed the title 15601 Legal Name change 15601 Legal Name changes Oct 6, 2023
@bcgov bcgov deleted a comment from bcregistry-sre Oct 6, 2023
nginx.conf Outdated Show resolved Hide resolved
- updated firebase config to allow connecting to Legal API temp URL
@@ -20,7 +20,7 @@
{ "key" : "X-XSS-Protection", "value" : "1; mode=block" },
{
"key": "Content-Security-Policy",
"value": "default-src 'self'; frame-src 'self' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; script-src 'self' 'unsafe-eval' 'unsafe-inline' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; style-src 'self' 'unsafe-inline' *.cloudflare.com *.googleapis.com; font-src 'self' *.gov.bc.ca *.hotjar.com *.cloudflare.com *.googleapis.com *.gstatic.com *.jsdelivr.net; img-src 'self' data: *.hotjar.com https://*.cac1.pure.cloud; connect-src 'self' *.gov.bc.ca *.launchdarkly.com *.hotjar.com *.postescanada-canadapost.ca *.sentry.io *.apigee.net wss://*.hotjar.com *.hotjar.io https://*.nr-data.net https://shyrka-prod-cac1.s3.ca-central-1.amazonaws.com https://*.newrelic.com https://*.cac1.pure.cloud wss://*.cac1.pure.cloud; manifest-src 'self'; media-src 'self' https://*.cac1.pure.cloud; object-src 'self' https://*.cac1.pure.cloud; child-src 'self' https://*.cac1.pure.cloud;"
"value": "default-src 'self'; frame-src 'self' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; script-src 'self' 'unsafe-eval' 'unsafe-inline' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; style-src 'self' 'unsafe-inline' *.cloudflare.com *.googleapis.com; font-src 'self' *.gov.bc.ca *.hotjar.com *.cloudflare.com *.googleapis.com *.gstatic.com *.jsdelivr.net; img-src 'self' data: *.hotjar.com https://*.cac1.pure.cloud; connect-src 'self' *.gov.bc.ca *.run.app *.launchdarkly.com *.hotjar.com *.postescanada-canadapost.ca *.sentry.io *.apigee.net wss://*.hotjar.com *.hotjar.io https://*.nr-data.net https://shyrka-prod-cac1.s3.ca-central-1.amazonaws.com https://*.newrelic.com https://*.cac1.pure.cloud wss://*.cac1.pure.cloud; manifest-src 'self'; media-src 'self' https://*.cac1.pure.cloud; object-src 'self' https://*.cac1.pure.cloud; child-src 'self' https://*.cac1.pure.cloud;"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be updated when merging to main branch.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@argush3 ^^

(Need to remove connect-src *.run.app.)

nginx.conf Outdated Show resolved Hide resolved
tests/unit/App.spec.ts Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
@bcgov bcgov deleted a comment from bcregistry-sre Oct 6, 2023
@bcgov bcgov deleted a comment from bcregistry-sre Oct 6, 2023
Copy link
Collaborator

@JazzarKarim JazzarKarim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great Sev! 👍

- restored nginx config
@severinbeauvais
Copy link
Collaborator Author

/gcbrun

@bcregistry-sre
Copy link
Collaborator

bcregistry-sre commented Oct 6, 2023

@bcgov bcgov deleted a comment from bcregistry-sre Oct 6, 2023
Copy link
Collaborator

@ketaki-deodhar ketaki-deodhar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked through all the changes. Looks good!

Copy link
Contributor

@PaulGarewal PaulGarewal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@severinbeauvais severinbeauvais merged commit 4c1dbb5 into bcgov:feature-legal-name Oct 10, 2023
5 checks passed
Copy link
Contributor

@jamespaologarcia jamespaologarcia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

JazzarKarim pushed a commit to JazzarKarim/business-create-ui that referenced this pull request Jan 25, 2024
* - app version = 5.6.0

* - updated Legal API URL (temporary)
- save operating name from business info
- added operating name to state
- added alternate names array to business inteface
- added operating name store getter and setter
- initialized operating name in state

* - added temp API URL to example env file
- 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

* - updated EntityInfo unit tests

* - added ids to some AssociationDetails elements
- added AssociationDetails unit tests

* - updated App unit tests

* - deleted obsolete nginx config
- updated firebase config to allow connecting to Legal API temp URL

* - commented out invalid comment in Dockerfil

* - renamed jest-wrapper-factory -> vitest-wrapper-factory

* - reverted Dockerfile
- restored nginx config
JazzarKarim pushed a commit to JazzarKarim/business-create-ui that referenced this pull request Feb 1, 2024
* - app version = 5.6.0

* - updated Legal API URL (temporary)
- save operating name from business info
- added operating name to state
- added alternate names array to business inteface
- added operating name store getter and setter
- initialized operating name in state

* - added temp API URL to example env file
- 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

* - updated EntityInfo unit tests

* - added ids to some AssociationDetails elements
- added AssociationDetails unit tests

* - updated App unit tests

* - deleted obsolete nginx config
- updated firebase config to allow connecting to Legal API temp URL

* - commented out invalid comment in Dockerfil

* - renamed jest-wrapper-factory -> vitest-wrapper-factory

* - reverted Dockerfile
- restored nginx config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants