From 01a068550f992d7b547aff028cb58155811f106f Mon Sep 17 00:00:00 2001 From: Vito Date: Tue, 28 Jul 2020 09:13:04 +0100 Subject: [PATCH] Put folder on top by default (#5918) --- demo-shell/src/app/components/files/files.component.ts | 2 +- .../document-list/components/document-list.component.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/demo-shell/src/app/components/files/files.component.ts b/demo-shell/src/app/components/files/files.component.ts index 6c408c7b1f..c727dc8447 100644 --- a/demo-shell/src/app/components/files/files.component.ts +++ b/demo-shell/src/app/components/files/files.component.ts @@ -89,7 +89,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy { processId; @Input() - sorting = ['name', 'asc']; + sorting = ['nodeType', 'DESC']; @Input() sortingMode = 'server'; diff --git a/lib/content-services/src/lib/document-list/components/document-list.component.ts b/lib/content-services/src/lib/document-list/components/document-list.component.ts index 9041abf6d5..0b38ba2344 100644 --- a/lib/content-services/src/lib/document-list/components/document-list.component.ts +++ b/lib/content-services/src/lib/document-list/components/document-list.component.ts @@ -182,7 +182,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte * override the default sorting detected by the component based on columns. */ @Input() - sorting = ['name', 'asc']; + sorting = ['nodeType', 'DESC']; /** Defines sorting mode. Can be either `client` (items in the list * are sorted client-side) or `server` (the ordering supplied by the @@ -671,7 +671,10 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte } onSortingChanged(event: CustomEvent) { - this.orderBy = [''.concat(event.detail.key, ' ' , event.detail.direction)]; + const flattenExtraSortingOption = this.sorting.join(' '); + const orderArray = [flattenExtraSortingOption]; + orderArray.push(''.concat(event.detail.key, ' ', event.detail.direction)); + this.orderBy = orderArray; this.reload(); }