-
Notifications
You must be signed in to change notification settings - Fork 50
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
15538 Fixed restoration type layout and validation issues #735
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,24 @@ | ||
<template> | ||
<div id="approval-type"> | ||
<div | ||
class="section-container" | ||
> | ||
<ApprovalTypeShared | ||
:courtOrderNumber="getRestoration.courtOrder.fileNumber" | ||
:approvedByRegistrar="approvedByRegistrar" | ||
:noticeDate="getRestoration.noticeDate" | ||
:applicationDate="getRestoration.applicationDate" | ||
:invalidSection="invalidSection" | ||
@radioButtonChange="setRestorationApprovalType($event)" | ||
@courtNumberChange="setRestorationCourtOrder({ fileNumber: $event })" | ||
@update:noticeDate="setRestorationNoticeDate($event)" | ||
@update:applicationDate="setRestorationApplicationDate($event)" | ||
@valid="setRestorationApprovalTypeValid($event)" | ||
/> | ||
</div> | ||
<ApprovalTypeShared | ||
class="pa-8" | ||
:courtOrderNumber="getRestoration.courtOrder.fileNumber" | ||
:approvedByRegistrar="approvedByRegistrar" | ||
:noticeDate="getRestoration.noticeDate" | ||
:applicationDate="getRestoration.applicationDate" | ||
:invalidSection="invalidSection" | ||
:validate="getShowErrors" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A previous fix implemented this prop to enable validation. |
||
@radioButtonChange="setRestorationApprovalType($event)" | ||
@courtNumberChange="setRestorationCourtOrder({ fileNumber: $event })" | ||
@update:noticeDate="setRestorationNoticeDate($event)" | ||
@update:applicationDate="setRestorationApplicationDate($event)" | ||
@valid="setRestorationApprovalTypeValid($event)" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { Component, Vue } from 'vue-property-decorator' | ||
import { Component, Prop, Vue } from 'vue-property-decorator' | ||
import { Getter, Action } from 'pinia-class' | ||
import { useStore } from '@/store/store' | ||
import { ApprovalTypes } from '@/enums' | ||
|
@@ -33,6 +31,9 @@ import { ApprovalType as ApprovalTypeShared } from '@bcrs-shared-components/appr | |
} | ||
}) | ||
export default class ApprovalType extends Vue { | ||
/** Whether this section is invalid. */ | ||
@Prop({ default: false }) readonly invalidSection!: boolean | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This now comes from the parent component instead of being computed here. |
||
|
||
@Getter(useStore) getApprovalTypeValid!: boolean | ||
@Getter(useStore) getRestoration!: RestorationStateIF | ||
@Getter(useStore) getShowErrors!: boolean | ||
|
@@ -43,11 +44,6 @@ export default class ApprovalType extends Vue { | |
@Action(useStore) setRestorationCourtOrder!: (x: CourtOrderIF) => void | ||
@Action(useStore) setRestorationNoticeDate!: (x: string) => void | ||
|
||
/** This section's validity state (when prompted by app). */ | ||
get invalidSection (): boolean { | ||
return (this.getShowErrors && !this.getApprovalTypeValid) | ||
} | ||
|
||
get approvedByRegistrar (): boolean { | ||
return (!!this.getRestoration.noticeDate && !!this.getRestoration.applicationDate) | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
<template> | ||
<div id="restoration-type"> | ||
<div | ||
id="restoration-type" | ||
:class="{ 'invalid-section': invalidSection }" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was previously in the parent component, but to make this consistent with the shared ApprovalType component, I moved it here. |
||
> | ||
<div class="section-container"> | ||
<v-row no-gutters> | ||
<v-col | ||
|
@@ -90,7 +93,7 @@ | |
</template> | ||
|
||
<script lang="ts"> | ||
import { Component, Mixins, Watch } from 'vue-property-decorator' | ||
import { Component, Mixins, Prop, Watch } from 'vue-property-decorator' | ||
import { DateMixin, CommonMixin } from '@/mixins' | ||
import { Getter, Action } from 'pinia-class' | ||
import { useStore } from '@/store/store' | ||
|
@@ -106,6 +109,9 @@ import { LimitedRestorationPanel } from '@bcrs-shared-components/limited-restora | |
} | ||
}) | ||
export default class RestorationType extends Mixins(DateMixin, CommonMixin) { | ||
/** Whether this section is invalid. */ | ||
@Prop({ default: false }) readonly invalidSection!: boolean | ||
|
||
@Getter(useStore) getCurrentDate!: string | ||
@Getter(useStore) getRestoration!: RestorationStateIF | ||
@Getter(useStore) getRestorationTypeValid!: boolean | ||
|
@@ -124,11 +130,6 @@ export default class RestorationType extends Mixins(DateMixin, CommonMixin) { | |
// Enum for template | ||
readonly RestorationTypes = RestorationTypes | ||
|
||
/** This section's validity state (when prompted by app). */ | ||
get invalidSection (): boolean { | ||
return (this.getShowErrors && !this.getRestorationTypeValid) | ||
} | ||
|
||
/** The expiry months from the limited restoration draft. */ | ||
get expiryMonths (): number { | ||
const expiryDate = this.getRestoration.expiry | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See recent comments in ticket bcgov/entity#15538 for sample screenshots. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<template> | ||
<div id="restoration-business-name"> | ||
<!-- Business Name and Name Translations --> | ||
<!-- Name section --> | ||
<section | ||
id="name-section" | ||
class="mt-10" | ||
> | ||
<header> | ||
<h2>Name</h2> | ||
<p> | ||
<p class="pt-2"> | ||
Add a Name Request that is reserved for this restoration application or restore | ||
as a numbered company. | ||
</p> | ||
|
@@ -25,35 +25,36 @@ | |
</v-card> | ||
</section> | ||
|
||
<!-- Restoration Type and Approval Type --> | ||
<!-- Restoration Type section --> | ||
<section | ||
id="restoration-type-section" | ||
class="mt-10" | ||
> | ||
<header> | ||
<h2>Restoration Type</h2> | ||
<p>Determine the restoration and approval type.</p> | ||
<p class="pt-2"> | ||
Determine the restoration and approval type. | ||
</p> | ||
</header> | ||
<v-card | ||
flat | ||
class="mt-5" | ||
> | ||
<RestorationType | ||
id="restoration-type" | ||
:class="{ 'approval-restoration-invalid-section': invalidSectionRestoration }" | ||
:invalidSection="invalidSectionRestoration" | ||
/> | ||
|
||
<!-- Divider b/w Restoration and Approval type --> | ||
<div | ||
class="px-5" | ||
:class="{ 'invalid-divider': invalidSectionRestoration && invalidSectionApproval }" | ||
class="px-5" | ||
> | ||
<v-divider /> | ||
</div> | ||
|
||
<ApprovalType | ||
id="approval-type" | ||
:class="{ 'approval-restoration-invalid-section': invalidSectionApproval }" | ||
:invalidSection="invalidSectionApproval" | ||
/> | ||
</v-card> | ||
</section> | ||
|
@@ -157,19 +158,9 @@ | |
content: counter(header-counter) '. '; | ||
} | ||
|
||
header p { | ||
padding-top: 0.5rem; | ||
} | ||
|
||
/* Invalid Section border for Approval and Restoration Type */ | ||
.approval-restoration-invalid-section{ | ||
box-shadow: inset 3px 0 0 $app-red; | ||
border-top-left-radius: 0 !important; | ||
border-bottom-left-radius: 0 !important; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is now done in the child components (as per comment above). |
||
|
||
#restoration-type-section .v-card .invalid-divider { | ||
.invalid-divider { | ||
border-left: 3px solid $BCgovInputError !important; | ||
// adjust left padding (was originally px-5) | ||
padding-left: calc(20px - 3px) !important; | ||
} | ||
</style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This div (and class) double-wrapped the sub-component, so wasn't needed.