From e17ff0e4b4c16f5ff5a9a873477d2c7063be204c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9verin=20Beauvais?= Date: Thu, 9 Nov 2023 11:39:18 -0800 Subject: [PATCH] - app version = 4.7.5 (#541) - moved director workaround to LegalServices - moved parties workaround to LegalServices - removed workaround from Change - removed workaround from Conversion - updated unit tests --- package-lock.json | 6 +++--- package.json | 2 +- src/services/legal-services.ts | 19 ++++++++++++++++++- src/views/Change.vue | 13 +------------ src/views/Conversion.vue | 13 +------------ tests/unit/legal-services.spec.ts | 10 +++++----- 6 files changed, 29 insertions(+), 34 deletions(-) diff --git a/package-lock.json b/package-lock.json index fb849d34..3f2c5f8d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "business-edit-ui", - "version": "4.7.4", + "version": "4.7.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "business-edit-ui", - "version": "4.7.4", + "version": "4.7.5", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/action-chip": "1.1.5", @@ -68,7 +68,7 @@ "@typescript-eslint/eslint-plugin": "^5.59.2", "@typescript-eslint/parser": "^5.59.2", "@vitejs/plugin-vue2": "^2.2.0", - "@volar-plugins/vetur": "*", + "@volar-plugins/vetur": "latest", "@vue/eslint-config-standard": "^4.0.0", "@vue/eslint-config-typescript": "^9.1.0", "@vue/test-utils": "^1.3.5", diff --git a/package.json b/package.json index 3ab394bb..71fc040d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "business-edit-ui", - "version": "4.7.4", + "version": "4.7.5", "private": true, "appName": "Edit UI", "sbcName": "SBC Common Components", diff --git a/src/services/legal-services.ts b/src/services/legal-services.ts index b7d01128..7ba2b798 100644 --- a/src/services/legal-services.ts +++ b/src/services/legal-services.ts @@ -202,6 +202,14 @@ export default class LegalServices { if (directors) { // convert director list to org-person list return directors.map(director => { + // WORK-AROUND WARNING !!! + // convert directors from "middleInitial" to "middleName" + const middleInitial = director.officer['middleInitial'] + if (middleInitial !== undefined) { + director.officer.middleName = middleInitial + delete director.officer['middleInitial'] + } + const orgPerson: OrgPersonIF = { deliveryAddress: director.deliveryAddress, mailingAddress: director.mailingAddress, @@ -236,7 +244,16 @@ export default class LegalServices { .then(response => { const parties = response?.data?.parties if (parties) { - return parties + // WORK-AROUND WARNING !!! + // convert parties from "middleInitial" to "middleName" + return parties.map(party => { + const middleInitial = party.officer['middleInitial'] + if (middleInitial !== undefined) { + party.officer.middleName = middleInitial + delete party.officer['middleInitial'] + } + return party + }) } // eslint-disable-next-line no-console console.log('fetchParties() error - invalid response =', response) diff --git a/src/views/Change.vue b/src/views/Change.vue index 183174d8..4384eada 100644 --- a/src/views/Change.vue +++ b/src/views/Change.vue @@ -285,22 +285,11 @@ export default class Change extends Mixins(CommonMixin, FeeMixin, FilingTemplate if (items.length !== 4) throw new Error('Failed to fetch entity snapshot') - // WORK-AROUND WARNING !!! - // convert orgPersons from "middleInitial" to "middleName" - const orgPersons = items[3].map(orgPerson => { - const middleInitial = orgPerson.officer['middleInitial'] - if (middleInitial !== undefined) { - orgPerson.officer.middleName = middleInitial - delete orgPerson.officer['middleInitial'] - } - return orgPerson - }) - return { businessInfo: items[0], authInfo: items[1], addresses: items[2], - orgPersons + orgPersons: items[3] } as EntitySnapshotIF } diff --git a/src/views/Conversion.vue b/src/views/Conversion.vue index 3a2666d2..a30c3a9a 100644 --- a/src/views/Conversion.vue +++ b/src/views/Conversion.vue @@ -240,22 +240,11 @@ export default class Conversion extends Mixins(CommonMixin, FeeMixin, FilingTemp throw new Error('Failed to fetch entity addresses') }) - // WORK-AROUND WARNING !!! - // convert orgPersons from "middleInitial" to "middleName" - const orgPersons = items[2].map(orgPerson => { - const middleInitial = orgPerson.officer['middleInitial'] - if (middleInitial !== undefined) { - orgPerson.officer.middleName = middleInitial - delete orgPerson.officer['middleInitial'] - } - return orgPerson - }) - return { businessInfo: items[0], authInfo: items[1], addresses, - orgPersons + orgPersons: items[2] } as EntitySnapshotIF } /** Emits Fetch Error event. */ diff --git a/tests/unit/legal-services.spec.ts b/tests/unit/legal-services.spec.ts index 7f3b7238..ae4851b0 100644 --- a/tests/unit/legal-services.spec.ts +++ b/tests/unit/legal-services.spec.ts @@ -138,8 +138,8 @@ describe('Legal Services', () => { it('fetches directors correctly', async () => { const DIRECTORS = [ - { appointmentDate: '2022-04-01' }, - { appointmentDate: '2022-05-01' } + { appointmentDate: '2022-04-01', officer: {} }, + { appointmentDate: '2022-05-01', officer: {} } ] const ORGPERSONS = [ { roles: [{ appointmentDate: '2022-04-01', roleType: 'Director' }] }, @@ -160,9 +160,9 @@ describe('Legal Services', () => { it('fetches parties correctly', async () => { const PARTIES = [ - { roles: [{ appointmentDate: '2022-04-01', roleType: 'Completing Party' }] }, - { roles: [{ appointmentDate: '2022-04-01', roleType: 'Incorporator' }] }, - { roles: [{ appointmentDate: '2022-05-01', roleType: 'Director' }] } + { officer: {}, roles: [{ appointmentDate: '2022-04-01', roleType: 'Completing Party' }] }, + { officer: {}, roles: [{ appointmentDate: '2022-04-01', roleType: 'Incorporator' }] }, + { officer: {}, roles: [{ appointmentDate: '2022-05-01', roleType: 'Director' }] } ] // mock endpoint