mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
#129 Improve document list reload behaviour
This commit is contained in:
@@ -38,7 +38,7 @@ describe('ContentAction', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
let alfrescoServiceMock = new AlfrescoServiceMock();
|
||||
documentList = new DocumentList(alfrescoServiceMock);
|
||||
documentList = new DocumentList(alfrescoServiceMock, null);
|
||||
actionList = new ContentActionList(documentList);
|
||||
});
|
||||
|
||||
|
@@ -34,7 +34,7 @@ describe('ContentColumnList', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
let alfrescoServiceMock = new AlfrescoServiceMock();
|
||||
documentList = new DocumentList(alfrescoServiceMock);
|
||||
documentList = new DocumentList(alfrescoServiceMock, null);
|
||||
columnList = new ContentColumnList(documentList);
|
||||
});
|
||||
|
||||
|
@@ -34,7 +34,7 @@ describe('ContentColumn', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
let alfrescoServiceMock = new AlfrescoServiceMock();
|
||||
documentList = new DocumentList(alfrescoServiceMock);
|
||||
documentList = new DocumentList(alfrescoServiceMock, null);
|
||||
columnList = new ContentColumnList(documentList);
|
||||
});
|
||||
|
||||
|
@@ -36,7 +36,7 @@ describe('DocumentList', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
alfrescoServiceMock = new AlfrescoServiceMock();
|
||||
documentList = new DocumentList(alfrescoServiceMock);
|
||||
documentList = new DocumentList(alfrescoServiceMock, null);
|
||||
|
||||
eventMock = {
|
||||
preventDefault: function () {
|
||||
@@ -105,7 +105,7 @@ describe('DocumentList', () => {
|
||||
});
|
||||
|
||||
it('should return no thumbnail url without service', () => {
|
||||
let list = new DocumentList(null);
|
||||
let list = new DocumentList(null, null);
|
||||
let node = new MinimalNodeEntity();
|
||||
expect(list.getThumbnailUrl(node)).toBeNull();
|
||||
});
|
||||
|
@@ -24,7 +24,8 @@ import {
|
||||
AfterContentInit,
|
||||
AfterViewChecked,
|
||||
OnChanges,
|
||||
TemplateRef
|
||||
TemplateRef,
|
||||
NgZone
|
||||
} from '@angular/core';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Subject } from 'rxjs/Rx';
|
||||
@@ -120,7 +121,9 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit,
|
||||
|
||||
contextActionHandler: Subject<any> = new Subject();
|
||||
|
||||
constructor(private alfrescoService: AlfrescoService) {}
|
||||
constructor(
|
||||
private alfrescoService: AlfrescoService,
|
||||
private ngZone: NgZone) {}
|
||||
|
||||
getContextActions(node: MinimalNodeEntity) {
|
||||
if (node && node.entry) {
|
||||
@@ -320,9 +323,11 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit,
|
||||
}
|
||||
|
||||
reload() {
|
||||
if (this.currentFolderPath) {
|
||||
this.displayFolderContent(this.currentFolderPath);
|
||||
}
|
||||
this.ngZone.run(() => {
|
||||
if (this.currentFolderPath) {
|
||||
this.displayFolderContent(this.currentFolderPath);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user