generated from bcgov/bcrs-template-ui
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
24657 - Notice of Withdrawal filing (#707)
* added the new component and filing type Signed-off-by: Qin <[email protected]> * bold note in the certify text Signed-off-by: Qin <[email protected]> * add the POA component Signed-off-by: Qin <[email protected]> * add the Ref Number component Signed-off-by: Qin <[email protected]> * add the staff payment section Signed-off-by: Qin <[email protected]> * update save and submit format Signed-off-by: Qin <[email protected]> * add the staff payment section 2 Signed-off-by: Qin <[email protected]> * fix the logic Signed-off-by: Qin <[email protected]> * update enum Signed-off-by: Qin <[email protected]> * fix lint Signed-off-by: Qin <[email protected]> * add unit tests Signed-off-by: Qin <[email protected]> * update enum 2 Signed-off-by: Qin <[email protected]> * fix staff payment logic Signed-off-by: Qin <[email protected]> * fix ref number logic Signed-off-by: Qin <[email protected]> * fix typo, remove inneeded Signed-off-by: Qin <[email protected]> * add staff role check Signed-off-by: Qin <[email protected]> * refine 2 new components Signed-off-by: Qin <[email protected]> * rename styles Signed-off-by: Qin <[email protected]> * add some unit tests Signed-off-by: Qin <[email protected]> * update POA section - finished Signed-off-by: Qin <[email protected]> * adjust lint Signed-off-by: Qin <[email protected]> * use date mixin, fix some notes Signed-off-by: Qin <[email protected]> * adjust label font Signed-off-by: Qin <[email protected]> * adjust label font 2 Signed-off-by: Qin <[email protected]> * add the staff role error dialog Signed-off-by: Qin <[email protected]> * add some unit tests Signed-off-by: Qin <[email protected]> * move staff role error dialog Signed-off-by: Qin <[email protected]> * change the url route format Signed-off-by: Qin <[email protected]> * update unit tests 1 Signed-off-by: Qin <[email protected]> * update filing id type Signed-off-by: Qin <[email protected]> * update emit method in Refe Number file Signed-off-by: Qin <[email protected]> * update court order section Signed-off-by: Qin <[email protected]> * update unit tests 2 Signed-off-by: Qin <[email protected]> * change filing id to string Signed-off-by: Qin <[email protected]> * change Emit format Signed-off-by: Qin <[email protected]> * update version Signed-off-by: Qin <[email protected]> * update space Signed-off-by: Qin <[email protected]> * update filing json, poa logic Signed-off-by: Qin <[email protected]> * correct filing name Signed-off-by: Qin <[email protected]> * remove reference number section Signed-off-by: Qin <[email protected]> --------- Signed-off-by: Qin <[email protected]>
- Loading branch information
Showing
21 changed files
with
1,682 additions
and
37 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
212 changes: 212 additions & 0 deletions
212
src/components/NoticeOfWithdrawal/PlanOfArrangement.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,212 @@ | ||
<template> | ||
<div id="withdrawal-poa"> | ||
<v-row no-gutters> | ||
<v-col | ||
cols="12" | ||
sm="3" | ||
class="pr-4" | ||
> | ||
<label | ||
id="court-order-label" | ||
:class="{'error-text': invalidSection}" | ||
>Court Order Number</label> | ||
</v-col> | ||
<v-col | ||
cols="12" | ||
:sm="9" | ||
> | ||
<p class="grey-text"> | ||
Provide a court order number if this record is part of a court order or a plan of arrangement. | ||
</p> | ||
<v-form | ||
id="court-num-form" | ||
ref="courtNumRef" | ||
v-model="valid" | ||
> | ||
<v-text-field | ||
id="court-order-number-input" | ||
v-model="courtOrderNumber" | ||
label="Court Order Number" | ||
:rules="courtOrderNumRules" | ||
filled | ||
/> | ||
</v-form> | ||
</v-col> | ||
</v-row> | ||
<v-row no-gutters> | ||
<v-col | ||
cols="12" | ||
sm="3" | ||
class="pr-4" | ||
> | ||
<label id="poa-label">Plan of Arrangement</label> | ||
</v-col> | ||
<v-col | ||
cols="12" | ||
:sm="9" | ||
> | ||
<p class="grey-text"> | ||
If you want to withdraw a record that is part of a plan of arrangement, | ||
you must withdraw all records related to the arrangement. | ||
This must be done before any of the terms of the arrangement take effect. | ||
</p> | ||
<v-checkbox | ||
id="plan-of-arrangement-checkbox" | ||
v-model="planOfArrangement" | ||
class="mt-0 pt-0" | ||
hide-details | ||
label="The record to be withdrawn was filed as part of an arrangement." | ||
/> | ||
</v-col> | ||
</v-row> | ||
<v-row | ||
no-gutters | ||
class="pt-4" | ||
> | ||
<v-col | ||
cols="12" | ||
sm="3" | ||
class="pr-4" | ||
/> | ||
<v-col | ||
cols="12" | ||
:sm="9" | ||
> | ||
<v-checkbox | ||
id="come-into-effect-checkbox" | ||
v-model="comeIntoEffect" | ||
class="mt-0 pt-0" | ||
hide-details | ||
label="One or more of the provisions of the arrangement have come into effect." | ||
:disabled="!planOfArrangement" | ||
/> | ||
</v-col> | ||
</v-row> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue from 'vue' | ||
import { Component, Emit, Prop, Watch } from 'vue-property-decorator' | ||
import { FormIF } from '@bcrs-shared-components/interfaces' | ||
@Component({}) | ||
export default class PlanOfArrangement extends Vue { | ||
// Refs | ||
$refs!: Vue['$refs'] & { | ||
courtNumRef: FormIF | ||
} | ||
/** Draft court order number. */ | ||
@Prop({ default: '' }) readonly draftCourtOrderNumber!: string | ||
/** Draft plan of arrangement. */ | ||
@Prop({ default: false }) readonly hasDraftPlanOfArrangement!: boolean | ||
/** Draft come into effect. */ | ||
@Prop({ default: false }) readonly hasDraftComeIntoEffect!: boolean | ||
/** Prompt Error. */ | ||
@Prop({ default: false }) readonly invalidSection!: boolean | ||
// Local properties | ||
private courtOrderNumber = '' | ||
private courtOrderNumRules = [] | ||
private planOfArrangement = false | ||
private comeIntoEffect = false | ||
private valid = false | ||
/** Called when component is mounted. */ | ||
mounted (): void { | ||
// Set default draft values if they exist | ||
if (this.draftCourtOrderNumber) this.courtOrderNumber = this.draftCourtOrderNumber | ||
if (this.hasDraftPlanOfArrangement) this.planOfArrangement = this.hasDraftPlanOfArrangement | ||
if (this.hasDraftComeIntoEffect) this.comeIntoEffect = this.hasDraftComeIntoEffect | ||
} | ||
/** Clear rules and reset validations. */ | ||
private clearValidations (): void { | ||
this.courtOrderNumRules = [] | ||
this.$refs.courtNumRef.resetValidation() | ||
} | ||
/** Triggers the form validation. */ | ||
public validate (): boolean { | ||
return this.$refs.courtNumRef.validate() | ||
} | ||
@Watch('planOfArrangement') | ||
@Watch('courtOrderNumber') | ||
@Watch('courtOrderNumberRequired') | ||
validateCourtNum (): void { | ||
// Apply TextField rules | ||
this.courtOrderNumRules = [ | ||
(v: string) => (!v || !/^\s/g.test(v)) || 'Invalid spaces', // leading spaces | ||
(v: string) => (!v || !/\s$/g.test(v)) || 'Invalid spaces', // trailing spaces | ||
(v: string) => (!v || !(v.length < 5)) || 'Court order number is invalid', // too short | ||
(v: string) => (!v || !(v.length > 20)) || 'Court order number is invalid' // too long | ||
] | ||
if (this.planOfArrangement) { | ||
this.courtOrderNumRules.push((v: string) => !!v || 'A Court Order number is required') | ||
} | ||
this.$refs.courtNumRef.validate() | ||
} | ||
@Watch('planOfArrangement') | ||
private onPlanOfArrangementChange (newVal: boolean): void { | ||
// If planOfArrangement is false, reset comeIntoEffect to false | ||
if (!newVal) { | ||
this.comeIntoEffect = false | ||
} | ||
} | ||
/** Emit court order number. */ | ||
@Watch('courtOrderNumber') | ||
@Emit('courtNumber') | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
emitCourtNumber (courtNumber: string): void {} | ||
/** Emit plan of arrangement. */ | ||
@Watch('planOfArrangement') | ||
@Emit('planOfArrangement') | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
emitPoa (planOfArrangement: boolean): void {} | ||
/** Emit come into effect. */ | ||
@Watch('comeIntoEffect') | ||
@Emit('comeIntoEffect') | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
emitEffect (planOfArrangement: boolean): void {} | ||
/** Emit valid. */ | ||
@Watch('valid') | ||
@Emit('valid') | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
private emitValid (valid: boolean): void {} | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
@import '@/assets/styles/theme.scss'; | ||
#poa-label, #court-order-label { | ||
font-weight: bold; | ||
color: $gray9; | ||
} | ||
:deep() { | ||
.v-card__actions { | ||
justify-content: flex-end; | ||
} | ||
.v-input .v-label { | ||
font-weight: normal; | ||
color: $gray7; | ||
} | ||
.theme--light.v-input input { | ||
font-weight: normal; | ||
color: $gray7; | ||
} | ||
} | ||
</style> |
106 changes: 106 additions & 0 deletions
106
src/components/NoticeOfWithdrawal/RecordToBeWithdrawn.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<template> | ||
<VcardTemplate id="record-to-be-withdrawn"> | ||
<template #icon> | ||
mdi-file-document-outline | ||
</template> | ||
|
||
<template #title> | ||
Record to be Withdrawn | ||
</template> | ||
|
||
<template #content> | ||
<v-row | ||
no-gutters | ||
class="px-6 py-6" | ||
> | ||
<v-col | ||
cols="12" | ||
sm="3" | ||
class="pr-4" | ||
> | ||
<strong>Filing Type</strong> | ||
</v-col> | ||
<v-col | ||
id="withdrawal-filing-type" | ||
cols="12" | ||
sm="9" | ||
> | ||
{{ getFilingToBeWithdrawn().displayName }} | ||
</v-col> | ||
</v-row> | ||
|
||
<v-row | ||
no-gutters | ||
class="px-6 py-6" | ||
> | ||
<v-col | ||
cols="12" | ||
sm="3" | ||
> | ||
<strong>Filing Number</strong> | ||
</v-col> | ||
<v-col | ||
id="withdrawal-filing-number" | ||
cols="12" | ||
sm="9" | ||
> | ||
{{ filingToBeWithdrawn }} | ||
</v-col> | ||
</v-row> | ||
|
||
<v-row | ||
no-gutters | ||
class="px-6 py-6" | ||
> | ||
<v-col | ||
cols="12" | ||
sm="3" | ||
> | ||
<strong>Effective Date and Time</strong> | ||
</v-col> | ||
<v-col | ||
id="withdrawal-filing-date" | ||
cols="12" | ||
sm="9" | ||
> | ||
{{ getFormattedFilingDate() }} | ||
</v-col> | ||
</v-row> | ||
</template> | ||
</VcardTemplate> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { Component, Prop, Mixins } from 'vue-property-decorator' | ||
import { DateMixin } from '@/mixins' | ||
import { Getter } from 'pinia-class' | ||
import { VcardTemplate } from '@/components/common' | ||
import { ApiFilingIF } from '@/interfaces' | ||
import { useFilingHistoryListStore } from '@/stores/filingHistoryListStore' | ||
@Component({ | ||
components: { | ||
VcardTemplate | ||
} | ||
}) | ||
export default class RecordToBeWithdrawn extends Mixins(DateMixin) { | ||
@Prop({ required: true }) readonly filingToBeWithdrawn!: string | ||
@Getter(useFilingHistoryListStore) getFilings!: Array<ApiFilingIF> | ||
getFilingToBeWithdrawn (): ApiFilingIF | null { | ||
const filingId = Number(this.filingToBeWithdrawn) | ||
const filings = this.getFilings as ApiFilingIF[] | ||
return filings.find(filing => filing.filingId === filingId) || null | ||
} | ||
getFormattedFilingDate (): string { | ||
const effectiveDate = this.getFilingToBeWithdrawn()?.effectiveDate | ||
if (effectiveDate) { | ||
const date = new Date(effectiveDate) | ||
return `${this.dateToPacificDateTime(date)}` | ||
} | ||
return 'Invalid date' | ||
} | ||
} | ||
</script> |
Oops, something went wrong.