From 0856511c9d291b3e7759cd3444819c1c5dcc848e Mon Sep 17 00:00:00 2001 From: HO <93981322+VWSCoronaDashboard19@users.noreply.github.com> Date: Thu, 10 Nov 2022 16:07:58 +0100 Subject: [PATCH] fix: add new Sanity field for thermometer title (#4490) --- .../severity-indicator-tile/severity-indicator-tile.tsx | 8 +++----- packages/app/src/pages/index.tsx | 4 ++-- packages/app/src/queries/get-topical-structure-query.ts | 1 + packages/app/src/queries/query-types.ts | 1 + packages/cms/src/schemas/topical/thermometer.ts | 9 +++++++-- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/packages/app/src/components/severity-indicator-tile/severity-indicator-tile.tsx b/packages/app/src/components/severity-indicator-tile/severity-indicator-tile.tsx index 7d753c6c8c..ed00ba262c 100644 --- a/packages/app/src/components/severity-indicator-tile/severity-indicator-tile.tsx +++ b/packages/app/src/components/severity-indicator-tile/severity-indicator-tile.tsx @@ -4,7 +4,7 @@ import styled from 'styled-components'; import { space } from '~/style/theme'; import { Box } from '~/components/base'; import { Markdown } from '~/components/markdown'; -import { BoldText, InlineText } from '~/components/typography'; +import { InlineText } from '~/components/typography'; import { TrendIcon, TrendIconColor } from '~/domain/topical/types'; import { SeverityIndicatorLabel } from './components/severity-indicator-label'; import { SeverityIndicator } from './components/severity-indicator'; @@ -18,7 +18,7 @@ interface SeverityIndicatorTileProps { description: string; label: string; level: SeverityLevel; - title: string; + title: string | null; sourceLabel: string; datesLabel: string; levelDescription: string; @@ -44,9 +44,7 @@ export const SeverityIndicatorTile = ({ description, label, level, title, datesL as="figure" > - - - + {title && } {datesLabel} diff --git a/packages/app/src/pages/index.tsx b/packages/app/src/pages/index.tsx index 9fe5dca9bf..c29b192144 100644 --- a/packages/app/src/pages/index.tsx +++ b/packages/app/src/pages/index.tsx @@ -126,7 +126,7 @@ const Home = (props: StaticProps) => { label: currentSeverityLevelTexts.label.toLowerCase(), }) } - title={thermometer.title} + title={thermometer.tileTitle} label={currentSeverityLevelTexts.label} sourceLabel={thermometer.sourceLabel} datesLabel={thermometer.datesLabel} @@ -140,7 +140,7 @@ const Home = (props: StaticProps) => { endDate={endDate} timelineEvents={thermometerEvents} labels={{ - heading: thermometer.title, + heading: thermometer.timeline.title, today: thermometer.timeline.todayLabel, tooltipCurrentEstimation: thermometer.timeline.tooltipLabel, }} diff --git a/packages/app/src/queries/get-topical-structure-query.ts b/packages/app/src/queries/get-topical-structure-query.ts index 8232546c49..b048c3e453 100644 --- a/packages/app/src/queries/get-topical-structure-query.ts +++ b/packages/app/src/queries/get-topical-structure-query.ts @@ -59,6 +59,7 @@ export function getTopicalStructureQuery(locale: string) { ][0]{ 'title': title.${locale}, 'subTitle': subTitle.${locale}, + "tileTitle":tileTitle.${locale}, currentLevel, 'thermometerLevels': thermometerLevels[]->{ 'level': level, diff --git a/packages/app/src/queries/query-types.ts b/packages/app/src/queries/query-types.ts index d73c007981..bcd4734ebb 100644 --- a/packages/app/src/queries/query-types.ts +++ b/packages/app/src/queries/query-types.ts @@ -13,6 +13,7 @@ export interface TopicalSanityData { interface ThermometerConfig { title: string; subTitle: PortableTextEntry[] | null; + tileTitle: string | null; currentLevel: SeverityLevel; datesLabel: string; levelDescription: string; diff --git a/packages/cms/src/schemas/topical/thermometer.ts b/packages/cms/src/schemas/topical/thermometer.ts index ff19b183bb..21e5903807 100644 --- a/packages/cms/src/schemas/topical/thermometer.ts +++ b/packages/cms/src/schemas/topical/thermometer.ts @@ -11,16 +11,21 @@ export const thermometer = { name: 'thermometer', fields: [ { - title: 'De titel van de thermometer', + title: 'De titel boven de thermometer', name: 'title', type: 'localeString', validation: REQUIRED, }, { - title: 'De beschrijving van de thermometer', + title: 'De beschrijving boven de thermometer', name: 'subTitle', type: 'localeRichContentBlock' }, + { + title: 'De titel binnen de thermometer tegel', + name: 'tileTitle', + type: 'localeString' + }, { title: 'Huidige stand', name: 'currentLevel',