Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

feature/COR-1953_non-archived-graphs-adjustments #5008

Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6ecee29
feat(COR-1953): Added corrections for rioolwater NL and infectieradar…
VWSCoronaDashboard30 Mar 12, 2024
c292f93
feature(COR-1953): Adjustments for metadata and time-series-chart com…
VWSCoronaDashboard30 Mar 19, 2024
b9fec93
feature(COR-1953): Adjustments for rioolwater page
VWSCoronaDashboard30 Mar 19, 2024
513e560
feature(COR-1953): Adjustments for NL variants page
VWSCoronaDashboard30 Mar 19, 2024
4cabb4b
feature(COR-1953): Adjustments for NL infectieradar page
VWSCoronaDashboard30 Mar 19, 2024
805ac46
feature(COR-1953): Adjustments for GM stertfe page
VWSCoronaDashboard30 Mar 19, 2024
5a361ec
feature(COR-1953): Adjustments for GM positive tests page
VWSCoronaDashboard30 Mar 19, 2024
24eab40
feature(COR-1953): Adjustments for GM patienten-in-beeld page
VWSCoronaDashboard30 Mar 19, 2024
4b43780
feature(COR-1953): Adjustments for NL de-coronaprik page
VWSCoronaDashboard30 Mar 19, 2024
31f2312
feature(COR-1953): Adjustments for NL de-coronaprik component indenta…
VWSCoronaDashboard30 Mar 19, 2024
9e6d245
feature(COR-1953): Adjustments for NL infectieradar page components
VWSCoronaDashboard30 Mar 19, 2024
df5e4ae
feature(COR-1953): Adjustments for NL positive tests page
VWSCoronaDashboard30 Mar 19, 2024
312d036
feature(COR-1953): Adjustments for NL besmettelijke-mensen page
VWSCoronaDashboard30 Mar 19, 2024
df6e64a
feature(COR-1953): Adjustments for NL coronamelder page
VWSCoronaDashboard30 Mar 19, 2024
22d81cb
feature(COR-1953): Adjustments for NL gedrag page
VWSCoronaDashboard30 Mar 19, 2024
e4e7804
feature(COR-1953): Adjustments for NL gehandicaptenzorg page
VWSCoronaDashboard30 Mar 19, 2024
d782b11
feature(COR-1953): Adjustments for NL klachten-bij-huisartsen page
VWSCoronaDashboard30 Mar 19, 2024
e113776
feature(COR-1953): Adjustments for NL kwetsbare-groepen-70-plussers page
VWSCoronaDashboard30 Mar 19, 2024
f437ec0
feature(COR-1953): Adjustments for NL patienten-in-beeld page
VWSCoronaDashboard30 Mar 19, 2024
64c2460
feature(COR-1953): Adjustments for NL sterfte page
VWSCoronaDashboard30 Mar 19, 2024
4e69634
feature(COR-1953): Adjustments for NL thuiswonende-70-plussers page
VWSCoronaDashboard30 Mar 19, 2024
9d71cbb
feature(COR-1953): Adjustments for NL ziekenhuizen-in-beeld page
VWSCoronaDashboard30 Mar 19, 2024
9d43714
feature(COR-1953): Adjustments for NL ziekenhuizen-in-beeld page impo…
VWSCoronaDashboard30 Mar 19, 2024
6cc801f
feature(COR-1953): Fixed merge conflicts
VWSCoronaDashboard30 Mar 20, 2024
6449d85
feature(COR-1953): Fixed sewer branch last insertion date not displaying
VWSCoronaDashboard30 Mar 20, 2024
3dc7a37
feature(COR-1953): Attempt to sign commit
VWSCoronaDashboard30 Mar 20, 2024
70277f0
feature(COR-1953): Reverting change for commit signing test
VWSCoronaDashboard30 Mar 20, 2024
ba1a3c7
feature(COR-1953): Fixed merge conflicts
VWSCoronaDashboard30 Mar 20, 2024
532cd2c
feature(COR-1953): Fixed rioolwater pageinformationblock not displayi…
VWSCoronaDashboard30 Mar 20, 2024
4c3b077
feat(COR-1953): Rename timeInterval to timeframePeriod
ben-van-eekelen Mar 20, 2024
4151d4a
Revert "feat(COR-1953): Rename timeInterval to timeframePeriod"
ben-van-eekelen Mar 20, 2024
10e5592
feature(COR-1953): Renamed timeInterval/TimeInterval to timeframePeri…
VWSCoronaDashboard30 Mar 20, 2024
697c182
Merge branch 'feature/COR-1953_non-archived-graphs-adjustments' of ht…
VWSCoronaDashboard30 Mar 20, 2024
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
6 changes: 3 additions & 3 deletions packages/app/src/components/chart-tile-double-column.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { ReactNode } from 'react';
import css from '@styled-system/css';
import { asResponsiveArray } from '~/style/utils';
import { Box } from './base';
import { ErrorBoundary } from './error-boundary';
import { FullscreenChartTile } from './fullscreen-chart-tile';
import { Heading } from './typography';
import { Markdown } from './markdown';
import { MetadataProps } from '~/components/metadata';
import { MetadataProps } from './metadata/types';
import { ReactNode } from 'react';
import { space } from '~/style/theme';
import css from '@styled-system/css';

