From 76697543d2138164cea53a8f559732cbbb385c5e Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Fri, 19 Jan 2024 14:45:23 +0100 Subject: [PATCH] feat: Allow most recent filter logic to be applied for TemporalOrdinalDimension --- app/configurator/components/field.tsx | 52 +++++++++++++++++++++++++-- app/rdf/query-dimension-values.ts | 15 ++++++-- 2 files changed, 62 insertions(+), 5 deletions(-) diff --git a/app/configurator/components/field.tsx b/app/configurator/components/field.tsx index 09c9ee11c..682fd0fcb 100644 --- a/app/configurator/components/field.tsx +++ b/app/configurator/components/field.tsx @@ -80,6 +80,7 @@ import { HierarchyValue, ObservationValue, TemporalDimension, + isTemporalOrdinalDimension, } from "@/domain/data"; import { useTimeFormatLocale } from "@/formatters"; import { TimeUnit } from "@/graphql/query-hooks"; @@ -240,11 +241,56 @@ export const DataFilterSelect = ({ ); } + const canUseMostRecentValue = isTemporalOrdinalDimension(dimension); + const usesMostRecentValue = isDynamicMaxValue(fieldProps.value); + const maxValue = sortedValues[sortedValues.length - 1].value; + return (