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

21134 Added continued in entity types to business search #573

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 30 additions & 7 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "business-edit-ui",
"version": "4.9.0",
"version": "4.9.1",
"private": true,
"appName": "Edit UI",
"sbcName": "SBC Common Components",
Expand All @@ -18,7 +18,7 @@
"@bcrs-shared-components/approval-type": "1.0.19",
"@bcrs-shared-components/base-address": "2.0.3",
"@bcrs-shared-components/breadcrumb": "2.1.5",
"@bcrs-shared-components/business-lookup": "1.1.30",
"@bcrs-shared-components/business-lookup": "1.3.4",
Copy link
Collaborator Author

@severinbeauvais severinbeauvais Jun 5, 2024

Choose a reason for hiding this comment

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

In this updated component, the default entity types prop now includes C, CBEN, CCC and CUL. (Some business searches use the default; other request specific types only.)

I also diffed the old vs new version of this component and I don't see any breaking changes.

Before (https://dev.edit.business.bcregistry.gov.bc.ca/FM1055550/change?accountid=3040):
image

After (https://business-edit-dev--pr-573-4h129ls0.web.app/FM1055550/change?accountid=3040):
image

Copy link
Collaborator

@JazzarKarim JazzarKarim Jun 5, 2024

Choose a reason for hiding this comment

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

I'm playing around with it by adding different types of businesses. Looks good.

Copy link
Collaborator Author

@severinbeauvais severinbeauvais Jun 5, 2024

Choose a reason for hiding this comment

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

Great, thanks.

The differences between the previous and new versions are: autofocus, removed whitespace, and added props.

Oh, and 4 more entity types in the prop default (link).

"@bcrs-shared-components/certify": "2.1.5",
"@bcrs-shared-components/completing-party": "2.1.30",
"@bcrs-shared-components/confirm-dialog": "1.2.1",
Expand Down
3 changes: 1 addition & 2 deletions src/components/common/FileUploadPdf.vue
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,7 @@ export default class FileUploadPdf extends Vue {
const psu = await this.getPresignedUrl(file.name)

// NB: will throw on API error
const res = await this.uploadToUrl(psu.preSignedUrl, file, psu.key,
this.userId)
const res = await this.uploadToUrl(psu.preSignedUrl, file, psu.key, this.userId)

// check if successful
if (res?.status === 200) {
Expand Down
14 changes: 7 additions & 7 deletions src/services/business-lookup-services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { AxiosInstance as axios } from '@/utils/'
* Class that provides integration with the BusinessLookup API.
*/
export default class BusinessLookupServices {
/** The Business API URL, from session storage. */
static get businessApiUrl (): string {
/** The Registries Search API URL, from session storage. */
static get searchApiUrl (): string {
return sessionStorage.getItem('REGISTRIES_SEARCH_API_URL')
}

/** The Business API Key, from session storage. */
static get businessApiKey (): string {
return sessionStorage.getItem('BUSINESS_API_KEY')
/** The Registries Search API Key, from session storage. */
static get searchApiKey (): string {
return sessionStorage.getItem('REGISTRIES_SEARCH_API_KEY')
}

/** The Account ID, from session storage. */
Expand All @@ -36,13 +36,13 @@ export default class BusinessLookupServices {
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'

let url = this.businessApiUrl + 'businesses/search/facets?start=0&rows=20'
let url = this.searchApiUrl + 'businesses/search/facets?start=0&rows=20'
url += `&categories=legalType:${legalType}${status ? '::status:' + status : ''}`
url += `&query=value:${encodeURIComponent(query)}`

return axios.get(url, {
headers: {
'x-apikey': this.businessApiKey,
'x-apikey': this.searchApiKey,
'Account-Id': this.accountId
}
}).then(response => {
Expand Down
14 changes: 7 additions & 7 deletions src/services/legal-services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,13 @@ export default class LegalServices {
}

/**
* Uploads the specified file to the specified URL.
* @param url the URL to upload to
* @param file the file to upload
* @param key the file key
* @param userId the file user id
* @returns the axios response
*/
* Uploads the specified file to the specified URL.
* @param url the URL to upload to
* @param file the file to upload
* @param key the file key
* @param userId the file user id
* @returns the axios response
*/
static async uploadToUrl (url: string, file: File, key: string, userId: string): Promise<AxiosResponse> {
const headers = {
'Content-Type': file.type,
Expand Down
4 changes: 2 additions & 2 deletions src/utils/FetchConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export async function FetchConfig (): Promise<any> {
(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
sessionStorage.setItem('BUSINESS_API_KEY', businessApiKey)
const registriesSearchApiKey: string = import.meta.env.VUE_APP_REGISTRIES_SEARCH_API_KEY
sessionStorage.setItem('REGISTRIES_SEARCH_API_KEY', registriesSearchApiKey)

const authApiUrl: string = (import.meta.env.VUE_APP_AUTH_API_URL + import.meta.env.VUE_APP_AUTH_API_VERSION + '/')
sessionStorage.setItem('AUTH_API_URL', authApiUrl)
Expand Down
5 changes: 4 additions & 1 deletion tests/unit/FetchConfig.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable max-len */

import { AxiosInstance, FetchConfig } from '@/utils'

// mock the console.info function to hide the output
Expand Down Expand Up @@ -47,12 +49,13 @@ describe('Fetch Config', () => {
// verify data
expect(sessionStorage.getItem('AUTH_API_URL')).toBe('auth api url/auth api version/')
expect(sessionStorage.getItem('AUTH_WEB_URL')).toBe('auth web url')
expect(sessionStorage.getItem('BUSINESS_API_KEY')).toBe('business api key')
expect(sessionStorage.getItem('BUSINESSES_URL')).toBe('businesses url')
expect(sessionStorage.getItem('DASHBOARD_URL')).toBe('dashboard url')
expect(sessionStorage.getItem('NAICS_URL')).toBe('naics api url/naics api version/')
expect(sessionStorage.getItem('PAY_API_URL')).toBe('pay api url/pay api version/')
expect(sessionStorage.getItem('REGISTRY_HOME_URL')).toBe('registry home url')
expect(sessionStorage.getItem('REGISTRIES_SEARCH_API_KEY')).toBe('business api key')
expect(sessionStorage.getItem('REGISTRIES_SEARCH_API_URL')).toBe('registries search api url/registries search api version/')
expect(sessionStorage.getItem('SITEMINDER_LOGOUT_URL')).toBe('siteminder logout url')
expect(sessionStorage.getItem('STATUS_API_URL')).toBe('status api url/status api version')
expect(AxiosInstance.defaults.baseURL).toBe('legal api url/legal api version 2/')
Expand Down
Loading