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

Commit

Permalink
feat: updated imports (#4137)
Browse files Browse the repository at this point in the history
Compact imports by adding an index to modules
  • Loading branch information
hasan-ozaynaci authored Mar 30, 2022
1 parent f795d6c commit 0712ba4
Show file tree
Hide file tree
Showing 28 changed files with 398 additions and 295 deletions.
24 changes: 24 additions & 0 deletions packages/app/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
export * from './collapsible/collapsible-button';
export * from './collapsible/collapsible-content';
export * from './collapsible/collapsible-section';
export type { AgeDemographicProps } from './age-demographic';
export type { PieChartProps } from './pie-chart';

export { AgeDemographic } from './age-demographic';
export { ChartTile } from './chart-tile';
export { InView } from './in-view';
export { Metadata } from './metadata';
export { PageInformationBlock } from './page-information-block';
export { TileList } from './tile-list';
export { TimeSeriesChart } from './time-series-chart';
export { WarningTile } from './warning-tile';
export { Divider } from './divider';
export { DynamicChoropleth } from './choropleth';
export { ChoroplethTile } from './choropleth-tile';
export { Markdown } from './markdown';
export { KpiTile } from './kpi-tile';
export { KpiValue } from './kpi-value';
export { TwoKpiSection } from './two-kpi-section';
export { LinkWithIcon } from './link-with-icon';
export { MaxWidth } from './max-width';
export { ChoroplethLegenda } from './choropleth-legenda';
export { SEOHead } from './seo-head';
export { PageKpi } from './page-kpi';
export { PageBarScale } from './page-barscale';
2 changes: 2 additions & 0 deletions packages/app/src/data/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { gmCodesByVrCode } from './gm-codes-by-vr-code';
export { vrCodeByGmCode } from './vr-code-by-gm-code';
1 change: 1 addition & 0 deletions packages/app/src/domain/deceased/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { DeceasedMonitorSection } from './deceased-monitor-section';
2 changes: 2 additions & 0 deletions packages/app/src/domain/escalation-level/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { EscalationLevelBanner } from './escalation-level-banner';
export { EscalationLevelLabel } from './escalation-level-label';

This file was deleted.

1 change: 1 addition & 0 deletions packages/app/src/domain/hospital/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { AdmissionsPerAgeGroup } from './admissions-per-age-group/admissions-per-age-group';
6 changes: 6 additions & 0 deletions packages/app/src/domain/layout/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export { Layout } from './layout';
export { NlLayout } from './nl-layout';
export { VrLayout } from './vr-layout';
export { GmLayout } from './gm-layout';
export { InLayout } from './in-layout';
export { Content } from './content';
3 changes: 3 additions & 0 deletions packages/app/src/domain/tested/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './infected-per-age-group';
export { GNumberBarChartTile } from './g-number-bar-chart-tile';
export { ReproductionChartTile } from './reproduction-chart-tile';
9 changes: 9 additions & 0 deletions packages/app/src/domain/topical/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export * from './mini-tile-selector-layout';
export { ArticleList } from './article-list';
export { HighlightsTile } from './highlights-tile';
export { ChoroplethTwoColumnLayout } from './choropleth-two-column-layout';
export { MiniTileLayout } from './mini-tile-layout';
export { MiniTrendTile } from './mini-trend-tile';
export { MiniVaccinationCoverageTile } from './mini-vaccination-coverage-tile';
export { TopicalSectionHeader } from './topical-section-header';
export { VaccinationCoverageChoropleth } from './vaccination-coverage-choropleth';
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ import {
ChartRegionControls,
RegionControlOption,
} from '~/components/chart-region-controls';
import { DynamicChoropleth } from '~/components/choropleth';
import { ChoroplethLegenda } from '~/components/choropleth-legenda';
import { DynamicChoropleth, ChoroplethLegenda, Markdown } from '~/components';
import { thresholds } from '~/components/choropleth/logic';
import { Markdown } from '~/components/markdown';
import { Text } from '~/components/typography';
import { gmCodesByVrCode } from '~/data/gm-codes-by-vr-code';
import { gmCodesByVrCode } from '~/data';
import {
CoverageKindProperty,
VaccinationCoverageKindSelect,
Expand All @@ -24,13 +22,13 @@ import { ChoroplethTooltip } from '~/domain/vaccine/vaccine-coverage-choropleth-
import { useIntl } from '~/intl';
import { SiteText } from '~/locale';
import { useReverseRouter } from '~/utils/use-reverse-router';
import { ChoroplethTwoColumnLayout } from '../topical/choropleth-two-column-layout';
import { TopicalSectionHeader } from '../topical/topical-section-header';
import { TopicalTile } from '../topical/topical-tile';
import { ChoroplethTwoColumnLayout } from './choropleth-two-column-layout';
import { TopicalSectionHeader } from './topical-section-header';
import { TopicalTile } from './topical-tile';
import {
AgeGroup,
AgeGroupSelect,
} from '../vaccine/components/age-group-select';
} from '~/domain/vaccine/components/age-group-select';

type DefaultProps = {
title: string;
Expand Down
14 changes: 14 additions & 0 deletions packages/app/src/domain/vaccine/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export { selectDeliveryAndAdministrationData } from './data-selection/select-delivery-and-administration-data';
export { selectVaccineCoverageData } from './data-selection/select-vaccine-coverage-data';
export { BoosterShotCoveragePerAgeGroup } from './booster-shot-coverage-per-age-group/booster-shot-coverage-per-age-group';
export { VaccinationsOverTimeTile } from './vaccinations-over-time-tile';
export { VaccineBoosterAdministrationsKpiSection } from './vaccine-booster-administrations-kpi-section';
export { VaccineAdministrationsKpiSection } from './vaccine-administrations-kpi-section';
export { VaccinationsShotKpiSection } from './vaccinations-shot-kpi-section';
export { VaccinationsKpiHeader } from './vaccinations-kpi-header';
export { VaccineCoverageChoroplethPerGm } from './vaccine-coverage-choropleth-per-gm';
export { VaccineCoveragePerAgeGroup } from './vaccine-coverage-per-age-group';
export { VaccineCoverageToggleTile } from './vaccine-coverage-toggle-tile';
export { VaccineDeliveryBarChart } from './vaccine-delivery-bar-chart';
export { VaccineStockPerSupplierChart } from './vaccine-stock-per-supplier-chart';
export { ChoroplethTooltip } from './vaccine-coverage-choropleth-per-gm';
43 changes: 21 additions & 22 deletions packages/app/src/pages/actueel/gemeente/[code].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,21 @@ import { isDefined, isPresent } from 'ts-is-present';
import { Box, Spacer } from '~/components/base';
import { CollapsibleButton } from '~/components/collapsible';
import { DataDrivenText } from '~/components/data-driven-text';
import { LinkWithIcon } from '~/components/link-with-icon';
import { Markdown } from '~/components/markdown';
import { MaxWidth } from '~/components/max-width';
import { Sitemap, useDataSitemap } from '~/components/sitemap';
import { Text } from '~/components/typography';
import { gmCodesByVrCode } from '~/data/gm-codes-by-vr-code';
import { vrCodeByGmCode } from '~/data/vr-code-by-gm-code';
import { VaccinationCoverageChoropleth } from '~/domain/actueel/vaccination-coverage-choropleth';
import { Layout } from '~/domain/layout/layout';
import { ArticleList } from '~/domain/topical/article-list';
import { Search } from '~/domain/topical/components/search';
import { LinkWithIcon, Markdown, MaxWidth } from '~/components';
import { gmCodesByVrCode, vrCodeByGmCode } from '~/data';
import {
VaccinationCoverageChoropleth,
ArticleList,
MiniTileSelectorItem,
MiniTileSelectorLayout,
} from '~/domain/topical/mini-tile-selector-layout';
import { MiniTrendTile } from '~/domain/topical/mini-trend-tile';
import { MiniVaccinationCoverageTile } from '~/domain/topical/mini-vaccination-coverage-tile';
import { TopicalSectionHeader } from '~/domain/topical/topical-section-header';
MiniTrendTile,
MiniVaccinationCoverageTile,
TopicalSectionHeader,
} from '~/domain/topical';
import { Search } from '~/domain/topical/components/search';
import { Layout } from '~/domain/layout';
import { selectVaccineCoverageData } from '~/domain/vaccine/data-selection/select-vaccine-coverage-data';
import { useAgegroupLabels } from '~/domain/vaccine/logic/use-agegroup-labels';
import { useIntl } from '~/intl';
Expand All @@ -54,15 +51,17 @@ import {
selectGmData,
getLokalizeTexts,
} from '~/static-props/get-data';
import { assert } from '~/utils/assert';
import { countTrailingNullValues } from '~/utils/count-trailing-null-values';
import { cutValuesFromTimeframe } from '~/utils/cut-values-from-timeframe';
import { getBoundaryDateStartUnix } from '~/utils/get-boundary-date-start-unix';
import { getVrForMunicipalityCode } from '~/utils/get-vr-for-municipality-code';
import { replaceComponentsInText } from '~/utils/replace-components-in-text';
import { replaceVariablesInText } from '~/utils/replace-variables-in-text';
import { trimNullValues } from '~/utils/trim-null-values';
import { useReverseRouter } from '~/utils/use-reverse-router';
import {
assert,
useReverseRouter,
trimNullValues,
replaceVariablesInText,
countTrailingNullValues,
cutValuesFromTimeframe,
getBoundaryDateStartUnix,
getVrForMunicipalityCode,
replaceComponentsInText,
} from '~/utils';

export { getStaticPaths } from '~/static-paths/gm';

Expand Down
36 changes: 18 additions & 18 deletions packages/app/src/pages/actueel/veiligheidsregio/[code].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,21 @@ import { isDefined, isPresent } from 'ts-is-present';
import { Box, Spacer } from '~/components/base';
import { CollapsibleButton } from '~/components/collapsible';
import { DataDrivenText } from '~/components/data-driven-text';
import { LinkWithIcon } from '~/components/link-with-icon';
import { Markdown } from '~/components/markdown';
import { MaxWidth } from '~/components/max-width';
import { LinkWithIcon, Markdown, MaxWidth } from '~/components';
import { Sitemap, useDataSitemap } from '~/components/sitemap';
import { Text } from '~/components/typography';
import { gmCodesByVrCode } from '~/data/gm-codes-by-vr-code';
import { VaccinationCoverageChoropleth } from '~/domain/actueel/vaccination-coverage-choropleth';
import { Layout } from '~/domain/layout/layout';
import { ArticleList } from '~/domain/topical/article-list';
import { gmCodesByVrCode } from '~/data';
import { Layout } from '~/domain/layout';
import { Search } from '~/domain/topical/components/search';
import {
MiniTileSelectorItem,
MiniTileSelectorLayout,
} from '~/domain/topical/mini-tile-selector-layout';
import { MiniTrendTile } from '~/domain/topical/mini-trend-tile';
import { MiniVaccinationCoverageTile } from '~/domain/topical/mini-vaccination-coverage-tile';
import { TopicalSectionHeader } from '~/domain/topical/topical-section-header';
VaccinationCoverageChoropleth,
ArticleList,
MiniTrendTile,
MiniVaccinationCoverageTile,
TopicalSectionHeader,
} from '~/domain/topical';
import { selectVaccineCoverageData } from '~/domain/vaccine/data-selection/select-vaccine-coverage-data';
import { useAgegroupLabels } from '~/domain/vaccine/logic/use-agegroup-labels';
import { useIntl } from '~/intl';
Expand All @@ -53,13 +51,15 @@ import {
selectVrData,
getLokalizeTexts,
} from '~/static-props/get-data';
import { countTrailingNullValues } from '~/utils/count-trailing-null-values';
import { cutValuesFromTimeframe } from '~/utils/cut-values-from-timeframe';
import { getBoundaryDateStartUnix } from '~/utils/get-boundary-date-start-unix';
import { replaceComponentsInText } from '~/utils/replace-components-in-text';
import { replaceVariablesInText } from '~/utils/replace-variables-in-text';
import { trimNullValues } from '~/utils/trim-null-values';
import { useReverseRouter } from '~/utils/use-reverse-router';
import {
useReverseRouter,
countTrailingNullValues,
cutValuesFromTimeframe,
getBoundaryDateStartUnix,
replaceComponentsInText,
replaceVariablesInText,
trimNullValues,
} from '~/utils';

