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

AGM Location Change 4th and final PR #556

Merged
merged 9 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all 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": "6.9.3",
"version": "6.9.4",
"private": true,
"appName": "Filings UI",
"sbcName": "SBC Common Components",
Expand Down
12 changes: 10 additions & 2 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 @@ -395,24 +395,27 @@
<v-btn
v-if="EnumUtilities.isPayMethodOnlineBanking(item)"
class="btn-change-payment-type"
: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>
<v-btn
v-else
class="btn-resume-payment"
: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>

<!-- dropdown menu -->
<v-menu
v-if="isCancellableTodoItem(item)"
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
offset-y
left
>
Expand All @@ -423,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 @@ -445,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 @@ -823,6 +826,11 @@
})
}

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

/** Loads a todo item into the Todo Items array. */
loadTodoItem (task: ApiTaskIF): void {
const todo = task.task.todo // already checked for not falsey in loadData()
Expand Down Expand Up @@ -2099,8 +2107,8 @@
border-bottom-right-radius: 0;
}

.btn-change-payment-type,
.btn-resume-payment {
.btn-change-payment-type.cancellable,
.btn-resume-payment.cancellable {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
Expand Down
5 changes: 3 additions & 2 deletions src/interfaces/api-filing-interface.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CorpTypeCd, EffectOfOrderTypes, FilingStatus, FilingSubTypes, FilingTypes } from '@/enums'
import { AddressIF, ApiDateTimeUtc, CommentIF, DocumentIF, FormattedDateTimeGmt, IsoDatePacific, SpecialResolutionIF }
import { ApiDateTimeUtc, CommentIF, DocumentIF, FormattedDateTimeGmt, IsoDatePacific, SpecialResolutionIF }
from '@/interfaces'

/**
Expand Down Expand Up @@ -43,7 +43,8 @@ export interface ApiFilingIF {

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

// alteration filings only
Expand Down
73 changes: 10 additions & 63 deletions src/views/AgmLocationChg.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@
@exit="onPaymentErrorDialogExit()"
/>

<StaffPaymentDialog
:staffPaymentData.sync="staffPaymentData"
attach="#agm-location-chg"
:dialog="staffPaymentDialog"
:loading="filingPaying"
@exit="staffPaymentDialog=false"
@submit="onClickFilePay(true)"
/>
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved

<!-- Initial Page Load Transition -->
<v-fade-transition>
<div
Expand Down Expand Up @@ -199,6 +190,7 @@
v-model="agmLocation"
:rules="agmLocationRules"
:validateForm="showErrors"
@update:agmLocation="agmLocation=$event"
@valid="agmLocationValid=$event"
/>
</v-col>
Expand Down Expand Up @@ -307,14 +299,12 @@ import { StatusCodes } from 'http-status-codes'
import { navigate } from '@/utils'
import SbcFeeSummary from 'sbc-common-components/src/components/SbcFeeSummary.vue'
import { Certify, DetailComment } from '@/components/common'
import { ConfirmDialog, PaymentErrorDialog, StaffPaymentDialog }
from '@/components/dialogs'
import { ConfirmDialog, PaymentErrorDialog } from '@/components/dialogs'
import { CommonMixin, DateMixin, EnumMixin, FilingMixin, ResourceLookupMixin } from '@/mixins'
import { ExpandableHelp } from '@bcrs-shared-components/expandable-help'
import { LegalServices } from '@/services/'
import { FilingCodes, FilingTypes, Routes, SaveErrorReasons, StaffPaymentOptions }
from '@/enums'
import { ConfirmDialogType, StaffPaymentIF } from '@/interfaces'
import { FilingCodes, FilingTypes, Routes, SaveErrorReasons } from '@/enums'
import { ConfirmDialogType } from '@/interfaces'
import { useBusinessStore, useConfigurationStore, useRootStore } from '@/stores'
import AgmLocation from '@/components/AgmLocationChange/AgmLocation.vue'
import AgmYear from '@/components/AgmLocationChange/AgmYear.vue'
Expand All @@ -328,8 +318,7 @@ import AgmYear from '@/components/AgmLocationChange/AgmYear.vue'
DetailComment,
ExpandableHelp,
PaymentErrorDialog,
SbcFeeSummary,
StaffPaymentDialog
SbcFeeSummary
}
})
export default class AgmLocationChg extends Mixins(CommonMixin, DateMixin,
Expand Down Expand Up @@ -363,10 +352,6 @@ export default class AgmLocationChg extends Mixins(CommonMixin, DateMixin,
reason = ''
reasonValid = false

// variables for staff payment
staffPaymentData = { option: StaffPaymentOptions.NONE } as StaffPaymentIF
staffPaymentDialog = false

// variables for displaying dialogs
resumeErrorDialog = false
saveErrorReason: SaveErrorReasons = null
Expand Down Expand Up @@ -418,7 +403,7 @@ export default class AgmLocationChg extends Mixins(CommonMixin, DateMixin,
get agmLocationRules (): Array<(val) => boolean | string> {
const rules = [] as Array<(val) => boolean | string>
rules.push(val => !!val || 'AGM location is required.')
rules.push(val => (val.length <= 100) || 'Must be 100 characters or less.')
rules.push(val => (val.length <= 400) || 'Must be 400 characters or less.')
return rules
}

Expand Down Expand Up @@ -481,17 +466,15 @@ export default class AgmLocationChg extends Mixins(CommonMixin, DateMixin,
this.dataLoaded = true

// always include agm location change code
// use existing Priority and Waive Fees flags
this.updateFilingData('add', FilingCodes.AGM_LOCATION_CHANGE, this.staffPaymentData.isPriority,
(this.staffPaymentData.option === StaffPaymentOptions.NO_FEE))
// clear Priority flag and set the Waive Fees flag to true
this.updateFilingData('add', FilingCodes.AGM_LOCATION_CHANGE, undefined, true)
}

/**
* Called when user clicks File and Pay button
* or when user retries from Save Error dialog
* or when user submits from Staff Payment dialog.
*/
async onClickFilePay (fromStaffPayment = false): Promise<void> {
async onClickFilePay (): Promise<void> {
// if there is an invalid component, scroll to it
if (!this.isPageValid) {
this.showErrors = true
Expand All @@ -506,13 +489,6 @@ export default class AgmLocationChg extends Mixins(CommonMixin, DateMixin,
// prevent double saving
if (this.busySaving) return

// if this is a staff user clicking File and Pay (not Submit)
// then detour via Staff Payment dialog
if (this.isRoleStaff && !fromStaffPayment) {
this.staffPaymentDialog = true
return
}

this.filingPaying = true

// save final filing (not draft)
Expand Down Expand Up @@ -599,26 +575,7 @@ export default class AgmLocationChg extends Mixins(CommonMixin, DateMixin,
}
}

switch (this.staffPaymentData.option) {
case StaffPaymentOptions.FAS:
header.header['routingSlipNumber'] = this.staffPaymentData.routingSlipNumber
header.header['priority'] = this.staffPaymentData.isPriority
break

case StaffPaymentOptions.BCOL:
header.header['bcolAccountNumber'] = this.staffPaymentData.bcolAccountNumber
header.header['datNumber'] = this.staffPaymentData.datNumber
header.header['folioNumber'] = this.staffPaymentData.folioNumber
header.header['priority'] = this.staffPaymentData.isPriority
break

case StaffPaymentOptions.NO_FEE:
header.header['waiveFees'] = true
break

case StaffPaymentOptions.NONE: // should never happen
break
}
header.header['waiveFees'] = true

const business: any = {
business: {
Expand Down Expand Up @@ -734,16 +691,6 @@ export default class AgmLocationChg extends Mixins(CommonMixin, DateMixin,
onHaveChanges (): void {
this.haveChanges = true
}

@Watch('staffPaymentData')
onStaffPaymentDataChanged (val: StaffPaymentIF): void {
const waiveFees = (val.option === StaffPaymentOptions.NO_FEE)

// add Waive Fees flag to all filing codes
this.updateFilingData('add', FilingCodes.AGM_LOCATION_CHANGE, val.isPriority, waiveFees)

this.haveChanges = true
}
}
</script>

Expand Down
8 changes: 4 additions & 4 deletions tests/unit/AgmLocation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('AgmLocation', () => {
/** Array of validations rules for AGM location to be passed as a prop. */
const rules = [] as Array<(val) => boolean | string>
rules.push(val => !!val || 'AGM location is required.')
rules.push(val => (val.length <= 100) || 'Must be 100 characters or less.')
rules.push(val => (val.length <= 400) || 'Must be 400 characters or less.')

it('initializes correctly', () => {
const wrapper = mount(AgmLocation,
Expand Down Expand Up @@ -89,10 +89,10 @@ describe('AgmLocation', () => {
})

const input = wrapper.find('#agm-location')
const a101 = 'a'.repeat(101)
await input.setValue(a101)
const a401 = 'a'.repeat(401)
await input.setValue(a401)

expect(wrapper.emitted('update:agmLocation').pop()[0]).toBe(a101)
expect(wrapper.emitted('update:agmLocation').pop()[0]).toBe(a401)
expect(wrapper.emitted('valid').pop()[0]).toBe(false)
wrapper.destroy()
})
Expand Down
2 changes: 0 additions & 2 deletions tests/unit/EntityMenu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,6 @@ describe('Entity Menu - Consent to Continuation click tests', () => {
})

describe('Entity Menu - Request AGM Extension click tests', () => {
let vm: any

beforeAll(() => {
// override feature flag
vi.spyOn(utils, 'GetFeatureFlag').mockImplementation(flag => {
Expand Down
Loading