mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ADF-5581] Reset filterValue when navigating to a new folder to ensur… (#10978)
* [ADF-5581] Reset filterValue when navigating to a new folder to ensure filters are cleared * [ADF-5581] Added unit tests to verify filterValue reset * [ADF-5581] Add unit tests to verify filter reset on navigation and preservation on sorting * [ADF-5581] Use SpyObj<ShareDataTableAdapter> in unit test to avoid any type * [ADF-5581] Remove redundant type on mockData declaration in unit test * Revert loadFolder() to reload() in onSortingChanged and update unit test accordingly
This commit is contained in:
@@ -719,6 +719,7 @@ export class DocumentListComponent extends DataTableSchema implements OnInit, On
|
||||
if (typeof node === 'string') {
|
||||
this.resetNewFolderPagination();
|
||||
this.currentFolderId = node;
|
||||
this.filterValue = {};
|
||||
this.folderChange.emit(new NodeEntryEvent({ id: node } as Node));
|
||||
this.reload();
|
||||
return true;
|
||||
@@ -726,6 +727,7 @@ export class DocumentListComponent extends DataTableSchema implements OnInit, On
|
||||
if (this.canNavigateFolder(node)) {
|
||||
this.resetNewFolderPagination();
|
||||
this.currentFolderId = this.getNodeFolderDestinationId(node);
|
||||
this.filterValue = {};
|
||||
this.folderChange.emit(new NodeEntryEvent({ id: this.currentFolderId } as Node));
|
||||
this.reload();
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user