Skip to content

Commit

Permalink
18024 Finish AGM Extension UI implementation (bcgov#594)
Browse files Browse the repository at this point in the history
* Fix AGM extension api payload

* Update version to 7.0.21

* Fix unit test
  • Loading branch information
leodube-aot authored Nov 28, 2023
1 parent b20dc57 commit eaf2445
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 24 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "business-filings-ui",
"version": "7.0.20",
"version": "7.0.21",
"private": true,
"appName": "Filings UI",
"sbcName": "SBC Common Components",
Expand All @@ -19,7 +19,7 @@
"@bcrs-shared-components/confirm-dialog": "1.2.1",
"@bcrs-shared-components/corp-type-module": "1.0.14",
"@bcrs-shared-components/court-order-poa": "2.1.4",
"@bcrs-shared-components/date-picker": "1.2.38",
"@bcrs-shared-components/date-picker": "1.2.39",
"@bcrs-shared-components/document-delivery": "1.2.1",
"@bcrs-shared-components/enums": "1.1.2",
"@bcrs-shared-components/expandable-help": "1.0.1",
Expand Down
10 changes: 10 additions & 0 deletions src/components/AgmExtension/ExtensionRequest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
nudge-right="40"
:minDate="incorporationDateText"
:maxDate="data.currentDate"
:inputRules="dateRules"
@emitDate="data.prevAgmDate = $event"
@emitCancel="data.prevAgmDate = ''"
/>
Expand Down Expand Up @@ -132,6 +133,7 @@
:showCurrent="prevExpiryDateMin"
:minDate="prevExpiryDateMin"
:maxDate="prevExpiryDateMax"
:inputRules="dateRules"
@emitDate="data.prevExpiryDate = $event"
@emitCancel="data.prevExpiryDate = ''"
/>
Expand Down Expand Up @@ -169,6 +171,7 @@
title="Intended date this AGM will be held"
nudge-right="40"
:minDate="data.currentDate"
:inputRules="dateRules"
@emitDate="data.intendedAgmDate = $event"
@emitCancel="data.intendedAgmDate = ''"
/>
Expand Down Expand Up @@ -234,6 +237,13 @@ export default class ExtensionRequest extends Vue {
]
}
/** The array of validations rule(s) for the date fields. */
get dateRules (): Array<(v) => boolean | string> {
return [
v => !!v || 'A date is required.'
]
}
/** Whether to disable the editing of AGM Year field. */
get isFirstAgm (): boolean {
// Field disabled on first load when value is null
Expand Down
21 changes: 12 additions & 9 deletions src/components/EntityInfo/EntityMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,21 @@
content-class="right-tooltip"
>
<template #activator="{ on }">
<v-list-item
<div
v-if="enableAgmExtension"
id="agm-ext-list-item"
:disabled="!isAllowed(AllowableActions.AGM_EXTENSION)"
v-on="on"
@click="goToAgmExtensionFiling()"
>
<v-list-item-title>
<span class="app-blue">Request AGM Extension</span>
</v-list-item-title>
</v-list-item>
<v-list-item
id="agm-ext-list-item"
:disabled="!isAllowed(AllowableActions.AGM_EXTENSION)"
v-on="on"
@click="goToAgmExtensionFiling()"
>
<v-list-item-title>
<span class="app-blue">Request AGM Extension</span>
</v-list-item-title>
</v-list-item>
</div>
</template>
<span>{{ agmExtensionToolTipText }}</span>
</v-tooltip>
Expand All @@ -191,7 +195,6 @@
<template #activator="{ on }">
<div
v-if="enableAgmLocationChg"
class="d-inline-block"
v-on="on"
>
<v-list-item
Expand Down
10 changes: 5 additions & 5 deletions src/views/AgmExtension.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@
:evaluateResult="extensionRequestValid"
/>

<!-- delete this debugging code -->
<pre class="mt-8">data: {{ data }}</pre>

<!-- Certify -->
<section class="mt-8">
<header>
Expand Down Expand Up @@ -431,12 +428,15 @@ export default class AgmExtension extends Mixins(CommonMixin, DateMixin,
// 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,
// conditionally add properties if not null
...(this.data.prevAgmDate && { prevAgmRefDate: this.data.prevAgmDate }),
...(this.data.prevExpiryDate && {
expireDateCurrExt: this.data.prevExpiryDate
}),
// add in remaining local properties for future auditing
...this.data
}
Expand Down
2 changes: 0 additions & 2 deletions tests/unit/AgmExtension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ describe('AGM Extension view', () => {
alreadyExtended: null,
currentDate: '2023-11-06',
expireDateApprovedExt: null,
expireDateCurrExt: null,
extReqForAgmYear: null,
extensionDuration: NaN,
incorporationDate: new Date('2000-01-01T08:00:00.000Z'),
Expand All @@ -209,7 +208,6 @@ describe('AGM Extension view', () => {
isGoodStanding: true,
isPrevExtension: null,
prevAgmDate: null,
prevAgmRefDate: null,
prevExpiryDate: null,
requestExpired: null,
totalApprovedExt: NaN,
Expand Down

0 comments on commit eaf2445

Please sign in to comment.