Skip to content

Commit

Permalink
feat: renew application overview step (HL-945) (#2334)
Browse files Browse the repository at this point in the history
* fix: resolve main and footer element background issue

* feat: rewrite application step 5 (overview)

* fix: add ibantools to benefit/shared

* chore: update translations and fill with TODO

* feat: rename component and add conditions for application view

* fix: start date input would not preselect the right end date

* refactor: cleanup de minimis test file
  • Loading branch information
sirtawast committed Oct 11, 2023
1 parent b73b243 commit 196af97
Show file tree
Hide file tree
Showing 18 changed files with 554 additions and 325 deletions.
29 changes: 19 additions & 10 deletions frontend/benefit/applicant/browser-tests/page-model/deminimis.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Selector } from 'testcafe';

import fi from '../../public/locales/fi/common.json';
import MainIngress from './MainIngress';
import Step1 from './step1';
import Step2 from './step2';
Expand All @@ -21,7 +22,15 @@ class DeMinimisAid {

public t: TestController;

private deminimisRowSelector = '[data-testid="deminimis-row"]';
private selectors = {
deMinimisRow: '[data-testid="deminimis-row"]',
applicationEditButton: '[data-testid="application-edit-button"]',
toastError: '.Toastify__toast-body[role="alert"]',
};

// eslint-disable-next-line class-methods-use-this
private getSelectorContinueButton = (): Selector =>
Selector('button').withText(fi.applications.actions.continue);

fillMandatoryFields = async (): Promise<void> => {
const mainIngress = new MainIngress();
Expand All @@ -41,7 +50,7 @@ class DeMinimisAid {
};

public getRowCount = async (): Promise<number> =>
Selector(this.deminimisRowSelector).count;
Selector(this.selectors.deMinimisRow).count;

private step1ToStep2 = async (): Promise<void> => {
await this.step1.clickSubmit();
Expand All @@ -57,9 +66,9 @@ class DeMinimisAid {
await this.step1.clickSaveAndClose();
const mainIngress = new MainIngress();
await mainIngress.isLoaded();
await t.click(Selector('[data-testid="application-edit-button"]'));
await t.click(Selector(this.selectors.applicationEditButton));
await this.step1.isLoaded();
await t.scrollIntoView(Selector('button').withText('Jatka'));
await t.scrollIntoView(this.getSelectorContinueButton());
};

public actions = {
Expand All @@ -83,7 +92,7 @@ class DeMinimisAid {
}
if (action === SAVE_ACTIONS.CONTINUE) {
await this.actions.saveStep1AndReturn();
await t.scrollIntoView(Selector('button').withText('Jatka'));
await t.scrollIntoView(this.getSelectorContinueButton());
await t.expect(await this.getRowCount()).eql(rows.length);
}
if (action === SAVE_ACTIONS.SAVE_AND_EXIT) {
Expand Down Expand Up @@ -124,11 +133,11 @@ class DeMinimisAid {
fillAndLeaveUnfinished: async (t: TestController): Promise<void> => {
await this.step1.fillDeminimisAid('One', '1', '');
await this.step1.clickSubmit();
const toastError = Selector(
'.Toastify__toast-body[role="alert"]'
).withText('Puuttuvia de minimis-tuen tietoja');
const toastError = Selector(this.selectors.toastError).withText(
fi.applications.sections.company.notifications.deMinimisUnfinished.label
);
await t.expect(await toastError.exists).ok();
await t.click(toastError.find('[title="Sulje ilmoitus"]'));
await t.click(toastError.find(`[title="${fi.toast.closeToast}"]`));
},

clearRowsWithSelectNo: async (
Expand All @@ -145,7 +154,7 @@ class DeMinimisAid {
}

await this.step1.selectYesDeMinimis();
await t.scrollIntoView(Selector('button').withText('Jatka'));
await t.scrollIntoView(this.getSelectorContinueButton());
await t.expect(await this.getRowCount()).eql(0);
},
};
Expand Down
17 changes: 13 additions & 4 deletions frontend/benefit/applicant/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"deMinimisAidsHeading": "Below, please fill in all the de minimis aid granted to the organisation for the current and two previous tax years.",
"deMinimisAidsAdd": "Save",
"deMinimisAidsRemove": "Delete",
"deMinimisAidsYes": "TODO",
"deMinimisAidsNo": "The applicant has not listed any previous de minimis aids.",
"notifications": {
"companyInformation": {
Expand Down Expand Up @@ -113,7 +114,8 @@
},
"alternativeCompanyStreetAddress": {
"label": "Address",
"placeholder": "Address"
"placeholder": "Address",
"view": "Delivery address"
},
"alternativeCompanyPostcode": {
"label": "Postal code",
Expand Down Expand Up @@ -177,12 +179,17 @@
"coOperationNegotiations": {
"label": "Does the organisation have ongoing or concluded change negotiations within the last 12 months?",
"tooltipText": "If change negotiations are ongoing or ended during the previous 12 months, please provide a more detailed explanation of the situation, such as for example who the negotiations concern or what outcome the negotiations led to.",
"view": {
"yes": "TODO",
"no": "TODO"
},
"yes": "Yes",
"no": "No"
},
"coOperationNegotiationsDescription": {
"label": "Provide a more detailed account of the co-determination negotiation situation:",
"placeholder": "Describe the situation"
"placeholder": "Describe the situation",
"labelShort": "Description"
}
}
},
Expand All @@ -195,13 +202,11 @@
"heading4": "Helsinki benefit is applied for the period?",
"heading4Sub1": "You can apply for the Helsinki benefit for the duration of the employment relationship, but only up to 12 months.",
"heading5Employment": "Employment relationship",
"heading5Assignment": "Commission",
"heading5EmploymentSub1": "Salary costs",
"salaryExpensesExplanation": "Please report gross salary, Indirect labour costs and holiday pay in euros per month",
"tooltips": {
"heading5Employment": "Collective agreement applied: e.g. Collective Agreement for the Commercial Sector. If there is no binding collective agreement in the sector, put in a dash.",
"heading5EmploymentSub1": "Gross salary refers to total salary before deducting taxes and statutory contributions. Gross salary is stated in employment contracts. If bonuses are paid as part of salary – such as evening, night or shift work – include an estimate of the amount of bonuses in the gross salary.",
"heading5Assignment": "The gross salary is the salary paid to the subsidised employee before the deduction of the employee's statutory contributions (the employee's unemployment insurance and pension insurance contributions) and taxes. If the subsidised employee is paid remuneration bonuses (e.g. evening, night or shift work bonus), take the estimated amount into account in the gross salary. The employers' statutory indirect labour costs include social security expenses, pension insurance, accident insurance and unemployment insurance premiums as well as the mandatory group life insurance premium. Indirect labour costs refer to the amount of the employer's statutory indirect labour costs paid for the salary per month. The holiday pay is a salary cost to be covered by the subsidy when it is paid for holiday pay during the subsidy period. Estimate the amount of holiday pay to be paid during the subsidy period. Holiday compensation is not covered by the Helsinki benefit.",
"heading2": "The pay subsidy and the employment subsidy for people aged 55 and above are monetary subsidies intended to promote the employment of unemployed jobseekers.",
"heading3": "The Helsinki benefit for employment is intended for guidance, orientation, tools, work clothing and workspace costs when no other support is paid for these. The Helsinki benefit for salary is intended for the cost of employing a subsidised employee (= gross salary, statutory indirect labour costs and holiday pay). The Helsinki benefit for a commission is intended for the performance of an individual job or project."
},
Expand Down Expand Up @@ -238,6 +243,9 @@
"commissionBenefitSelected": "Please provide the duration of the commission here"
},
"fields": {
"prefilled": {
"companyName": "Name of the employer"
},
"firstName": {
"label": "First name",
"placeholder": "First name"
Expand Down Expand Up @@ -267,6 +275,7 @@
},
"paySubsidyGranted": {
"label": "Has this employment relationship received any of the following aid?",
"labelShort": "Received aid",
"paySubsidyDefault": "Pay subsidy",
"paySubsidyAged": "Employment aid for people aged 55 and above",
"paySubsidyNone": "None of the previous subsidies have been granted for this employment relationship"
Expand Down
39 changes: 24 additions & 15 deletions frontend/benefit/applicant/public/locales/fi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,19 @@
"deMinimisAidsHeading": "Täytä alle kaikki organisaatiolle myönnetyt de minimis -tuet kuluvan vuoden ja kahden edellisen verovuoden ajalta.",
"deMinimisAidsAdd": "Tallenna",
"deMinimisAidsRemove": "Poista",
"deMinimisAidsNo": "Hakija ei ole ilmoittanut aiemmista de minimis -tuista.",
"deMinimisAidsYes": "Kyllä, työnantajalle on myönnetty de minimis -tukia kuluvan vuoden ja kahden edellisen verovuoden aikana oheisen taulukon mukaisesti.",
"deMinimisAidsNo": "Ei, työnantajalle ei ole myönnetty de minimis -tukia kuluvan vuoden ja kahden edellisen verovuoden aikana.",
"notifications": {
"companyInformation": {
"label": "Tiedot haetaan Yritys- ja yhteisötietojärjestelmästä",
"content": "Merkityt tiedot on haettu Yritys- ja yhteisötietojärjestelmästä. Jos haluat Helsinki-lisä-päätöksen toiseen toimipisteeseen, vaihda tilalle toinen postiosoite."
},
"deMinimisAidMaxAmount": {
"label": "Enimmäismäärä ylitetty",
"content": "De minimis-tuen enimmäismäärä on ylitetty. Tuki voi olla enintään 200 000 euroa, joka myönnetään yritykselle kuluvan vuoden ja kahden edellisen verovuoden kuluessa. Enimmäismäärässä huomioidaan kaikkien eri viranomaisten kyseisenä ajanjaksona de minimis -tukena myöntämä rahoitus."
"content": "De minimis -tuen enimmäismäärä on ylitetty. Tuki voi olla enintään 200 000 euroa, joka myönnetään yritykselle kuluvan vuoden ja kahden edellisen verovuoden kuluessa. Enimmäismäärässä huomioidaan kaikkien eri viranomaisten kyseisenä ajanjaksona de minimis -tukena myöntämä rahoitus."
},
"deMinimisUnfinished": {
"label": "Puuttuvia de minimis-tuen tietoja",
"label": "Puuttuvia de minimis -tuen tietoja",
"content": "Täytä puuttuvat minimis -kentät ja paina 'Tallenna' painiketta."
}
},
Expand All @@ -105,15 +106,16 @@
"fields": {
"companyBusinessId": "Y-tunnus",
"companyName": "Työnantajan nimi",
"companyAddress": "Katuosoite",
"companyAddress": "Osoite",
"companyPostcode": "Postinumero",
"companyCity": "Postitoimipaikka",
"useAlternativeAddress": {
"label": "Käytä toista osoitetta"
},
"alternativeCompanyStreetAddress": {
"label": "Osoite",
"placeholder": "Osoite"
"placeholder": "Osoite",
"view": "Toimitusosoite"
},
"alternativeCompanyPostcode": {
"label": "Postinumero",
Expand Down Expand Up @@ -177,12 +179,17 @@
"coOperationNegotiations": {
"label": "Onko organisaatiolla käynnissä tai edeltävän 12 kuukauden aikana päättynyt muutosneuvottelut?",
"tooltipText": "Jos muutosneuvottelut ovat käynnissä tai päättyneet edeltävän 12 kuukauden aikana, niin anna tarkempi selvitys tilanteesta, kuten esimerkiksi ketä neuvottelut koskevat tai mihin lopputulokseen neuvottelut johtivat.",
"view": {
"yes": "Kyllä, organisaatiolla on käynnissä olevat, tai päättyneet muutosneuvottelut edeltävän 12 kuukauden aikana.",
"no": "Ei, organisaatiolla ei ole käynnissä tai edeltävän 12 kuukauden aikana päättyneitä muutosneuvotteluja."
},
"yes": "Kyllä",
"no": "Ei"
},
"coOperationNegotiationsDescription": {
"label": "Anna tarkempi selvitys neuvotteluiden tilanteesta.",
"placeholder": "Kuvaile tilannetta"
"placeholder": "Kuvaile tilannetta",
"labelShort": "Kuvaus tilanteesta"
}
}
},
Expand All @@ -195,13 +202,11 @@
"heading4": "Mille ajalle haet Helsinki-lisää?",
"heading4Sub1": "Voit hakea Helsinki-lisää työsuhteen keston ajaksi, mutta enintään 12 kuukaudeksi.",
"heading5Employment": "Työsuhde",
"heading5Assignment": "Toimeksianto",
"heading5EmploymentSub1": "Palkkauskustannukset",
"salaryExpensesExplanation": "Ilmoita bruttopalkka, sivukulut ja lomaraha euroina kuukaudessa.",
"tooltips": {
"heading5Employment": "Sovellettava työehtosopimus: esim. Kaupan työehtosopimus. Jos alalla ei ole velvoittavaa työehtosopimusta, merkitse viiva.",
"heading5EmploymentSub1": "Bruttopalkka tarkoittaa palkkasummaa ennen verojen ja lakisääteisten maksujen vähentämistä. Bruttopalkka on merkitty työsopimukseen. Mikäli osana palkkaa maksetaan lisiä, kuten ilta-, yö- tai vuorolisiä, laske arvio lisien määristä mukaan bruttopalkkaan.",
"heading5Assignment": "Palkkauskustannukset tooltip text",
"heading2": "Palkkatuki ja ja 55-vuotta täyttäneiden työllistämistuki ovat työttömän työnhakijan työllistymisen edistämiseksi tarkoitettuja rahallisia tukia.",
"heading3": "Työllistämisen Helsinki-lisä on tarkoitettu ohjaus-, perehdytys-, työväline-, työvaate- ja työtilakustannuksiin silloin, kun niihin ei makseta muuta tukea. Palkan Helsinki-lisä on tarkoitettu työllistetyn henkilön palkkauskustannuksiin (=bruttopalkka, lakisääteiset sivukulut ja lomaraha). Toimeksiannon Helsinki-lisä on tarkoitettu yksittäisen työn tai projektin suorittamiseen."
},
Expand Down Expand Up @@ -238,6 +243,9 @@
"commissionBenefitSelected": "Merkitse tähän toimeksiannon kesto"
},
"fields": {
"prefilled": {
"companyName": "Työnantajan nimi"
},
"firstName": {
"label": "Etunimi",
"placeholder": "Etunimi"
Expand Down Expand Up @@ -267,6 +275,7 @@
},
"paySubsidyGranted": {
"label": "Onko työsuhteeseen myönnetty jokin seuraavista tuista?",
"labelShort": "Myönnetyt tuet",
"paySubsidyDefault": "Palkkatuki",
"paySubsidyAged": "55 vuotta täyttäneiden työllistämistuki",
"paySubsidyNone": "Työsuhteeseen ei ole myönnetty mitään edeltävistä tuista"
Expand All @@ -289,8 +298,8 @@
"commission": "Toimeksiannon Helsinki-lisä"
},
"jobTitle": {
"label": "Tehtävänimike",
"placeholder": "Tehtävänimike"
"label": "Työnimike",
"placeholder": "Työnimike"
},
"workingHours": {
"label": "Työaika",
Expand Down Expand Up @@ -333,17 +342,17 @@
"placeholder": "Palkkio"
},
"startDate": {
"label": "Alkaen",
"placeholder": "Alkaen"
"label": "Aloituspäivä",
"placeholder": "Aloituspäivä"
},
"endDate": {
"label": "Päättyen",
"placeholder": "Päättyen"
"label": "Päättymispäivä",
"placeholder": "Päättymispäivä"
}
}
},
"attachments": {
"heading1": " ",
"heading1": "Liitteet",
"types": {
"employmentContract": {
"title": "Työsopimus",
Expand Down
Loading

0 comments on commit 196af97

Please sign in to comment.