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 First PR #1

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 4 additions & 2 deletions src/components/common/DetailComment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default class DetailComment extends Vue {
get rules (): Array<(val) => boolean | string> {
// include whitespace in maximum length check
return [
val => (val && val.trim().length > 0) || 'Detail is required.',
val => (val && val.trim().length > 0) || this.textRequiredErrorMsg,
Copy link
Owner Author

Choose a reason for hiding this comment

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

Using this new prop to show "Reason is required" instead of "Detail is required"
reason is required

val => (val && val.length <= this.maxLength) || 'Maximum characters exceeded.'
]
}
Expand All @@ -61,6 +61,9 @@ export default class DetailComment extends Vue {
/** Prompt the validations. Used for global validations. */
@Prop({ default: false }) readonly validateForm!: boolean

/** Text is required error message. */
@Prop({ default: 'Detail is required.' }) readonly textRequiredErrorMsg!: string

detailedComment = ''

/** Called when component is created. */
Expand Down Expand Up @@ -113,7 +116,6 @@ export default class DetailComment extends Vue {
// Move the placeholder and input text from the edges.
:deep() {
.theme--light.v-input input, .theme--light.v-input textarea {
background-color: $gray1;
Copy link
Owner Author

Choose a reason for hiding this comment

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

The component had a weird behavior/color:
weird color for detail comment

I don't know if you can see it haha but the background is a little bit messed up (2 colors). This fixes that.

padding-top: 0.5rem;
padding-left: 0.5rem;
}
Expand Down
133 changes: 95 additions & 38 deletions src/views/AgmLocationChg.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,22 @@
</h3>
<div class="mt-6">
<p class="ml-1">
This request for location change is only needed if the meetings are fully in-person. In general,
these meetings are required to be held in British Columbia. However, there are exceptions to this
rule. If the company's articles permit it or if the members agree, the meeting can be conducted at
a location outside British Columbia. If the meeting combines both in-person and online
participation, the location requirement only applies to the in-person component. If the meeting is
entirely conducted online, these location restrictions do not apply.
Generally, company meetings must be in British Columbia (BC). However, there are exceptions to
this rule. A company must request a location change if the metting will be fully or partially
in-person and none of the exceptions listed below apply. Partially in-person meetings combine
both in-person and online participation. The location change request only applies to
the in-person participants.
<br><br>
Exceptions to the requirement for a location change request include the following:
<br><br>
<ul>
<li>The meeting will be fully online;</li>
<li>The company's articles permit a location outside BC;</li>
<li>
Nothing in the articles restrict a location change approved by
resolution or by ordinary resolution, as the case may be.
</li>
</ul>
</p>
</div>
</section>
Expand All @@ -90,14 +100,15 @@
</p>
</header>

<div :class="{ 'invalid-section': !agmYearValid && showErrors }">
Copy link
Owner Author

Choose a reason for hiding this comment

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

I don't believe we need here a red border for everything. I don't see this type of behavior in other local filings. I think the red border should be to what's invalid.

<div>
<v-card
flat
class="py-4"
>
<!-- AGM Year -->
<div
id="agm-year-section"
:class="{ 'invalid-section': !agmYearValid && showErrors }"
>
<v-row
no-gutters
Expand Down Expand Up @@ -128,38 +139,70 @@

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

<!-- Location address -->
<v-row
no-gutters
class="my-6"
<!-- Reason -->
<div
id="reason-section"
:class="{ 'invalid-section': !reasonValid && showErrors }"
>
<v-col
cols="12"
sm="3"
class="pr-4"
>
<strong :class="{ 'app-red': !agmLocationAddressValid && showErrors }">New AGM Location</strong>
</v-col>
<v-col
cols="12"
sm="9"
<v-row
no-gutters
class="my-6"
>
<div
id="location-section"
:class="{ 'invalid-section': !agmLocationAddressValid && showErrors }"
<v-col
cols="12"
sm="3"
class="pl-4 pt-4"
>
<AgmLocationAddress
ref="agmLocationAddressRef"
:editing="true"
:schema="locationAddressSchema"
:excludeBC="true"
:deliveryInstructionsText="'Additional location details'"
@update:address="updateLocationAddress"
@valid="agmLocationAddressValid=$event"
<strong :class="{ 'app-red': !reasonValid && showErrors }">Reason</strong>
</v-col>
<v-col
cols="12"
sm="8"
>
<DetailComment
v-model="reason"
:class="{ 'invalid-component': !reasonValid && showErrors }"
placeholder="Reason"
maxLength="1994"
textRequiredErrorMsg="Reason is required."
:validateForm="showErrors"
@valid="reasonValid=$event"
/>
</div>
</v-col>
</v-row>
</v-col>
</v-row>
</div>

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

<!-- Location address -->
<div
id="location-section"
:class="{ 'invalid-section': !agmLocationAddressValid && showErrors }"
>
<v-row
no-gutters
class="my-6"
>
<v-col
cols="12"
sm="3"
class="pl-4 pr-4"
>
<strong :class="{ 'app-red': !agmLocationAddressValid && showErrors }">AGM Location</strong>
</v-col>
<v-col
cols="12"
sm="9"
>
<v-col
cols="12"
sm="8"
>
<!-- Placeholder for the new AGM location component that I'll create in the next PR -->
</v-col>
</v-col>
</v-row>
</div>
</v-card>
</div>
</section>
Expand Down Expand Up @@ -264,11 +307,11 @@ import { navigate } from '@/utils'
import SbcFeeSummary from 'sbc-common-components/src/components/SbcFeeSummary.vue'
import { locationAddressSchema } from '@/schemas'
import { BaseAddress } from '@bcrs-shared-components/base-address'
import { ExpandableHelp } from '@bcrs-shared-components/expandable-help'
import { Certify } from '@/components/common'
import { Certify, DetailComment } from '@/components/common'
import { ConfirmDialog, PaymentErrorDialog, StaffPaymentDialog }
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'
Expand All @@ -281,6 +324,7 @@ import AgmYear from '@/components/AgmLocationChange/AgmYear.vue'
AgmYear,
Certify,
ConfirmDialog,
DetailComment,
ExpandableHelp,
AgmLocationAddress: BaseAddress,
PaymentErrorDialog,
Expand Down Expand Up @@ -317,6 +361,10 @@ export default class AgmLocationChg extends Mixins(CommonMixin, DateMixin,
isCertified = false
certifyFormValid = false

// variables for DetailComment component
reason = ''
reasonValid = false

// variables for staff payment
staffPaymentData = { option: StaffPaymentOptions.NONE } as StaffPaymentIF
staffPaymentDialog = false
Expand Down Expand Up @@ -382,7 +430,7 @@ export default class AgmLocationChg extends Mixins(CommonMixin, DateMixin,

get previousYear () : number {
const today = new Date()
return new Date(today.getFullYear() - 1, today.getMonth() + 1, today.getDate()).getFullYear()
return new Date(today.getFullYear() - 2, today.getMonth() + 1, today.getDate()).getFullYear()
}

get followingYear () : number {
Expand Down Expand Up @@ -667,6 +715,7 @@ export default class AgmLocationChg extends Mixins(CommonMixin, DateMixin,
/** Array of valid components. Must match validFlags. */
readonly validComponents = [
'agm-year-section',
'reason-section',
'location-section',
'certify-form-section'
]
Expand All @@ -676,6 +725,7 @@ export default class AgmLocationChg extends Mixins(CommonMixin, DateMixin,
return {
// mainSection: this.sectionValid,
agmYear: this.agmYearValid,
reason: this.reasonValid,
locationAddress: this.agmLocationAddressValid,
certifyForm: this.certifyFormValid
}
Expand All @@ -684,6 +734,7 @@ export default class AgmLocationChg extends Mixins(CommonMixin, DateMixin,
@Watch('agmYearValid')
@Watch('agmLocationAddressValid')
@Watch('certifyFormValid')
@Watch('resonValid')
onHaveChanges (): void {
this.haveChanges = true
}
Expand Down Expand Up @@ -775,5 +826,11 @@ h2 {
color: $app-red;
}
}

.invalid-component {
.title-label {
color: $app-red;
}
}
}
</style>