From 6f68f000460f26a6a768cd123313dd17ebf1fe9e Mon Sep 17 00:00:00 2001 From: tekoiv Date: Mon, 29 May 2023 12:19:38 +0300 Subject: [PATCH] fix: about texts for kela and fix warning --- app/component/AboutPage.js | 12 +++++++++--- app/component/TopLevel.js | 13 ++++++++----- app/configurations/config.kela.js | 10 ++++++---- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/app/component/AboutPage.js b/app/component/AboutPage.js index 198cc444eb..936b14361b 100644 --- a/app/component/AboutPage.js +++ b/app/component/AboutPage.js @@ -1,12 +1,15 @@ import PropTypes from 'prop-types'; /* eslint-disable react/no-array-index-key */ -import React from 'react'; +import React, { useEffect, useState } from 'react'; import Link from 'found/Link'; import { FormattedMessage } from 'react-intl'; import connectToStores from 'fluxible-addons-react/connectToStores'; const AboutPage = ({ currentLanguage }, { config }) => { - const about = config.aboutThisService[currentLanguage]; + const [about, setAbout] = useState([]); + useEffect(() => { + setAbout(config.aboutThisService[currentLanguage]); + }, []); return (
@@ -16,7 +19,10 @@ const AboutPage = ({ currentLanguage }, { config }) => {

{section.header}

{section.paragraphs && section.paragraphs.map((p, j) => ( -

{p}

+

))} {section.link && ( diff --git a/app/component/TopLevel.js b/app/component/TopLevel.js index af12dfe68e..066bdda78c 100644 --- a/app/component/TopLevel.js +++ b/app/component/TopLevel.js @@ -83,11 +83,14 @@ class TopLevel extends React.Component { } componentDidMount() { - import( - /* webpackChunkName: "main" */ `../configurations/images/${this.context.config.logo}` - ).then(logo => { - this.setState({ logo: logo.default }); - }); + if (this.context.config.logo) { + // Logo is not mandatory + import( + /* webpackChunkName: "main" */ `../configurations/images/${this.context.config.logo}` + ).then(logo => { + this.setState({ logo: logo.default }); + }); + } } componentDidUpdate(prevProps) { diff --git a/app/configurations/config.kela.js b/app/configurations/config.kela.js index 13aa0e8e22..09091f3ecf 100644 --- a/app/configurations/config.kela.js +++ b/app/configurations/config.kela.js @@ -115,9 +115,9 @@ export default configMerger(matkaConfig, { { header: 'Tietoja palvelusta', paragraphs: [ - 'Tervetuloa Kelan reittioppaaseen! Palvelu perustuu Digitransit-palvelualustaan.', + 'Reittiopasta käytetään Kelan matkaetuuksien hakemisessa ja myöntämisessä. Voit selvittää reittioppaalla matkasi tietoja kuten matkan pituuden, kulkutavan ja matkustusajan. Reittiopasta hyödynnetään Kelan koulumatkatuessa sekä terveydenhuollon ja kuntoutuksen matkakorvauksissa.', + 'Kela ei vastaa reittioppaan tiedoista. Jos havaitset reittioppaassa puutteita tai virheitä, ole yhteydessä palvelun tietojen toimittajaan.', ], - link: 'https://kela.fi', }, ], @@ -125,7 +125,8 @@ export default configMerger(matkaConfig, { { header: 'Om tjänsten', paragraphs: [ - 'Den här tjänsten erbjuds av Fpa för reseplanering. Tjänsten baserar sig på Digitransit-plattformen.', + 'Reseplaneraren används vid ansökan om och beviljande av reseförmåner från FPA. Med hjälp av reseplaneraren ser du uppgifter om din resa, såsom resans längd, färdsätt och restid. Reseplaneraren används för FPA:s skoleresestöd samt reseersättningar i samband med hälso- och sjukvård och rehabilitering.', + 'FPA svarar inte för uppgifterna i reseplaneraren. Om du märker brister eller fel i reseplaneraren ska du kontakta den som levererar uppgifter till tjänsten.', ], }, ], @@ -134,7 +135,8 @@ export default configMerger(matkaConfig, { { header: 'About this service', paragraphs: [ - 'This service is provided by Kela for route planning. Service is built on Digitransit platform.', + 'The journey planner is used when applying for and granting travel-related benefits from Kela. In the journey planner, you can see information about your trip, for instance travel distance, mode of transport and travel time. The journey planner is used for school transport subsidy and reimbursements of travel expenses in connection with health care and rehabilitation.', + 'Kela is not responsible for the information in the journey planner. If you notice inaccuracies or incorrect information in the journey planner, you should contact the supplier of information to the service.', ], }, ],