Skip to content

Commit

Permalink
- app version = 5.11.1 (bcgov#712)
Browse files Browse the repository at this point in the history
- removed Expiry Date from Continuation Authorization component
- removed Expiry Date from Summary component
- vertically aligned file buttons with label on Summary page
- removed Expiry Date from interface
- removed Expiry Date from filing resume draft
- updated unit tests

Co-authored-by: Severin Beauvais <[email protected]>
  • Loading branch information
severinbeauvais and Severin Beauvais authored Jun 19, 2024
1 parent 1dee380 commit 7657972
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 89 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-create-ui",
"version": "5.11.0",
"version": "5.11.1",
"private": true,
"appName": "Create UI",
"sbcName": "SBC Common Components",
Expand Down
57 changes: 5 additions & 52 deletions src/components/ContinuationIn/ContinuationAuthorization.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,42 +42,9 @@
/>
</v-col>
</v-row>

<!-- Expiry Date -->
<v-row
class="mt-4"
no-gutters
>
<v-col
cols="12"
sm="3"
>
<label>Expiry Date</label>
</v-col>

<v-col
cols="12"
sm="9"
class="pl-8"
>
<DatePickerShared
id="expiry-date"
ref="expiryDateRef"
title="Expiry Date (Optional)"
:nudgeRight="40"
:nudgeTop="85"
hint="The date the authorization expires"
:persistentHint="true"
:initialValue="authorization.expiryDate"
:inputRules="getShowErrors ? expiryDateRules: []"
:minDate="getCurrentDate"
@emitDateSync="authorization.expiryDate = $event"
/>
</v-col>
</v-row>
</v-form>

<v-divider class="mt-6 mb-8" />
<v-divider class="mt-4 mb-8" />

<header>
<p>
Expand Down Expand Up @@ -153,7 +120,6 @@ export default class ExtraproRegistration extends Mixins(DocumentMixin) {
// Refs
$refs!: {
authorizationDateRef: DatePickerShared,
expiryDateRef: DatePickerShared,
formRef: FormIF
}
Expand All @@ -170,7 +136,6 @@ export default class ExtraproRegistration extends Mixins(DocumentMixin) {
// Local properties
authorization = null as ContinuationAuthorizationIF
authorizationDateValid = false
expiryDateValid = false
fileValidity = false
customErrorMessage = ['', '', '', '', ''] // max 5 files
Expand Down Expand Up @@ -202,13 +167,6 @@ export default class ExtraproRegistration extends Mixins(DocumentMixin) {
]
}
get expiryDateRules (): Array<VuetifyRuleFunction> {
return [
() => !this.authorization.expiryDate ||
(this.authorization.expiryDate >= this.getCurrentDate) || 'Expiry Date cannot be in the past'
]
}
/** The number of file upload components to display (max 5). */
get numUploads (): number {
return Math.min((this.authorization.files.length + 1), 5)
Expand All @@ -217,7 +175,7 @@ export default class ExtraproRegistration extends Mixins(DocumentMixin) {
/** Called when this component is mounted. */
mounted (): void {
this.authorization = this.getContinuationAuthorization ||
{ files: [], date: null, expiryDate: null } as ContinuationAuthorizationIF
{ files: [], date: null } as ContinuationAuthorizationIF
}
/**
Expand Down Expand Up @@ -281,22 +239,19 @@ export default class ExtraproRegistration extends Mixins(DocumentMixin) {
@Watch('getShowErrors')
@Watch('minAuthorizationDate') // because Authorization Date depends on this
@Watch('authorization.date') // because Expiry Date depends on this
@Watch('authorization.expiryDate')
@Watch('authorization.date') // in case this changes
private async onGetShowErrors (): Promise<void> {
if (this.getShowErrors) {
// wait for form to finish rendering
await this.$nextTick()
// validate the form and our custom components that don't support form validation
// validate the form and our custom component that doesn't support form validation
this.$refs.formRef.validate()
this.authorizationDateValid = this.$refs.authorizationDateRef.validateForm()
this.expiryDateValid = this.$refs.expiryDateRef.validateForm()
}
}
@Watch('authorization', { deep: true })
@Watch('authorizationDateValid') // re-validate when the Authorization Date validity changes
@Watch('expiryDateValid')
@Emit('valid')
private onComponentValid (): boolean {
// sync local object to the store
Expand All @@ -306,7 +261,6 @@ export default class ExtraproRegistration extends Mixins(DocumentMixin) {
// and at least one file uploaded
return (
this.authorizationDateValid &&
this.expiryDateValid &&
(this.authorization.files.length >= 1)
)
}
Expand All @@ -333,8 +287,7 @@ label {
padding-right: 1rem !important;
}
#authorization-date,
#expiry-date {
#authorization-date {
// show pointer on hover
:deep(.v-input__slot) {
pointer-events: auto;
Expand Down
32 changes: 5 additions & 27 deletions src/components/ContinuationIn/SummaryBusinessHomeJurisdiction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -304,28 +304,6 @@
</v-col>
</v-row>
</article>

<!-- Expiry Date -->
<article class="section-container">
<v-row no-gutters>
<v-col
cols="12"
sm="3"
class="pr-4"
>
<label>Expiry Date</label>
</v-col>
<v-col
cols="12"
sm="9"
class="pt-4 pt-sm-0"
>
<div id="expiry-date">
{{ expiryDate || '[Not entered]' }}
</div>
</v-col>
</v-row>
</article>
</div>
</section>
</div>
Expand Down Expand Up @@ -400,11 +378,6 @@ export default class SummaryBusinessHomeJurisdiction extends Mixins(DateMixin, D
return this.yyyyMmDdToPacificDate(this.getContinuationAuthorization?.date, true, false)
}
/** The formatted expiry date. */
get expiryDate (): string {
return this.yyyyMmDdToPacificDate(this.getContinuationAuthorization?.expiryDate, true, false)
}
/** Downloads the director affidavit document. */
async downloadAffidavitDocument (): Promise<void> {
await this.download(this.getExistingBusinessInfo.affidavitFileKey,
Expand Down Expand Up @@ -449,6 +422,11 @@ article:not(:last-child) {
padding-bottom: 0;
}
// vertically align file buttons with label
#continuation-authorization-summary .col-sm-9 {
margin-top: -6px !important;
}
.download-affidavit-btn,
.download-authorization-btn {
// nudge icon down a bit to line up with text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ export interface ContinuationAuthorizationIF {
fileName: string
}>
date: string // YYYY-MM-DD
expiryDate?: string // YYYY-MM-DD
}
3 changes: 1 addition & 2 deletions src/mixins/filing-template-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,7 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM
if (this.getContinuationAuthorization) {
filing.continuationIn.authorization = {
files: this.getContinuationAuthorization.files,
date: this.getContinuationAuthorization.date,
expiryDate: this.getContinuationAuthorization.expiryDate || undefined // can't be null
date: this.getContinuationAuthorization.date
}
}

Expand Down
2 changes: 0 additions & 2 deletions tests/unit/ContinuationAuthorization.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ describe('Continuation Authorization component', () => {
const formRows = wrapper.findAll('form > .row')
expect(formRows.at(0).find('.col-sm-3 label').text()).toBe('Authorization Date')
expect(formRows.at(0).find('.col-sm-9').findComponent(DatePickerShared).exists()).toBe(true)
expect(formRows.at(1).find('.col-sm-3 label').text()).toBe('Expiry Date')
expect(formRows.at(1).find('.col-sm-9').findComponent(DatePickerShared).exists()).toBe(true)

expect(wrapper.find('header').exists()).toBe(true)
expect(wrapper.find('header p').text()).toContain('Upload documents that support proof of')
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/SummaryBusinessHomeJurisdiction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ describe('Summary Business Home Jurisdiction component', () => {
expect(wrapper.find('.business-home-step-error-message a span').text()).toBe('Return to this step to finish it')

expect(wrapper.find('#continuation-authorization-summary').exists()).toBe(true)
const articles = wrapper.findAll('#continuation-authorization-summary article')

const articles = wrapper.findAll('#continuation-authorization-summary article')
expect(articles.at(0).find('label').text()).toBe('Continuation Authorization')
expect(articles.at(1).find('label').text()).toBe('Authorization Date')
expect(articles.at(2).find('label').text()).toBe('Expiry Date')

wrapper.destroy()
})
Expand Down

0 comments on commit 7657972

Please sign in to comment.