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

Commit

Permalink
Archive page and add warning tile (#4260)
Browse files Browse the repository at this point in the history
* feat(situationsPage): archive page and add warning tile

* feat: added new key for warning
  • Loading branch information
hasan-ozaynaci authored May 23, 2022
1 parent 1ab4c1b commit 64861ee
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 20 deletions.
1 change: 1 addition & 0 deletions packages/app/src/domain/layout/logic/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export type VrItemKeys =
| 'vaccinations';

export type VrCategoryKeys =
| 'archived_metrics'
| 'behaviour'
| 'early_indicators'
| 'hospitals'
Expand Down
15 changes: 7 additions & 8 deletions packages/app/src/domain/layout/nl-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,7 @@ export function NlLayout(props: NlLayoutProps) {
['hospitals', ['hospital_admissions', 'intensive_care_admissions']],
[
'infections',
[
'positive_tests',
'reproduction_number',
'mortality',
'variants',
'source_investigation',
],
['positive_tests', 'reproduction_number', 'mortality', 'variants'],
],
['behaviour', ['compliance']],
[
Expand All @@ -67,7 +61,12 @@ export function NlLayout(props: NlLayoutProps) {
map: [
[
'archived_metrics',
['coronamelder_app', 'infectious_people', 'general_practitioner_suspicions'],
[
'source_investigation',
'coronamelder_app',
'infectious_people',
'general_practitioner_suspicions',
],
],
],
});
Expand Down
19 changes: 18 additions & 1 deletion packages/app/src/domain/layout/vr-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function VrLayout(props: VrLayoutProps) {
map: [
['vaccinations', ['vaccinations']],
['hospitals', ['hospital_admissions']],
['infections', ['positive_tests', 'mortality', 'source_investigation']],
['infections', ['positive_tests', 'mortality']],
['behaviour', ['compliance']],
[
'vulnerable_groups',
Expand All @@ -80,6 +80,12 @@ export function VrLayout(props: VrLayoutProps) {
],
});

const archivedItems = useSidebar({
layout: 'vr',
code: code,
map: [['archived_metrics', ['source_investigation']]],
});

return (
<>
<Head>
Expand Down Expand Up @@ -144,6 +150,17 @@ export function VrLayout(props: VrLayoutProps) {
<Menu spacing={2}>
<MenuRenderer items={items} />
</Menu>

<Box
borderTopColor="border"
borderTopStyle="solid"
borderTopWidth={1}
pt={3}
>
<Menu>
<MenuRenderer items={archivedItems} />
</Menu>
</Box>
</Box>
)}
</>
Expand Down
17 changes: 14 additions & 3 deletions packages/app/src/pages/landelijk/brononderzoek.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Gedrag } from '@corona-dashboard/icons';
import { isEmpty } from 'lodash';
import { GetStaticPropsContext } from 'next';
import { PageInformationBlock } from '~/components/page-information-block';
import { TileList } from '~/components/tile-list';
import { PageInformationBlock, TileList, WarningTile } from '~/components';
import { Layout } from '~/domain/layout/layout';
import { NlLayout } from '~/domain/layout/nl-layout';
import { SituationsDataCoverageChoroplethTile } from '~/domain/situations/situations-data-coverage-choropleth-tile';
import { SituationsOverviewChoroplethTile } from '~/domain/situations/situations-overview-choropleth-tile';
import { useIntl } from '~/intl';
import { Languages } from '~/locale';
import {
getArticleParts,
Expand Down Expand Up @@ -63,6 +64,7 @@ export default function BrononderzoekPage(
const { pageText, choropleth, lastGenerated, content } = props;
const { caterogyTexts, metadataTexts, textShared, textChoroplethTooltips } =
pageText;
const { commonTexts } = useIntl();

const metadata = {
...metadataTexts,
Expand All @@ -77,7 +79,7 @@ export default function BrononderzoekPage(
<NlLayout>
<TileList>
<PageInformationBlock
category={caterogyTexts.category}
category={commonTexts.nationaal_layout.headings.archief}
screenReaderCategory={caterogyTexts.screenReaderCategory}
title={textShared.titel}
icon={<Gedrag />}
Expand All @@ -95,6 +97,15 @@ export default function BrononderzoekPage(
articles={content.articles}
/>

{textShared.belangrijk_bericht &&
!isEmpty(textShared.belangrijk_bericht) && (
<WarningTile
isFullWidth
message={textShared.belangrijk_bericht}
variant="emphasis"
/>
)}

<SituationsDataCoverageChoroplethTile
data={choropleth.vr}
text={textShared}
Expand Down
29 changes: 21 additions & 8 deletions packages/app/src/pages/veiligheidsregio/[code]/brononderzoek.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { TimeframeOption } from '@corona-dashboard/common';
import { Gedrag } from '@corona-dashboard/icons';
import { isEmpty } from 'lodash';
import { GetStaticPropsContext } from 'next';
import { ChartTile } from '~/components/chart-tile';
import { KpiTile } from '~/components/kpi-tile';
import { KpiValue } from '~/components/kpi-value';
import { Markdown } from '~/components/markdown';
import { PageInformationBlock } from '~/components/page-information-block';
import { TileList } from '~/components/tile-list';
import { TwoKpiSection } from '~/components/two-kpi-section';
import {
ChartTile,
WarningTile,
KpiTile,
KpiValue,
Markdown,
PageInformationBlock,
TileList,
TwoKpiSection,
} from '~/components';
import { InlineText, BoldText } from '~/components/typography';
import { Layout } from '~/domain/layout/layout';
import { VrLayout } from '~/domain/layout/vr-layout';
Expand Down Expand Up @@ -110,7 +114,7 @@ export default function BrononderzoekPage(
<VrLayout vrName={vrName}>
<TileList>
<PageInformationBlock
category={commonTexts.nationaal_layout.headings.besmettingen}
category={commonTexts.nationaal_layout.headings.archief}
screenReaderCategory={
commonTexts.sidebar.metrics.source_investigation.title
}
Expand Down Expand Up @@ -138,6 +142,15 @@ export default function BrononderzoekPage(
warning={textShared.warning}
/>

{textShared.belangrijk_bericht &&
!isEmpty(textShared.belangrijk_bericht) && (
<WarningTile
isFullWidth
message={textShared.belangrijk_bericht}
variant="emphasis"
/>
)}

<TwoKpiSection>
<SituationsDataCoverageTile
data={lastValue}
Expand Down
1 change: 1 addition & 0 deletions packages/cms/src/lokalize/key-mutations.csv
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ timestamp,action,key,document_id,move_to
2022-05-09T08:58:28.088Z,move,accessibility.charts.hospital_admissions_region_choropleth.description,G1DXw0RdifOml06twMjbPq,common.accessibility.charts.hospital_admissions_region_choropleth.description
2022-05-12T07:55:42.658Z,delete,common.charts.time_controls.firstOfSeptember,A5Y41hFe5J3wNnB7O7FFlP,__
2022-05-17T11:30:05.964Z,delete,pages.vaccinationsPage.nl.booster_kpi.booster_shot_last_seven_days.description,W42pYebYgNKSplnOwA9UMB,__
2022-05-23T10:24:35.671Z,add,pages.situationsPage.shared.belangrijk_bericht,RQYRq9yqc5kuEd5capEHG3,__

0 comments on commit 64861ee

Please sign in to comment.