Skip to content

Commit

Permalink
Merge pull request #561 from bcgov/ccfri-3829-pdf-sections-collapsed
Browse files Browse the repository at this point in the history
Fix PDF expansion panels
  • Loading branch information
trev-dev authored Nov 4, 2024
2 parents 8177c82 + 1934d93 commit 0fe1665
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 29 deletions.
40 changes: 22 additions & 18 deletions frontend/src/components/SummaryDeclaration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<v-card-title class="rounded-t-lg pt-3 pb-3 card-title" style="color: #003466"> Summary </v-card-title>
</v-col>
</v-row>
<v-expansion-panels ref="v-expansion-panels" v-model="expand" multiple variant="accordion">
<v-expansion-panels v-model="expand" multiple variant="accordion">
<v-row v-if="isMainLoading">
<v-col>
<v-skeleton-loader
Expand All @@ -88,7 +88,7 @@
</v-row>
<v-row v-else no-gutters class="d-flex flex-column pb-2 pt-2">
<div v-if="!isRenewal">
<v-expansion-panel variant="accordion">
<v-expansion-panel variant="accordion" value="organization-summary">
<OrganizationSummary
:program-year="formattedProgramYear"
:summary-model="summaryModel"
Expand All @@ -107,7 +107,7 @@
/>

