[ACA-3672] - added server order for document -list (#5899)

* [ACA-3672] - added sorting server side for document-list

* [ACA-3672] - added and fixed unit tests for backend order

* [ACA-3672] - fixed failing test

* [ACA-3672] - regenerated doc and renamed variable

Co-authored-by: Vito Albano <vitoalbano@Vitos-MacBook-Pro.local>
This commit is contained in:
Vito
2020-07-23 14:04:05 +01:00
committed by GitHub
parent a5972e753a
commit 30c5c58d40
57 changed files with 132 additions and 81 deletions

View File

@@ -191,7 +191,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
* before delivering it.
*/
@Input()
sortingMode = 'client';
sortingMode = 'server';
/** The inline style to apply to every row. See
* the Angular NgStyle
@@ -314,6 +314,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
selection = new Array<NodeEntry>();
$folderNode: Subject<Node> = new Subject<Node>();
allowFiltering: boolean = true;
orderBy: string[] = ['name ASC'];
// @deprecated 3.0.0
folderNode: Node;
@@ -639,7 +640,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
this.updateCustomSourceData(this._currentFolderId);
}
this.documentListService.loadFolderByNodeId(this._currentFolderId, this._pagination, this.includeFields, this.where)
this.documentListService.loadFolderByNodeId(this._currentFolderId, this._pagination, this.includeFields, this.where, this.orderBy)
.subscribe((documentNode: DocumentLoaderNode) => {
if (documentNode.currentNode) {
this.folderNode = documentNode.currentNode.entry;
@@ -665,6 +666,11 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
}
}
onSortingChanged(event: CustomEvent) {
this.orderBy = [''.concat(event.detail.key, ' ' , event.detail.direction)];
this.reload();
}
/**
* Creates a set of predefined columns.
*/