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

21718 Updated list of legal types to search #574

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

severinbeauvais
Copy link
Collaborator

Issue #: bcgov/entity#21718

Description of changes:

  • app version = 4.9.2
  • refactored BusinessLookupServices.search() to use legalTypes parameter (same as in Create UI)
  • updated unit tests

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

- refactored BusinessLookupServices.search() to use legalTypes parameter (same as in Create UI)
- updated unit tests
static async search (query: string, status: string): Promise<BusinessLookupResultIF[]> {
const legalType = 'BC,A,ULC,C,S,XP,GP,LP,CUL,XS,LLC,LL,BEN,CP,CC,XL,FI,XCP,PA'

static async search (query: string, status: string, legalTypes: string): Promise<BusinessLookupResultIF[]> {
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 method is called by the Business Lookup shared component, which passed in the full list of legal types (unless overridden by a prop, not used in this case).

The call to search: https://github.com/bcgov/bcrs-shared-components/blob/83cfe9c8dbe19714567814eb3efd7e08f35faf49/src/components/business-lookup/BusinessLookup.vue#L237

The default prop: https://github.com/bcgov/bcrs-shared-components/blob/83cfe9c8dbe19714567814eb3efd7e08f35faf49/src/components/business-lookup/BusinessLookup.vue#L170

Where the Business Lookup component is used:

(note that legalTypes is not passed in, so we use the default)

}).then(response => {
}

return axios.get(url, config).then(response => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just some cleanup to match Create UI.

.returns(new Promise(resolve => resolve({ data: { searchResults: { results: [result] } } })))

// search and look at results
const results = await BusinessLookupServices.search('FM1000002', 'ACTIVE')
const results = await BusinessLookupServices.search('FM1000002', 'ACTIVE', 'SP')
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just some simplifications so we don't have to carry around the whole list of legal types multiple times.

@severinbeauvais
Copy link
Collaborator Author

/gcbrun

@bcregistry-sre
Copy link
Collaborator

bcregistry-sre commented Jun 11, 2024

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.

LGTM Sev!

@severinbeauvais severinbeauvais merged commit 2de7847 into bcgov:main Jun 11, 2024
4 of 5 checks passed
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.

3 participants