diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.js b/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.js index 41e35c9438..96d6fee1fa 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.js +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.js @@ -44,7 +44,7 @@ System.register(['angular2/core', './document-list'], function(exports_1, contex // so that content children can access it } ContentColumnList.prototype.registerColumn = function (column) { - if (column) { + if (this.documentList && column) { this.documentList.columns.push(column); } }; diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.js.map b/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.js.map index 42ad335fcd..c00bd59f55 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.js.map +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.js.map @@ -1 +1 @@ -{"version":3,"file":"content-column-list.js","sourceRoot":"","sources":["content-column-list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;YAUH;gBACI,2BAAoB,YAA0B;oBAA1B,iBAAY,GAAZ,YAAY,CAAc;oBAC1C,sCAAsC;oBACtC,yCAAyC;gBAC7C,CAAC;gBAED,0CAAc,GAAd,UAAe,MAA0B;oBACrC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;wBACT,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;oBAC3C,CAAC;gBACL,CAAC;gBAdL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,iBAAiB;wBAC3B,QAAQ,EAAE,EAAE;qBACf,CAAC;;qCAAA;gBAYF,wBAAC;YAAD,CAAC,AAXD,IAWC;YAXD,iDAWC,CAAA"} \ No newline at end of file +{"version":3,"file":"content-column-list.js","sourceRoot":"","sources":["content-column-list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;YAUH;gBACI,2BAAoB,YAA0B;oBAA1B,iBAAY,GAAZ,YAAY,CAAc;oBAC1C,sCAAsC;oBACtC,yCAAyC;gBAC7C,CAAC;gBAED,0CAAc,GAAd,UAAe,MAA0B;oBACrC,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,IAAI,MAAM,CAAC,CAAC,CAAC;wBAC9B,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;oBAC3C,CAAC;gBACL,CAAC;gBAdL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,iBAAiB;wBAC3B,QAAQ,EAAE,EAAE;qBACf,CAAC;;qCAAA;gBAYF,wBAAC;YAAD,CAAC,AAXD,IAWC;YAXD,iDAWC,CAAA"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.ts b/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.ts index 0ad9d62688..ad48474c11 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.ts @@ -30,7 +30,7 @@ export class ContentColumnList { } registerColumn(column: ContentColumnModel) { - if (column) { + if (this.documentList && column) { this.documentList.columns.push(column); } } diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-column.js b/ng2-components/ng2-alfresco-documentlist/src/components/content-column.js index 0851eb3d4c..ed6cd83cce 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-column.js +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-column.js @@ -54,7 +54,9 @@ System.register(['angular2/core', './content-column-list', './../models/content- if (!model.srTitle && model.source === '$thumbnail') { model.srTitle = 'Thumbnail'; } - this.list.registerColumn(model); + if (this.list) { + this.list.registerColumn(model); + } }; __decorate([ core_1.Input(), diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-column.js.map b/ng2-components/ng2-alfresco-documentlist/src/components/content-column.js.map index be345dae57..511410ad0c 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-column.js.map +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-column.js.map @@ -1 +1 @@ -{"version":3,"file":"content-column.js","sourceRoot":"","sources":["content-column.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;YAUH;gBAiBI,uBACY,IAAuB;oBAAvB,SAAI,GAAJ,IAAI,CAAmB;oBAfnC,UAAK,GAAW,EAAE,CAAC;gBAgBnB,CAAC;gBAED,gCAAQ,GAAR;oBACI,IAAI,KAAK,GAAG,IAAI,yCAAkB,EAAE,CAAC;oBACrC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;oBACzB,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;oBAC7B,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;oBAC3B,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;oBAE/B,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM,KAAK,YAAY,CAAC,CAAC,CAAC;wBAClD,KAAK,CAAC,OAAO,GAAG,WAAW,CAAC;oBAChC,CAAC;oBAED,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;gBACpC,CAAC;gBA/BD;oBAAC,YAAK,EAAE;;4DAAA;gBAMR;oBAAC,YAAK,CAAC,UAAU,CAAC;;8DAAA;gBAGlB;oBAAC,YAAK,EAAE;;6DAAA;gBAGR;oBAAC,YAAK,CAAC,OAAO,CAAC;;+DAAA;gBAlBnB;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,gBAAgB;wBAC1B,QAAQ,EAAE,EAAE;qBACf,CAAC;;iCAAA;gBAmCF,oBAAC;YAAD,CAAC,AAlCD,IAkCC;YAlCD,yCAkCC,CAAA"} \ No newline at end of file +{"version":3,"file":"content-column.js","sourceRoot":"","sources":["content-column.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;YAUH;gBAiBI,uBACY,IAAuB;oBAAvB,SAAI,GAAJ,IAAI,CAAmB;oBAfnC,UAAK,GAAW,EAAE,CAAC;gBAgBnB,CAAC;gBAED,gCAAQ,GAAR;oBACI,IAAI,KAAK,GAAG,IAAI,yCAAkB,EAAE,CAAC;oBACrC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;oBACzB,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;oBAC7B,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;oBAC3B,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;oBAE/B,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM,KAAK,YAAY,CAAC,CAAC,CAAC;wBAClD,KAAK,CAAC,OAAO,GAAG,WAAW,CAAC;oBAChC,CAAC;oBAED,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;wBACZ,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;oBACpC,CAAC;gBACL,CAAC;gBAjCD;oBAAC,YAAK,EAAE;;4DAAA;gBAMR;oBAAC,YAAK,CAAC,UAAU,CAAC;;8DAAA;gBAGlB;oBAAC,YAAK,EAAE;;6DAAA;gBAGR;oBAAC,YAAK,CAAC,OAAO,CAAC;;+DAAA;gBAlBnB;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,gBAAgB;wBAC1B,QAAQ,EAAE,EAAE;qBACf,CAAC;;iCAAA;gBAqCF,oBAAC;YAAD,CAAC,AApCD,IAoCC;YApCD,yCAoCC,CAAA"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-column.ts b/ng2-components/ng2-alfresco-documentlist/src/components/content-column.ts index 65a2d23ec6..cc62d35db2 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-column.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-column.ts @@ -55,6 +55,8 @@ export class ContentColumn implements OnInit { model.srTitle = 'Thumbnail'; } - this.list.registerColumn(model); + if (this.list) { + this.list.registerColumn(model); + } } } diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.js b/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.js index f7b0be49e7..c0bf009745 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.js +++ b/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.js @@ -46,7 +46,7 @@ System.register(['angular2/core', './alfresco.service'], function(exports_1, con DocumentActionsService.prototype.getHandler = function (key) { if (key) { var lkey = key.toLowerCase(); - return this.handlers[lkey]; + return this.handlers[lkey] || null; } return null; }; @@ -69,7 +69,7 @@ System.register(['angular2/core', './alfresco.service'], function(exports_1, con window.alert('standard document action 2'); }; DocumentActionsService.prototype.download = function (obj) { - if (obj && !obj.isFolder) { + if (this._alfrescoService && obj && !obj.isFolder) { var link = document.createElement('a'); document.body.appendChild(link); link.setAttribute('download', 'download'); diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.js.map b/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.js.map index e32a58a868..fbf975bc28 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.js.map +++ b/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.js.map @@ -1 +1 @@ -{"version":3,"file":"document-actions.service.js","sourceRoot":"","sources":["document-actions.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;YAOH;gBAGI,gCAAoB,gBAAiC;oBAAjC,qBAAgB,GAAhB,gBAAgB,CAAiB;oBAF7C,aAAQ,GAA4C,EAAE,CAAC;oBAG3D,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AC;wBACvB,IAAI,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;wBACvC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;wBAChC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;wBAC1C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;wBACrD,IAAI,CAAC,KAAK,EAAE,CAAC;wBACb,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;oBACpC,CAAC;gBACL,CAAC;gBAhDL;oBAAC,iBAAU,EAAE;;0CAAA;gBAiDb,6BAAC;YAAD,CAAC,AAhDD,IAgDC;YAhDD,2DAgDC,CAAA"} \ No newline at end of file +{"version":3,"file":"document-actions.service.js","sourceRoot":"","sources":["document-actions.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;YAOH;gBAGI,gCAAoB,gBAAiC;oBAAjC,qBAAgB,GAAhB,gBAAgB,CAAiB;oBAF7C,aAAQ,GAA4C,EAAE,CAAC;oBAG3D,IAAI,CAAC,mBAAmB,EAAE,CAAC;gBAC/B,CAAC;gBAED,2CAAU,GAAV,UAAW,GAAW;oBAClB,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;wBACN,IAAI,IAAI,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;wBAC7B,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;oBACvC,CAAC;oBACD,MAAM,CAAC,IAAI,CAAC;gBAChB,CAAC;gBAED,2CAAU,GAAV,UAAW,GAAW,EAAE,OAA6B;oBACjD,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;wBACN,IAAI,IAAI,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;wBAC7B,IAA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;;0CAAA;gBAiDb,6BAAC;YAAD,CAAC,AAhDD,IAgDC;YAhDD,2DAgDC,CAAA"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.ts b/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.ts index 3dce46d9b4..d15ef780ad 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.ts @@ -30,7 +30,7 @@ export class DocumentActionsService { getHandler(key: string): ContentActionHandler { if (key) { let lkey = key.toLowerCase(); - return this.handlers[lkey]; + return this.handlers[lkey] || null; } return null; } @@ -59,7 +59,7 @@ export class DocumentActionsService { } private download(obj: any) { - if (obj && !obj.isFolder) { + if (this._alfrescoService && obj && !obj.isFolder) { let link = document.createElement('a'); document.body.appendChild(link); link.setAttribute('download', 'download'); diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.js b/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.js index 7ae2b32bdd..6997fb6e9a 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.js +++ b/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.js @@ -44,7 +44,7 @@ System.register(['angular2/core'], function(exports_1, context_1) { FolderActionsService.prototype.getHandler = function (key) { if (key) { var lkey = key.toLowerCase(); - return this.handlers[lkey]; + return this.handlers[lkey] || null; } return null; }; diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.js.map b/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.js.map index 898f9f0cfc..34251d612c 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.js.map +++ b/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.js.map @@ -1 +1 @@ -{"version":3,"file":"folder-actions.service.js","sourceRoot":"","sources":["folder-actions.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;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;;;;;YAMH;gBAGI;oBAFQ,aAAQ,GAA4C,EAAE,CAAC;oBAG3D,qEAAqE;oBACrE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBACjE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACrE,CAAC;gBAED,yCAAU,GAAV,UAAW,GAAW;oBAClB,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;wBACN,IAAI,IAAI,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;wBAC7B,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;oBACvC,CAAC;oBACD,MAAM,CAAC,IAAI,CAAC;gBAChB,CAAC;gBAED,yCAAU,GAAV,UAAW,GAAW,EAAE,OAA6B;oBACjD,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;wBACN,IAAI,IAAI,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;wBAC7B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;oBAClC,CAAC;gBACL,CAAC;gBAEO,oDAAqB,GAA7B,UAA8B,QAAa;oBACvC,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;gBAC7C,CAAC;gBAEO,oDAAqB,GAA7B,UAA8B,QAAa;oBACvC,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;gBAC7C,CAAC;gBA/BL;oBAAC,iBAAU,EAAE;;wCAAA;gBAgCb,2BAAC;YAAD,CAAC,AA/BD,IA+BC;YA/BD,uDA+BC,CAAA"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.ts b/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.ts index 7727598616..f364b6d6a8 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.ts @@ -31,7 +31,7 @@ export class FolderActionsService { getHandler(key: string): ContentActionHandler { if (key) { let lkey = key.toLowerCase(); - return this.handlers[lkey]; + return this.handlers[lkey] || null; } return null; } diff --git a/ng2-components/ng2-alfresco-documentlist/test/components/content-column-list.spec.ts b/ng2-components/ng2-alfresco-documentlist/test/components/content-column-list.spec.ts new file mode 100644 index 0000000000..600984cdc3 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/test/components/content-column-list.spec.ts @@ -0,0 +1,48 @@ +/** + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + it, + describe, + expect, + beforeEach +} from 'angular2/testing'; +import {DocumentList} from '../../src/components/document-list'; +import {AlfrescoServiceMock} from '../assets/alfresco.service.mock'; +import {ContentColumnList} from '../../src/components/content-column-list'; +import {ContentColumnModel} from '../../src/models/content-column.model'; + +describe('ContentColumnList', () => { + + let documentList: DocumentList; + let columnList: ContentColumnList; + + beforeEach(() => { + let alfrescoServiceMock = new AlfrescoServiceMock(); + documentList = new DocumentList(alfrescoServiceMock); + columnList = new ContentColumnList(documentList); + }); + + it('should register column within parent document list', () => { + expect(documentList.columns.length).toBe(0); + + columnList.registerColumn(new ContentColumnModel()); + + expect(documentList.columns.length).toBe(1); + }); + +}); diff --git a/ng2-components/ng2-alfresco-documentlist/test/components/content-column.spec.ts b/ng2-components/ng2-alfresco-documentlist/test/components/content-column.spec.ts new file mode 100644 index 0000000000..192fbc854a --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/test/components/content-column.spec.ts @@ -0,0 +1,79 @@ +/** + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + it, + describe, + expect, + beforeEach +} from 'angular2/testing'; +import {DocumentList} from '../../src/components/document-list'; +import {ContentColumn} from '../../src/components/content-column'; +import {AlfrescoServiceMock} from '../assets/alfresco.service.mock'; +import {ContentColumnList} from '../../src/components/content-column-list'; + +describe('ContentColumn', () => { + + let documentList: DocumentList; + let columnList: ContentColumnList; + + beforeEach(() => { + let alfrescoServiceMock = new AlfrescoServiceMock(); + documentList = new DocumentList(alfrescoServiceMock); + columnList = new ContentColumnList(documentList); + }); + + it('should register model within parent column list', () => { + spyOn(columnList, 'registerColumn').and.callThrough(); + + let column = new ContentColumn(columnList); + column.ngOnInit(); + + expect(columnList.registerColumn).toHaveBeenCalled(); + }); + + it('should setup model properties during registration', () => { + + let column = new ContentColumn(columnList); + column.title = '