diff --git a/package-lock.json b/package-lock.json index 6b0223d02..9f2f74ea5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "business-filings-ui", - "version": "7.0.33", + "version": "7.0.34", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "business-filings-ui", - "version": "7.0.33", + "version": "7.0.34", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/base-address": "2.0.9", diff --git a/package.json b/package.json index d96051e97..e5d61a7c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "business-filings-ui", - "version": "7.0.33", + "version": "7.0.34", "private": true, "appName": "Filings UI", "sbcName": "SBC Common Components", diff --git a/src/components/Dashboard/Alerts/Amalgamation.vue b/src/components/Dashboard/Alerts/Amalgamation.vue new file mode 100644 index 000000000..120bbeb92 --- /dev/null +++ b/src/components/Dashboard/Alerts/Amalgamation.vue @@ -0,0 +1,127 @@ + + + + + diff --git a/src/components/Dashboard/FilingHistoryList/LimitedRestorationExtensionFiling.vue b/src/components/Dashboard/FilingHistoryList/LimitedRestorationExtensionFiling.vue index 72ce11f51..b8ff3918c 100644 --- a/src/components/Dashboard/FilingHistoryList/LimitedRestorationExtensionFiling.vue +++ b/src/components/Dashboard/FilingHistoryList/LimitedRestorationExtensionFiling.vue @@ -7,10 +7,10 @@

The period of restoration was successfuly extended and is active - until {{ expiryDateFriendly }}. At the end of the extended limited - restoration period, the company will be automatically dissolved. If you require assistance - to extend a limited restoration/reinstatement or wish to convert your restoration from a - limited period to a full restoration, please contact BC Registries staff: + until {{ expiryDateFriendly || '[unknown]' }}. At the end of the extended + limited restoration period, the company will be automatically dissolved. If you require + assistance to extend a limited restoration/reinstatement or wish to convert your restoration + from a limited period to a full restoration, please contact BC Registries staff:

@@ -33,7 +33,7 @@ export default class LimitedRestorationExtensionFiling extends Vue { /** The expiry date of the limited restoration extension filing. */ get expiryDateFriendly (): string { const date = DateUtilities.yyyyMmDdToDate(this.filing.expiry) - return (DateUtilities.dateToPacificDate(date, true) || 'Unknown') + return DateUtilities.dateToPacificDate(date, true) } } diff --git a/src/components/common/Certify.vue b/src/components/common/Certify.vue index 5f97512fc..fb0c105bc 100644 --- a/src/components/common/Certify.vue +++ b/src/components/common/Certify.vue @@ -38,7 +38,7 @@

- Date: {{ formattedCurrentDate }} + Date: {{ formattedCurrentDate || '[unknown]' }}

