From 02c9fc0abefd93552b525ae4a86f4bee666f89ec Mon Sep 17 00:00:00 2001 From: Severin Beauvais Date: Tue, 16 Jul 2024 13:39:55 -0700 Subject: [PATCH 1/4] - app version = 7.3.14 - now store pending bootstrap item to Pendings list - added "pendings" store state, action, getter - added pending conditionals to dashboard v-cards - refactored PendingList.vue - implemented PendingTemplate.vue - implemented ContinuationIn.vue - misc cleanup --- package-lock.json | 4 +- package.json | 2 +- src/App.vue | 24 +- src/components/Dashboard/AddressListSm.vue | 4 +- src/components/Dashboard/PendingList.vue | 2365 +---------------- .../Dashboard/PendingList/PendingTemplate.vue | 104 + .../PendingList/filings/ContinuationIn.vue | 45 + .../Dashboard/PendingList/filings/index.ts | 1 + src/components/Dashboard/TodoList.vue | 13 +- src/components/EntityInfo/EntityHeader.vue | 36 +- src/interfaces/root-state-interface.ts | 4 +- src/stores/rootStore.ts | 18 +- src/views/Dashboard.vue | 19 +- tests/unit/App.spec.ts | 4 +- tests/unit/EntityHeader.spec.ts | 4 +- tests/unit/PendingList.spec.ts | 43 + 16 files changed, 314 insertions(+), 2376 deletions(-) create mode 100644 src/components/Dashboard/PendingList/PendingTemplate.vue create mode 100644 src/components/Dashboard/PendingList/filings/ContinuationIn.vue create mode 100644 src/components/Dashboard/PendingList/filings/index.ts create mode 100644 tests/unit/PendingList.spec.ts diff --git a/package-lock.json b/package-lock.json index c2bf94aef..8c2bbea21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "business-filings-ui", - "version": "7.3.13", + "version": "7.3.14", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "business-filings-ui", - "version": "7.3.13", + "version": "7.3.14", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/base-address": "2.0.9", diff --git a/package.json b/package.json index 85892aac6..ff28ab467 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "business-filings-ui", - "version": "7.3.13", + "version": "7.3.14", "private": true, "appName": "Filings UI", "sbcName": "SBC Common Components", diff --git a/src/App.vue b/src/App.vue index b02baed23..aad652e4e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -343,8 +343,9 @@ export default class App extends Mixins( created (): void { // listen for reload data events this.$root.$on('reloadData', async () => { - // clear Todo List / Filing History List before fetching new data + // clear lists before fetching new data this.setTasks([]) + this.setPendings([]) this.setFilings([]) await this.fetchData() }) @@ -391,6 +392,7 @@ export default class App extends Mixins( @Action(useRootStore) setKeycloakRoles!: (x: Array) => void @Action(useRootStore) setNameRequest!: (x: any) => void @Action(useRootStore) setParties!: (x: Array) => void + @Action(useRootStore) setPendings!: (x: Array) => void @Action(useRootStore) setRecordsAddress!: (x: OfficeAddressIF) => void @Action(useRootStore) setRegisteredAddress!: (x: OfficeAddressIF) => void @Action(useRootStore) setTasks!: (x: Array) => void @@ -687,7 +689,25 @@ export default class App extends Mixins( /** Stores bootstrap item in the Pending List. */ storeBootstrapPending (response: any): void { - this.storeBootstrapFiling(response) // *** TODO: implement this + const filing = response.filing as TaskTodoIF + // NB: these were already validated in storeBootstrapItem() + const header = filing.header + const data = filing[header.name] + + // set addresses + this.storeAddresses({ data: data.offices || [] }) + + // set parties + this.storeParties({ data: { parties: data.parties || [] } }) + + const description = GetCorpFullDescription(data.nameRequest.legalType) + const filingName = EnumUtilities.filingTypeToName(header.name, null, data.type) + + // save display name for later + filing.displayName = `${description} ${filingName}` + + // add this as a pending item + this.setPendings([filing]) } /** Stores bootstrap item in the Filing History List. */ diff --git a/src/components/Dashboard/AddressListSm.vue b/src/components/Dashboard/AddressListSm.vue index e85dfff27..63e924ade 100644 --- a/src/components/Dashboard/AddressListSm.vue +++ b/src/components/Dashboard/AddressListSm.vue @@ -352,7 +352,9 @@ export default class AddressListSm extends Mixins(CommonMixin, CountriesProvince return [] // All panels closed by default } else if (this.disabled) { return [OPEN_PANEL, CLOSE_PANEL] - } else return [OPEN_PANEL] + } else { + return [OPEN_PANEL] + } } } diff --git a/src/components/Dashboard/PendingList.vue b/src/components/Dashboard/PendingList.vue index 1d2612bbf..85ca0f8d1 100644 --- a/src/components/Dashboard/PendingList.vue +++ b/src/components/Dashboard/PendingList.vue @@ -1,2232 +1,66 @@ @@ -2234,138 +68,21 @@ export default class PendingList extends Mixins(AllowableActionsMixin, DateMixin diff --git a/src/components/Dashboard/PendingList/PendingTemplate.vue b/src/components/Dashboard/PendingList/PendingTemplate.vue new file mode 100644 index 000000000..ebe647bf1 --- /dev/null +++ b/src/components/Dashboard/PendingList/PendingTemplate.vue @@ -0,0 +1,104 @@ + + + + + diff --git a/src/components/Dashboard/PendingList/filings/ContinuationIn.vue b/src/components/Dashboard/PendingList/filings/ContinuationIn.vue new file mode 100644 index 000000000..ce6fa522e --- /dev/null +++ b/src/components/Dashboard/PendingList/filings/ContinuationIn.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/src/components/Dashboard/PendingList/filings/index.ts b/src/components/Dashboard/PendingList/filings/index.ts new file mode 100644 index 000000000..ce7a41b43 --- /dev/null +++ b/src/components/Dashboard/PendingList/filings/index.ts @@ -0,0 +1 @@ +export { default as ContinuationIn } from './ContinuationIn.vue' diff --git a/src/components/Dashboard/TodoList.vue b/src/components/Dashboard/TodoList.vue index 3894cda43..2d4f7ecac 100644 --- a/src/components/Dashboard/TodoList.vue +++ b/src/components/Dashboard/TodoList.vue @@ -69,7 +69,7 @@ :class="{'invalid-section ml-n1 pl-1 rounded-0': showInvalidSection(item)}" >
-
+

