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(() => {
|
beforeEach(() => {
|
||||||
let alfrescoServiceMock = new AlfrescoServiceMock();
|
let alfrescoServiceMock = new AlfrescoServiceMock();
|
||||||
documentList = new DocumentList(alfrescoServiceMock);
|
documentList = new DocumentList(alfrescoServiceMock, null);
|
||||||
actionList = new ContentActionList(documentList);
|
actionList = new ContentActionList(documentList);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -34,7 +34,7 @@ describe('ContentColumnList', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
let alfrescoServiceMock = new AlfrescoServiceMock();
|
let alfrescoServiceMock = new AlfrescoServiceMock();
|
||||||
documentList = new DocumentList(alfrescoServiceMock);
|
documentList = new DocumentList(alfrescoServiceMock, null);
|
||||||
columnList = new ContentColumnList(documentList);
|
columnList = new ContentColumnList(documentList);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -34,7 +34,7 @@ describe('ContentColumn', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
let alfrescoServiceMock = new AlfrescoServiceMock();
|
let alfrescoServiceMock = new AlfrescoServiceMock();
|
||||||
documentList = new DocumentList(alfrescoServiceMock);
|
documentList = new DocumentList(alfrescoServiceMock, null);
|
||||||
columnList = new ContentColumnList(documentList);
|
columnList = new ContentColumnList(documentList);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -36,7 +36,7 @@ describe('DocumentList', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
alfrescoServiceMock = new AlfrescoServiceMock();
|
alfrescoServiceMock = new AlfrescoServiceMock();
|
||||||
documentList = new DocumentList(alfrescoServiceMock);
|
documentList = new DocumentList(alfrescoServiceMock, null);
|
||||||
|
|
||||||
eventMock = {
|
eventMock = {
|
||||||
preventDefault: function () {
|
preventDefault: function () {
|
||||||
@@ -105,7 +105,7 @@ describe('DocumentList', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should return no thumbnail url without service', () => {
|
it('should return no thumbnail url without service', () => {
|
||||||
let list = new DocumentList(null);
|
let list = new DocumentList(null, null);
|
||||||
let node = new MinimalNodeEntity();
|
let node = new MinimalNodeEntity();
|
||||||
expect(list.getThumbnailUrl(node)).toBeNull();
|
expect(list.getThumbnailUrl(node)).toBeNull();
|
||||||
});
|
});
|
||||||
|
@@ -24,7 +24,8 @@ import {
|
|||||||
AfterContentInit,
|
AfterContentInit,
|
||||||
AfterViewChecked,
|
AfterViewChecked,
|
||||||
OnChanges,
|
OnChanges,
|
||||||
TemplateRef
|
TemplateRef,
|
||||||
|
NgZone
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
import { Subject } from 'rxjs/Rx';
|
import { Subject } from 'rxjs/Rx';
|
||||||
@@ -120,7 +121,9 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit,
|
|||||||
|
|
||||||
contextActionHandler: Subject<any> = new Subject();
|
contextActionHandler: Subject<any> = new Subject();
|
||||||
|
|
||||||
constructor(private alfrescoService: AlfrescoService) {}
|
constructor(
|
||||||
|
private alfrescoService: AlfrescoService,
|
||||||
|
private ngZone: NgZone) {}
|
||||||
|
|
||||||
getContextActions(node: MinimalNodeEntity) {
|
getContextActions(node: MinimalNodeEntity) {
|
||||||
if (node && node.entry) {
|
if (node && node.entry) {
|
||||||
@@ -320,9 +323,11 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit,
|
|||||||
}
|
}
|
||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
|
this.ngZone.run(() => {
|
||||||
if (this.currentFolderPath) {
|
if (this.currentFolderPath) {
|
||||||
this.displayFolderContent(this.currentFolderPath);
|
this.displayFolderContent(this.currentFolderPath);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user