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

correction filing (part 1) #22

Merged
merged 3 commits into from
Feb 26, 2020
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
5 changes: 2 additions & 3 deletions src/components/AnnualReport/AGMDate.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<template>
<v-card flat class="agm-date-container">
<div class="meta-container">
<label>
<span>Annual General<br>Meeting Date</span>
</label>
<label>Annual General<br>Meeting Date</label>

<v-form ref="form" class="value date">
<v-menu
Expand Down Expand Up @@ -279,6 +277,7 @@ export default class AgmDate extends Mixins(DateMixin) {

> label:first-child {
font-weight: 700;
margin-bottom: 2rem;
}
}

Expand Down
139 changes: 0 additions & 139 deletions src/components/AnnualReport/StaffPayment.vue

This file was deleted.

12 changes: 7 additions & 5 deletions src/components/Dashboard/FilingHistoryList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@
</template>
<v-list dense>
<v-list-item-group color="primary">
<!-- NB: this menu item is disabled in current release -->
<v-list-item disabled>
<v-list-item>
<v-list-item-icon>
<v-icon>mdi-file-document-edit-outline</v-icon>
</v-list-item-icon>
Expand Down Expand Up @@ -136,8 +135,8 @@
</v-list>

<div class="paper-filings body-2" v-if="item.paperOnly">
<p>Filings completed <b>before March 10, 2019</b> are only available from the BC Registry as paper
documents.</p>
<p>Filings completed <strong>before March 10, 2019</strong> are only available from the BC Registry
as paper documents.</p>
<p>To request copies of paper documents, contact BC Registry Staff with the document you require and
the name and incorporation number of your association:</p>
<ul class="contact-info__list mt-5">
Expand Down Expand Up @@ -234,7 +233,10 @@ export default {
currentFilingId: null,

// enums
EntityTypes
EntityTypes,
FilingNames,
FilingStatus,
FilingTypes
}
},

Expand Down
2 changes: 1 addition & 1 deletion src/components/Dashboard/TodoList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
<v-expansion-panel-content>
<v-card v-if="isPending(item)" data-test-class="payment-incomplete">
<v-card-text>
<p class="font-weight-bold black--text">Payment Incomplete</P>
<p class="font-weight-bold black--text">Payment Incomplete</p>
<p>This filing is pending payment. The payment may still be in progress or may have been
interrupted for some reason.<p>
<p>You may continue this filing by selecting "Resume Payment".</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
>
<template slot="label">
<div class="certify-stmt">
I, <b>{{trimmedCertifiedBy || '[Legal Name]'}}</b>, certify that I have relevant knowledge of the
{{entityDisplay || 'association'}} and that I am authorized to make this filing.
I, <strong>{{trimmedCertifiedBy || '[Legal Name]'}}</strong>, certify that I have relevant knowledge
of the {{entityDisplay || 'association'}} and that I am authorized to make this filing.
</div>
</template>
</v-checkbox>
Expand All @@ -45,37 +45,35 @@ import { mapState } from 'vuex'
export default class Certify extends Vue {
readonly currentDate!: string

// Props passed into this component.
/** Certified By prop. */
@Prop({ default: '' })
private certifiedBy: string

/** Is Certified prop. */
@Prop({ default: false })
private isCertified: boolean

/** Message prop. */
@Prop({ default: '' })
private message: string

/** Entity Display prop. */
@Prop({ default: '' })
private entityDisplay: string

/**
* Called when component is created.
*/
/** Called when component is created. */
cameron-eyds marked this conversation as resolved.
Show resolved Hide resolved
private created (): void {
// always give the parent a "valid" event for its property values
// inform parent of initial validity
this.emitValid(Boolean(this.trimmedCertifiedBy && this.isCertified))
}

/**
* Computed value.
* @returns The trimmed "Certified By" string (may be '').
*/
/** The trimmed "Certified By" string (may be ''). */
private get trimmedCertifiedBy (): string {
// remove repeated inline whitespace, and leading/trailing whitespace
return this.certifiedBy && this.certifiedBy.replace(/\s+/g, ' ').trim()
}

// Emit an update event when input changes.
/** Emits an event to update the Certified By prop. */
@Emit('update:certifiedBy')
private emitCertifiedBy (certifiedBy: string): string {
// remove repeated inline whitespace, and leading/trailing whitespace
Expand All @@ -84,14 +82,14 @@ export default class Certify extends Vue {
return certifiedBy
}

// Emit an update event when checkbox changes.
/** Emits an event to update the Is Certified prop. */
@Emit('update:isCertified')
private emitIsCertified (isCertified: boolean): boolean {
this.emitValid(Boolean(this.trimmedCertifiedBy && isCertified))
return isCertified
}

// Emit an event indicating whether or not the form is valid.
/** Emits an event indicating whether or not the form is valid. */
@Emit('valid')
private emitValid (valid: boolean): void { }
}
Expand All @@ -118,7 +116,8 @@ export default class Certify extends Vue {
position: relative;

> label:first-child {
font-weight: 500;
font-weight: 700;
margin-bottom: 2rem;
}
}

Expand All @@ -130,7 +129,6 @@ export default class Certify extends Vue {
flex: 0 0 auto;
padding-right: 2rem;
width: 12rem;
font-weight: 700;
}
}
}
Expand Down
34 changes: 22 additions & 12 deletions src/components/common/DetailComment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
auto-grow
rows="5"
id="detail-comment-textarea"
:counter="MAXLENGTH"
:counter="maxLength"
:rules="rules"
:value="value"
:label="label"
:placeholder="placeholder"
:autofocus="autofocus"
@input="emitInput($event)"
/>
Expand All @@ -22,15 +22,13 @@ import { Debounce } from 'vue-debounce-decorator'