{{ item.title }} @@ -758,7 +758,10 @@ export default class TodoList extends Mixins(AllowableActionsMixin, DateMixin) { return this.todoItems.sort((a, b) => (a.order - b.order)) } - /** Whether to show Name Request Info section. */ + /** + * Whether to show Name Request Info section. + * Can only be called if an expand button was rendered. + */ isFilingWithNr (item: TodoItemIF): boolean { return ( EnumUtilities.isTypeAmalgamationApplication(item) || @@ -1916,7 +1919,7 @@ export default class TodoList extends Mixins(AllowableActionsMixin, DateMixin) { return case FilingTypes.CONTINUATION_IN: { - // navigate to Create UI to resume this Continuation In Application + // navigate to Create UI to resume this Continuation In const continuationInUrl = `${this.getCreateUrl}/continuation-in-business-home?id=${this.tempRegNumber}` navigate(continuationInUrl) return @@ -2219,7 +2222,7 @@ export default class TodoList extends Mixins(AllowableActionsMixin, DateMixin) { @Watch('getTasks', { immediate: true }) async onTasksChanged (): Promise { - // load data initially and when tasks list changes + // load data initially and when task list changes await this.loadData() } @@ -2301,7 +2304,7 @@ export default class TodoList extends Mixins(AllowableActionsMixin, DateMixin) { .v-btn { // adjust button position so it fits within the title height - margin-top: -8px; + margin-top: -4px; margin-bottom: -4px; } } diff --git a/src/components/EntityInfo/EntityHeader.vue b/src/components/EntityInfo/EntityHeader.vue index 548d86e4f..7f992f0d1 100644 --- a/src/components/EntityInfo/EntityHeader.vue +++ b/src/components/EntityInfo/EntityHeader.vue @@ -81,9 +81,9 @@
- {{ appDescription }} + {{ bootstrapFilingDescription }}
@@ -107,16 +107,18 @@ export default class EntityHeader extends Vue { @Getter(useBusinessStore) isEntitySoleProp!: boolean @Getter(useBusinessStore) isHistorical!: boolean - @Getter(useFilingHistoryListStore) getFilings!: ApiFilingIF[] + @Getter(useFilingHistoryListStore) getFilings!: Array @Getter(useFilingHistoryListStore) isAuthorizedToContinueOut!: boolean @Getter(useRootStore) getLimitedRestorationActiveUntil!: string @Getter(useRootStore) getReasonText!: string - @Getter(useRootStore) getTasks!: ApiTaskIF[] - @Getter(useRootStore) isAmalgamationTodo!: boolean + @Getter(useRootStore) getPendingsList!: Array + @Getter(useRootStore) getTasks!: Array @Getter(useRootStore) isAmalgamationFiling!: boolean - @Getter(useRootStore) isContinuationInTodo!: boolean + @Getter(useRootStore) isAmalgamationTodo!: boolean @Getter(useRootStore) isContinuationInFiling!: boolean + @Getter(useRootStore) isContinuationInPending!: boolean + @Getter(useRootStore) isContinuationInTodo!: boolean @Getter(useRootStore) isInLimitedRestoration!: boolean /** The business description. */ @@ -129,22 +131,14 @@ export default class EntityHeader extends Vue { } } - /** The incorporation/registration/continuationIn/amalgamation application description. */ - get appDescription (): string { - if (this.isAmalgamationTodo) { - return this.getTasks[0]?.task.filing.displayName - } - if (this.isAmalgamationFiling) { - return this.getFilings[0]?.displayName - } + /** The amalgamation / continuation in / incorporation application / registration description. */ + get bootstrapFilingDescription (): string { + if (this.isAmalgamationTodo) return this.getTasks[0]?.task.filing.displayName + if (this.isAmalgamationFiling) return this.getFilings[0]?.displayName - if (this.isContinuationInTodo) { - return this.getTasks[0]?.task.filing.displayName - } - // *** TODO: what needs to be done here for pending continuation bootstrap filing? - if (this.isContinuationInFiling) { - return this.getFilings[0]?.displayName - } + if (this.isContinuationInTodo) return this.getTasks[0]?.task.filing.displayName + if (this.isContinuationInPending) return this.getPendingsList[0].displayName + if (this.isContinuationInFiling) return this.getFilings[0]?.displayName const filingName = [CorpTypeCd.SOLE_PROP, CorpTypeCd.PARTNERSHIP].includes(this.getLegalType) ? FilingNames.REGISTRATION diff --git a/src/interfaces/root-state-interface.ts b/src/interfaces/root-state-interface.ts index ab1385043..7fea5e45b 100644 --- a/src/interfaces/root-state-interface.ts +++ b/src/interfaces/root-state-interface.ts @@ -49,6 +49,8 @@ export interface RootStateIF { parties: Array recordsAddress: OfficeAddressIF registeredAddress: OfficeAddressIF - tasks: Array // "tasks" data from API + // *** TODO: declare a type for pendings + pendings: Array // pending list from bootstrap filing + tasks: Array // "tasks" list from API (or bootstrap filing) userInfo: any // from auth db } diff --git a/src/stores/rootStore.ts b/src/stores/rootStore.ts index 1cdaa1ccd..f49a09f67 100644 --- a/src/stores/rootStore.ts +++ b/src/stores/rootStore.ts @@ -34,13 +34,19 @@ export const useRootStore = defineStore('root', { parties: [], recordsAddress: null, registeredAddress: null, + pendings: [], tasks: [], userInfo: null }), getters: { - /** The list of tasks from the API. */ - getTasks (state: RootStateIF): ApiTaskIF[] { + /** The list of pending items. */ + getPendingsList (state: RootStateIF): Array { + return state.pendings + }, + + /** The list of tasks (todo items). */ + getTasks (state: RootStateIF): Array { return state.tasks }, @@ -212,7 +218,7 @@ export const useRootStore = defineStore('root', { ) }, - /** Is True if this is a bootstrap todo and should be displayed in the Todo List. */ + /** Is True if this is a bootstrap todo item and should be displayed in the Todo List. */ isBootstrapTodo (): boolean { return ( this.isAmalgamationTodo || @@ -229,7 +235,7 @@ export const useRootStore = defineStore('root', { ) }, - /** Is True if this is a bootstrap filing and should be displayed in the Filing History List. */ + /** Is True if this is a bootstrap filing item and should be displayed in the Filing History List. */ isBootstrapFiling (): boolean { return ( this.isAmalgamationFiling || @@ -489,6 +495,10 @@ export const useRootStore = defineStore('root', { this.businessPhoneExtension = businessPhoneExtension }, + setPendings (pendings: Array) { + this.pendings = pendings + }, + setTasks (tasks: Array) { this.tasks = tasks }, diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index 5ff152e87..e7588d3f3 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -46,19 +46,15 @@

- Pending ({{ pendingCount }}) + Pending ({{ getPendingsList.length }})

- - +
@@ -152,7 +148,7 @@ @@ -195,7 +191,7 @@

@@ -230,7 +226,7 @@
@@ -280,7 +276,6 @@ import { useBusinessStore, useConfigurationStore, useFilingHistoryListStore, use export default class Dashboard extends Mixins(AllowableActionsMixin, CommonMixin, DateMixin) { // local variables todoCount = 0 - pendingCount = 0 coaWarningDialog = false alertCount = 0 @@ -302,7 +297,9 @@ export default class Dashboard extends Mixins(AllowableActionsMixin, CommonMixin @Getter(useFilingHistoryListStore) getPendingCoa!: ApiFilingIF @Getter(useRootStore) getParties!: Array + @Getter(useRootStore) getPendingsList!: Array @Getter(useRootStore) isBootstrapFiling!: boolean + @Getter(useRootStore) isBootstrapPending!: boolean @Getter(useRootStore) isBootstrapTodo!: boolean // @Getter(useRootStore) isRoleStaff!: boolean diff --git a/tests/unit/App.spec.ts b/tests/unit/App.spec.ts index 5b030f999..0b00bccd2 100644 --- a/tests/unit/App.spec.ts +++ b/tests/unit/App.spec.ts @@ -2955,7 +2955,7 @@ describe('App as a completed vertical amalgamation application', () => { }) }) -describe('App as a draft numbered continuation in application', () => { +describe('App as a draft numbered continuation in', () => { let wrapper: Wrapper beforeAll(() => { @@ -3049,7 +3049,7 @@ describe('App as a draft numbered continuation in application', () => { }) }) -describe('App as a completed continuation in application', () => { +describe('App as a completed continuation in', () => { // Intermediate scenario - still using Temp Reg Number let wrapper: Wrapper diff --git a/tests/unit/EntityHeader.spec.ts b/tests/unit/EntityHeader.spec.ts index 7464c862c..2277d462b 100644 --- a/tests/unit/EntityHeader.spec.ts +++ b/tests/unit/EntityHeader.spec.ts @@ -360,7 +360,7 @@ describe('Entity Header - data', () => { expect(wrapper.find('#business-description').text()).toBe('BC Limited Company') }) - it('displays Draft Continuation In application entity info - Named company', async () => { + it('displays Draft Continuation In entity info - Named company', async () => { // set store properties businessStore.setLegalName('Continued In Company') rootStore.setBootstrapFilingStatus(FilingStatus.DRAFT) @@ -387,7 +387,7 @@ describe('Entity Header - data', () => { expect(wrapper.find('#app-description').text()).toBe('BC Limited Company Continuation Application') }) - it('displays Draft Continuation In application entity info - Numbered Company', async () => { + it('displays Draft Continuation In entity info - Numbered Company', async () => { // set store properties businessStore.setLegalName(null) rootStore.setBootstrapFilingStatus(FilingStatus.DRAFT) diff --git a/tests/unit/PendingList.spec.ts b/tests/unit/PendingList.spec.ts new file mode 100644 index 000000000..cf4122949 --- /dev/null +++ b/tests/unit/PendingList.spec.ts @@ -0,0 +1,43 @@ +import Vue from 'vue' +import Vuetify from 'vuetify' +import { mount } from '@vue/test-utils' +import PendingList from '@/components/Dashboard/PendingList.vue' + +Vue.use(Vuetify) +const vuetify = new Vuetify({}) + +// *** TODO: implement this +describe.skip('PendingList component', () => { + it('handles empty data', () => { + const wrapper = mount(PendingList, { vuetify }) + + expect(wrapper.find('#entity-in-good-standing').text()).toBe('No') + expect(wrapper.find('#entity-date-of-incorporation').text()).toBe('') + + wrapper.destroy() + }) + + it('displays business info properly', () => { + const wrapper = mount(PendingList, { + propsData: { + highlightId: null + }, + vuetify + }) + + // verify component displays properly + expect(wrapper.find('.v-card').attributes('id')).toBe('about-the-business') + expect(wrapper.find('header i').attributes('class')).toContain('mdi-domain') + expect(wrapper.find('header h2').text()).toBe('About the Business') + + const rows = wrapper.findAll('.content > .row') + expect(rows.at(0).find('.col-sm-3').text()).toBe('Business in Good Standing') + expect(rows.at(1).find('.col-sm-3').text()).toBe('Date of Incorporation') + + // verify displayed text + expect(wrapper.find('#entity-in-good-standing').text()).toBe('Yes') + expect(wrapper.find('#entity-date-of-incorporation').text()).toBe('December 31, 2023') + + wrapper.destroy() + }) +}) From 8b0125f6ce931e084a2e1627e31e8afd2983f6b5 Mon Sep 17 00:00:00 2001 From: Severin Beauvais Date: Wed, 17 Jul 2024 10:39:31 -0700 Subject: [PATCH 2/4] - renamed setPendings -> setPendingsList --- src/App.vue | 6 +++--- src/stores/rootStore.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/App.vue b/src/App.vue index aad652e4e..de8afc99c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -345,7 +345,7 @@ export default class App extends Mixins( this.$root.$on('reloadData', async () => { // clear lists before fetching new data this.setTasks([]) - this.setPendings([]) + this.setPendingsList([]) this.setFilings([]) await this.fetchData() }) @@ -392,7 +392,7 @@ export default class App extends Mixins( @Action(useRootStore) setKeycloakRoles!: (x: Array) => void @Action(useRootStore) setNameRequest!: (x: any) => void @Action(useRootStore) setParties!: (x: Array) => void - @Action(useRootStore) setPendings!: (x: Array) => void + @Action(useRootStore) setPendingsList!: (x: Array) => void @Action(useRootStore) setRecordsAddress!: (x: OfficeAddressIF) => void @Action(useRootStore) setRegisteredAddress!: (x: OfficeAddressIF) => void @Action(useRootStore) setTasks!: (x: Array) => void @@ -707,7 +707,7 @@ export default class App extends Mixins( filing.displayName = `${description} ${filingName}` // add this as a pending item - this.setPendings([filing]) + this.setPendingsList([filing]) } /** Stores bootstrap item in the Filing History List. */ diff --git a/src/stores/rootStore.ts b/src/stores/rootStore.ts index f49a09f67..be0a70d67 100644 --- a/src/stores/rootStore.ts +++ b/src/stores/rootStore.ts @@ -495,7 +495,7 @@ export const useRootStore = defineStore('root', { this.businessPhoneExtension = businessPhoneExtension }, - setPendings (pendings: Array) { + setPendingsList (pendings: Array) { this.pendings = pendings }, From 344549c9e9811d70853dcb1cb7465fadc59ca08b Mon Sep 17 00:00:00 2001 From: Severin Beauvais Date: Wed, 17 Jul 2024 10:43:24 -0700 Subject: [PATCH 3/4] - added DefaultFiling.vue --- .../PendingList/filings/DefaultFiling.vue | 22 +++++++++++++++++++ .../Dashboard/PendingList/filings/index.ts | 1 + 2 files changed, 23 insertions(+) create mode 100644 src/components/Dashboard/PendingList/filings/DefaultFiling.vue diff --git a/src/components/Dashboard/PendingList/filings/DefaultFiling.vue b/src/components/Dashboard/PendingList/filings/DefaultFiling.vue new file mode 100644 index 000000000..66d977a8a --- /dev/null +++ b/src/components/Dashboard/PendingList/filings/DefaultFiling.vue @@ -0,0 +1,22 @@ + + + diff --git a/src/components/Dashboard/PendingList/filings/index.ts b/src/components/Dashboard/PendingList/filings/index.ts index ce7a41b43..53aff95a1 100644 --- a/src/components/Dashboard/PendingList/filings/index.ts +++ b/src/components/Dashboard/PendingList/filings/index.ts @@ -1 +1,2 @@ export { default as ContinuationIn } from './ContinuationIn.vue' +export { default as DefaultFiling } from './DefaultFiling.vue' From 6b05e4d221561a5b09c2d086c1d1e2e4c44b84ac Mon Sep 17 00:00:00 2001 From: Severin Beauvais Date: Wed, 17 Jul 2024 11:35:30 -0700 Subject: [PATCH 4/4] - renamed pendings -> pendingsList --- src/interfaces/root-state-interface.ts | 4 ++-- src/stores/rootStore.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/interfaces/root-state-interface.ts b/src/interfaces/root-state-interface.ts index 7fea5e45b..96fc2f026 100644 --- a/src/interfaces/root-state-interface.ts +++ b/src/interfaces/root-state-interface.ts @@ -49,8 +49,8 @@ export interface RootStateIF { parties: Array recordsAddress: OfficeAddressIF registeredAddress: OfficeAddressIF - // *** TODO: declare a type for pendings - pendings: Array // pending list from bootstrap filing + // *** TODO: declare a type for pendingsList + pendingsList: Array // pendings list from bootstrap filing tasks: Array // "tasks" list from API (or bootstrap filing) userInfo: any // from auth db } diff --git a/src/stores/rootStore.ts b/src/stores/rootStore.ts index be0a70d67..bb1628047 100644 --- a/src/stores/rootStore.ts +++ b/src/stores/rootStore.ts @@ -34,7 +34,7 @@ export const useRootStore = defineStore('root', { parties: [], recordsAddress: null, registeredAddress: null, - pendings: [], + pendingsList: [], tasks: [], userInfo: null }), @@ -42,7 +42,7 @@ export const useRootStore = defineStore('root', { getters: { /** The list of pending items. */ getPendingsList (state: RootStateIF): Array { - return state.pendings + return state.pendingsList }, /** The list of tasks (todo items). */ @@ -495,8 +495,8 @@ export const useRootStore = defineStore('root', { this.businessPhoneExtension = businessPhoneExtension }, - setPendingsList (pendings: Array) { - this.pendings = pendings + setPendingsList (pendingsList: Array) { + this.pendingsList = pendingsList }, setTasks (tasks: Array) {