mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
#581 fix document list data loading
- reduce amount of unnecessary data reloads
This commit is contained in:
parent
cb5cac2cbc
commit
48edbea8ae
@ -257,12 +257,6 @@ describe('DocumentList', () => {
|
|||||||
expect(calls).toBe(1);
|
expect(calls).toBe(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should reload on binding changes', () => {
|
|
||||||
spyOn(documentList, 'reload').and.stub();
|
|
||||||
documentList.ngOnChanges();
|
|
||||||
expect(documentList.reload).toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should execute context action on callback', () => {
|
it('should execute context action on callback', () => {
|
||||||
let action = {
|
let action = {
|
||||||
node: {},
|
node: {},
|
||||||
|
@ -24,7 +24,6 @@ import {
|
|||||||
AfterContentInit,
|
AfterContentInit,
|
||||||
AfterViewInit,
|
AfterViewInit,
|
||||||
AfterViewChecked,
|
AfterViewChecked,
|
||||||
OnChanges,
|
|
||||||
TemplateRef,
|
TemplateRef,
|
||||||
NgZone,
|
NgZone,
|
||||||
ViewChild,
|
ViewChild,
|
||||||
@ -59,7 +58,7 @@ declare let __moduleName: string;
|
|||||||
providers: [DocumentListService],
|
providers: [DocumentListService],
|
||||||
directives: [CONTEXT_MENU_DIRECTIVES, ALFRESCO_DATATABLE_DIRECTIVES]
|
directives: [CONTEXT_MENU_DIRECTIVES, ALFRESCO_DATATABLE_DIRECTIVES]
|
||||||
})
|
})
|
||||||
export class DocumentList implements OnInit, AfterViewInit, AfterViewChecked, AfterContentInit, OnChanges {
|
export class DocumentList implements OnInit, AfterViewInit, AfterViewChecked, AfterContentInit {
|
||||||
|
|
||||||
static SINGLE_CLICK_NAVIGATION: string = 'click';
|
static SINGLE_CLICK_NAVIGATION: string = 'click';
|
||||||
static DOUBLE_CLICK_NAVIGATION: string = 'dblclick';
|
static DOUBLE_CLICK_NAVIGATION: string = 'dblclick';
|
||||||
@ -165,14 +164,9 @@ export class DocumentList implements OnInit, AfterViewInit, AfterViewChecked, Af
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.data.thumbnails = this.thumbnails;
|
this.data.thumbnails = this.thumbnails;
|
||||||
this.data.maxItems = this.pageSize;
|
this.data.maxItems = this.pageSize;
|
||||||
this.displayFolderContent(this.currentFolderPath);
|
|
||||||
this.contextActionHandler.subscribe(val => this.contextActionCallback(val));
|
this.contextActionHandler.subscribe(val => this.contextActionCallback(val));
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges() {
|
|
||||||
this.reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
ngAfterContentInit() {
|
ngAfterContentInit() {
|
||||||
let columns = this.data.getColumns();
|
let columns = this.data.getColumns();
|
||||||
if (!columns || columns.length === 0) {
|
if (!columns || columns.length === 0) {
|
||||||
@ -185,7 +179,6 @@ export class DocumentList implements OnInit, AfterViewInit, AfterViewChecked, Af
|
|||||||
if (this.emptyFolderTemplate) {
|
if (this.emptyFolderTemplate) {
|
||||||
this.dataTable.noContentTemplate = this.emptyFolderTemplate;
|
this.dataTable.noContentTemplate = this.emptyFolderTemplate;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user