From b5529aa9382c09d8e821ae49154895c63ad68290 Mon Sep 17 00:00:00 2001 From: VWSCoronaDashboard18 <93984341+VWSCoronaDashboard18@users.noreply.github.com> Date: Fri, 29 Jul 2022 21:15:59 +0200 Subject: [PATCH] Set right sorting of Chart and remove wrong items from Table --- .../domain/variants/static-props/get-variant-chart-data.ts | 4 ++-- .../domain/variants/static-props/get-variant-table-data.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/app/src/domain/variants/static-props/get-variant-chart-data.ts b/packages/app/src/domain/variants/static-props/get-variant-chart-data.ts index 6f158abc1e..443a842674 100644 --- a/packages/app/src/domain/variants/static-props/get-variant-chart-data.ts +++ b/packages/app/src/domain/variants/static-props/get-variant-chart-data.ts @@ -2,7 +2,7 @@ import { NlVariants } from '@corona-dashboard/common'; import { isDefined } from 'ts-is-present'; import { SiteText } from '~/locale'; -export type VariantCodesAll = SiteText['common']['variant_codes'] +export type VariantCodesAll = SiteText['common']['variant_codes']; export type VariantCode = keyof VariantCodesAll; @@ -34,7 +34,7 @@ export function getVariantChartData(variants: NlVariants | undefined) { variant.last_value.is_variant_of_concern || variant.last_value.has_historical_significance ) - .sort((a, b) => a.last_value.order - b.last_value.order); + .sort((a, b) => b.last_value.order - a.last_value.order); diff --git a/packages/app/src/domain/variants/static-props/get-variant-table-data.ts b/packages/app/src/domain/variants/static-props/get-variant-table-data.ts index cc2081ae65..feefe1586b 100644 --- a/packages/app/src/domain/variants/static-props/get-variant-table-data.ts +++ b/packages/app/src/domain/variants/static-props/get-variant-table-data.ts @@ -31,7 +31,7 @@ export function getVariantTableData( date_start_unix: 0, date_end_unix: 0, }, - } as const + } as const; if (!isDefined(variants) || !isDefined(variants.values)) { return emptyValues; @@ -65,7 +65,7 @@ export function getVariantTableData( const variantTable = variants.values .filter( (variant) => - variant.variant_code !== 'other_graph' || (!variant.last_value.has_historical_significance && variant.last_value.is_variant_of_concern) + variant.variant_code !== 'other_graph' && !variant.last_value.has_historical_significance ) .sort((a, b) => a.last_value.order - b.last_value.order) .map((variant) => {