Skip to content

Commit

Permalink
20436 Removed Intended Date field (bcgov#646)
Browse files Browse the repository at this point in the history
- app version = 7.1.10
- deleted Intended Date template
- updated validity code
- updated interfaces
- deleted field from filing
- update unit tests

Co-authored-by: Severin Beauvais <severin.beauvais@gov.bc.ca>
  • Loading branch information
severinbeauvais and Severin Beauvais authored Apr 8, 2024
1 parent 36b06a3 commit faf7c8e
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 56 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.1.9",
"version": "7.1.10",
"private": true,
"appName": "Filings UI",
"sbcName": "SBC Common Components",
Expand Down
47 changes: 6 additions & 41 deletions src/components/AgmExtension/ExtensionRequest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
class="px-6 py-7"
:class="{ 'invalid-section': !firstSectionValid && showErrors }"
>
<!-- first AGM? -->
<v-row
v-if="!is30MonthsAfterIncorp"
no-gutters
Expand Down Expand Up @@ -45,6 +46,7 @@
</v-col>
</v-row>

<!-- AGM year -->
<v-row no-gutters>
<v-col
cols="12"
Expand Down Expand Up @@ -74,6 +76,7 @@
:class="{ 'invalid-section': !secondSectionValid && showErrors }"
>
<v-expand-transition>
<!-- annual reference / AGM date -->
<v-row
v-if="!isFirstAgm"
no-gutters
Expand Down Expand Up @@ -102,6 +105,8 @@
</v-col>
</v-row>
</v-expand-transition>

<!-- extension already requested? -->
<v-row no-gutters>
<v-col
cols="12"
Expand Down Expand Up @@ -147,37 +152,6 @@
</v-col>
</v-row>
</div>

<v-divider class="mx-4" />

<div
class="px-6 py-7"
:class="{ 'invalid-section': !thirdSectionValid && showErrors }"
>
<v-row no-gutters>
<v-col
cols="12"
sm="3"
class="pr-4"
>
<strong>Intended date this AGM will be held</strong>
</v-col>
<v-col
cols="12"
sm="9"
>
<DatePicker
class="pt-2"
title="Intended date this AGM will be held"
nudge-right="40"
:minDate="data.currentDate"
:inputRules="dateRules"
@emitDate="data.intendedAgmDate = $event"
@emitCancel="data.intendedAgmDate = ''"
/>
</v-col>
</v-row>
</div>
</template>
</VcardTemplate>
</template>
Expand Down Expand Up @@ -222,10 +196,6 @@ export default class ExtensionRequest extends Vue {
}
}
get thirdSectionValid (): boolean {
return !!this.data.intendedAgmDate
}
/** The array of validations rule(s) for the AGM Year text field. */
get agmYearRules (): Array<(v) => boolean | string> {
return [
Expand Down Expand Up @@ -323,7 +293,6 @@ export default class ExtensionRequest extends Vue {
@Watch('data.prevAgmDate')
@Watch('data.isPrevExtension')
@Watch('data.prevExpiryDate')
@Watch('data.intendedAgmDate')
@Watch('data.currentDate')
@Watch('agmYearValid')
private onHaveChanges (): void {
Expand Down Expand Up @@ -497,11 +466,7 @@ export default class ExtensionRequest extends Vue {
/** Whether the extension request is valid or not */
checkValidity (): void {
this.isValid = (
this.firstSectionValid &&
this.secondSectionValid &&
this.thirdSectionValid
)
this.isValid = (this.firstSectionValid && this.secondSectionValid)
this.emitValid()
}
Expand Down
2 changes: 0 additions & 2 deletions src/interfaces/agm-ext-eval-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export interface AgmExtEvalIF {
prevAgmDate: string // YYYY-MM-DD
isPrevExtension: boolean
prevExpiryDate: string // YYYY-MM-DD
intendedAgmDate: string // YYYY-MM-DD
extensionDuration: number // in months
agmDueDate: string // YYYY-MM-DD
isEligible: boolean
Expand All @@ -28,7 +27,6 @@ export const EmptyAgmExtEval: AgmExtEvalIF = {
prevAgmDate: null,
isPrevExtension: null,
prevExpiryDate: null,
intendedAgmDate: null,
extensionDuration: NaN,
agmDueDate: null,
isEligible: null
Expand Down
1 change: 0 additions & 1 deletion src/interfaces/api-filing-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export interface ApiFilingIF {
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
Expand Down
2 changes: 0 additions & 2 deletions src/views/AgmExtension.vue
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ export default class AgmExtension extends Mixins(CommonMixin, DateMixin,
year: this.data.agmYear,
isFirstAgm: this.data.isFirstAgm,
extReqForAgmYear: this.data.isPrevExtension,
intendedAgmDate: this.data.intendedAgmDate,
totalApprovedExt: this.getTotalAgmExtensionDuration(Number(this.data.agmYear)) + this.data.extensionDuration,
expireDateApprovedExt: this.data.agmDueDate,
// conditionally add properties if not null
Expand Down Expand Up @@ -540,7 +539,6 @@ export default class AgmExtension extends Mixins(CommonMixin, DateMixin,
@Watch('data.prevAgmDate')
@Watch('data.isPrevExtension')
@Watch('data.prevExpiryDate')
@Watch('data.intendedAgmDate')
private onHaveChanges (): void {
this.haveChanges = true
}
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/AgmExtension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import VueRouter from 'vue-router'
import mockRouter from './mockRouter'
import { CorpTypeCd, FilingTypes } from '@/enums'
import { LegalServices } from '@/services'
import flushPromises from 'flush-promises'

// components
import AgmExtension from '@/views/AgmExtension.vue'
Expand All @@ -19,7 +20,6 @@ import { Certify } from '@/components/common'
import { ExpandableHelp } from '@bcrs-shared-components/expandable-help'
import ExtensionRequest from '@/components/AgmExtension/ExtensionRequest.vue'
import SbcFeeSummary from 'sbc-common-components/src/components/SbcFeeSummary.vue'
import flushPromises from 'flush-promises'

// suppress warning "Unknown custom element <affix>" warnings
Vue.config.silent = true
Expand Down Expand Up @@ -213,7 +213,6 @@ describe('AGM Extension view', () => {
extReqForAgmYear: null,
extensionDuration: NaN,
incorporationDate: new Date('2000-01-01T08:00:00.000Z'),
intendedAgmDate: null,
isEligible: true,
isFirstAgm: null,
isGoodStanding: true,
Expand Down
5 changes: 0 additions & 5 deletions tests/unit/ExtensionRequest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Vuetify from 'vuetify'
import { mount } from '@vue/test-utils'
import { createPinia, setActivePinia } from 'pinia'
import ExtensionRequest from '@/components/AgmExtension/ExtensionRequest.vue'
import { DatePicker } from '@bcrs-shared-components/date-picker'
import { AgmExtEvalIF, EmptyAgmExtEval } from '@/interfaces'

Vue.use(Vuetify)
Expand Down Expand Up @@ -53,10 +52,6 @@ describe('ExtensionRequest', () => {
expect(rows.at(2).find('.col-sm-9').text())
.toContain('Yes - Specify the date the extension expires')
expect(rows.at(2).find('.col-sm-9').text()).toContain('No - this is the first extension request for this AGM')

// Verify intended date picker
expect(rows.at(3).find('.col-sm-3').text()).toBe('Intended date this AGM will be held')
expect(rows.at(3).find('.col-sm-9').findComponent(DatePicker).exists()).toBe(true)
})

it('displays first agm with no previous extension requested', async () => {
Expand Down

0 comments on commit faf7c8e

Please sign in to comment.