mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-5654] Retain filter header in document list. (#8811)
* [ACS-5654] Retain filter header in document list. * [ACS-5654] Unit tests * [ACS-5654] Unit tests * [ACS-5654] Unit test fix.
This commit is contained in:
@@ -61,6 +61,7 @@ import { matIconRegistryMock } from '../../testing/mat-icon-registry-mock';
|
|||||||
import { domSanitizerMock } from '../../testing/dom-sanitizer-mock';
|
import { domSanitizerMock } from '../../testing/dom-sanitizer-mock';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { FileAutoDownloadComponent } from './file-auto-download/file-auto-download.component';
|
import { FileAutoDownloadComponent } from './file-auto-download/file-auto-download.component';
|
||||||
|
import { ShareDataTableAdapter } from '../data/share-datatable-adapter';
|
||||||
|
|
||||||
const mockDialog = {
|
const mockDialog = {
|
||||||
open: jasmine.createSpy('open')
|
open: jasmine.createSpy('open')
|
||||||
@@ -237,6 +238,15 @@ describe('DocumentList', () => {
|
|||||||
expect(documentList.selection).toEqual([]);
|
expect(documentList.selection).toEqual([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should show the header when there are no records in the table but filter is active', () => {
|
||||||
|
documentList.data = new ShareDataTableAdapter(thumbnailService, contentService, []);
|
||||||
|
documentList.filterValue = { $thumbnail: 'TYPE:"cm:folder"' };
|
||||||
|
|
||||||
|
fixture.detectChanges();
|
||||||
|
|
||||||
|
expect(documentList.showHeader).toEqual('always');
|
||||||
|
});
|
||||||
|
|
||||||
it('should reloadWithoutResettingSelection not reset the selection', () => {
|
it('should reloadWithoutResettingSelection not reset the selection', () => {
|
||||||
documentList.selection = [{ entry: mockNode3 }];
|
documentList.selection = [{ entry: mockNode3 }];
|
||||||
documentList.reloadWithoutResettingSelection();
|
documentList.reloadWithoutResettingSelection();
|
||||||
|
@@ -451,6 +451,9 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
|||||||
.subscribe(val => this.contextActionCallback(val));
|
.subscribe(val => this.contextActionCallback(val));
|
||||||
|
|
||||||
this.enforceSingleClickNavigationForMobile();
|
this.enforceSingleClickNavigationForMobile();
|
||||||
|
if (this.filterValue && Object.keys(this.filterValue).length > 0) {
|
||||||
|
this.showHeader = ShowHeaderMode.Always;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterContentInit() {
|
ngAfterContentInit() {
|
||||||
|
Reference in New Issue
Block a user