From de8724792d0abf6289c76f2e6953a17f79278fff Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 14 May 2024 17:47:21 +0200 Subject: [PATCH] Improve usability of date range selector --- libs/ui/src/lib/assistant/assistant.component.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/libs/ui/src/lib/assistant/assistant.component.ts b/libs/ui/src/lib/assistant/assistant.component.ts index 101872a86..58d41a564 100644 --- a/libs/ui/src/lib/assistant/assistant.component.ts +++ b/libs/ui/src/lib/assistant/assistant.component.ts @@ -228,12 +228,7 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { { label: '1 ' + $localize`year` + ' (' + $localize`1Y` + ')', value: '1y' - }, - { - label: '5 ' + $localize`years` + ' (' + $localize`5Y` + ')', - value: '5y' - }, - { label: $localize`Max`, value: 'max' } + } ]; if (this.user?.settings?.isExperimentalFeatures) { @@ -250,6 +245,14 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { ); } + this.dateRangeOptions = this.dateRangeOptions.concat([ + { + label: '5 ' + $localize`years` + ' (' + $localize`5Y` + ')', + value: '5y' + }, + { label: $localize`Max`, value: 'max' } + ]); + this.dateRangeFormControl.setValue(this.user?.settings?.dateRange ?? null); this.filterForm.setValue(