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

Commit

Permalink
Set right sorting of Chart and remove wrong items from Table
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorrik-Klijnsma-Work committed Jul 29, 2022
1 parent b3e780a commit b5529aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<VariantRow>((variant) => {
Expand Down

0 comments on commit b5529aa

Please sign in to comment.