Skip to content

Commit

Permalink
add the POA component
Browse files Browse the repository at this point in the history
Signed-off-by: Qin <[email protected]>
  • Loading branch information
ArwenQin committed Dec 5, 2024
1 parent 6ff8788 commit 625165f
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 35 deletions.
135 changes: 135 additions & 0 deletions src/components/NoticeOfWithdraw/PlanOfArrangement.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<template>
<div id="withdrawal-poa">
<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"
>
<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'
@Component({})
export default class PlanOfArrangement extends Vue {
/** Prompt the validations. Used for global validations. */
@Prop({ default: false }) readonly autoValidation!: boolean
/** Draft plan of arrangement. */
@Prop({ default: false }) readonly hasDraftPlanOfArrangement!: boolean
/** Draft come into effect. */
@Prop({ default: false }) readonly hasComeIntoEffect!: boolean
/** Prompt Error. */
@Prop({ default: false }) readonly invalidSection!: boolean
// Local properties
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.hasDraftPlanOfArrangement) this.planOfArrangement = this.hasDraftPlanOfArrangement
if (this.hasComeIntoEffect) this.comeIntoEffect = this.hasComeIntoEffect
}
@Watch('planOfArrangement')
private onPlanOfArrangementChange (newVal: boolean): void {
// If planOfArrangement is false, reset comeIntoEffect to false
if (!newVal) {
this.comeIntoEffect = false
}
}
/** Emit plan of arrangement. */
@Watch('planOfArrangement')
@Emit('emitPoa')
private emitPoa (): boolean {
return this.planOfArrangement
}
/** Emit come into effect. */
@Watch('comeIntoEffect')
@Emit('emitEffect')
private emitEffect (): boolean {
return this.comeIntoEffect
}
@Watch('valid')
@Emit('emitValid')
private emitValid (): boolean {
return this.valid
}
}
</script>

<style lang="scss" scoped>
@import '@/assets/styles/theme.scss';
#court-order-label,
#poa-label {
font-size: $px-16;
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>
Empty file.
2 changes: 1 addition & 1 deletion src/components/common/Certify.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<strong>Date:</strong> {{ formattedCurrentDate || '[unknown]' }}
</p>
<p class="certify-clause">
<strong>Note:</strong> {{ message }}
<strong v-if="message">Note:</strong> {{ message }}
</p>
</v-col>
</v-row>
Expand Down
49 changes: 15 additions & 34 deletions src/views/NoticeOfWithdrawal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,31 +137,30 @@
</div>
</section>

<!-- Court Order and Plan of Arrangement -->
<section v-if="isRoleStaff">
<!-- Withdrawal of Arrangement Records -->
<section>
<header>
<h2>Court Order and Plan of Arrangement</h2>
<h2>Withdrawal of Arrangement Records</h2>
<p class="grey-text">
If this filing is pursuant to a court order, enter the court order number. If this filing is pursuant
to a plan of arrangement, enter the court order number and select Plan of Arrangement.
Indicate if the record to be withdrawn is pursuant to a plan of arrangement and
if one or more of the provisions of the arrangement have come into effect.
</p>
</header>
<div
id="court-order-section"
:class="{ 'invalid-section': !courtOrderValid && showErrors }"
:class="{ 'invalid-section': showErrors }"
>
<v-card
flat
class="py-8 px-5"
>
<CourtOrderPoa
<PlanOfArrangement
:autoValidation="showErrors"
:courtOrderNumberRequired="false"
:draftCourtOrderNumber="fileNumber"
:hasDraftPlanOfArrangement="hasPlanOfArrangement"
@emitCourtNumber="fileNumber=$event"
:hasDraftComeIntoEffect="hasComeIntoEffect"
:hasComeIntoEffect="hasComeIntoEffect"
@emitPoa="hasPlanOfArrangement=$event"
@emitValid="courtOrderValid=$event"
@emitEffect="hasComeIntoEffect=$event"
/>
</v-card>
</div>
Expand Down Expand Up @@ -271,15 +270,15 @@ import { EnumUtilities, LegalServices } from '@/services/'
import { EffectOfOrderTypes, FilingStatus, SaveErrorReasons } from '@/enums'
import { FilingCodes, FilingTypes, StaffPaymentOptions } from '@bcrs-shared-components/enums'
import { ConfirmDialogType, StaffPaymentIF } from '@/interfaces'
import { CourtOrderPoa } from '@bcrs-shared-components/court-order-poa'
import PlanOfArrangement from '@/components/NoticeOfWithdraw/PlanOfArrangement.vue'
import { DocumentDelivery } from '@bcrs-shared-components/document-delivery'
import { useBusinessStore, useConfigurationStore, useRootStore } from '@/stores'
@Component({
components: {
Certify,
ConfirmDialog,
CourtOrderPoa,
PlanOfArrangement,
DocumentDelivery,
ForeignJurisdiction,
PaymentErrorDialog,
Expand Down Expand Up @@ -313,17 +312,9 @@ export default class NoticeOfWithdrawal extends Mixins(CommonMixin, DateMixin, F
isCertified = false
certifyFormValid = false
// variables for Courder Order POA component
fileNumber = ''
// variables for POA component
hasPlanOfArrangement = false
courtOrderValid = true
// variables for Foreign Jurisdiction component
draftCountry = ''
draftRegion = ''
selectedCountry = ''
selectedRegion = ''
foreignJurisdictionValid = false
hasComeIntoEffect = false
// variables for Document Delivery component
documentDeliveryValid = true
Expand Down Expand Up @@ -369,7 +360,6 @@ export default class NoticeOfWithdrawal extends Mixins(CommonMixin, DateMixin, F
get isPageValid (): boolean {
return (
this.certifyFormValid &&
this.foreignJurisdictionValid &&
this.documentDeliveryValid &&
this.courtOrderValid
)
Expand Down Expand Up @@ -495,12 +485,6 @@ export default class NoticeOfWithdrawal extends Mixins(CommonMixin, DateMixin, F
this.hasPlanOfArrangement = EnumUtilities.isEffectOfOrderPlanOfArrangement(courtOrder.effectOfOrder)
}
const foreignJurisdiction = filing.consentContinuationOut.foreignJurisdiction
if (foreignJurisdiction) {
this.draftCountry = foreignJurisdiction.country
this.draftRegion = foreignJurisdiction.region
}
if (filing.header.documentOptionalEmail) {
this.documentOptionalEmail = filing.header.documentOptionalEmail
}
Expand Down Expand Up @@ -746,8 +730,6 @@ export default class NoticeOfWithdrawal extends Mixins(CommonMixin, DateMixin, F
const data: any = {
consentContinuationOut: {
foreignJurisdiction: {
country: this.selectedCountry,
region: this.selectedRegion
}
}
}
Expand Down Expand Up @@ -882,7 +864,6 @@ export default class NoticeOfWithdrawal extends Mixins(CommonMixin, DateMixin, F
/** Object of valid flags. Must match validComponents. */
get validFlags (): object {
return {
foreignJurisdiction: this.foreignJurisdictionValid,
documentDelivery: this.documentDeliveryValid,
certifyForm: this.certifyFormValid,
courtOrder: this.courtOrderValid
Expand Down Expand Up @@ -912,7 +893,7 @@ export default class NoticeOfWithdrawal extends Mixins(CommonMixin, DateMixin, F
<style lang="scss" scoped>
@import '@/assets/styles/theme.scss';
#notice-of-withdraw {
#notice-of-withdrawal {
/* Set "header-counter" to 0 */
counter-reset: header-counter;
}
Expand Down

0 comments on commit 625165f

Please sign in to comment.