From 6d6a17bac5937ea07a14e7a6ca81adcdbfee1103 Mon Sep 17 00:00:00 2001 From: trivernis Date: Sat, 5 Feb 2022 20:44:46 +0100 Subject: [PATCH] Add default value to empty sort preset Signed-off-by: trivernis --- mediarepo-ui/src/api/models/SortKey.ts | 4 +--- .../sidebar/file-search/sort-dialog/sort-dialog.component.ts | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mediarepo-ui/src/api/models/SortKey.ts b/mediarepo-ui/src/api/models/SortKey.ts index bf85cb4..4bd651c 100644 --- a/mediarepo-ui/src/api/models/SortKey.ts +++ b/mediarepo-ui/src/api/models/SortKey.ts @@ -30,9 +30,7 @@ export class SortKey { }; } else { this.data = { - [value]: { - direction: this.sortDirection - } + [value]: this.sortDirection } as SortKeyData; } } diff --git a/mediarepo-ui/src/app/components/shared/sidebar/file-search/sort-dialog/sort-dialog.component.ts b/mediarepo-ui/src/app/components/shared/sidebar/file-search/sort-dialog/sort-dialog.component.ts index 128cc38..d9ed433 100644 --- a/mediarepo-ui/src/app/components/shared/sidebar/file-search/sort-dialog/sort-dialog.component.ts +++ b/mediarepo-ui/src/app/components/shared/sidebar/file-search/sort-dialog/sort-dialog.component.ts @@ -20,7 +20,9 @@ export class SortDialogComponent implements OnInit { public sortingPreset: SortingPreset = SortingPreset.fromValues(-1, []); public availablePresets: SortingPreset[] = []; public suggestedNamespaces: Namespace[] = []; - public emptyPreset = SortingPreset.fromValues(-1, []); + public emptyPreset = SortingPreset.fromValues(-1, [ + SortKey.fromValues("FileImportedTime", "Ascending", undefined) + ]); public previousId: number = -1; private namespaces: Namespace[] = [];