interface ChartTileDoubleColumnProps {
title: string;
Expand Down
12 changes: 6 additions & 6 deletions packages/app/src/components/chart-tile.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { TimeframeOption } from '@corona-dashboard/common';
import { ReactNode, useEffect, useState } from 'react';
import styled from 'styled-components';
import theme, { space } from '~/style/theme';
import { Box, Spacer } from './base';
import { ChartTileToggle, ChartTileToggleProps } from './chart-tile-toggle';
import { ChartTimeControls } from './chart-time-controls';
import { ErrorBoundary } from './error-boundary';
import { FullscreenChartTile } from './fullscreen-chart-tile';
import { Markdown } from './markdown';
import { MetadataProps } from '~/components/metadata';
import { Heading } from './typography';
import { Markdown } from './markdown';
import { MetadataProps } from './metadata/types';
import { ReactNode, useEffect, useState } from 'react';
import { TimeframeOption } from '@corona-dashboard/common';
import styled from 'styled-components';
import theme, { space } from '~/style/theme';

interface ChartTileProps {
children: ReactNode;
Expand Down
13 changes: 7 additions & 6 deletions packages/app/src/components/choropleth-tile.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { ChoroplethThresholdsValue } from '@corona-dashboard/common';
import { space } from '~/style/theme';
import { ChoroplethLegenda } from '~/components/choropleth-legenda';
import { useBreakpoints } from '~/utils/use-breakpoints';
import { Box } from './base';
import { CalendarGear } from '@corona-dashboard/icons';
import { ChartRegionControls, RegionControlOption } from './chart-region-controls';
import { ChoroplethLegenda } from '~/components/choropleth-legenda';
import { ChoroplethThresholdsValue } from '@corona-dashboard/common';
import { ErrorBoundary } from './error-boundary';
import { FullscreenChartTile } from './fullscreen-chart-tile';
import { MetadataProps } from '~/components/metadata';
import { Heading, Text } from './typography';
import { CalendarGear } from '@corona-dashboard/icons';
import { MetadataProps } from './metadata/types';
import { space } from '~/style/theme';
import { useBreakpoints } from '~/utils/use-breakpoints';

type ChoroplethTileProps = {
title: string;
description?: string | React.ReactNode;
Expand Down
23 changes: 12 additions & 11 deletions packages/app/src/components/fullscreen-chart-tile.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import { colors } from '@corona-dashboard/common';
import { Box } from './base/box';
import { Close, Expand } from '@corona-dashboard/icons';
import { useEffect, useRef, useState } from 'react';
import styled from 'styled-components';
import { Tile } from '~/components/tile';
import { useIntl } from '~/intl';
import { space } from '~/style/theme';
import { colors } from '@corona-dashboard/common';
import { IconButton } from './icon-button';
import { Metadata } from '~/components/metadata';
import { MetadataProps } from './metadata/types';
import { Modal } from './modal';
import { replaceVariablesInText } from '~/utils/replace-variables-in-text';
import { space } from '~/style/theme';
import { Spacer } from './base';
import { Tile } from '~/components/tile';
import { useBreakpoints } from '~/utils/use-breakpoints';
import { useEffect, useRef, useState } from 'react';
import { useIntl } from '~/intl';
import { usePrevious } from '~/utils/use-previous';
import { Spacer } from './base';
import { Box } from './base/box';
import { IconButton } from './icon-button';
import { Metadata, MetadataProps } from '~/components/metadata';
import { Modal } from './modal';
import styled from 'styled-components';

interface FullscreenChartTileProps {
children: React.ReactNode;
Expand Down
10 changes: 6 additions & 4 deletions packages/app/src/components/kpi-tile.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { Markdown } from '~/components/markdown';
import { Tile } from '~/components/tile';
import { fontSizes } from '~/style/theme';
import { Box } from './base';
import { Metadata, MetadataProps } from '~/components/metadata';
import { fontSizes } from '~/style/theme';
import { Heading } from './typography';
import { Markdown } from '~/components/markdown';
import { Metadata } from '~/components/metadata';
import { MetadataProps } from './metadata/types';
import { Tile } from '~/components/tile';

interface KpiTileProps {
title?: string;
description?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/kpi/bordered-kpi-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import styled from 'styled-components';
import { Box } from '~/components/base';
import { mediaQueries, space } from '~/style/theme';
import { KpiTile } from '../kpi-tile';
import { MetadataProps } from '~/components/metadata';
import { TwoKpiSection } from '../two-kpi-section';
import { KpiContent } from './components/kpi-content';
import { BorderedKpiSectionProps } from './types';
import { Markdown } from '../markdown';
import { MetadataProps } from '../metadata/types';

export const BorderedKpiSection = ({ title, description, source, dateOrRange, tilesData, disclaimer }: BorderedKpiSectionProps) => {
const metadata: MetadataProps = {
Expand Down
10 changes: 5 additions & 5 deletions packages/app/src/components/kpi/components/kpi-content.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Bar } from '~/domain/vaccine/components/bar';
import { BoldText } from '~/components/typography';
import { Box } from '~/components/base';
import { KpiValue } from '~/components/kpi-value';
import { Markdown } from '~/components/markdown';
import { BoldText } from '~/components/typography';
import { Bar } from '~/domain/vaccine/components/bar';
import { Metadata, MetadataProps } from '~/components';
import { parseBirthyearRange } from '~/domain/vaccine/logic/parse-birthyear-range';
import { useIntl } from '~/intl';
import { space } from '~/style/theme';
import { replaceVariablesInText } from '~/utils';
import { space } from '~/style/theme';
import { TileData as KpiContentProps } from '../types';
import { Metadata, MetadataProps } from '~/components';
import { useIntl } from '~/intl';

export const KpiContent = ({ title, description, value, bar, birthyear, differenceValue, isPercentage = false, dateOrRange, source }: KpiContentProps) => {
const { commonTexts } = useIntl();
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/components/lokalize-metadata.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useIntl } from '~/intl';
import { Box } from '~/components/base';
import { Text } from '~/components/typography';
import { space } from '~/style/theme';
import { Text } from '~/components/typography';
import { useIntl } from '~/intl';

export interface MetadataProps {
date: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Box } from '~/components/base';
import { Clock, Database, MeerInformatie } from '@corona-dashboard/icons';
import { colors } from '@corona-dashboard/common';
import React from 'react';
import { MetadataItem } from '~/components/metadata/components/items/metadata-item';
import { MetadataProps } from '~/components';
import { useIntl } from '~/intl';
import { MetadataReference } from '~/components/metadata/components/items/metadata-reference';
import { useIntl } from '~/intl';
import React from 'react';

interface PageInformationBlockMetadataProps extends MetadataProps {
dateText: string | undefined;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { space } from '~/style/theme';
import { Text } from '~/components/typography';
import { replaceVariablesInText } from '~/utils';
import { Box } from '~/components/base';
import { Calendar, Clock, Database } from '@corona-dashboard/icons';
import { colors } from '@corona-dashboard/common';
import { insertDateIntoString } from '~/components/metadata/logic/insert-date-into-string';
import { Markdown, MetadataProps } from '~/components';
import React from 'react';
import { MetadataIcon } from '~/components/metadata/components/items/metadata-icon';
import { MetadataItem } from '~/components/metadata/components/items/metadata-item';
import { replaceVariablesInText } from '~/utils';
import { space } from '~/style/theme';
import { Text } from '~/components/typography';
import { useIntl } from '~/intl';
import { MetadataIcon } from '~/components/metadata/components/items/metadata-icon';
import React from 'react';

interface TileFooterMetadataProps extends MetadataProps {
dateString: string | null;
Expand All @@ -28,7 +27,7 @@ interface TileFooterMetadataProps extends MetadataProps {
* @param {string} props.datumsText - Textual representation of the metadata date.
* @param {(number|DateRange|string)} props.date - Date of the metadata item. It can be a number, a DateRange object, or a string.
* @param {DateRange} props.datePeriod - Date range for the metadata.
* @param {number} props.dateOfInsertionUnix - Unix timestamp of when the metadata was inserted.
* @param {number} props.dateOfInsertion - Unix timestamp of when the metadata was inserted.
* @param {boolean} props.isArchivedGraph - Flag indicating whether the metadata is for an archived graph.
* @param {Source} props.source - Source of the metadata.
* @param {Source[]} [props.dataSources=[]] - Array of data sources for the metadata.
Expand All @@ -39,19 +38,19 @@ interface TileFooterMetadataProps extends MetadataProps {
* @returns {ReactElement} A React element that contains the tile footer with metadata items.
*/
export function TileFooterMetadata({
dataSources = [],
date,
dateOfInsertion,
dateString,
marginBottom,
datumsText,
date,
datePeriod,
dateOfInsertionUnix,
isArchivedGraph,
source,
dataSources = [],
referenceLink,
disclaimer,
obtainedAt,
intervalString,
isArchivedGraph,
marginBottom,
obtainedAt,
referenceLink,
source,
timeInterval,
}: TileFooterMetadataProps) {
const { commonTexts, formatDateFromSeconds } = useIntl();
const metadataText = commonTexts.common.metadata;
Expand All @@ -66,35 +65,33 @@ export function TileFooterMetadata({
})
) : (
<>
{datePeriod && (
{timeInterval && (
<Box display="flex" alignItems="flex-start" color="gray7">
<MetadataIcon>
<Calendar aria-hidden color={colors.gray7} />
</MetadataIcon>
<Text variant="label1">
{replaceVariablesInText(commonTexts.common.metadata.time_interval, {
dateStart: formatDateFromSeconds(datePeriod.start, 'weekday-long'),
dateEnd: formatDateFromSeconds(datePeriod.end, 'weekday-long'),
dateStart: formatDateFromSeconds(timeInterval.start, 'weekday-long'),
dateEnd: formatDateFromSeconds(timeInterval.end, 'weekday-long'),
})}
</Text>
</Box>
)}

{dateOfInsertionUnix && (
<MetadataItem
icon={<Clock aria-hidden colors={colors.gray7} />}
items={[
{
text: insertDateIntoString(
formatDateFromSeconds,
isArchivedGraph ? commonTexts.common.metadata.last_insertion_date_archived : commonTexts.common.metadata.last_insertion_date,
dateOfInsertionUnix,
dateOfInsertionUnix,
'weekday-long'
),
},
]}
/>
{dateOfInsertion && (
<Box display="flex" alignItems="flex-start" color="gray7" marginY={space[1]}>
<MetadataIcon>
<Clock aria-hidden color={colors.gray7} />
</MetadataIcon>
<Text variant="label1">
{isArchivedGraph
? replaceVariablesInText(commonTexts.common.metadata.last_insertion_date_archived, {
dateOfInsertion: formatDateFromSeconds(dateOfInsertion, 'weekday-long'),
})
: replaceVariablesInText(commonTexts.common.metadata.last_insertion_date, { dateOfInsertion: formatDateFromSeconds(dateOfInsertion, 'weekday-long') })}
</Text>
</Box>
)}

{source ? (
Expand Down
32 changes: 16 additions & 16 deletions packages/app/src/components/metadata/metadata.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { External as ExternalLinkIcon } from '@corona-dashboard/icons';
import { ExternalLink } from '~/components/external-link';
import { Text } from '../typography';
import { replaceVariablesInText } from '~/utils/replace-variables-in-text';
import { space } from '~/style/theme';
import { useIntl } from '~/intl';
import React from 'react';
import { insertDateIntoString } from '~/components/metadata/logic/insert-date-into-string';
import { MetadataProps } from './types';
import { PageInformationBlockMetadata } from '~/components/metadata/components/page-information-block-metadata';
import { replaceVariablesInText } from '~/utils/replace-variables-in-text';
import { space } from '~/style/theme';
import { Text } from '../typography';
import { TileFooterMetadata } from '~/components/metadata/components/tile-footer-metadata';
import { useIntl } from '~/intl';
import React from 'react';

/**
* @function
Expand All @@ -20,25 +20,25 @@ import { TileFooterMetadata } from '~/components/metadata/components/tile-footer
* @returns {JSX.Element} JSX Element that represents metadata information.
*/
export function Metadata({
accessibilitySubject,
dataSources = [],
date,
dateOfInsertionUnix,
datePeriod,
dateOfInsertion,
dateOrRange,
datumsText,
disclaimer,
intervalCount,
isArchivedGraph = false,
isTileFooter,
isPageInformationBlock,
isTileFooter,
jsonSources = [],
marginBottom,
obtainedAt,
source,
dateOrRange,
accessibilitySubject,
moreInformationLabel,
moreInformationLink,
obtainedAt,
referenceLink,
jsonSources = [],
source,
timeInterval,
VWSCoronaDashboard30 marked this conversation as resolved.
Show resolved Hide resolved
}: MetadataProps) {
const { commonTexts, formatDateFromSeconds } = useIntl();

Expand All @@ -56,7 +56,7 @@ export function Metadata({
})
: null;

const dateText = datumsText && dateOfInsertionUnix && dateOrRange ? insertDateIntoString(formatDateFromSeconds, datumsText, dateOfInsertionUnix, dateOrRange) : undefined;
const dateText = datumsText && dateOfInsertion && dateOrRange ? insertDateIntoString(formatDateFromSeconds, datumsText, dateOfInsertion, dateOrRange) : undefined;

const intervalString =
intervalCount &&
Expand Down Expand Up @@ -94,8 +94,8 @@ export function Metadata({
marginBottom={marginBottom}
datumsText={datumsText}
date={date}
datePeriod={datePeriod}
dateOfInsertionUnix={dateOfInsertionUnix}
timeInterval={timeInterval}
dateOfInsertion={dateOfInsertion}
isArchivedGraph={isArchivedGraph}
source={source}
dataSources={dataSources}
Expand Down
6 changes: 3 additions & 3 deletions packages/app/src/components/metadata/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface DateRange {
* @property {string} [intervalCount] - Interval count for the metadata.
* @property {string} [disclaimer] - Disclaimer text for the metadata.
* @property {DateRange} [datePeriod] - Date range for the metadata.
* @property {number} [dateOfInsertionUnix] - Unix timestamp of when the metadata was inserted.
* @property {number} [dateOfInsertion] - Unix timestamp of when the metadata was inserted.
* @property {boolean} [isArchivedGraph] - Flag indicating whether the metadata is for an archived graph.
* @property {number|DateRange} [dateOrRange] - Date or date range of the metadata.
* @property {string} [accessibilitySubject] - Accessibility subject text for the metadata.
Expand All @@ -68,8 +68,8 @@ export type MetadataProps = {
datumsText?: string;
intervalCount?: string;
disclaimer?: string;
datePeriod?: DateRange;
dateOfInsertionUnix?: number;
timeInterval?: DateRange;
dateOfInsertion?: number;
isArchivedGraph?: boolean;
dateOrRange?: number | DateRange;
accessibilitySubject?: string;
Expand Down
Loading
Loading