From f9c4cbac414abdfeb41b401f06d6af85a36b9b10 Mon Sep 17 00:00:00 2001 From: leodube-aot <122323255+leodube-aot@users.noreply.github.com> Date: Thu, 1 Aug 2024 13:43:32 -0500 Subject: [PATCH] 22434 Update in dissolution alert (#689) * Update dissolution alert * Update date format * Update package version --- package-lock.json | 4 +- package.json | 2 +- .../Dashboard/Alerts/InDissolution.vue | 24 ++++++------ src/mixins/date-mixin.ts | 38 +++++++++---------- tests/unit/InDissolution.spec.ts | 8 ++-- 5 files changed, 37 insertions(+), 39 deletions(-) diff --git a/package-lock.json b/package-lock.json index 232908342..26eae29b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "business-filings-ui", - "version": "7.3.19", + "version": "7.3.20", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "business-filings-ui", - "version": "7.3.19", + "version": "7.3.20", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/base-address": "2.0.9", diff --git a/package.json b/package.json index 83f5092f7..5a5fd6f48 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "business-filings-ui", - "version": "7.3.19", + "version": "7.3.20", "private": true, "appName": "Filings UI", "sbcName": "SBC Common Components", diff --git a/src/components/Dashboard/Alerts/InDissolution.vue b/src/components/Dashboard/Alerts/InDissolution.vue index 62fcd161b..d80ca6183 100644 --- a/src/components/Dashboard/Alerts/InDissolution.vue +++ b/src/components/Dashboard/Alerts/InDissolution.vue @@ -11,7 +11,7 @@ > mdi-alert - Urgent - this business is in the process of being dissolved + This business is in the process of being dissolved

- This means that the business will be struck from the Corporate Registry in - {{ daysLeft }} days due to overdue annual reports. - Please file the annual reports immediately to bring this business back into good standing - or request a delay of dissolution if more time is needed. + This business will be struck from the Business Registry as soon as {{ targetDissolutionDate }} + due to overdue annual reports. Please file the annual reports immediately to bring this business back into good + standing or request a delay of dissolution if more time is needed.

- For assistance, please contact BC Registries staff: + If further action is required, please contact BC Registries staff:

@@ -48,9 +47,9 @@ import { Component, Emit, Prop, Vue } from 'vue-property-decorator' import { BusinessWarningIF } from '@/interfaces' import { ContactInfo } from '@/components/common' +import { DateUtilities } from '@/services' import { Getter } from 'pinia-class' import { useBusinessStore, useRootStore } from '@/stores' -import { DateUtilities } from '@/services' import { WarningTypes } from '@/enums' @Component({ @@ -62,16 +61,14 @@ export default class InDissolution extends Vue { @Getter(useBusinessStore) getBusinessWarnings!: BusinessWarningIF[] @Getter(useRootStore) getCurrentDate!: string - /** Return the number of days left for the business until it is dissolved. */ - get daysLeft (): string { + /** Return the target dissolution date for the business in dissolution. */ + get targetDissolutionDate (): string { const warning = this.getBusinessWarnings.find(item => item.warningType?.includes(WarningTypes.INVOLUNTARY_DISSOLUTION) ) - const targetDissolutionDate = warning?.data?.targetDissolutionDate - const daysDifference = DateUtilities.daysBetweenTwoDates( - new Date(this.getCurrentDate), new Date(targetDissolutionDate)) + const targetDissolutionDate = DateUtilities.yyyyMmDdToDate(warning?.data?.targetDissolutionDate) - if (daysDifference >= 0) return String(daysDifference) + if (targetDissolutionDate) return DateUtilities.dateToPacificDate(targetDissolutionDate, true) return 'Unknown' } @@ -126,6 +123,7 @@ p { .v-icon { font-size: $px-16 !important; } + span { font-size: $px-14 !important; } diff --git a/src/mixins/date-mixin.ts b/src/mixins/date-mixin.ts index 33f077e7c..67c8594b1 100644 --- a/src/mixins/date-mixin.ts +++ b/src/mixins/date-mixin.ts @@ -10,7 +10,7 @@ export default class DateMixin extends Vue { @Getter(useRootStore) getCurrentJsDate!: Date /** - * DEPRECATED - call resources/date-utilities instead + * DEPRECATED - call services/date-utilities instead * Fetches and returns the web server's current date (in UTC). * Used to bypass the user's local clock/timezone. * Ref: https://www.npmjs.com/package/serverdate @@ -21,7 +21,7 @@ export default class DateMixin extends Vue { } /** - * DEPRECATED - call resources/date-utilities instead + * DEPRECATED - call services/date-utilities instead * Creates and returns a new Date object in UTC, given parameters in Pacific timezone. * (This works regardless of user's local clock/timezone.) * @example "2021, 0, 1, 0, 0" -> "2021-01-01T08:00:00.000Z" @@ -32,7 +32,7 @@ export default class DateMixin extends Vue { } /** - * DEPRECATED - call resources/date-utilities instead + * DEPRECATED - call services/date-utilities instead * Converts a date string (YYYY-MM-DD) to a Date object at 12:00:00 am Pacific time. * @example 2021-11-22 -> 2021-11-22T08:00:00.00Z */ @@ -41,7 +41,7 @@ export default class DateMixin extends Vue { } /** - * DEPRECATED - call resources/date-utilities instead + * DEPRECATED - call services/date-utilities instead * Converts a Date object to a date string (YYYY-MM-DD) in Pacific timezone. * @example "2021-01-01 07:00:00 GMT" -> "2020-12-31" * @example "2021-01-01 08:00:00 GMT" -> "2021-01-01" @@ -51,7 +51,7 @@ export default class DateMixin extends Vue { } /** - * DEPRECATED - call resources/date-utilities instead + * DEPRECATED - call services/date-utilities instead * Converts a date string (YYYY-MM-DD) to a formatted date string (Month Day, Year). * @example "2020-01-01" -> "Jan 1, 2020" */ @@ -60,7 +60,7 @@ export default class DateMixin extends Vue { } /** - * DEPRECATED - call resources/date-utilities instead + * DEPRECATED - call services/date-utilities instead * Converts a Date object to a date string (Month Day, Year) in Pacific timezone. * @param date * @param longMonth whether to show long month name (eg, December vs Dec) @@ -73,7 +73,7 @@ export default class DateMixin extends Vue { } /** - * DEPRECATED - call resources/date-utilities instead + * DEPRECATED - call services/date-utilities instead * Converts a Date object to a time string (HH:MM am/pm) in Pacific timezone. * @example "2021-01-01 07:00:00 GMT" -> "11:00 pm" * @example "2021-01-01 08:00:00 GMT" -> "12:00 am" @@ -83,7 +83,7 @@ export default class DateMixin extends Vue { } /** - * DEPRECATED - call resources/date-utilities instead + * DEPRECATED - call services/date-utilities instead * Converts a Date object to a date and time string (Month Day, Year at HH:MM am/pm * Pacific time). * @example "2021-01-01 07:00:00 GMT" -> "December 31, 2020 at 11:00 pm Pacific time" @@ -104,7 +104,7 @@ export default class DateMixin extends Vue { } /** - * DEPRECATED - call resources/date-utilities instead + * DEPRECATED - call services/date-utilities instead * Converts a Date object to an API datetime string. * @example 2021-08-05T16:56:50Z -> 2021-08-05T16:56:50+00:00 */ @@ -113,7 +113,7 @@ export default class DateMixin extends Vue { } /** - * DEPRECATED - call resources/date-utilities instead + * DEPRECATED - call services/date-utilities instead * Converts an API datetime string (in UTC) to a Date object. * @example 2021-08-05T16:56:50.783101+00:00 -> 2021-08-05T16:56:50Z */ @@ -122,7 +122,7 @@ export default class DateMixin extends Vue { } /** - * DEPRECATED - call resources/date-utilities instead + * DEPRECATED - call services/date-utilities instead * Converts an API datetime string (in UTC) to a date string (Month Day, Year). * @example "2021-01-01T00:00:00.000000+00:00" -> "Dec 31, 2020" (PST example) * @example "2021-07-01T00:00:00.000000+00:00" -> "Jun 30, 2021" (PDT example) @@ -132,7 +132,7 @@ export default class DateMixin extends Vue { } /** - * DEPRECATED - call resources/date-utilities instead + * DEPRECATED - call services/date-utilities instead * Converts an API datetime string (in UTC) to a date and time string (Month Day, Year at HH:MM am/pm * Pacific time). * @example "2021-01-01T00:00:00.000000+00:00" -> "Dec 31, 2020 at 04:00 pm Pacific time" (PST example) @@ -143,7 +143,7 @@ export default class DateMixin extends Vue { } /** - * DEPRECATED - call resources/date-utilities instead + * DEPRECATED - call services/date-utilities instead * Converts an API datetime string (in UTC) to a UTC string. * @example "2021-10-01T19:26:24.530803+00:00" -> "Fri, 01 Oct 2021 19:26:24 GMT" */ @@ -152,7 +152,7 @@ export default class DateMixin extends Vue { } /** - * DEPRECATED - call resources/date-utilities instead + * DEPRECATED - call services/date-utilities instead * Converts an API datetime string (in UTC) to a date string (YYYY-MM-DD) in Pacific timezone. * @example "2021-11-17T08:00:00+00:00" -> "2021-11-17" */ @@ -161,7 +161,7 @@ export default class DateMixin extends Vue { } /** - * DEPRECATED - call resources/date-utilities instead + * DEPRECATED - call services/date-utilities instead * Converts a date string (YYYY-MM-DD) to an API datetime string (in UTC). * @example "2021-01-01" -> 2021-01-01T08:00:00+00:00" // PST * @example "2021-07-01" -> 2021-07-01T07:00:00+00:00" // PDT @@ -171,7 +171,7 @@ export default class DateMixin extends Vue { } /** - * DEPRECATED - call resources/date-utilities instead + * DEPRECATED - call services/date-utilities instead * Compares two date strings (YYYY-MM-DD). * @param date1 the first date to compare * @param date2 the second date to compare @@ -183,7 +183,7 @@ export default class DateMixin extends Vue { } /** - * DEPRECATED - call resources/date-utilities instead + * DEPRECATED - call services/date-utilities instead * Returns the earliest of two date strings (YYYY-MM-DD). * @param date1 first date * @param date2 second date @@ -193,7 +193,7 @@ export default class DateMixin extends Vue { } /** - * DEPRECATED - call resources/date-utilities instead + * DEPRECATED - call services/date-utilities instead * Returns the latest of two date strings (YYYY-MM-DD). * @param date1 first date * @param date2 second date @@ -203,7 +203,7 @@ export default class DateMixin extends Vue { } /** - * DEPRECATED - call resources/date-utilities instead + * DEPRECATED - call services/date-utilities instead * Returns the number of days that 'date' is from today in Pacific timezone. * @returns -1 for yesterday * @returns 0 for today diff --git a/tests/unit/InDissolution.spec.ts b/tests/unit/InDissolution.spec.ts index e1b4facc7..6464c6c67 100644 --- a/tests/unit/InDissolution.spec.ts +++ b/tests/unit/InDissolution.spec.ts @@ -38,7 +38,7 @@ describe('Missing Information alert', () => { // verify content expect(wrapper.findAll('.v-expansion-panel').length).toBe(1) expect(wrapper.find('.v-expansion-panel').attributes('id')).toBe('in-dissolution-panel') - expect(wrapper.find('h3').text()).toBe('Urgent - this business is in the process of being dissolved') + expect(wrapper.find('h3').text()).toBe('This business is in the process of being dissolved') expect(wrapper.find('button.details-btn').text()).toBe('View Details') wrapper.destroy() @@ -53,12 +53,12 @@ describe('Missing Information alert', () => { // verify content expect(wrapper.findAll('.v-expansion-panel').length).toBe(1) expect(wrapper.find('.v-expansion-panel').attributes('id')).toBe('in-dissolution-panel') - expect(wrapper.find('h3').text()).toBe('Urgent - this business is in the process of being dissolved') + expect(wrapper.find('h3').text()).toBe('This business is in the process of being dissolved') expect(wrapper.find('button.details-btn').text()).toBe('Hide Details') expect(wrapper.findAll('.v-expansion-panel-content p').at(0).text()).toContain( - 'This means that the business will be struck') + 'This business will be struck') expect(wrapper.findAll('.v-expansion-panel-content p').at(1).text()).toContain( - 'For assistance, please contact BC Registries staff:') + 'If further action is required, please contact BC Registries staff:') expect(wrapper.findComponent(ContactInfo).exists()).toBe(true) wrapper.destroy()