Skip to content

Commit

Permalink
22434 Update in dissolution alert (#689)
Browse files Browse the repository at this point in the history
* Update dissolution alert

* Update date format

* Update package version
  • Loading branch information
leodube-aot authored Aug 1, 2024
1 parent c0a4035 commit f9c4cba
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 39 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
24 changes: 11 additions & 13 deletions src/components/Dashboard/Alerts/InDissolution.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
>
mdi-alert
</v-icon>
<span>Urgent - this business is in the process of being dissolved</span>
<span>This business is in the process of being dissolved</span>
</h3>
<v-btn
text
Expand All @@ -31,13 +31,12 @@

<v-expansion-panel-content eager>
<p class="mb-0">
This means that the business will be struck from the Corporate Registry in
<strong>{{ daysLeft }} days</strong> 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 <strong>{{ targetDissolutionDate }}</strong>
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.
</p>
<p class="mb-0 pt-5">
For assistance, please contact BC Registries staff:
If further action is required, please contact BC Registries staff:
</p>
<ContactInfo class="pt-5" />
</v-expansion-panel-content>
Expand All @@ -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({
Expand All @@ -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'
}
Expand Down Expand Up @@ -126,6 +123,7 @@ p {
.v-icon {
font-size: $px-16 !important;
}
span {
font-size: $px-14 !important;
}
Expand Down
38 changes: 19 additions & 19 deletions src/mixins/date-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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
*/
Expand All @@ -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"
Expand All @@ -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"
*/
Expand All @@ -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)
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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
*/
Expand All @@ -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
*/
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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"
*/
Expand All @@ -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"
*/
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/InDissolution.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit f9c4cba

Please sign in to comment.