[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:
Shivangi Shree
2025-07-02 17:48:13 +05:30
committed by GitHub
parent d776c7c77d
commit c7f28d54d6
2 changed files with 42 additions and 0 deletions
@@ -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;