Skip to content

Commit

Permalink
[ACS-5654] Retain filter header in document list. (#3381)
Browse files Browse the repository at this point in the history
* [ACS-5654] Retain filter header in document list.

* [ACS-5654 Unit tests]

* [ACS-5654] Unit test update
  • Loading branch information
arohilaGL authored Aug 22, 2023
1 parent 9d1a6ae commit bc9c581
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ describe('FilesComponent', () => {

expect(router.navigate['calls'].argsFor(0)[0]).toEqual(['/personal-files', 'parent-id']);
});

it('should check isFilterHeaderActive to be true when filters are present in queryParamMap', () => {
Object.defineProperty(route, 'queryParamMap', { value: of({ params: { $thumbnail: 'TYPE:"cm:folder"' } }) });

fixture.detectChanges();

expect(component.isFilterHeaderActive).toBeTrue();
});
});

describe('refresh on events', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
this.route.queryParamMap.subscribe((queryMap: Params) => {
this.queryParams = queryMap.params;
});

this.route.params.subscribe(({ folderId }: Params) => {
const nodeId = folderId || data.defaultNodeId;

Expand Down Expand Up @@ -129,6 +128,9 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
});

this.columns = this.extensions.documentListPresets.files || [];
if (this.queryParams && Object.keys(this.queryParams).length > 0) {
this.isFilterHeaderActive = true;
}
}

ngOnDestroy() {
Expand Down

0 comments on commit bc9c581

Please sign in to comment.