Skip to content

Commit

Permalink
Merge pull request #1126 from City-of-Helsinki/UHF-11059
Browse files Browse the repository at this point in the history
UHF-11059: Home care client fee calculator additions
  • Loading branch information
teroelonen authored Dec 9, 2024
2 parents 902ed2f + c92bc8f commit 063e0c5
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dist/css/styles.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/helfi_calculator.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/home_care_client_fee.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/home_care_service_voucher.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/js/calculator/helfi_calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ class HelfiCalculator {
<legend class="helfi-calculator__legend helfi-calculator__legend--level_{{level}}{{^level}}2{{/level}}">{{text}}</legend>
`,
paragraph: `
<p>{{text}}</p>
<p{{#class}} class="{{class}}"{{/class}}>{{text}}</p>
`,
hr: `
<hr>
Expand Down
14 changes: 14 additions & 0 deletions src/js/calculator/home_care_client_fee/_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ function getFormData(id, t, { firstPerWeekPrice }) {
],
},
},
{
group: {
id: 'safetyphone_group',
hide_group: true,
items: [
{
paragraph: {
text: t('safetyphone_emergency_visit_explanation'),
class: 'hdbt-helper-text',
}
},
],
},
},
{
heading: {
text: t('shopping_service_heading'),
Expand Down
5 changes: 5 additions & 0 deletions src/js/calculator/home_care_client_fee/_translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ const translations = {
sv: 'Inkludera en trygghetstelefon och ett säkerhetsarmband i bedömningen',
en: 'Include the safety phone and safety bracelet in the estimate',
},
safetyphone_emergency_visit_explanation: {
fi: 'Huomiothan, että turvapalveluiden hälytyskäynti maksaa 23,25 € tai 46,50 € kerta tulorajoistasi riippuen. Kuukausittain laskutamme enintään 5 hälytyskäyntiä, eli tulorajoistasi riippuen enintään 116,25 € tai 232,50 € kuukaudessa.',
sv: 'Observera, att ett larmbesök från trygghetstjänsten kostar 23,25 € eller 46,50 € per gång, beroende på dina inkomstgränser. Vi fakturerar högst 5 larmbesök per månad. Det vill säga, beroende på dina inkomstgränser, max 116,25 € eller 232,50 € per månad.',
en: 'Please note that an emergency visit from the safety services costs EUR 23.25 or EUR 46.50 per visit, depending on your income limits. Each month, you will be billed for a maximum of five emergency visits, totalling no more than EUR 116.25 or EUR 232.50, depending on your income limits.',
},
yes_calculate: {
fi: 'Kyllä, laske arvioon.',
sv: 'Ja, inkludera i bedömningen.',
Expand Down
19 changes: 12 additions & 7 deletions src/js/calculator/home_care_client_fee/home_care_client_fee.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,18 @@ class HomeCareClientFee {
});

const update = () => {
const mealService = this.calculator.getFieldValue('meal_service');

if (mealService === '1') {
this.calculator.showGroup('meal_service_group');
} else {
this.calculator.hideGroup('meal_service_group');
}
const fields = [
{ field: 'safetyphone', group: 'safetyphone_group' },
{ field: 'meal_service', group: 'meal_service_group' },
];

fields.forEach(({ field, group }) => {
if (this.calculator.getFieldValue(field) === '1') {
this.calculator.showGroup(group);
} else {
this.calculator.hideGroup(group);
}
});
};

const validate = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
transition: none;
}

.helfi-calculator__item > p:first-child {
margin-top: 0;
}

& > :first-child {
border-left: $spacing-half solid $color-black-20;
padding-left: $spacing-and-half;
Expand Down

0 comments on commit 063e0c5

Please sign in to comment.