mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACA-3506] - Filter are kept when reloaded (#5885)
* [ADF] - saving in the url the filter values * Fixed filter status on refresh * Fixed filter status on refresh * [ACA-3506] - added url filtering save * [ACA-3506] - fixed spellcheck * improve log * more log * fix scripts * Added documentation for allowUpdateOnChange setting * Added default value in description for docs Co-authored-by: Vito Albano <vitoalbano@Vitos-MacBook-Pro.local> Co-authored-by: Eugenio Romano <eugenio.romano@alfresco.com>
This commit is contained in:
@@ -163,6 +163,9 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
@Input()
|
||||
enableCustomHeaderFilter = false;
|
||||
|
||||
@Input()
|
||||
paramValues: Map <any, any> = null;
|
||||
|
||||
@Output()
|
||||
documentListReady: EventEmitter<any> = new EventEmitter();
|
||||
|
||||
@@ -655,7 +658,27 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
|
||||
onAllFilterCleared() {
|
||||
this.documentList.node = null;
|
||||
if (this.currentFolderId === '-my-') {
|
||||
this.router.navigate([this.navigationRoute, '']);
|
||||
} else {
|
||||
this.router.navigate([this.navigationRoute, this.currentFolderId, 'display', this.displayMode]);
|
||||
}
|
||||
this.documentList.reload();
|
||||
}
|
||||
|
||||
onFilterSelected(currentActiveFilters: Map<string, string>) {
|
||||
const objectFromMap = {};
|
||||
currentActiveFilters.forEach((value: any, key) => {
|
||||
let paramValue = null;
|
||||
if (value && value.from && value.to) {
|
||||
paramValue = `${value.from}||${value.to}`;
|
||||
} else {
|
||||
paramValue = value;
|
||||
}
|
||||
objectFromMap[key] = paramValue;
|
||||
});
|
||||
|
||||
this.router.navigate([], { relativeTo: this.route, queryParams: objectFromMap });
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user