From 49d378489370118e3eb1582d68552da0121f557e Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Wed, 14 Jun 2017 20:18:52 +0100 Subject: [PATCH] [ADF-524] Datatable loading state (#1958) * loading state datatable * modify readme after review --- .../ng2-alfresco-datatable/README.md | 1 + .../document-list.component.spec.ts | 22 +++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/ng2-components/ng2-alfresco-datatable/README.md b/ng2-components/ng2-alfresco-datatable/README.md index b379d36ea7..3d220e38d7 100644 --- a/ng2-components/ng2-alfresco-datatable/README.md +++ b/ng2-components/ng2-alfresco-datatable/README.md @@ -220,6 +220,7 @@ You can add a template that will be showed when there are no result in your data [data]="data" [actions]="contentActions" [multiselect]="multiselect" + [loading]=isLoading()" (showRowContextMenu)="onShowRowContextMenu($event)" (showRowActionsMenu)="onShowRowActionsMenu($event)" (executeRowAction)="onExecuteRowAction($event)" diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.component.spec.ts b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.component.spec.ts index 36aaf5f30b..479a3db5a9 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.component.spec.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.component.spec.ts @@ -62,7 +62,7 @@ describe('DocumentList', () => { ], providers: [ DocumentListService, - { provide: NgZone, useValue: zone } + {provide: NgZone, useValue: zone} ] }).compileComponents(); })); @@ -237,7 +237,7 @@ describe('DocumentList', () => { documentMenu ]; - let nodeFile = { entry: { isFile: true, name: 'xyz', allowableOperations: ['create', 'update'] } }; + let nodeFile = {entry: {isFile: true, name: 'xyz', allowableOperations: ['create', 'update']}}; let actions = documentList.getNodeActions(nodeFile); expect(actions.length).toBe(1); @@ -258,7 +258,7 @@ describe('DocumentList', () => { documentMenu ]; - let nodeFile = { entry: { isFolder: true, name: 'xyz', allowableOperations: ['create', 'update'] } }; + let nodeFile = {entry: {isFolder: true, name: 'xyz', allowableOperations: ['create', 'update']}}; let actions = documentList.getNodeActions(nodeFile); expect(actions.length).toBe(1); @@ -279,7 +279,7 @@ describe('DocumentList', () => { documentMenu ]; - let nodeFile = { entry: { isFile: true, name: 'xyz', allowableOperations: ['create', 'update'] } }; + let nodeFile = {entry: {isFile: true, name: 'xyz', allowableOperations: ['create', 'update']}}; let actions = documentList.getNodeActions(nodeFile); expect(actions.length).toBe(1); @@ -299,7 +299,7 @@ describe('DocumentList', () => { documentMenu ]; - let nodeFile = { entry: { isFolder: true, name: 'xyz', allowableOperations: ['create', 'update'] } }; + let nodeFile = {entry: {isFolder: true, name: 'xyz', allowableOperations: ['create', 'update']}}; let actions = documentList.getNodeActions(nodeFile); expect(actions.length).toBe(1); @@ -319,7 +319,7 @@ describe('DocumentList', () => { documentMenu ]; - let nodeFile = { entry: { isFile: true, name: 'xyz', allowableOperations: ['create', 'update', 'delete'] } }; + let nodeFile = {entry: {isFile: true, name: 'xyz', allowableOperations: ['create', 'update', 'delete']}}; let actions = documentList.getNodeActions(nodeFile); expect(actions.length).toBe(1); @@ -339,7 +339,7 @@ describe('DocumentList', () => { documentMenu ]; - let nodeFile = { entry: { isFolder: true, name: 'xyz', allowableOperations: ['create', 'update', 'delete'] } }; + let nodeFile = {entry: {isFolder: true, name: 'xyz', allowableOperations: ['create', 'update', 'delete']}}; let actions = documentList.getNodeActions(nodeFile); expect(actions.length).toBe(1); @@ -358,7 +358,7 @@ describe('DocumentList', () => { documentMenu ]; - let nodeFile = { entry: { isFile: true, name: 'xyz', allowableOperations: null } }; + let nodeFile = {entry: {isFile: true, name: 'xyz', allowableOperations: null}}; let actions = documentList.getNodeActions(nodeFile); expect(actions.length).toBe(1); @@ -377,7 +377,7 @@ describe('DocumentList', () => { documentMenu ]; - let nodeFile = { entry: { isFolder: true, name: 'xyz', allowableOperations: null } }; + let nodeFile = {entry: {isFolder: true, name: 'xyz', allowableOperations: null}}; let actions = documentList.getNodeActions(nodeFile); expect(actions.length).toBe(1); @@ -681,7 +681,7 @@ describe('DocumentList', () => { }); documentList.currentFolderId = 'wrong-id'; - documentList.ngOnChanges({ currentFolderId: new SimpleChange(null, documentList.currentFolderId, true) }); + documentList.ngOnChanges({currentFolderId: new SimpleChange(null, documentList.currentFolderId, true)}); }); it('should require dataTable to check empty template', () => { @@ -773,7 +773,7 @@ describe('DocumentList', () => { it('should load folder by ID on init', () => { documentList.currentFolderId = '1d26e465-dea3-42f3-b415-faa8364b9692'; spyOn(documentList, 'loadFolderNodesByFolderNodeId').and.returnValue(Promise.resolve()); - documentList.ngOnChanges({ folderNode: new SimpleChange(null, documentList.currentFolderId, true) }); + documentList.ngOnChanges({folderNode: new SimpleChange(null, documentList.currentFolderId, true)}); expect(documentList.loadFolderNodesByFolderNodeId).toHaveBeenCalled(); });