Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UHF-11059: Home care client fee calculator additions #1126

Merged
merged 4 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading