Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

18274 Updated To Do List and Recent Filing History #584

Merged
merged 5 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.0.11",
"version": "7.0.12",
"private": true,
"appName": "Filings UI",
"sbcName": "SBC Common Components",
Expand Down
1 change: 1 addition & 0 deletions src/components/Dashboard/FilingHistoryList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export default class FilingHistoryList extends Mixins(FilingMixin) {
is (filing: ApiFilingIF): string {
switch (true) {
case filing.availableOnPaperOnly: return 'paper-filing' // must come first
case EnumUtilities.isTypeAgmExtension(filing): return 'agm-extension'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where the specific filing template is assigned. Otherwise (eg, AGM Location Change), it uses the default filing template (line 158).

case EnumUtilities.isTypeAlteration(filing): return 'alteration-filing'
case EnumUtilities.isTypeChangeOfAddress(filing): return 'change-of-address'
case EnumUtilities.isTypeConsentContinuationOut(filing): return 'consent-continuation-out'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<template>
<FilingTemplate
class="agm-extension"
:filing="filing"
:index="index"
>
<template #body>
<div v-if="isFilingComplete">
<p class="mt-4">
The {{ agmYear }} AGM must be held by <strong>{{ agmDueDate }}</strong>.
</p>
</div>
</template>
</FilingTemplate>
</template>

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator'
import { ApiFilingIF } from '@/interfaces'
import FilingTemplate from '../FilingTemplate.vue'
import { DateUtilities, EnumUtilities } from '@/services'

@Component({
components: { FilingTemplate }
})
export default class ConsentContinuationOut extends Vue {
@Prop({ required: true }) readonly filing!: ApiFilingIF
@Prop({ required: true }) readonly index!: number

/** Whether the filing is complete. */
get isFilingComplete (): boolean {
return EnumUtilities.isStatusCompleted(this.filing)
}

get agmYear (): string {
return this.filing.data?.agmExtension?.year || '[unknown]'
}

get agmDueDate (): string {
const yyyyMmDd = this.filing.data?.agmExtension?.expireDateApprovedExt
const date = DateUtilities.yyyyMmDdToDate(yyyyMmDd)
const pacificDate = DateUtilities.dateToPacificDate(date, true)
if (pacificDate) return `${pacificDate} at 11:59 pm Pacific time`
return '[unknown]'
}
}
</script>

<style lang="scss" scoped>
@import "@/assets/styles/theme.scss";

p {
color: $gray7;
font-size: $px-15;
margin-top: 1rem !important;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default class ConsentContinuationOut extends Mixins(CountriesProvincesMix
}

/** Get the respective regions of the country selected as an array of objects. */
get canadaUsaRegions (): Array<object> {
get canadaUsaRegions (): Array<any> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes a lint warning.

Ditto in ContinuationOut.vue below.

const foreignJusrisdictionCountry = this.filing.data?.consentContinuationOut?.country
if (foreignJusrisdictionCountry === 'CA') {
return this.getCountryRegions('CA')
Expand All @@ -145,5 +145,4 @@ p {
.warn-icon {
margin-bottom: 6px;
}

</style>
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class ContinuationOut extends Mixins(CountriesProvincesMixin) {
}

/** Get the respective regions of the country selected as an array of objects. */
get canadaUsaRegions (): Array<object> {
get canadaUsaRegions (): Array<any> {
const foreignJusrisdictionCountry = this.filing.data?.continuationOut?.country
if (foreignJusrisdictionCountry === 'CA') {
return this.getCountryRegions('CA')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { default as AgmExtension } from './AgmExtension.vue'
export { default as AlterationFiling } from './AlterationFiling.vue'
export { default as ChangeOfAddress } from './ChangeOfAddress.vue'
export { default as ConsentContinuationOut } from './ConsentContinuationOut.vue'
Expand Down
41 changes: 38 additions & 3 deletions src/components/Dashboard/TodoList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
<v-btn
class="ma-1 affiliation-invitation-action-button"
color="primary"
@click.native.stop="authorizeAffiliationInvitation(true, item)"

Check warning on line 244 in src/components/Dashboard/TodoList.vue

View workflow job for this annotation

GitHub Actions / linting (20.5.1)

'.native' modifier on 'v-on' directive is deprecated
>
<span>Authorize</span>
</v-btn>
Expand All @@ -249,7 +249,7 @@
class="ma-1 affiliation-invitation-action-button"
outlined
color="primary"
@click.native.stop="authorizeAffiliationInvitation(false, item)"

Check warning on line 252 in src/components/Dashboard/TodoList.vue

View workflow job for this annotation

GitHub Actions / linting (20.5.1)

'.native' modifier on 'v-on' directive is deprecated
>
<span>Do not authorize</span>
</v-btn>
Expand Down Expand Up @@ -315,7 +315,7 @@
class="btn-draft-resume"
color="primary"
:disabled="!item.enabled"
@click.native.stop="doResumeFiling(item)"

Check warning on line 318 in src/components/Dashboard/TodoList.vue

View workflow job for this annotation

GitHub Actions / linting (20.5.1)

'.native' modifier on 'v-on' directive is deprecated
>
<template v-if="isTypeIncorporationApplication(item) && item.isEmptyFiling">
<span v-if="getNameRequest">Incorporate using this NR</span>
Expand Down Expand Up @@ -398,7 +398,7 @@
:class="{ 'cancellable' : isCancellableTodoItem(item) }"
color="primary"
:disabled="!item.enabled"
@click.native.stop="doResumePayment(item)"

Check warning on line 401 in src/components/Dashboard/TodoList.vue

View workflow job for this annotation

GitHub Actions / linting (20.5.1)

'.native' modifier on 'v-on' directive is deprecated
>
<span>Change Payment Type</span>
</v-btn>
Expand All @@ -408,7 +408,7 @@
:class="{ 'cancellable' : isCancellableTodoItem(item) }"
color="primary"
:disabled="!item.enabled"
@click.native.stop="doResumePayment(item)"

Check warning on line 411 in src/components/Dashboard/TodoList.vue

View workflow job for this annotation

GitHub Actions / linting (20.5.1)

'.native' modifier on 'v-on' directive is deprecated
>
<span>Resume Payment</span>
</v-btn>
Expand All @@ -426,7 +426,7 @@
color="primary"
:disabled="!item.enabled"
v-on="on"
@click.native.stop

Check warning on line 429 in src/components/Dashboard/TodoList.vue

View workflow job for this annotation

GitHub Actions / linting (20.5.1)

'.native' modifier on 'v-on' directive is deprecated
>
<v-icon>mdi-menu-down</v-icon>
</v-btn>
Expand All @@ -448,7 +448,7 @@
class="btn-retry-payment"
color="primary"
:disabled="!item.enabled"
@click.native.stop="doResumePayment(item)"

Check warning on line 451 in src/components/Dashboard/TodoList.vue

View workflow job for this annotation

GitHub Actions / linting (20.5.1)

'.native' modifier on 'v-on' directive is deprecated
>
<span>Retry Payment</span>
</v-btn>
Expand Down Expand Up @@ -643,7 +643,7 @@
enableCheckbox: Array<any> = []
confirmEnabled = false
panel: number = null // currently expanded panel
checkTimer: number = null
checkTimer = null // may be type number or NodeJS.Timeout
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is type any by default.

When run locally, checkTimer is type NodeJS.Timeout. When run in the browser, it's type number. They both work the same way but this fixes some lint warnings.

inProcessFiling: number = null
fetchAffiliationInvitationsErrorDialog = false
authorizeAffiliationInvitationErrorDialog = false
Expand All @@ -663,7 +663,6 @@
@Getter(useRootStore) getTasks!: Array<ApiTaskIF>
@Getter(useRootStore) getTodoListResource!: TodoListResourceIF
@Getter(useBusinessStore) isBenBcCccUlc!: boolean
@Getter(useBusinessStore) isSoleProp!: boolean

@Action(useRootStore) setARFilingYear!: (x: number) => void
@Action(useRootStore) setArMinDate!: (x: string) => void
Expand Down Expand Up @@ -828,7 +827,10 @@

/** Check if task item is cancellable (has a draft). */
isCancellableTodoItem (item: TodoItemIF): boolean {
return (item.name !== FilingTypes.AGM_LOCATION_CHANGE)
return (
(item.name !== FilingTypes.AGM_EXTENSION) &&
(item.name !== FilingTypes.AGM_LOCATION_CHANGE)
)
}

/** Loads a todo item into the Todo Items array. */
Expand Down Expand Up @@ -999,6 +1001,9 @@

if (header) {
switch (header.name) {
case FilingTypes.AGM_EXTENSION:
await this.loadAgmExtension(task)
break
case FilingTypes.AGM_LOCATION_CHANGE:
await this.loadAgmLocationChange(task)
break
Expand Down Expand Up @@ -1490,6 +1495,36 @@
}
}

async loadAgmExtension (task: ApiTaskIF): Promise<void> {
const filing = task.task.filing
const header = filing.header
const agmLocationChange = filing.agmLocationChange

if (header && agmLocationChange) {
const paymentStatusCode = header.paymentStatusCode
const payErrorObj = paymentStatusCode && await PayServices.getPayErrorObj(this.getPayApiUrl, paymentStatusCode)

const item = {
name: FilingTypes.AGM_EXTENSION,
filingId: header.filingId,
title: FilingNames.AGM_EXTENSION,
draftTitle: FilingNames.AGM_EXTENSION,
status: header.status,
enabled: task.enabled,
order: task.order,
paymentMethod: header.paymentMethod || null,
paymentToken: header.paymentToken || null,
payErrorObj,
// FUTURE: ideally, this would come from the filing:
warnings: this.getBusinessWarnings.map(warning => warning.message)
} as TodoItemIF
this.todoItems.push(item)
} else {
// eslint-disable-next-line no-console
console.log('ERROR - invalid header or business in filing =', filing)
}
}

async loadAgmLocationChange (task: ApiTaskIF): Promise<void> {
const filing = task.task.filing
const header = filing.header
Expand Down
2 changes: 1 addition & 1 deletion src/components/EntityInfo/EntityMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export default class EntityMenu extends Mixins(AllowableActionsMixin) {

/** The tooltip text for AGM Extension list item. Text is different if action item is disabled. */
get agmExtensionToolTipText (): string {
if (!this.isAllowed(AllowableActions.AGM_LOCATION_CHANGE)) {
if (!this.isAllowed(AllowableActions.AGM_EXTENSION)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug fix.

return 'The business must be in good standing to request an AGM extension.'
} else {
return 'Request an AGM extension. The longest extension granted at one time is six months.'
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/ForeignJurisdiction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default class ForeignJurisdiction extends Mixins(CountriesProvincesMixin)
}

/** Get the respective regions of the country selected as an array of objects. */
get canadaUsaRegions (): Array<object> {
get canadaUsaRegions (): Array<any> {
if (this.selectedCountryName === 'Canada') {
let regions = this.getCountryRegions('CA')
regions = regions.filter(province => province.short !== 'BC')
Expand Down
16 changes: 14 additions & 2 deletions src/interfaces/api-filing-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,21 @@ export interface ApiFilingIF {
freeze: boolean
}

agmExtension?: {
year: string // YYYY-MM-DD
isFirstAgm: boolean
prevAgmRefDate: string // YYYY-MM-DD
extReqForAgmYear: boolean
expireDateCurrExt: string // YYYY-MM-DD
intendedAgmDate: string // YYYY-MM-DD
totalApprovedExt: number // in months
extensionDuration: number // in months
expireDateApprovedExt: string // YYYY-MM-DD
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the expected object in the filings endpoint response.


agmLocationChange?: {
year: string,
reason: string,
year: string
reason: string
agmLocation: string
}

Expand Down
10 changes: 10 additions & 0 deletions src/services/enum-utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ export default class EnumUtilities {
// Filing Type helpers
//

/** Returns True if filing is an AGM Extension. */
static isTypeAgmExtension (item: any): boolean {
return (item.name === FilingTypes.AGM_EXTENSION)
}

/** Returns True if filing is an AGM Location Change. */
static isTypeAgmLocationChange (item: any): boolean {
return (item.name === FilingTypes.AGM_LOCATION_CHANGE)
}

/** Returns True if filing is an Alteration. */
static isTypeAlteration (item: any): boolean {
return (item.name === FilingTypes.ALTERATION)
Expand Down
10 changes: 10 additions & 0 deletions src/views/AgmExtension.vue
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,16 @@ export default class AgmExtension extends Mixins(CommonMixin, DateMixin,

const data: any = {
[FilingTypes.AGM_EXTENSION]: {
// convert local properties into API/schema properties
year: this.data.agmYear,
isFirstAgm: this.data.isFirstAgm,
prevAgmRefDate: this.data.prevAgmDate,
extReqForAgmYear: this.data.isPrevExtension,
expireDateCurrExt: this.data.prevExpiryDate,
intendedAgmDate: this.data.intendedAgmDate,
totalApprovedExt: this.data.extensionDuration,
expireDateApprovedExt: this.data.agmDueDate,
// add in remaining local properties for future auditing
...this.data
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where we assign the data in the filing JSON (sent to API when filing is filed).

}
}
Expand Down
Loading