From 736b5ccf80e05496e7744fadbe8203b44ecfdae4 Mon Sep 17 00:00:00 2001 From: Vito Date: Thu, 13 Aug 2020 09:35:45 +0100 Subject: [PATCH] Fixed sorting for filters (#1597) Co-authored-by: Vito Albano --- src/app.config.json | 14 ++++++++++++++ src/app/components/files/files.component.html | 2 ++ src/app/components/page.component.ts | 5 +++++ 3 files changed, 21 insertions(+) diff --git a/src/app.config.json b/src/app.config.json index 28448bcbd..e63bda146 100644 --- a/src/app.config.json +++ b/src/app.config.json @@ -514,6 +514,20 @@ "field": "cm:created", "ascending": true }, + { + "key": "modifiedAt", + "label": "SEARCH.SORT.MODIFIED_DATE", + "type": "FIELD", + "field": "cm:modified", + "ascending": true + }, + { + "key": "modifiedByUser.displayName", + "label": "SEARCH.SORT.MODIFIER", + "type": "FIELD", + "field": "cm:modifier", + "ascending": true + }, { "key": "score", "label": "Relevance", diff --git a/src/app/components/files/files.component.html b/src/app/components/files/files.component.html index f669faad2..f13ab14d3 100644 --- a/src/app/components/files/files.component.html +++ b/src/app/components/files/files.component.html @@ -31,6 +31,7 @@ [imageResolver]="imageResolver" (node-dblclick)="navigateTo($event.detail?.node)" (name-click)="navigateTo($event.detail?.node)" + (sorting-changed)="onSortingChanged($event)" > @@ -39,6 +40,7 @@ [currentFolderNodeId]="node?.id" [maxItems]="(documentList?.pagination | async)?.maxItems" [skipCount]="(documentList?.pagination | async)?.skipCount" + [sorting]="filterSorting" (update)="onFilterUpdate($event)" (clear)="onAllFilterCleared()" > diff --git a/src/app/components/page.component.ts b/src/app/components/page.component.ts index f32746f2d..99022640e 100644 --- a/src/app/components/page.component.ts +++ b/src/app/components/page.component.ts @@ -66,6 +66,7 @@ export abstract class PageComponent implements OnInit, OnDestroy, OnChanges { canUpload = false; nodeResult: NodePaging; showHeader = ShowHeaderMode.Always; + filterSorting = null; protected subscriptions: Subscription[] = []; @@ -164,6 +165,10 @@ export abstract class PageComponent implements OnInit, OnDestroy, OnChanges { this.nodeResult = newNodePaging; } + onSortingChanged(event) { + this.filterSorting = event.detail.key + '-' + event.detail.direction; + } + onAllFilterCleared() { if (!this.isOutletPreviewUrl()) { this.documentList.node = null;