<div v-else>
<v-expansion-panel v-if="facility?.facilityInfo" variant="accordion">
<v-expansion-panel v-if="facility?.facilityInfo" variant="accordion" value="facility-information">
<FacilityInformationSummary
:facility-info="facility?.facilityInfo"
:funding="facility?.funding"
Expand All @@ -121,7 +121,7 @@
@is-summary-valid="isFormComplete"
/>
</v-expansion-panel>
<v-expansion-panel variant="accordion">
<v-expansion-panel variant="accordion" value="ccof-summary">
<div v-if="!facility.funding || isRenewal" />
<div v-else>
<CCOFSummaryFamily
Expand All @@ -141,7 +141,7 @@
/>
</div>
</v-expansion-panel>
<v-expansion-panel variant="accordion">
<v-expansion-panel variant="accordion" value="ccfri-summary">
<CCFRISummary
:ccfri="facility?.ccfri"
:facility-id="facility.facilityId"
Expand All @@ -150,7 +150,7 @@
@is-summary-valid="isFormComplete"
/>
</v-expansion-panel>
<v-expansion-panel v-if="facility?.rfiApp" variant="accordion">
<v-expansion-panel v-if="facility?.rfiApp" variant="accordion" value="rfi-summary">
<RFISummary
:rfi-app="facility?.rfiApp"
:ccfri-id="facility?.ccfri?.ccfriId"
Expand All @@ -160,7 +160,7 @@
@is-summary-valid="isFormComplete"
/>
</v-expansion-panel>
<v-expansion-panel v-if="facility?.nmfApp" variant="accordion">
<v-expansion-panel v-if="facility?.nmfApp" variant="accordion" value="nmf-summary">
<NMFSummary
:nmf-app="facility?.nmfApp"
:ccfri-id="facility?.ccfri?.ccfriId"
Expand All @@ -170,7 +170,7 @@
@is-summary-valid="isFormComplete"
/>
</v-expansion-panel>
<v-expansion-panel variant="accordion">
<v-expansion-panel variant="accordion" value="ecewe-summary-a">
<ECEWESummary
:ecewe="{}"
:ecewe-facility="facility.ecewe"
Expand All @@ -180,7 +180,7 @@
@is-summary-valid="isFormComplete"
/>
</v-expansion-panel>
<v-expansion-panel variant="accordion">
<v-expansion-panel variant="accordion" value="uploaded-documents-summary">
<UploadedDocumentsSummary
:documents="facility.documents"
:program-year-id="summaryModel?.application?.programYearId"
Expand All @@ -190,7 +190,7 @@
</div>
</div>
<div v-if="!isRenewal" class="mt-10">
<v-expansion-panel variant="accordion">
<v-expansion-panel variant="accordion" value="ecewe-summary-b">
<ECEWESummary
:ecewe="summaryModel.ecewe"
:ecewe-facility="null"
Expand Down Expand Up @@ -242,7 +242,7 @@
I hereby confirm that the information I have provided in this application is complete and accurate. I
certify that I have read and understand the following requirements:
</p>
<ul style="padding-top: 10px">
<ul class="ml-5 pt-5">
<li>Each facility must be licensed under the Community Care and Assisted Living Act;</li>
<li>
Each facility must be in compliance with the Community Care and Assisted Living Act and Child Care
Expand Down Expand Up @@ -588,9 +588,6 @@ export default {
return facility.facilityInfo.facilityAccountNumber;
});
},
numberOfPanelsToExpand() {
return this.$refs['v-expansion-panels']?.$children.length;
},
hasChangeNotificationFormDocuments() {
return this.summaryModel?.changeRequestTypes?.includes(CHANGE_REQUEST_TYPES.PDF_CHANGE);
},
Expand All @@ -611,7 +608,6 @@ export default {
handler: function (val) {
if (val) {
setTimeout(() => {
console.log(this.$refs['v-expansion-panels']);
const keys = Object.keys(this.payload);
console.log('calling after 1 second');
//If this is a change request, we'll have 2 items in the payload.
Expand Down Expand Up @@ -817,9 +813,17 @@ export default {
this.updateNavBarStatus(formObj, isComplete);
},
expandAllPanels() {
for (let i = 0; i < this.numberOfPanelsToExpand; i++) {
this.expand.push(i);
}
this.expand = [
'organization-summary',
'facility-information',
'ccof-summary',
'ccfri-summary',
'rfi-summary',
'nmf-summary',
'ecewe-summary-a',
'ecewe-summary-b',
'uploaded-documents-summary',
];
},
updateNavBarStatus(formObj, isComplete) {
if (formObj && !this.isReadOnly) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
</v-row>
<div v-else>
<v-expansion-panels
ref="v-expansion-panels"
v-model="expand"
class="mt-6 rounded facility-info"
focusable
Expand All @@ -82,7 +81,12 @@
>
<v-row no-gutters class="d-flex flex-column mb-2">
<!-- Change Notification Form Summary -->
<v-expansion-panel v-if="hasChangeRequestType('PDF_CHANGE')" variant="accordion" class="mb-8 mt-8">
<v-expansion-panel
v-if="hasChangeRequestType('PDF_CHANGE')"
variant="accordion"
class="mb-8 mt-8"
value="change-notification-form-summary"
>
<ChangeNotificationFormSummary
:change-notification-form-documents="summaryModel?.changeNotificationFormDocuments"
@is-summary-valid="isFormComplete"
Expand All @@ -98,7 +102,7 @@
type="paragraph, text@3, paragraph, text@3, paragraph"
/>
<div v-else>
<v-expansion-panel variant="accordion">
<v-expansion-panel variant="accordion" value="facility-name">
<v-row no-gutters class="d-flex pl-6 py-5">
<v-col class="col-6 col-lg-4">
<p class="summary-label">Facility Name</p>
Expand All @@ -120,7 +124,7 @@
</v-col>
</v-row>
</v-expansion-panel>
<v-expansion-panel variant="accordion">
<v-expansion-panel variant="accordion" value="mtfi-summary">
<MTFISummary
v-if="hasChangeRequestType('MTFI') && !isSummaryLoading[index]"
:old-ccfri="facility?.oldCcfri"
Expand All @@ -129,7 +133,11 @@
@is-summary-valid="isFormComplete"
/>
</v-expansion-panel>
<v-expansion-panel v-if="facility?.hasRfi && !isSummaryLoading[index]" variant="accordion">
<v-expansion-panel
v-if="facility?.hasRfi && !isSummaryLoading[index]"
variant="accordion"
value="rfi-summary"
>
<RFISummary
:rfi-app="facility?.rfiApp"
:ccfri-id="facility?.ccfriApplicationId"
Expand Down Expand Up @@ -429,9 +437,6 @@ export default {
const applicationList = Array.from(this.applicationMap?.values());
return isAnyApplicationUnlocked(applicationList);
},
numberOfPanelsToExpand() {
return this.$refs['v-expansion-panels']?.$children.length;
},
isSummaryComplete() {
if (this.hasChangeRequestType('MTFI') && this.summaryModel?.mtfiFacilities?.length === 0) return false;
return this.invalidSummaryForms.length < 1;
Expand Down Expand Up @@ -488,9 +493,7 @@ export default {
'setDeclarationModel',
]),
expandAllPanels() {
for (let i = 0; i < this.numberOfPanelsToExpand; i++) {
this.expand.push(i);
}
this.expand = ['change-notification-form-summary', 'facility-name', 'mtfi-summary', 'rfi-summary'];
},
isPageComplete() {
if (this.model.agreeConsentCertify && this.model.orgContactName && this.isSummaryComplete) {
Expand Down

0 comments on commit 0fe1665

Please sign in to comment.