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

15538 Fixed restoration type layout and validation issues #735

Merged
merged 2 commits into from
Sep 25, 2024
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
54 changes: 44 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "business-create-ui",
"version": "5.11.19",
"version": "5.11.20",
"private": true,
"appName": "Create UI",
"sbcName": "SBC Common Components",
Expand All @@ -14,7 +14,7 @@
},
"dependencies": {
"@babel/compat-data": "^7.21.5",
"@bcrs-shared-components/approval-type": "1.0.19",
"@bcrs-shared-components/approval-type": "1.1.2",
"@bcrs-shared-components/base-address": "2.0.3",
"@bcrs-shared-components/breadcrumb": "2.1.15",
"@bcrs-shared-components/business-lookup": "1.3.4",
Expand Down
40 changes: 18 additions & 22 deletions src/components/Restoration/ApprovalType.vue
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
<template>
<div id="approval-type">
<div
class="section-container"
>
Copy link
Collaborator Author

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.

<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"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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'
Expand All @@ -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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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
Expand All @@ -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)
}
Expand Down
15 changes: 8 additions & 7 deletions src/components/Restoration/RestorationType.vue
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 }"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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
Expand Down Expand Up @@ -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'
Expand All @@ -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
Expand All @@ -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
Expand Down
31 changes: 11 additions & 20 deletions src/views/Restoration/RestorationBusinessName.vue
Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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>
Expand All @@ -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>

Check warning on line 37 in src/views/Restoration/RestorationBusinessName.vue

View workflow job for this annotation

GitHub Actions / linting (20.5.1)

Expected indentation of 8 spaces but found 10 spaces
</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>
Expand Down Expand Up @@ -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;
}
Copy link
Collaborator Author

@severinbeauvais severinbeauvais Sep 25, 2024

Choose a reason for hiding this comment

The 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>
Loading