export { getStaticPaths } from '~/static-paths/vr';

Expand Down
41 changes: 22 additions & 19 deletions packages/app/src/pages/gemeente/[code]/positief-geteste-mensen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@ import { colors, TimeframeOption } from '@corona-dashboard/common';
import { Test } from '@corona-dashboard/icons';
import { GetStaticPropsContext } from 'next';
import { Box } from '~/components/base';
import { ChartTile } from '~/components/chart-tile';
import { DynamicChoropleth } from '~/components/choropleth';
import { ChoroplethTile } from '~/components/choropleth-tile';
import { Text, InlineText } from '~/components/typography';
import {
ChartTile,
DynamicChoropleth,
TwoKpiSection,
ChoroplethTile,
TimeSeriesChart,
TileList,
InView,
CollapsibleContent,
KpiTile,
KpiValue,
Markdown,
PageInformationBlock,
} from '~/components';
import { thresholds } from '~/components/choropleth/logic/thresholds';
import { InView } from '~/components/in-view';
import { CollapsibleContent } from '~/components/collapsible';
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 { TimeSeriesChart } from '~/components/time-series-chart';
import { TwoKpiSection } from '~/components/two-kpi-section';
import { InlineText, Text } from '~/components/typography';
import { GmLayout } from '~/domain/layout/gm-layout';
import { Layout } from '~/domain/layout/layout';
import { Layout, GmLayout } from '~/domain/layout';
import { useIntl } from '~/intl';
import { Languages } from '~/locale';
import {
Expand All @@ -42,10 +43,12 @@ import {
} from '~/static-props/get-data';
import { filterByRegionMunicipalities } from '~/static-props/utils/filter-by-region-municipalities';
import { ArticleParts, PagePartQueryResult } from '~/types/cms';
import { replaceComponentsInText } from '~/utils/replace-components-in-text';
import { replaceVariablesInText } from '~/utils/replace-variables-in-text';
import { getVrForMunicipalityCode } from '~/utils/get-vr-for-municipality-code';
import { useReverseRouter } from '~/utils/use-reverse-router';
import {
replaceComponentsInText,
replaceVariablesInText,
getVrForMunicipalityCode,
useReverseRouter,
} from '~/utils';
export { getStaticPaths } from '~/static-paths/gm';

export const getStaticProps = createGetStaticProps(
Expand Down
23 changes: 12 additions & 11 deletions packages/app/src/pages/gemeente/[code]/sterfte.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { colors, TimeframeOption } from '@corona-dashboard/common';
import { Coronavirus } from '@corona-dashboard/icons';
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 { TimeSeriesChart } from '~/components/time-series-chart';
import { TwoKpiSection } from '~/components/two-kpi-section';
import {
KpiValue,
KpiTile,
ChartTile,
PageInformationBlock,
Markdown,
TimeSeriesChart,
TwoKpiSection,
TileList,
} from '~/components';
import { Text } from '~/components/typography';
import { GmLayout } from '~/domain/layout/gm-layout';
import { Layout } from '~/domain/layout/layout';
import { Layout, GmLayout } from '~/domain/layout';
import { useIntl } from '~/intl';
import { Languages } from '~/locale';
import {
Expand All @@ -34,7 +35,7 @@ import {
selectGmData,
} from '~/static-props/get-data';
import { ArticleParts, PagePartQueryResult } from '~/types/cms';
import { replaceVariablesInText } from '~/utils/replace-variables-in-text';
import { replaceVariablesInText } from '~/utils';

export { getStaticPaths } from '~/static-paths/gm';

Expand Down
38 changes: 21 additions & 17 deletions packages/app/src/pages/gemeente/[code]/vaccinaties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,27 @@ import { GetStaticPropsContext } from 'next';
import { useState } from 'react';
import { hasValueAtKey, isDefined, isPresent } from 'ts-is-present';
import { Box } from '~/components/base';
import { DynamicChoropleth } from '~/components/choropleth';
import { ChoroplethTile } from '~/components/choropleth-tile';
import {
DynamicChoropleth,
ChoroplethTile,
Markdown,
PageInformationBlock,
TileList,
} from '~/components';
import { thresholds } from '~/components/choropleth/logic';
import { Markdown } from '~/components/markdown';
import { PageInformationBlock } from '~/components/page-information-block';
import { TileList } from '~/components/tile-list';
import { gmCodesByVrCode } from '~/data/gm-codes-by-vr-code';
import { vrCodeByGmCode } from '~/data/vr-code-by-gm-code';
import { GmLayout } from '~/domain/layout/gm-layout';
import { Layout } from '~/domain/layout/layout';
import { gmCodesByVrCode, vrCodeByGmCode } from '~/data';
import { Layout, GmLayout } from '~/domain/layout';
import { Languages } from '~/locale';
import {
AgeGroup,
AgeGroupSelect,
} from '~/domain/vaccine/components/age-group-select';
import { selectVaccineCoverageData } from '~/domain/vaccine/data-selection/select-vaccine-coverage-data';
import { ChoroplethTooltip } from '~/domain/vaccine/vaccine-coverage-choropleth-per-gm';
import { VaccineCoveragePerAgeGroup } from '~/domain/vaccine/vaccine-coverage-per-age-group';
import { VaccineCoverageToggleTile } from '~/domain/vaccine/vaccine-coverage-toggle-tile';
import {
selectVaccineCoverageData,
VaccineCoverageToggleTile,
ChoroplethTooltip,
VaccineCoveragePerAgeGroup,
} from '~/domain/vaccine';
import { useIntl } from '~/intl';
import {
getArticleParts,
Expand All @@ -41,10 +43,12 @@ import {
getLokalizeTexts,
} from '~/static-props/get-data';
import { ArticleParts, LinkParts, PagePartQueryResult } from '~/types/cms';
import { assert } from '~/utils/assert';
import { replaceVariablesInText } from '~/utils/replace-variables-in-text';
import { useReverseRouter } from '~/utils/use-reverse-router';
import { useFormatLokalizePercentage } from '~/utils/use-format-lokalize-percentage';
import {
assert,
replaceVariablesInText,
useReverseRouter,
useFormatLokalizePercentage,
} from '~/utils';

export { getStaticPaths } from '~/static-paths/gm';

Expand Down
Loading

0 comments on commit 0712ba4

Please sign in to comment.