@Component({})
export default class DetailComment extends Vue {
private readonly MAXLENGTH = 4096

/** Array of validations rules for the textarea. */
private get rules (): Array<Function> {
// exclude whitespace in minimum length check
// include whitespace in maximum length check
return [
val => (val && val.trim().length > 0) || 'Detail is required.',
val => (val && val.length <= this.MAXLENGTH) || 'Maximum characters exceeded.'
val => (val && val.length <= this.maxLength) || 'Maximum characters exceeded.'
]
}

Expand All @@ -39,27 +37,36 @@ export default class DetailComment extends Vue {
(this.$refs.textarea as any).resetValidation()
}

/** Comment (v-model) passed into this component. */
/** Comment (v-model) passed into this component (required). */
@Prop({ default: '' })
private value: string

/** Label passed into this component. */
/** Placeholder passed into this component (optional). */
@Prop({ default: '' })
private label: string
private placeholder: string

/** Max Length passed into this component (optional). */
@Prop({ default: 4096 })
private maxLength: number

/** Autofocus passed into this component. */
/** Autofocus passed into this component (optional). */
@Prop({ default: false })
private autofocus: boolean

/** Called when component is created. */
created (): void {
// inform parent of initial validity
this.emitValid(this.value)
}

/**
* Called when prop changes (ie, v-model is updated by parent).
* This method is debounced to prevent excessive validation.
*/
@Watch('value')
@Debounce(300)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know this was not implemented in this PR, but this makes me think. Should we have implemented the Debounce decorator on all our listeners? Just a little bit of reading on the topic makes me think it is certainly not a bad thing when trying to optimize performance. No Action required here, just starting a conversation :)

Copy link
Collaborator Author

@severinbeauvais severinbeauvais Feb 26, 2020

Choose a reason for hiding this comment

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

I implemented it here because it needed it (it validated a bunch of rules on every keystroke, which made system responsiveness noticeably slow).

I think we should debounce methods when needed, but I haven't found any other candidates. Do you have something in mind?

Copy link
Collaborator

Choose a reason for hiding this comment

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

No nothing specific, i just know that some of the watchers are triggered constantly and was just thinking ( theoretically ) this is a cool way of optimizing. It's just something i'll keep in mind going forward, if a watcher is a good candidate for Debouncing.

private onValueChanged (val: string): void {
const isValidComment = this.rules.every(rule => rule(val) === true)
this.emitValid(isValidComment)
this.emitValid(val)
}

/** Emits an event with the changed comment (ie, updated v-model). */
Expand All @@ -68,7 +75,10 @@ export default class DetailComment extends Vue {

/** Emits an event indicating whether or not this component is valid. */
@Emit('valid')
private emitValid (val: boolean): void { }
private emitValid (val: string): boolean {
// component is valid if every rule is valid
return this.rules.every(rule => rule(val) === true)
}
}
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,10 @@ import { Component, Mixins, Vue, Prop, Watch, Emit } from 'vue-property-decorato
import axios from '@/axios-auth'
import { mapState, mapGetters } from 'vuex'
import { required, maxLength } from 'vuelidate/lib/validators'
import { WarningPopover } from '@/components/dialogs'

// Components
import BaseAddress from 'sbc-common-components/src/components/BaseAddress.vue'
import { WarningPopover } from '@/components/dialogs'

// Mixins
import { DateMixin, EntityFilterMixin, CommonMixin, DirectorMixin, ResourceLookupMixin } from '@/mixins'
Expand Down
Loading