[ACA-3542] - added sorting for filters (#5932)

* [ACA-3542] - added sorting for filters

* [ACA-3542] - removed wrong parameter

* [ACA-3542] - fixed test with fixed sorting mode parameter

* Update content-node-selector-panel.component.html

* fix e2e

* fix delete site

Co-authored-by: Eugenio Romano <eromano@users.noreply.github.com>
Co-authored-by: Eugenio Romano <eugenio.romano@alfresco.com>
This commit is contained in:
Vito
2020-08-03 10:30:14 +01:00
committed by GitHub
parent bfbb66ea8e
commit 85183ead0d
25 changed files with 114 additions and 27 deletions

View File

@@ -567,7 +567,7 @@
"ascending": true
},
{
"key": "createdByUser",
"key": "createdByUser.displayName",
"label": "Author",
"type": "FIELD",
"field": "cm:creator",

View File

@@ -229,7 +229,7 @@
[sortingMode]="sortingMode"
[showHeader]="showHeader"
[thumbnails]="thumbnails"
[stickyHeader]="stickyHeader"
[stickyHeader]="stickyHeader"
(error)="onNavigationError($event)"
(success)="resetError()"
(ready)="emitReadyEvent($event)"
@@ -242,6 +242,7 @@
<adf-search-header [col]="col"
[value]="paramValues? paramValues[col.key] : null"
[currentFolderNodeId]="currentFolderId"
[sorting]="filterSorting"
[maxItems]="pagination?.maxItems"
[skipCount]="pagination?.skipCount"
(update)="onFilterUpdate($event)"

View File

@@ -88,7 +88,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
processId;
@Input()
sorting = ['nodeType', 'DESC'];
sorting = ['name', 'ASC'];
@Input()
sortingMode = 'server';
@@ -163,7 +163,10 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
enableCustomHeaderFilter = false;
@Input()
paramValues: Map <any, any> = null;
paramValues: Map<any, any> = null;
@Input()
filterSorting: string = null;
@Output()
documentListReady: EventEmitter<any> = new EventEmitter();
@@ -208,7 +211,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
enableMediumTimeFormat = false;
displayEmptyMetadata = false;
hyperlinkNavigation = false;
filtersStates: any[] = [];
filteredSorting: string[] = null;
constructor(private notificationService: NotificationService,
private uploadService: UploadService,

View File

@@ -4,6 +4,8 @@
[showSettingsPanel]="false"
[navigationRoute]="navigationRoute"
[currentFolderId]="currentFolderId"
[filterSorting]="filterSorting"
[enableCustomHeaderFilter]="true"
[paramValues]="queryParams">
[paramValues]="queryParams"
(sorting-changed)="onSortingChanged($event)">
</app-files-component>

View File

@@ -30,6 +30,7 @@ export class FilteredSearchComponent {
currentFolderId = '-my-';
queryParams = null;
filterSorting = null;
constructor(@Optional() private route: ActivatedRoute) {
@@ -46,4 +47,8 @@ export class FilteredSearchComponent {
}
}
onSortingChanged(event) {
this.filterSorting = event.detail.column + '-' + event.detail.direction;
}
}