Skip to content

Commit

Permalink
Merge pull request #538 from bcgov/viet-vue-3-upgrade-continue
Browse files Browse the repository at this point in the history
Viet Vue 3 upgrade fix continue
  • Loading branch information
vietle-cgi authored Oct 15, 2024
2 parents b7f5ca2 + c8eb97f commit 11cd167
Show file tree
Hide file tree
Showing 17 changed files with 792 additions and 848 deletions.
2 changes: 1 addition & 1 deletion backend/src/components/facility.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function mapCCFRIObjectForFront(data) {
async function getFacility(req, res) {
try {
//,_ccof_change_request_value
let operation = 'accounts('+req.params.facilityId+')?$select=ccof_accounttype,name,ccof_facilitystartdate,address1_line1,address1_city,address1_postalcode,ccof_position,emailaddress1,address1_primarycontactname,telephone1,ccof_facilitylicencenumber,ccof_licensestartdate,ccof_formcomplete,ccof_everreceivedfundingundertheccofprogram,ccof_facilityreceived_ccof_funding,accountnumber,ccof_facilitystatus'; //+ getMappingString(FacilityMappings);
let operation = 'accounts('+req.params.facilityId+')?$select=ccof_accounttype,name,ccof_facilitystartdate,address1_line1,address1_city,address1_stateorprovince,address1_postalcode,ccof_position,emailaddress1,address1_primarycontactname,telephone1,ccof_facilitylicencenumber,ccof_licensestartdate,ccof_formcomplete,ccof_everreceivedfundingundertheccofprogram,ccof_facilityreceived_ccof_funding,accountnumber,ccof_facilitystatus'; //+ getMappingString(FacilityMappings);
log.info('operation: ', operation);
let facility = await getOperation(operation);

Expand Down
3 changes: 3 additions & 0 deletions backend/src/util/mapping/Mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ const OrganizationMappings = [
{ back: 'name', front: 'legalName' },
{ back: 'address1_name', front: 'address1' }, //Address
{ back: 'address1_city', front: 'city1' },
{ back: 'address1_stateorprovince', front: 'province1' },
{ back: 'address1_postalcode', front: 'postalCode1' },
{ back: 'address2_name', front: 'address2' }, //Mailing Address
{ back: 'address2_city', front: 'city2' },
{ back: 'address2_stateorprovince', front: 'province2' },
{ back: 'address2_postalcode', front: 'postalCode2' },
{ back: 'address1_primarycontactname', front: 'contactName' },
{ back: 'ccof_position', front: 'position' },
Expand All @@ -28,6 +30,7 @@ const FacilityMappings = [
{ back: 'ccof_facilitystartdate', front: 'yearBeganOperation' },
{ back: 'address1_line1', front: 'facilityAddress' },
{ back: 'address1_city', front: 'city' },
{ back: 'address1_stateorprovince', front: 'province' },
{ back: 'address1_postalcode', front: 'postalCode' },
{ back: 'ccof_position', front: 'position' },
{ back: 'emailaddress1', front: 'email' },
Expand Down
14 changes: 7 additions & 7 deletions frontend/src/components/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
<p class="pt-4">
<strong>NOTE:</strong> The information collected through My ChildCareBC Services is collected under the
authority of the <i>Freedom of Information and Protection of Privacy Act</i> (FOIPPA) and the
<i>Child Care BC Act</i> (SBC 2001, c. 4) and will be used for the purpose of administering the Child Care
Operating Funding Program, which includes the Child Care Fee Reduction Initiative and the Early Childhood
Educator (ECE) Wage Enhancement for successfully enrolled applicants. Personal information is protected from
unauthorized use and disclosure in accordance with FOIPPA. Any questions or concerns about the collection of
this information can be directed to the Director, Child Care Operating Funding Program, PO Box 9965 Stn Prov
Govt, Victoria BC V8W 9R4, Phone: in Greater Victoria: 250 356-6501, outside of Greater Victoria, Toll Free: 1
888 338-6622 (option 2).
<i>Early Learning and Child Care Act</i> (SBC 2001, c. 4) and will be used for the purpose of administering
the Child Care Operating Funding Program, which includes the Child Care Fee Reduction Initiative and the Early
Childhood Educator (ECE) Wage Enhancement for successfully enrolled applicants. Personal information is
protected from unauthorized use and disclosure in accordance with FOIPPA. Any questions or concerns about the
collection of this information can be directed to the Director, Child Care Operating Funding Program, PO Box
9965 Stn Prov Govt, Victoria BC V8W 9R4, Phone: in Greater Victoria: 250 356-6501, outside of Greater
Victoria, Toll Free: 1 888 338-6622 (option 2).
</p>
<v-row>
<v-col class="xs-12 lg-4 xl-2">
Expand Down
48 changes: 18 additions & 30 deletions frontend/src/components/SummaryDeclaration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,28 +64,16 @@
<v-row v-if="!isSomeChangeRequestActive()" class="d-flex justify-center text-h5" style="color: #003466">
To submit your application, review this summary of your information and scroll down to sign the declaration.
</v-row>
<v-row v-if="!isSummaryComplete && !isProcessing" justify="center">
<v-card class="py-0 px-3 mx-0 mt-10 rounded-lg col-11" elevation="4">
<v-container class="pa-0 col-12">
<v-row>
<v-col class="pa-0">
<v-card-title class="rounded-t-lg pt-3 pb-3 noticeAlert">
<v-icon size="x-large" class="py-1 px-3 noticeAlertIcon"> mdi-alert-octagon </v-icon>
Incomplete Form
</v-card-title>
</v-col>
</v-row>
<v-row>
<v-col class="pb-0 pr-3 justify-center">
<div>
<p>You will not be able to submit your application until it is complete.</p>
<p>Incomplete sections are marked with a red exclamation point.</p>
</div>
</v-col>
</v-row>
</v-container>
</v-card>
</v-row>
<v-card v-if="!isSummaryComplete && !isProcessing" elevation="4">
<v-card-title class="rounded-t-lg pt-3 pb-3 noticeAlert">
<v-icon size="x-large" class="py-1 px-3 noticeAlertIcon"> mdi-alert-octagon </v-icon>
Incomplete Form
</v-card-title>
<div class="pa-4">
<p>You will not be able to submit your application until it is complete.</p>
<p>Incomplete sections are marked with a red exclamation point.</p>
</div>
</v-card>
<div>
<v-row class="d-flex justify-center">
<v-card class="py-0 px-3 mx-0 mt-10 rounded-lg col-11" elevation="4">
Expand Down Expand Up @@ -238,7 +226,7 @@
>
Funding Agreement Number: {{ getFundingAgreementNumber }}
</v-row>
<v-row justify="center">
<v-row justify="center" class="ma-8 pb-12">
<v-card class="py-0 px-3 mx-0 mt-10 rounded-lg col-11" elevation="4">
<v-row>
<v-col class="pa-0">
Expand All @@ -254,7 +242,7 @@
/>
</v-col>
</v-row>
<v-row v-if="!isProcessing">
<v-row v-if="!isProcessing" class="px-8">
<v-col class="pb-0">
<div v-show="!isRenewal && !organizationAccountNumber && !isChangeRequest">
<p>
Expand Down Expand Up @@ -283,10 +271,10 @@
</ul>
<p style="padding-top: 10px">
Intentionally supplying information that is false or misleading with respect to a material fact in
order to obtain a child care grant may lead to action being taken under Section 9 of the Child Care BC
Act. If you are convicted of an offence under section 9, a court may order you imprisoned for up to
six months, fine you not more than $2,000.00, or order you to pay the government all or part of any
amount received under the child care grant.
order to obtain a child care grant may lead to action being taken under Section 9 of the Early
Learning and Child Care Act. If you are convicted of an offence under section 9, a court may order you
imprisoned for up to six months, fine you not more than $2,000.00, or order you to pay the government
all or part of any amount received under the child care grant.
</p>
</div>
<!-- show for new org after ministry unlocks -->
Expand Down Expand Up @@ -335,8 +323,8 @@
understand and acknowledge that providing false or misleading information either on the Form or
otherwise to the Province to obtain any funding under the Funding Agreement or otherwise failing to
comply with the Funding Agreement could result in certain penalties or repayment obligations, or
both, under any or all of the Child Care BC Act, any successor legislation, or the Funding
Agreement;
both, under any or all of the Early Learning and Child Care Act, any successor legislation, or the
Funding Agreement;
</li>
<li>
If I have applied for and been approved by the Province to enroll in the ECE Wage Enhancement, the
Expand Down
131 changes: 59 additions & 72 deletions frontend/src/components/SupportingDocumentUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,47 +23,35 @@
<v-data-table
v-if="!isLoading"
:headers="headers"
:items="uploadedDocuments"
:items="uploadedSupportingDocuments"
class="elevation-1"
hide-default-header
hide-default-footer
:items-per-page="-1"
>
<template #top>
<v-col flex>
<v-toolbar flat color="white">
<div class="d-flex">
<v-btn
color="primary"
class="ml-2 text-white v-skeleton-loader-small-button"
:disabled="isLocked"
@click="addNew"
>
<v-icon theme="dark"> mdi-plus </v-icon>
Add
</v-btn>
</div>
</v-toolbar>
</v-col>
<div class="ma-4 d-flex">
<v-btn color="primary" class="ml-2" :disabled="isLocked" @click="addNew">
<v-icon>mdi-plus</v-icon>
Add
</v-btn>
</div>
</template>

<template #item.facilityName="{ item }">
<v-col flex>
<div v-if="item?.annotationid">
<span> {{ item?.ccof_facility_name }} </span>
</div>
<v-select
v-else
v-model="item.selectFacility"
:items="facilityNames"
item-title="facilityName"
placeholder="Select a facility"
return-object
class="drop-down-select"
required
:rules="selectRules"
/>
</v-col>
<div v-if="item?.annotationid">
<span> {{ item?.ccof_facility_name }} </span>
</div>
<v-select
v-else
v-model="item.selectFacility"
:items="facilityNames"
item-title="facilityName"
placeholder="Select a facility"
return-object
class="drop-down-select"
:rules="selectRules"
/>
</template>

<template #item.document="{ item }">
Expand All @@ -73,16 +61,11 @@
<v-file-input
v-else
:id="String(item.id)"
color="#003366"
:rules="fileRules"
prepend-icon="mdi-file-upload"
:clearable="false"
class="pt-0"
:accept="fileAccept"
:disabled="false"
placeholder="Select your file"
:error-messages="fileInputError"
required
@click:clear="deleteItem(item)"
@change="selectFile"
/>
Expand Down Expand Up @@ -218,37 +201,33 @@ export default {
facilityNames: [],
model: {},
tempFacilityId: null,
isValidForm: false,
isValidForm: true,
currentrow: null,
otherChanges: null,
headers: [
{
text: 'Facility Name',
align: 'left',
sortable: false,
title: 'Facility Name',
value: 'facilityName',
class: 'table-header',
width: '35%',
sortable: false,
},
{
text: 'Document',
align: 'left',
sortable: false,
title: 'Document',
value: 'document',
class: 'table-header',
width: '25%',
sortable: false,
},
{
text: 'Description',
align: 'left',
sortable: false,
title: 'Description',
value: 'description',
class: 'table-header',
width: '35%',
sortable: false,
},
{
text: 'Actions',
align: 'left',
title: 'Actions',
sortable: false,
width: '5%',
value: 'actions',
class: 'table-header',
},
],
fileAccept: [
Expand All @@ -267,10 +246,9 @@ export default {
],
fileExtensionAccept: ['pdf', 'png', 'jpg', 'jpeg', 'heic', 'doc', 'docx', 'xls', 'xlsx'],
fileFormats: 'PDF, JPEG, JPG, PNG, HEIC, DOC, DOCX, XLS and XLSX',
fileInputError: [],
fileMap: new Map(),
fileRules: [],
uploadedDocuments: [],
uploadedSupportingDocuments: [],
editedIndex: -1,
editedItem: {
selectFacility: '',
Expand Down Expand Up @@ -323,8 +301,10 @@ export default {
return false;
},
isSaveDisabled() {
const newFilesAdded = this.uploadedDocuments.filter((el) => !!el.id);
return this.isValidForm && (newFilesAdded.length > 0 || this.uploadedDocuments?.deletedItems?.length > 0);
const newFilesAdded = this.uploadedSupportingDocuments.filter((el) => !!el.id);
return (
this.isValidForm && (newFilesAdded.length > 0 || this.uploadedSupportingDocuments?.deletedItems?.length > 0)
);
},
isNextEnabled() {
if (this.isChangeRequest) return this.isValidForm;
Expand Down Expand Up @@ -444,7 +424,7 @@ export default {
this.isProcessing = true;
try {
await this.processDocumentFileDelete();
const newFilesAdded = this.uploadedDocuments.filter((el) => !!el.id);
const newFilesAdded = this.uploadedSupportingDocuments.filter((el) => !!el.id);
if (newFilesAdded.length > 0) {
await this.processDocumentFilesSave(newFilesAdded);
this.fileMap?.clear();
Expand Down Expand Up @@ -480,8 +460,8 @@ export default {
}
},
async processDocumentFileDelete() {
if (this.uploadedDocuments?.deletedItems?.length > 0) {
await this.deleteDocuments(this.uploadedDocuments.deletedItems);
if (this.uploadedSupportingDocuments?.deletedItems?.length > 0) {
await this.deleteDocuments(this.uploadedSupportingDocuments.deletedItems);
}
},
async selectFile(event) {
Expand All @@ -495,7 +475,7 @@ export default {
readFile(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsBinaryString(file);
reader.readAsArrayBuffer(file);
reader.onload = () => {
const doc = {
filename: getFileNameWithMaxNameLength(file.name),
Expand All @@ -521,7 +501,7 @@ export default {
this.isLoading = true;
try {
await this.getDocuments(this.applicationId);
this.uploadedDocuments = this.uploadedDocuments.filter(
this.uploadedSupportingDocuments = this.uploadedDocuments.filter(
(document) => this.navBarList.findIndex((item) => item.facilityId == document.ccof_facility) > -1,
);
} catch (e) {
Expand All @@ -532,35 +512,35 @@ export default {
}
},
editItem(item) {
this.editedIndex = this.uploadedDocuments.indexOf(item);
this.editedIndex = this.uploadedSupportingDocuments.indexOf(item);
this.editedItem = Object.assign({}, item);
},
deleteItem(item) {
const index = this.uploadedDocuments.indexOf(item);
const index = this.uploadedSupportingDocuments.indexOf(item);
if (item.annotationid) {
let deletedItems = this.uploadedDocuments['deletedItems'];
let deletedItems = this.uploadedSupportingDocuments['deletedItems'];
if (deletedItems?.length > 0) {
deletedItems.push(item.annotationid);
this.uploadedDocuments['deletedItems'] = deletedItems;
this.uploadedSupportingDocuments['deletedItems'] = deletedItems;
} else {
deletedItems = [];
deletedItems.push(item.annotationid);
this.uploadedDocuments['deletedItems'] = deletedItems;
this.uploadedSupportingDocuments['deletedItems'] = deletedItems;
}
}
this.uploadedDocuments.splice(index, 1);
this.uploadedSupportingDocuments.splice(index, 1);
},
addNew() {
const addObj = Object.assign({}, this.defaultItem);
addObj.id = Math.random() * 10;
//addObj.id = this.uploadedDocuments.length + 1;
this.uploadedDocuments.unshift(addObj);
//addObj.id = this.uploadedSupportingDocuments.length + 1;
this.uploadedSupportingDocuments.unshift(addObj);
this.editItem(addObj);
},
updateDescription(item) {
const index = this.uploadedDocuments.indexOf(item);
this.uploadedDocuments[index].description = item.description;
const index = this.uploadedSupportingDocuments.indexOf(item);
this.uploadedSupportingDocuments[index].description = item.description;
},
async mapFacilityData() {
for (let facilityInfo of this.navBarList) {
Expand All @@ -584,4 +564,11 @@ export default {
overflow: hidden;
text-overflow: ellipsis;
}
:deep(.v-field__input) {
overflow: hidden;
text-overflow: ellipsis;
}
:deep(.v-select__selection) {
padding-left: 12px;
}
</style>
Loading

0 comments on commit 11cd167

Please sign in to comment.