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

Commit

Permalink
topic/COR-1952_COR-1953_graph-adjustments (#5013)
Browse files Browse the repository at this point in the history
* feat(COR-1953/COR-1952): Added new metadata fields

* feat(COR-1952/COR-1953): Added lokalize keys

* feat(COR-1953): Added corrections for rioolwater NL and infectieradar pages (#5005)

* feature/COR-1954-consolidate-metadata (#5007)

* feat(COR-1954): Initial copy-paste merging

* feat(COR-1954): Add JSDoc comments

* feat(COR-1954): Fix empty source showing up

* feat(COR-1954): Replace source with metadataItem

* feat(COR-1954): Turn datelastinserted date into MetadataItem

* feat(COR-1954): Consolidated metadataprops type into seperate type file

* feat(COR-1954) Split up and combine into module

* feat(COR-1954): Substitute clock on pageinfoblock with metadataitem

* feature/COR-1953_non-archived-graphs-adjustments (#5008)

* feat(COR-1953): Added corrections for rioolwater NL and infectieradar pages

* feature(COR-1953): Adjustments for metadata and time-series-chart components

* feature(COR-1953): Adjustments for rioolwater page

* feature(COR-1953): Adjustments for NL variants page

* feature(COR-1953): Adjustments for NL infectieradar page

* feature(COR-1953): Adjustments for GM stertfe page

* feature(COR-1953): Adjustments for GM positive tests page

* feature(COR-1953): Adjustments for GM patienten-in-beeld page

* feature(COR-1953): Adjustments for NL de-coronaprik page

* feature(COR-1953): Adjustments for NL de-coronaprik component indentation

* feature(COR-1953): Adjustments for NL infectieradar page components

* feature(COR-1953): Adjustments for NL positive tests page

* feature(COR-1953): Adjustments for NL besmettelijke-mensen page

* feature(COR-1953): Adjustments for NL coronamelder page

* feature(COR-1953): Adjustments for NL gedrag page

* feature(COR-1953): Adjustments for NL gehandicaptenzorg page

* feature(COR-1953): Adjustments for NL klachten-bij-huisartsen page

* feature(COR-1953): Adjustments for NL kwetsbare-groepen-70-plussers page

* feature(COR-1953): Adjustments for NL patienten-in-beeld page

* feature(COR-1953): Adjustments for NL sterfte page

* feature(COR-1953): Adjustments for NL thuiswonende-70-plussers page

* feature(COR-1953): Adjustments for NL ziekenhuizen-in-beeld page

* feature(COR-1953): Adjustments for NL ziekenhuizen-in-beeld page import order

* feature(COR-1953): Fixed sewer branch last insertion date not displaying

* feature(COR-1953): Attempt to sign commit

* feature(COR-1953): Reverting change for commit signing test

* feature(COR-1953): Fixed rioolwater pageinformationblock not displaying last update

* feat(COR-1953): Rename timeInterval to timeframePeriod

* Revert "feat(COR-1953): Rename timeInterval to timeframePeriod"

This reverts commit 4c3b077.

* feature(COR-1953): Renamed timeInterval/TimeInterval to timeframePeriod/TimeframePeriod

---------

Co-authored-by: VWSCoronaDashboard29 <[email protected]>

* feature/COR-1951_dropdown-options-selection-changes (#5010)

* feature/COR-1938-update-format-intial-tick-date (#5003)

* refactor(COR-1938): Make comments JSDoc compliant

* refactor: reorder

* refactor: reorder

* feat(COR-1938): Set dateformat of first tick to include date

* feature(COR-1951): Corrected time frame option values

---------

Co-authored-by: Ben van Eekelen (work) <[email protected]>

* feature/COR-1956_make-metadata-consistent (#5011)

* feat(COR-1953): Added corrections for rioolwater NL and infectieradar pages

* feature(COR-1953): Adjustments for metadata and time-series-chart components

* feature(COR-1953): Adjustments for rioolwater page

* feature(COR-1953): Adjustments for NL variants page

* feature(COR-1953): Adjustments for NL infectieradar page

* feature(COR-1953): Adjustments for GM stertfe page

* feature(COR-1953): Adjustments for GM positive tests page

* feature(COR-1953): Adjustments for GM patienten-in-beeld page

* feature(COR-1953): Adjustments for NL de-coronaprik page

* feature(COR-1953): Adjustments for NL de-coronaprik component indentation

* feature(COR-1953): Adjustments for NL infectieradar page components

* feature(COR-1953): Adjustments for NL positive tests page

* feature(COR-1953): Adjustments for NL besmettelijke-mensen page

* feature(COR-1953): Adjustments for NL coronamelder page

* feature(COR-1953): Adjustments for NL gedrag page

* feature(COR-1953): Adjustments for NL gehandicaptenzorg page

* feature(COR-1953): Adjustments for NL klachten-bij-huisartsen page

* feature(COR-1953): Adjustments for NL kwetsbare-groepen-70-plussers page

* feature(COR-1953): Adjustments for NL patienten-in-beeld page

* feature(COR-1953): Adjustments for NL sterfte page

* feature(COR-1953): Adjustments for NL thuiswonende-70-plussers page

* feature(COR-1953): Adjustments for NL ziekenhuizen-in-beeld page

* feature(COR-1953): Adjustments for NL ziekenhuizen-in-beeld page import order

* feature(COR-1953): Fixed sewer branch last insertion date not displaying

* feature(COR-1953): Attempt to sign commit

* feature(COR-1953): Reverting change for commit signing test

* feature(COR-1953): Fixed rioolwater pageinformationblock not displaying last update

* feat(COR-1953): Rename timeInterval to timeframePeriod

* Revert "feat(COR-1953): Rename timeInterval to timeframePeriod"

This reverts commit 4c3b077.

* feature(COR-1953): Renamed timeInterval/TimeInterval to timeframePeriod/TimeframePeriod

* feature(COR-1956): Adjusted KPI's and Choropleths to new metadata

---------

Co-authored-by: VWSCoronaDashboard29 <[email protected]>

* feature/COR-1952_archived-graphs-adjustments (#5009)

* feature(COR-1952): Corrected archived graphs for NL variants page

* feature(COR-1952): Corrected archived graphs for NL sterfte page

* feature(COR-1952): Corrected archived graphs for NL kwetsbare-groepen-70-plussers page

* feature(COR-1952): Corrected archived graphs for NL reproductiegetal page

* feature(COR-1952): Corrected archived graphs for NL positieve-testen page

* feature(COR-1952): Corrected archived graphs for NL gehandicaptenzorg page

* feature(COR-1952): Corrected archived graphs for NL thuiswonende-70-plussers page

* feature(COR-1952): Corrected archived graphs for NL coronamelder page

* feature(COR-1952): Corrected archived graphs for GM positieve-testen page

* feature(COR-1952): Corrected archived graphs for GM sterfte page

* feature(COR-1952): Corrected archived graphs for GM patienten-in-beeld page

* feature(COR-1952): Added missing metadata for patienten-in-beeld

---------

Co-authored-by: Ben van Eekelen (work) <[email protected]>
  • Loading branch information
VWSCoronaDashboard30 and ben-van-eekelen authored Mar 22, 2024
1 parent 07b5790 commit 00c7dd7
Show file tree
Hide file tree
Showing 78 changed files with 1,487 additions and 903 deletions.
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 './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
22 changes: 11 additions & 11 deletions packages/app/src/components/chart-tile.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
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 './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;
title: string;
description?: string;
disableFullscreen?: boolean;
id?: string;
metadata?: MetadataProps;
onSelectTimeframe?: (timeframe: TimeframeOption) => void;
timeframeInitialValue?: TimeframeOption;
timeframeOptions?: TimeframeOption[];
title: string;
toggle?: ChartTileToggleProps;
onSelectTimeframe?: (timeframe: TimeframeOption) => void;
}

export const ChartTile = ({
children,
title,
description,
disableFullscreen,
id,
metadata,
onSelectTimeframe,
timeframeInitialValue,
toggle,
timeframeOptions,
onSelectTimeframe,
title,
toggle,
}: ChartTileProps) => {
const [timeframe, setTimeframe] = useState<TimeframeOption>(timeframeInitialValue || TimeframeOption.ALL);

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 './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 './metadata';
import { Modal } from './modal';
import styled from 'styled-components';

interface FullscreenChartTileProps {
children: React.ReactNode;
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ export * from './collapsible/collapsible-content';
export * from './collapsible/collapsible-section';
export type { AgeDemographicProps } from './age-demographic';
export type { PieChartProps } from './pie-chart';
export type { MetadataProps } from './metadata';
export type { MetadataProps } from './metadata/types';

export { AgeDemographic } from './age-demographic';
export { ChartTile } from './chart-tile';
export { InView } from './in-view';
export { Metadata } from './metadata';
export { Metadata } from './metadata/metadata';
export { PageInformationBlock } from './page-information-block';
export { TileList } from './tile-list';
export { Tile } from './tile';
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 './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
19 changes: 16 additions & 3 deletions packages/app/src/components/kpi/bordered-kpi-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,30 @@ import styled from 'styled-components';
import { Box } from '~/components/base';
import { mediaQueries, space } from '~/style/theme';
import { KpiTile } from '../kpi-tile';
import { MetadataProps } from '../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) => {
export const BorderedKpiSection = ({
title,
description,
source,
timeframePeriod,
dateOfInsertion,
isTimeframePeriodKpi,
tilesData,
disclaimer,
isArchived,
}: BorderedKpiSectionProps) => {
const metadata: MetadataProps = {
date: dateOrRange,
timeframePeriod: timeframePeriod,
source: source,
disclaimer: disclaimer,
isTimeframePeriodKpi: isTimeframePeriodKpi,
dateOfInsertion: dateOfInsertion,
isArchived: isArchived,
};

return (
Expand Down
16 changes: 9 additions & 7 deletions packages/app/src/components/kpi/components/kpi-content.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
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) => {
export const KpiContent = ({ title, description, value, bar, birthyear, differenceValue, isPercentage = false, dateOfInsertion, dateOrRange, source }: KpiContentProps) => {
const { commonTexts } = useIntl();
const parsedBirthyearRange = birthyear ? parseBirthyearRange(birthyear) : null;

const metadata: MetadataProps = {
date: dateOrRange,
timeframePeriod: dateOrRange,
source: source,
isTimeframePeriodKpi: true,
dateOfInsertion: dateOfInsertion,
};

return (
Expand Down
6 changes: 5 additions & 1 deletion packages/app/src/components/kpi/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { DifferenceInteger } from '@corona-dashboard/common';

export type TileData = {
dateOrRange?: number | DateRange;
dateOfInsertion?: number;
source?: {
href: string;
text: string;
Expand All @@ -21,7 +22,10 @@ interface DateRange {
}

export interface BorderedKpiSectionProps {
dateOrRange?: number | DateRange;
timeframePeriod?: number | DateRange;
isTimeframePeriodKpi?: boolean;
dateOfInsertion?: number;
isArchived?: boolean;
description: string;
source?: {
href: string;
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
118 changes: 0 additions & 118 deletions packages/app/src/components/metadata.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import styled from 'styled-components';
import css from '@styled-system/css';

export const MetadataIcon = styled.span(() =>
css({
minWidth: '1.8rem',

svg: {
height: '15px',
width: 'auto',
},
})
);
Loading

0 comments on commit 00c7dd7

Please sign in to comment.