Skip to content

Commit c59bfd4

Browse files
authored
Merge pull request #566 from bcgov/ccfri-3832-update-fiscal-year-label
ccfri-3832 - update fiscal year label
2 parents 70abbcb + f423837 commit c59bfd4

File tree

17 files changed

+137
-152
lines changed

17 files changed

+137
-152
lines changed

backend/src/components/message.js

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
'use strict';
2+
const { isEmpty } = require('lodash');
23
const { getOperation, patchOperationWithObjectId } = require('./utils');
34
const { MappableObjectForFront } = require('../util/mapping/MappableObject');
45
const { MessageMappings } = require('../util/mapping/Mappings');
@@ -13,33 +14,33 @@ function mapMessageObjectForFront(data) {
1314
return new MappableObjectForFront(data, MessageMappings).toJSON();
1415
}
1516

16-
function sortByPropertyDesc(property){
17-
return function(a,b){
18-
if(a[property] < b[property])
19-
return 1;
20-
else if(a[property] > b[property])
21-
return -1;
22-
return 0;
23-
}
17+
function sortByPropertyDesc(property) {
18+
return function (a, b) {
19+
if (a[property] < b[property]) return 1;
20+
else if (a[property] > b[property]) return -1;
21+
return 0;
22+
};
2423
}
2524

2625
async function getAllMessages(req, res) {
2726
try {
28-
let operation = 'emails?$select=activityid,createdon,description,lastopenedtime,ccof_program_year,_regardingobjectid_value,subject&$expand=regardingobjectid_account_email($select=accountid,accountnumber,name)&$filter=(regardingobjectid_account_email/accountid eq ' + req.params.organizationId + ' and statecode eq 1)';
27+
let operation =
28+
'emails?$select=activityid,createdon,description,lastopenedtime,ccof_program_year,_regardingobjectid_value,subject&$expand=regardingobjectid_account_email($select=accountid,accountnumber,name)&$filter=(regardingobjectid_account_email/accountid eq ' +
29+
req.params.organizationId +
30+
' and statecode eq 1)';
2931
log.info('operation: ', operation);
3032
let operationResponse = await getOperation(operation);
3133
operationResponse.value.sort(sortByPropertyDesc('createdon'));
3234
let allMessages = [];
33-
operationResponse.value.forEach(item => {
35+
operationResponse.value.forEach((item) => {
3436
let message = mapMessageObjectForFront(item);
35-
message.isRead = message.lastOpenedTime ? true : false;
36-
message.programYearValue = message.programYearValue?.replace(/[^\d/]/g, '');
37+
message.isRead = !isEmpty(message.lastOpenedTime);
3738
allMessages.push(message);
3839
});
3940
return res.status(HttpStatus.OK).json(allMessages);
4041
} catch (e) {
4142
log.error('failed with error', e);
42-
return res.status(HttpStatus.INTERNAL_SERVER_ERROR).json(e.data? e.data : e?.status );
43+
return res.status(HttpStatus.INTERNAL_SERVER_ERROR).json(e.data ? e.data : e?.status);
4344
}
4445
}
4546

@@ -48,12 +49,11 @@ async function updateMessageLastOpenedTime(req, res) {
4849
let response = await patchOperationWithObjectId('emails', req.params.messageId, req.body);
4950
return res.status(HttpStatus.OK).json(response);
5051
} catch (e) {
51-
return res.status(HttpStatus.INTERNAL_SERVER_ERROR).json(e.data? e.data : e?.status );
52+
return res.status(HttpStatus.INTERNAL_SERVER_ERROR).json(e.data ? e.data : e?.status);
5253
}
5354
}
5455

5556
module.exports = {
5657
getAllMessages,
57-
updateMessageLastOpenedTime
58+
updateMessageLastOpenedTime,
5859
};
59-

frontend/src/components/CcfriEstimator.vue

+13-13
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<v-icon size="x-large" class="py-1 noticeInfoIcon"> mdi-information </v-icon>
1919
</v-col>
2020
<v-col>
21-
Thank you for your patience while we update fees for the 2023/24 year. Please check back as updates
21+
Thank you for your patience while we update fees for the 2023-24 year. Please check back as updates
2222
occur daily or if you have questions about the fees a facility is approved for, call the contact
2323
centre at 1-888-338-6622 (Option 2).
2424
</v-col>
@@ -996,11 +996,11 @@ export default {
996996
},
997997
ageCategoryToolTip() {
998998
// eslint-disable-next-line
999-
return "Parents can ask their child care provider if they are unsure<br/>which age category to select.";
999+
return 'Parents can ask their child care provider if they are unsure<br/>which age category to select.';
10001000
},
10011001
feeFrequencyToolTip() {
10021002
// eslint-disable-next-line
1003-
return "Select whether parent fees are charged daily or monthly.";
1003+
return 'Select whether parent fees are charged daily or monthly.';
10041004
},
10051005
approvedFeeToolTip() {
10061006
if (this.isParent) {
@@ -1012,18 +1012,18 @@ export default {
10121012
actualParentFeeToolTip() {
10131013
if (this.isParent) {
10141014
// eslint-disable-next-line
1015-
return "Enter the parent fee before any reductions or<br>benefits are applied. Providers are required to give<br>parents this information in writing.<br><br>This fee may differ from the approved full-time<br>parent fee if it is a part-time fee, discounted fee, or<br>inclusive of optional fees. For example, the provider<br>may offer a reduced fee for families with other<br>siblings at the facility.";
1015+
return 'Enter the parent fee before any reductions or<br>benefits are applied. Providers are required to give<br>parents this information in writing.<br><br>This fee may differ from the approved full-time<br>parent fee if it is a part-time fee, discounted fee, or<br>inclusive of optional fees. For example, the provider<br>may offer a reduced fee for families with other<br>siblings at the facility.';
10161016
}
10171017
// eslint-disable-next-line
1018-
return "Enter the parent fee before any reductions or<br>benefits are applied. Providers are required to give<br>parents this information in writing.<br><br>This fee may differ from the approved full-time<br>parent fee if it is a part-time fee, discounted fee, or<br>inclusive of optional fees. For example, the provider<br>may offer a reduced fee for families with other<br>siblings at the facility.";
1018+
return 'Enter the parent fee before any reductions or<br>benefits are applied. Providers are required to give<br>parents this information in writing.<br><br>This fee may differ from the approved full-time<br>parent fee if it is a part-time fee, discounted fee, or<br>inclusive of optional fees. For example, the provider<br>may offer a reduced fee for families with other<br>siblings at the facility.';
10191019
},
10201020
resultsToolTip() {
10211021
if (this.isParent) {
10221022
// eslint-disable-next-line
1023-
return "If the calculation below does not match your<br>expected result, contact your child care provider. If<br>the inconsistency remains, call the Child Care<br>Operating Funding Program at 1-888-338-6622<br>(Option 2).";
1023+
return 'If the calculation below does not match your<br>expected result, contact your child care provider. If<br>the inconsistency remains, call the Child Care<br>Operating Funding Program at 1-888-338-6622<br>(Option 2).';
10241024
}
10251025
// eslint-disable-next-line
1026-
return "If the calculation below does not match your<br>expected result, contact the Child Care Operating<br>Funding Program at 1-888-338-6622 (Option 2)."
1026+
return 'If the calculation below does not match your<br>expected result, contact the Child Care Operating<br>Funding Program at 1-888-338-6622 (Option 2).';
10271027
},
10281028
},
10291029
watch: {},
@@ -1162,27 +1162,27 @@ export default {
11621162
switch (this.children[index - 1].childAgeCategory) {
11631163
case CHILDCARE_TYPE_PRESCHOOL:
11641164
// eslint-disable-next-line
1165-
return "Licensed preschool care is only funded for 4 hours or less.";
1165+
return 'Licensed preschool care is only funded for 4 hours or less.';
11661166
case CHILDCARE_TYPE_SCHOOL_CARE_K:
11671167
case CHILDCARE_TYPE_SCHOOL_CARE_1:
11681168
// eslint-disable-next-line
1169-
return "Select the amount of time your child has access to a child<br>care space, not the amount of time your child attends the space.<br><br>For example, select \"Over 4 hours\" if your child<br>attends care for one hour in the morning and two hours in<br>the afternoon, but you are able to use the space for longer<br>than 4 hours.";
1169+
return 'Select the amount of time your child has access to a child<br>care space, not the amount of time your child attends the space.<br><br>For example, select "Over 4 hours" if your child<br>attends care for one hour in the morning and two hours in<br>the afternoon, but you are able to use the space for longer<br>than 4 hours.';
11701170
default:
11711171
// eslint-disable-next-line
1172-
return "Select your typical care schedule. Maximum funding for<br>CCFRI is based on five days of over 4 hours of care<br>(full time care).";
1172+
return 'Select your typical care schedule. Maximum funding for<br>CCFRI is based on five days of over 4 hours of care<br>(full time care).';
11731173
}
11741174
} else {
11751175
switch (this.children[index - 1].childAgeCategory) {
11761176
case CHILDCARE_TYPE_PRESCHOOL:
11771177
// eslint-disable-next-line
1178-
return "Preschool care is only CCFRI-eligible for 4 hours or less.";
1178+
return 'Preschool care is only CCFRI-eligible for 4 hours or less.';
11791179
case CHILDCARE_TYPE_SCHOOL_CARE_K:
11801180
case CHILDCARE_TYPE_SCHOOL_CARE_1:
11811181
// eslint-disable-next-line
1182-
return "Select the amount of time the child has access to care, not the amount of<br>time the child is actually in care. For example, if the child has access to 5<br>hours of care but attends care for 3 hours, select \"Over 4 hours.\"";
1182+
return 'Select the amount of time the child has access to care, not the amount of<br>time the child is actually in care. For example, if the child has access to 5<br>hours of care but attends care for 3 hours, select "Over 4 hours."';
11831183
default:
11841184
// eslint-disable-next-line
1185-
return "For part-time care estimates, select the typical schedule of half days (4 hours<br>or less) and full days (over 4 hours). The maximum benefit rates for<br>CCFRI are based on 5 full days per week (full-time care).";
1185+
return 'For part-time care estimates, select the typical schedule of half days (4 hours<br>or less) and full days (over 4 hours). The maximum benefit rates for<br>CCFRI are based on 5 full days per week (full-time care).';
11861186
}
11871187
}
11881188
},

frontend/src/components/LandingPage.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ import {
357357
} from '@/utils/constants.js';
358358
import alertMixin from '@/mixins/alertMixin.js';
359359
import { checkApplicationUnlocked } from '@/utils/common.js';
360+
import { formatFiscalYearName } from '@/utils/format';
360361

361362
export default {
362363
name: 'LandingPage',
@@ -429,7 +430,7 @@ export default {
429430
//show the year ahead because we can't pull from application year YET
430431
else if (this.ccofRenewStatus === this.RENEW_STATUS_NEW) {
431432
let nameToReturn = this.getNextProgramYear?.name;
432-
return nameToReturn?.replace(/[^\d/]/g, '');
433+
return formatFiscalYearName(nameToReturn);
433434
} else if (
434435
this.ccofRenewStatus === this.RENEW_STATUS_CONTINUE ||
435436
this.ccofRenewStatus === this.RENEW_STATUS_ACTION_REQUIRED

frontend/src/components/MessagesPage.vue

+38-31
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Spinner style="width: 100%"></Spinner>
55
</v-row>
66
<v-row fluid class="mx-4" v-else>
7-
<v-row >
7+
<v-row>
88
<v-col id="messages-summary" fluid class="pa-0" :cols="4">
99
<v-card tile style="border-right: 1px solid lightgrey" :height="fitScreenHeight()" class="pa-0 elevation-0">
1010
<v-data-table
@@ -13,20 +13,20 @@
1313
:mobile-breakpoint="960"
1414
:height="fitScreenHeight()"
1515
fixed-header
16-
:item-value="item => item.messageId"
16+
:item-value="messageId"
1717
:items-per-page="-1"
1818
hide-default-footer
1919
@click:row="rowClickHandler"
2020
>
21-
<template #no-data>
22-
<v-alert :value="true" type="info">
23-
No Data
24-
</v-alert>
25-
</template>
26-
<template #item.isRead="{ item }">
27-
<p v-if="item.isRead">Read</p>
28-
<p v-else>Unread</p>
29-
</template>
21+
<template #no-data>
22+
<v-alert :value="true" type="info"> No Data </v-alert>
23+
</template>
24+
<template #item.isRead="{ item }">
25+
{{ item.isRead ? 'Read' : 'Unread' }}
26+
</template>
27+
<template #item.programYearValue="{ item }">
28+
{{ formatFiscalYearName(item.programYearValue) }}
29+
</template>
3030
</v-data-table>
3131
</v-card>
3232
</v-col>
@@ -35,11 +35,11 @@
3535
<v-card-title class="pa-0">
3636
<v-row>
3737
<v-col :cols="8">
38-
{{ message.sender }}
39-
</v-col>
40-
<v-col align="right" :cols="4">
41-
{{ message.dateReceived }}
42-
</v-col>
38+
{{ message.sender }}
39+
</v-col>
40+
<v-col align="right" :cols="4">
41+
{{ message.dateReceived }}
42+
</v-col>
4343
</v-row>
4444
<v-row>
4545
<v-col>
@@ -61,17 +61,19 @@
6161
</template>
6262

6363
<script>
64-
import { useAuthStore } from '../store/auth.js';
65-
import { useMessageStore } from '../store/message.js';
66-
import { mapState, mapActions } from 'pinia';
67-
import Spinner from './common/Spinner.vue';
68-
import { PATHS } from '../utils/constants.js';
6964
import { useDisplay } from 'vuetify';
7065
66+
import { useAuthStore } from '@/store/auth.js';
67+
import { useMessageStore } from '@/store/message.js';
68+
import { mapState, mapActions } from 'pinia';
69+
import Spinner from '@/components/common/Spinner.vue';
70+
import { PATHS } from '@/utils/constants.js';
71+
import { formatFiscalYearName } from '@/utils/format';
72+
7173
export default {
7274
name: 'MessagesPage',
7375
components: {
74-
Spinner
76+
Spinner,
7577
},
7678
data() {
7779
return {
@@ -116,7 +118,7 @@ export default {
116118
},
117119
methods: {
118120
...mapActions(useMessageStore, ['updateMessage', 'getAllMessages']),
119-
121+
formatFiscalYearName,
120122
async loadMessages() {
121123
try {
122124
this.loading = true;
@@ -125,7 +127,7 @@ export default {
125127
await this.getAllMessages(organizationId);
126128
}
127129
} catch (error) {
128-
console.error("Error in loadMessages:", error);
130+
console.error('Error in loadMessages:', error);
129131
} finally {
130132
this.loading = false;
131133
}
@@ -154,19 +156,24 @@ export default {
154156
},
155157
fitScreenHeight() {
156158
switch (this.displayName) {
157-
case 'xs': return '67vh';
158-
case 'sm': return '82vh';
159-
case 'md': return '75vh';
160-
case 'lg': return '70vh';
161-
case 'xl': return '78vh';
162-
default: return '70vh';
159+
case 'xs':
160+
return '67vh';
161+
case 'sm':
162+
return '82vh';
163+
case 'md':
164+
return '75vh';
165+
case 'lg':
166+
return '70vh';
167+
case 'xl':
168+
return '78vh';
169+
default:
170+
return '70vh';
163171
}
164172
},
165173
},
166174
};
167175
</script>
168176

169-
170177
<style scoped>
171178
:deep(html) {
172179
overflow-y: auto;

frontend/src/components/RFI/NMF.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
<div class="px-md-12 px-7 pb-10">
120120
<p class="text-h6 text--primary my-0">
121121
4. Please tell us anything else you’d like us to know about how your facility’s business case supports
122-
setting fees higher than the Affordability Benchmarks outlined in the 2023/24
122+
setting fees higher than the Affordability Benchmarks outlined in the 2023-24
123123
<a :href="fundingUrl" target="_blank">Funding Guidelines</a>
124124
</p>
125125
<div class="pt-6">

frontend/src/components/SubmissionHistory.vue

+7-6
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@
5050

5151
<script>
5252
import { mapState, mapActions } from 'pinia';
53-
import { useOrganizationStore } from '../store/ccof/organization.js';
54-
import { useDocumentStore } from '../store/document.js';
5553
56-
import { PATHS, ApiRoutes } from '../utils/constants.js';
57-
import alertMixin from '../mixins/alertMixin.js';
58-
import NavButton from './util/NavButton.vue';
54+
import NavButton from '@/components/util/NavButton.vue';
55+
import { useOrganizationStore } from '@/store/ccof/organization.js';
56+
import { useDocumentStore } from '@/store/document.js';
57+
import alertMixin from '@/mixins/alertMixin.js';
58+
import { PATHS, ApiRoutes } from '@/utils/constants.js';
59+
import { formatFiscalYearName } from '@/utils/format';
5960
6061
export default {
6162
components: { NavButton },
@@ -93,7 +94,7 @@ export default {
9394
annotationId: submission?.annotationId,
9495
appId: submission?.appId,
9596
type: submission?.type,
96-
fiscalYear: submission?.fiscalYear.replace(/[^\d/]/g, ''),
97+
fiscalYear: formatFiscalYearName(submission?.fiscalYear),
9798
submissionDate: submission?.submissionDate,
9899
submissionDateString: this.getSubmissionDateString(submission?.submissionDate),
99100
fileName: submission?.fileName,

frontend/src/components/ccfriApplication/group/AddNewFees.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
If you have more than one fee for the same category, <strong> enter the highest fee. </strong><br /><br />
2020
<strong>Enter the fee before CCFRI is applied. </strong> <br /><br />
2121
<span v-if="languageYearLabel != programYearTypes.HISTORICAL">
22-
<strong>New for 2024/25:</strong> CCFRI regions align with the BCSSA's grouping of school districts into 6
22+
<strong>New for 2024-25:</strong> CCFRI regions align with the BCSSA's grouping of school districts into 6
2323
regional chapters. Use the
2424
<a href="https://bcmcf.ca1.qualtrics.com/jfe/form/SV_eVcEWJC8HTelRCS" target="_blank">BCSSA region lookup</a>
2525
to find your region.</span

0 commit comments

Comments
 (0)