{{ message }} @@ -94,7 +94,7 @@ export default class Certify extends Vue { get formattedCurrentDate (): string { const date = DateUtilities.yyyyMmDdToDate(this.getCurrentDate) - return (DateUtilities.dateToPacificDate(date, true) || 'Unknown') + return DateUtilities.dateToPacificDate(date, true) } /** The trimmed "Certified By" string (may be ''). */ diff --git a/src/components/common/DateTooltip.vue b/src/components/common/DateTooltip.vue index c91a124db..622c3cec1 100644 --- a/src/components/common/DateTooltip.vue +++ b/src/components/common/DateTooltip.vue @@ -9,10 +9,10 @@ class="date-tooltip d-inline cursor-default" v-on="on" > - {{ dateString }} + {{ dateString || '[unknown]' }} - {{ dateTimeString }} + {{ dateTimeString || '[unknown]' }} @@ -25,11 +25,11 @@ export default class DateTooltip extends Vue { @Prop({ default: null }) readonly date!: Date get dateString (): string { - return (DateUtilities.dateToPacificDate(this.date) || '[unknown]') + return DateUtilities.dateToPacificDate(this.date) } get dateTimeString (): string { - return (DateUtilities.dateToPacificDateTime(this.date) || '[unknown]') + return DateUtilities.dateToPacificDateTime(this.date) } } diff --git a/src/interfaces/business-state-interfaces.ts b/src/interfaces/business-state-interfaces.ts index 8c218d6c4..e589e3684 100644 --- a/src/interfaces/business-state-interfaces.ts +++ b/src/interfaces/business-state-interfaces.ts @@ -29,6 +29,7 @@ export interface BusinessWarningIF { filing?: string // not used message: string warningType: string // FUTURE: use an enum + data?: any // optional extra properties (eg, amalgamationDate) } /** The Business object from the Legal API. */ diff --git a/src/stores/businessStore.ts b/src/stores/businessStore.ts index dd6436350..166f4a611 100644 --- a/src/stores/businessStore.ts +++ b/src/stores/businessStore.ts @@ -137,6 +137,11 @@ export const useBusinessStore = defineStore('business', { ) }, + /** Is True if the business is part of a future effective amalgamation filing. */ + isFutureEffectiveAmalgamation (): boolean { + return this.getBusinessWarnings.some(item => item.warningType === 'FUTURE_EFFECTIVE_AMALGAMATION') + }, + /** Is True if business is active. */ isActive (): boolean { return (this.getBusinessState === EntityState.ACTIVE) diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index 07c1802d2..9415ed2a4 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -29,6 +29,7 @@ + @@ -237,15 +238,16 @@ import AddressListSm from '@/components/Dashboard/AddressListSm.vue' import CustodianListSm from '@/components/Dashboard/CustodianListSm.vue' import DirectorListSm from '@/components/Dashboard/DirectorListSm.vue' import FilingHistoryList from '@/components/Dashboard/FilingHistoryList.vue' +import Amalgamation from '@/components/Dashboard/Alerts/Amalgamation.vue' import FrozenInformation from '@/components/Dashboard/Alerts/FrozenInformation.vue' +import MissingInformation from '@/components/Dashboard/Alerts/MissingInformation.vue' +import NotInCompliance from '@/components/Dashboard/Alerts/NotInCompliance.vue' +import NotInGoodStanding from '@/components/Dashboard/Alerts/NotInGoodStanding.vue' import LegalObligation from '@/components/Dashboard/LegalObligation.vue' import ProprietorPartnersListSm from '@/components/Dashboard/ProprietorPartnersListSm.vue' import StaffNotation from '@/components/Dashboard/StaffNotation.vue' import TodoList from '@/components/Dashboard/TodoList.vue' import { CoaWarningDialog } from '@/components/dialogs' -import MissingInformation from '@/components/Dashboard/Alerts/MissingInformation.vue' -import NotInCompliance from '@/components/Dashboard/Alerts/NotInCompliance.vue' -import NotInGoodStanding from '@/components/Dashboard/Alerts/NotInGoodStanding.vue' import { Routes, AllowableActions, Roles } from '@/enums' import { PartyIF } from '@/interfaces' import { AllowableActionsMixin, CommonMixin, DateMixin, EnumMixin } from '@/mixins' @@ -256,6 +258,7 @@ export default { components: { AddressListSm, + Amalgamation, CoaWarningDialog, CustodianListSm, DirectorListSm, @@ -293,6 +296,7 @@ export default { 'getIdentifier', 'hasComplianceWarning', 'hasMissingInfoWarning', + 'isFutureEffectiveAmalgamation', 'isAdminFrozen', 'isBenBcCccUlc', 'isFirm', @@ -348,9 +352,9 @@ export default { return +this.$route.query.filing_id }, - /** Whether to show Missing Information alert. */ - isMissingInformationAlert (): boolean { - return this.hasMissingInfoWarning + /** Whether to show Amalgamation alert. */ + isAmalgamationAlert (): boolean { + return this.isFutureEffectiveAmalgamation }, /** Whether to show Missing Information alert. */ @@ -358,6 +362,11 @@ export default { return this.isAdminFrozen }, + /** Whether to show Missing Information alert. */ + isMissingInformationAlert (): boolean { + return this.hasMissingInfoWarning + }, + /** Whether to show Not In Compliance alert. */ isNotInComplianceAlert (): boolean { return this.hasComplianceWarning @@ -371,6 +380,7 @@ export default { /** The number of alerts. */ alertCount (): number { let count = 0 + if (this.isAmalgamationAlert) count++ if (this.isFrozenInformationAlert) count++ if (this.isMissingInformationAlert) count++ if (this.isNotInComplianceAlert) count++ @@ -385,7 +395,7 @@ export default { methods: { goToStandaloneDirectors () { - this.$router.push({ name: Routes.STANDALONE_DIRECTORS, params: { filingId: 0 } }) // 0 means "new COD filing" + this.$router.push({ name: Routes.STANDALONE_DIRECTORS, params: { filingId: '0' } }) // 0 means "new COD filing" }, goToChangeFiling () { @@ -394,7 +404,7 @@ export default { }, goToStandaloneAddresses () { - this.$router.push({ name: Routes.STANDALONE_ADDRESSES, params: { filingId: 0 } }) // 0 means "new COA filing" + this.$router.push({ name: Routes.STANDALONE_ADDRESSES, params: { filingId: '0' } }) // 0 means "new COA filing" }, reloadDataIfNeeded (needed: boolean) { diff --git a/tests/unit/Amalgamation.spec.ts b/tests/unit/Amalgamation.spec.ts new file mode 100644 index 000000000..dcfa41080 --- /dev/null +++ b/tests/unit/Amalgamation.spec.ts @@ -0,0 +1,60 @@ +import Vue from 'vue' +import Vuetify from 'vuetify' +import { mount } from '@vue/test-utils' +import { createPinia, setActivePinia } from 'pinia' +import { useBusinessStore } from '@/stores' +import Amalgamation from '@/components/Dashboard/Alerts/Amalgamation.vue' +import { ContactInfo } from '@/components/common' +import flushPromises from 'flush-promises' + +Vue.use(Vuetify) +const vuetify = new Vuetify({}) + +setActivePinia(createPinia()) +const businessStore = useBusinessStore() + +describe('Amalgamation component', () => { + beforeAll(() => { + businessStore.$state.businessInfo.warnings = [ + { + code: 'AMALGAMATING_BUSINESS', + message: 'This business is part of a future effective amalgamation.', + warningType: 'FUTURE_EFFECTIVE_AMALGAMATION', + data: { + amalgamationDate: '2024-01-31T08:00:00+00:00' + } + } + ] + }) + + it('Displays expansion panel closed', () => { + const wrapper = mount(Amalgamation, { vuetify }) + + // verify content + expect(wrapper.find('h3').text()).toContain('This corporation is part of an amalgamation') + expect(wrapper.find('h3').text()).toContain('January 31, 2024') + expect(wrapper.find('.details-btn').text()).toBe('View Details') + expect(wrapper.find('.v-expansion-panel-content').exists()).toBe(false) + + wrapper.destroy() + }) + + it('Displays expansion panel open', async () => { + const wrapper = mount(Amalgamation, { vuetify }) + + // click the button + await wrapper.find('.details-btn').trigger('click') + await flushPromises() // wait for expansion transition + + // verify content + expect(wrapper.find('h3').text()).toContain('This corporation is part of an amalgamation') + expect(wrapper.find('h3').text()).toContain('January 31, 2024') + expect(wrapper.find('.v-expansion-panel-content').exists()).toBe(true) + expect(wrapper.find('.v-expansion-panel-content__wrap').text()).toContain('If you have any questions') + expect(wrapper.findComponent(ContactInfo).exists()).toBe(true) + + wrapper.destroy() + }) + + // FUTURE: add a text to verify hidePhoneNumbers() +}) diff --git a/tests/unit/Dashboard.spec.ts b/tests/unit/Dashboard.spec.ts index 329d3569f..59284147f 100644 --- a/tests/unit/Dashboard.spec.ts +++ b/tests/unit/Dashboard.spec.ts @@ -218,7 +218,7 @@ describe('Dashboard - Click Tests', () => { // verify routing to Standalone Office Address Filing page with id=0 expect(vm.$route.name).toBe('standalone-addresses') - expect(vm.$route.params.filingId).toBe(0) + expect(vm.$route.params.filingId).toBe('0') wrapper.destroy() }) @@ -251,7 +251,7 @@ describe('Dashboard - Click Tests', () => { wrapper.findComponent(CoaWarningDialog).vm.$emit('proceed', true) expect(vm.$route.name).toBe('standalone-addresses') - expect(vm.$route.params.filingId).toBe(0) + expect(vm.$route.params.filingId).toBe('0') wrapper.destroy() }) @@ -276,7 +276,7 @@ describe('Dashboard - Click Tests', () => { // verify routing to Standalone Directors Filing page with id=0 expect(vm.$route.name).toBe('standalone-directors') - expect(vm.$route.params.filingId).toBe(0) + expect(vm.$route.params.filingId).toBe('0') wrapper.destroy() }) diff --git a/tests/unit/DateTooltip.spec.ts b/tests/unit/DateTooltip.spec.ts index ac2cd3f95..0f1fcec8c 100644 --- a/tests/unit/DateTooltip.spec.ts +++ b/tests/unit/DateTooltip.spec.ts @@ -15,7 +15,7 @@ describe('Date Tooltip', () => { // verify content expect(wrapper.find('span').text()).toBe('[unknown]') - expect(vm.dateTimeString).toBe('[unknown]') + expect(vm.dateTimeString).toBeNull() wrapper.destroy() }) diff --git a/tests/unit/MissingInformation.spec.ts b/tests/unit/MissingInformation.spec.ts index e04d86cb2..8edb79b64 100644 --- a/tests/unit/MissingInformation.spec.ts +++ b/tests/unit/MissingInformation.spec.ts @@ -7,8 +7,8 @@ import { ContactInfo } from '@/components/common' import flushPromises from 'flush-promises' Vue.use(Vuetify) - const vuetify = new Vuetify({}) + setActivePinia(createPinia()) describe('Missing Information component', () => {