mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-5654] Retain filter header in document list. (#3381)
* [ACS-5654] Retain filter header in document list. * [ACS-5654 Unit tests] * [ACS-5654] Unit test update
This commit is contained in:
@@ -156,6 +156,14 @@ describe('FilesComponent', () => {
|
|||||||
|
|
||||||
expect(router.navigate['calls'].argsFor(0)[0]).toEqual(['/personal-files', 'parent-id']);
|
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', () => {
|
describe('refresh on events', () => {
|
||||||
|
@@ -95,7 +95,6 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
|
|||||||
this.route.queryParamMap.subscribe((queryMap: Params) => {
|
this.route.queryParamMap.subscribe((queryMap: Params) => {
|
||||||
this.queryParams = queryMap.params;
|
this.queryParams = queryMap.params;
|
||||||
});
|
});
|
||||||
|
|
||||||
this.route.params.subscribe(({ folderId }: Params) => {
|
this.route.params.subscribe(({ folderId }: Params) => {
|
||||||
const nodeId = folderId || data.defaultNodeId;
|
const nodeId = folderId || data.defaultNodeId;
|
||||||
|
|
||||||
@@ -129,6 +128,9 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.columns = this.extensions.documentListPresets.files || [];
|
this.columns = this.extensions.documentListPresets.files || [];
|
||||||
|
if (this.queryParams && Object.keys(this.queryParams).length > 0) {
|
||||||
|
this.isFilterHeaderActive = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
|
Reference in New Issue
Block a user