mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[ADF-587] upgrade components to angular 4 (#1866)
[ADF-587] upgrade components to angular 4
This commit is contained in:
parent
5ba1202292
commit
e29741d18d
@ -113,7 +113,7 @@ module.exports = {
|
|||||||
// Workaround for angular/angular#11580
|
// Workaround for angular/angular#11580
|
||||||
new webpack.ContextReplacementPlugin(
|
new webpack.ContextReplacementPlugin(
|
||||||
// The (\\|\/) piece accounts for path separators in *nix and Windows
|
// The (\\|\/) piece accounts for path separators in *nix and Windows
|
||||||
/angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
|
/angular(\\|\/)core(\\|\/)@angular/,
|
||||||
helpers.root('./app'), // location of your src
|
helpers.root('./app'), // location of your src
|
||||||
{} // a map of your routes
|
{} // a map of your routes
|
||||||
),
|
),
|
||||||
|
@ -49,20 +49,22 @@
|
|||||||
"alfresco"
|
"alfresco"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "2.4.7",
|
"@angular/animations": "~4.0.0",
|
||||||
"@angular/compiler": "2.4.7",
|
"@angular/common": "~4.0.0",
|
||||||
"@angular/compiler-cli": "2.4.7",
|
"@angular/compiler": "~4.0.0",
|
||||||
"@angular/core": "2.4.7",
|
"@angular/core": "~4.0.0",
|
||||||
"@angular/forms": "2.4.7",
|
"@angular/forms": "~4.0.0",
|
||||||
"@angular/http": "2.4.7",
|
"@angular/http": "~4.0.0",
|
||||||
|
"@angular/platform-browser": "~4.0.0",
|
||||||
|
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||||
|
"@angular/router": "~4.0.0",
|
||||||
|
"@angular/compiler-cli": "~4.0.0",
|
||||||
|
|
||||||
"@angular/material": "2.0.0-beta.1",
|
"@angular/material": "2.0.0-beta.1",
|
||||||
"@angular/platform-browser": "2.4.7",
|
|
||||||
"@angular/platform-browser-dynamic": "2.4.7",
|
|
||||||
"@angular/router": "3.4.7",
|
|
||||||
"core-js": "2.4.1",
|
"core-js": "2.4.1",
|
||||||
"reflect-metadata": "0.1.9",
|
"reflect-metadata": "0.1.9",
|
||||||
"rxjs": "5.1.0",
|
"rxjs": "5.1.0",
|
||||||
"zone.js": "0.7.6",
|
"zone.js": "0.8.4",
|
||||||
|
|
||||||
"dialog-polyfill": "^0.4.7",
|
"dialog-polyfill": "^0.4.7",
|
||||||
"material-design-icons": "2.2.3",
|
"material-design-icons": "2.2.3",
|
||||||
|
@ -33,15 +33,16 @@
|
|||||||
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "2.4.7",
|
"@angular/common": "~4.0.0",
|
||||||
"@angular/compiler": "2.4.7",
|
"@angular/compiler": "~4.0.0",
|
||||||
"@angular/core": "2.4.7",
|
"@angular/core": "~4.0.0",
|
||||||
"@angular/forms": "2.4.7",
|
"@angular/forms": "~4.0.0",
|
||||||
"@angular/http": "2.4.7",
|
"@angular/http": "~4.0.0",
|
||||||
|
"@angular/platform-browser": "~4.0.0",
|
||||||
|
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||||
|
"@angular/router": "~4.0.0",
|
||||||
|
|
||||||
"@angular/material": "2.0.0-beta.1",
|
"@angular/material": "2.0.0-beta.1",
|
||||||
"@angular/platform-browser": "2.4.7",
|
|
||||||
"@angular/platform-browser-dynamic": "2.4.7",
|
|
||||||
"@angular/router": "3.4.7",
|
|
||||||
"alfresco-js-api": "~1.4.0",
|
"alfresco-js-api": "~1.4.0",
|
||||||
"chart.js": "2.5.0",
|
"chart.js": "2.5.0",
|
||||||
"core-js": "2.4.1",
|
"core-js": "2.4.1",
|
||||||
@ -56,7 +57,7 @@
|
|||||||
"reflect-metadata": "0.1.10",
|
"reflect-metadata": "0.1.10",
|
||||||
"rxjs": "5.1.0",
|
"rxjs": "5.1.0",
|
||||||
"systemjs": "0.19.27",
|
"systemjs": "0.19.27",
|
||||||
"zone.js": "0.7.6"
|
"zone.js": "0.8.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/hammerjs": "^2.0.34",
|
"@types/hammerjs": "^2.0.34",
|
||||||
|
@ -108,7 +108,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let reportId = 1;
|
let reportId = 1;
|
||||||
let change = new SimpleChange(null, reportId);
|
let change = new SimpleChange(null, reportId, true);
|
||||||
component.ngOnChanges({ 'reportId': change });
|
component.ngOnChanges({ 'reportId': change });
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
@ -128,7 +128,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let reportId = 1;
|
let reportId = 1;
|
||||||
let change = new SimpleChange(null, reportId);
|
let change = new SimpleChange(null, reportId, true);
|
||||||
component.ngOnChanges({ 'reportId': change });
|
component.ngOnChanges({ 'reportId': change });
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
@ -155,7 +155,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let reportId = 1;
|
let reportId = 1;
|
||||||
let change = new SimpleChange(null, reportId);
|
let change = new SimpleChange(null, reportId, true);
|
||||||
component.ngOnChanges({ 'reportId': change });
|
component.ngOnChanges({ 'reportId': change });
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
@ -216,7 +216,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let reportId = 1;
|
let reportId = 1;
|
||||||
let change = new SimpleChange(null, reportId);
|
let change = new SimpleChange(null, reportId, true);
|
||||||
component.ngOnChanges({ 'reportId': change });
|
component.ngOnChanges({ 'reportId': change });
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
@ -241,7 +241,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let reportId = 1;
|
let reportId = 1;
|
||||||
let change = new SimpleChange(null, reportId);
|
let change = new SimpleChange(null, reportId, true);
|
||||||
component.ngOnChanges({ 'reportId': change });
|
component.ngOnChanges({ 'reportId': change });
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
@ -266,7 +266,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let reportId = 1;
|
let reportId = 1;
|
||||||
let change = new SimpleChange(null, reportId);
|
let change = new SimpleChange(null, reportId, true);
|
||||||
component.ngOnChanges({ 'reportId': change });
|
component.ngOnChanges({ 'reportId': change });
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
@ -304,7 +304,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let reportId = 1;
|
let reportId = 1;
|
||||||
let change = new SimpleChange(null, reportId);
|
let change = new SimpleChange(null, reportId, true);
|
||||||
component.ngOnChanges({ 'reportId': change });
|
component.ngOnChanges({ 'reportId': change });
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -338,7 +338,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
|||||||
|
|
||||||
component.appId = appId;
|
component.appId = appId;
|
||||||
component.reportId = '1';
|
component.reportId = '1';
|
||||||
let change = new SimpleChange(null, appId);
|
let change = new SimpleChange(null, appId, true);
|
||||||
component.ngOnChanges({ 'appId': change });
|
component.ngOnChanges({ 'appId': change });
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -351,7 +351,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let reportId = 1;
|
let reportId = 1;
|
||||||
let change = new SimpleChange(null, reportId);
|
let change = new SimpleChange(null, reportId, true);
|
||||||
component.ngOnChanges({ 'reportId': change });
|
component.ngOnChanges({ 'reportId': change });
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
@ -401,7 +401,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let reportId = 1;
|
let reportId = 1;
|
||||||
let change = new SimpleChange(null, reportId);
|
let change = new SimpleChange(null, reportId, true);
|
||||||
component.ngOnChanges({ 'reportId': change });
|
component.ngOnChanges({ 'reportId': change });
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -413,7 +413,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let reportId = 1;
|
let reportId = 1;
|
||||||
let change = new SimpleChange(null, reportId);
|
let change = new SimpleChange(null, reportId, true);
|
||||||
component.ngOnChanges({ 'reportId': change });
|
component.ngOnChanges({ 'reportId': change });
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
@ -459,7 +459,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
let reportId = 1;
|
let reportId = 1;
|
||||||
let change = new SimpleChange(null, reportId);
|
let change = new SimpleChange(null, reportId, true);
|
||||||
component.ngOnChanges({ 'reportId': change });
|
component.ngOnChanges({ 'reportId': change });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
|
@ -29,15 +29,16 @@
|
|||||||
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "2.4.7",
|
"@angular/common": "~4.0.0",
|
||||||
"@angular/compiler": "2.4.7",
|
"@angular/compiler": "~4.0.0",
|
||||||
"@angular/core": "2.4.7",
|
"@angular/core": "~4.0.0",
|
||||||
"@angular/forms": "2.4.7",
|
"@angular/forms": "~4.0.0",
|
||||||
"@angular/http": "2.4.7",
|
"@angular/http": "~4.0.0",
|
||||||
|
"@angular/platform-browser": "~4.0.0",
|
||||||
|
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||||
|
"@angular/router": "~4.0.0",
|
||||||
|
|
||||||
"@angular/material": "2.0.0-beta.1",
|
"@angular/material": "2.0.0-beta.1",
|
||||||
"@angular/platform-browser": "2.4.7",
|
|
||||||
"@angular/platform-browser-dynamic": "2.4.7",
|
|
||||||
"@angular/router": "3.4.7",
|
|
||||||
"alfresco-js-api": "~1.4.0",
|
"alfresco-js-api": "~1.4.0",
|
||||||
"core-js": "2.4.1",
|
"core-js": "2.4.1",
|
||||||
"hammerjs": "2.0.8",
|
"hammerjs": "2.0.8",
|
||||||
@ -47,7 +48,7 @@
|
|||||||
"reflect-metadata": "0.1.10",
|
"reflect-metadata": "0.1.10",
|
||||||
"rxjs": "5.1.0",
|
"rxjs": "5.1.0",
|
||||||
"systemjs": "0.19.27",
|
"systemjs": "0.19.27",
|
||||||
"zone.js": "0.7.6"
|
"zone.js": "0.8.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/hammerjs": "^2.0.34",
|
"@types/hammerjs": "^2.0.34",
|
||||||
|
@ -36,15 +36,16 @@
|
|||||||
"activiti"
|
"activiti"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "2.4.7",
|
"@angular/common": "~4.0.0",
|
||||||
"@angular/compiler": "2.4.7",
|
"@angular/compiler": "~4.0.0",
|
||||||
"@angular/core": "2.4.7",
|
"@angular/core": "~4.0.0",
|
||||||
"@angular/forms": "2.4.7",
|
"@angular/forms": "~4.0.0",
|
||||||
"@angular/http": "2.4.7",
|
"@angular/http": "~4.0.0",
|
||||||
|
"@angular/platform-browser": "~4.0.0",
|
||||||
|
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||||
|
"@angular/router": "~4.0.0",
|
||||||
|
|
||||||
"@angular/material": "2.0.0-beta.1",
|
"@angular/material": "2.0.0-beta.1",
|
||||||
"@angular/platform-browser": "2.4.7",
|
|
||||||
"@angular/platform-browser-dynamic": "2.4.7",
|
|
||||||
"@angular/router": "3.4.7",
|
|
||||||
"alfresco-js-api": "~1.4.0",
|
"alfresco-js-api": "~1.4.0",
|
||||||
"core-js": "2.4.1",
|
"core-js": "2.4.1",
|
||||||
"hammerjs": "2.0.8",
|
"hammerjs": "2.0.8",
|
||||||
@ -55,7 +56,7 @@
|
|||||||
"reflect-metadata": "0.1.10",
|
"reflect-metadata": "0.1.10",
|
||||||
"rxjs": "5.1.0",
|
"rxjs": "5.1.0",
|
||||||
"systemjs": "0.19.27",
|
"systemjs": "0.19.27",
|
||||||
"zone.js": "0.7.6"
|
"zone.js": "0.8.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/hammerjs": "^2.0.34",
|
"@types/hammerjs": "^2.0.34",
|
||||||
|
@ -137,7 +137,7 @@ describe('ActivitiContent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let contentId = 1;
|
let contentId = 1;
|
||||||
let change = new SimpleChange(null, contentId);
|
let change = new SimpleChange(null, contentId, true);
|
||||||
component.ngOnChanges({ 'id': change });
|
component.ngOnChanges({ 'id': change });
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
@ -180,7 +180,7 @@ describe('ActivitiContent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let contentId = 1;
|
let contentId = 1;
|
||||||
let change = new SimpleChange(null, contentId);
|
let change = new SimpleChange(null, contentId, true);
|
||||||
component.ngOnChanges({'id': change});
|
component.ngOnChanges({'id': change});
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
@ -208,7 +208,7 @@ describe('ActivitiContent', () => {
|
|||||||
it('should show unsupported preview with unsupported file', (done) => {
|
it('should show unsupported preview with unsupported file', (done) => {
|
||||||
|
|
||||||
let contentId = 1;
|
let contentId = 1;
|
||||||
let change = new SimpleChange(null, contentId);
|
let change = new SimpleChange(null, contentId, true);
|
||||||
component.ngOnChanges({'id': change});
|
component.ngOnChanges({'id': change});
|
||||||
|
|
||||||
component.contentLoaded.subscribe((res) => {
|
component.contentLoaded.subscribe((res) => {
|
||||||
|
@ -258,7 +258,7 @@ describe('ActivitiForm', () => {
|
|||||||
spyOn(formComponent, 'getFormByTaskId').and.stub();
|
spyOn(formComponent, 'getFormByTaskId').and.stub();
|
||||||
const taskId = '<task id>';
|
const taskId = '<task id>';
|
||||||
|
|
||||||
let change = new SimpleChange(null, taskId);
|
let change = new SimpleChange(null, taskId, true);
|
||||||
formComponent.ngOnChanges({'taskId': change});
|
formComponent.ngOnChanges({'taskId': change});
|
||||||
|
|
||||||
expect(formComponent.getFormByTaskId).toHaveBeenCalledWith(taskId);
|
expect(formComponent.getFormByTaskId).toHaveBeenCalledWith(taskId);
|
||||||
@ -268,7 +268,7 @@ describe('ActivitiForm', () => {
|
|||||||
spyOn(formComponent, 'getFormDefinitionByFormId').and.stub();
|
spyOn(formComponent, 'getFormDefinitionByFormId').and.stub();
|
||||||
const formId = '123';
|
const formId = '123';
|
||||||
|
|
||||||
let change = new SimpleChange(null, formId);
|
let change = new SimpleChange(null, formId, true);
|
||||||
formComponent.ngOnChanges({'formId': change});
|
formComponent.ngOnChanges({'formId': change});
|
||||||
|
|
||||||
expect(formComponent.getFormDefinitionByFormId).toHaveBeenCalledWith(formId);
|
expect(formComponent.getFormDefinitionByFormId).toHaveBeenCalledWith(formId);
|
||||||
@ -278,7 +278,7 @@ describe('ActivitiForm', () => {
|
|||||||
spyOn(formComponent, 'getFormDefinitionByFormName').and.stub();
|
spyOn(formComponent, 'getFormDefinitionByFormName').and.stub();
|
||||||
const formName = '<form>';
|
const formName = '<form>';
|
||||||
|
|
||||||
let change = new SimpleChange(null, formName);
|
let change = new SimpleChange(null, formName, true);
|
||||||
formComponent.ngOnChanges({'formName': change});
|
formComponent.ngOnChanges({'formName': change});
|
||||||
|
|
||||||
expect(formComponent.getFormDefinitionByFormName).toHaveBeenCalledWith(formName);
|
expect(formComponent.getFormDefinitionByFormName).toHaveBeenCalledWith(formName);
|
||||||
@ -304,7 +304,7 @@ describe('ActivitiForm', () => {
|
|||||||
spyOn(formComponent, 'getFormDefinitionByFormId').and.stub();
|
spyOn(formComponent, 'getFormDefinitionByFormId').and.stub();
|
||||||
spyOn(formComponent, 'getFormDefinitionByFormName').and.stub();
|
spyOn(formComponent, 'getFormDefinitionByFormName').and.stub();
|
||||||
|
|
||||||
formComponent.ngOnChanges({'tag': new SimpleChange(null, 'hello world')});
|
formComponent.ngOnChanges({'tag': new SimpleChange(null, 'hello world', true)});
|
||||||
|
|
||||||
expect(formComponent.getFormByTaskId).not.toHaveBeenCalled();
|
expect(formComponent.getFormByTaskId).not.toHaveBeenCalled();
|
||||||
expect(formComponent.getFormDefinitionByFormId).not.toHaveBeenCalled();
|
expect(formComponent.getFormDefinitionByFormId).not.toHaveBeenCalled();
|
||||||
|
@ -77,19 +77,19 @@ describe('ActivitiStartForm', () => {
|
|||||||
|
|
||||||
it('should load start form on change if processDefinitionId defined', () => {
|
it('should load start form on change if processDefinitionId defined', () => {
|
||||||
component.processDefinitionId = exampleId1;
|
component.processDefinitionId = exampleId1;
|
||||||
component.ngOnChanges({ processDefinitionId: new SimpleChange(exampleId1, exampleId2) });
|
component.ngOnChanges({ processDefinitionId: new SimpleChange(exampleId1, exampleId2, true) });
|
||||||
expect(formService.getStartFormDefinition).toHaveBeenCalled();
|
expect(formService.getStartFormDefinition).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should load start form when processDefinitionId changed', () => {
|
it('should load start form when processDefinitionId changed', () => {
|
||||||
component.processDefinitionId = exampleId1;
|
component.processDefinitionId = exampleId1;
|
||||||
component.ngOnChanges({ processDefinitionId: new SimpleChange(exampleId1, exampleId2) });
|
component.ngOnChanges({ processDefinitionId: new SimpleChange(exampleId1, exampleId2, true) });
|
||||||
expect(formService.getStartFormDefinition).toHaveBeenCalled();
|
expect(formService.getStartFormDefinition).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not load start form when changes notified but no change to processDefinitionId', () => {
|
it('should not load start form when changes notified but no change to processDefinitionId', () => {
|
||||||
component.processDefinitionId = exampleId1;
|
component.processDefinitionId = exampleId1;
|
||||||
component.ngOnChanges({ otherProp: new SimpleChange(exampleId1, exampleId2) });
|
component.ngOnChanges({ otherProp: new SimpleChange(exampleId1, exampleId2, true) });
|
||||||
expect(formService.getStartFormDefinition).not.toHaveBeenCalled();
|
expect(formService.getStartFormDefinition).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ describe('ActivitiStartForm', () => {
|
|||||||
}));
|
}));
|
||||||
component.processDefinitionId = exampleId1;
|
component.processDefinitionId = exampleId1;
|
||||||
component.ngOnInit();
|
component.ngOnInit();
|
||||||
component.ngOnChanges({ processDefinitionId: new SimpleChange(exampleId1, exampleId2) });
|
component.ngOnChanges({ processDefinitionId: new SimpleChange(exampleId1, exampleId2, true) });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(component.outcomesContainer).toBeTruthy();
|
expect(component.outcomesContainer).toBeTruthy();
|
||||||
});
|
});
|
||||||
@ -126,7 +126,7 @@ describe('ActivitiStartForm', () => {
|
|||||||
}));
|
}));
|
||||||
component.processDefinitionId = exampleId1;
|
component.processDefinitionId = exampleId1;
|
||||||
component.showOutcomeButtons = true;
|
component.showOutcomeButtons = true;
|
||||||
component.ngOnChanges({ processDefinitionId: new SimpleChange(exampleId1, exampleId2) });
|
component.ngOnChanges({ processDefinitionId: new SimpleChange(exampleId1, exampleId2, true) });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(component.outcomesContainer).toBeTruthy();
|
expect(component.outcomesContainer).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
@ -35,15 +35,16 @@
|
|||||||
"alfresco"
|
"alfresco"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "2.4.7",
|
"@angular/common": "~4.0.0",
|
||||||
"@angular/compiler": "2.4.7",
|
"@angular/compiler": "~4.0.0",
|
||||||
"@angular/core": "2.4.7",
|
"@angular/core": "~4.0.0",
|
||||||
"@angular/forms": "2.4.7",
|
"@angular/forms": "~4.0.0",
|
||||||
"@angular/http": "2.4.7",
|
"@angular/http": "~4.0.0",
|
||||||
|
"@angular/platform-browser": "~4.0.0",
|
||||||
|
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||||
|
"@angular/router": "~4.0.0",
|
||||||
|
|
||||||
"@angular/material": "2.0.0-beta.1",
|
"@angular/material": "2.0.0-beta.1",
|
||||||
"@angular/platform-browser": "2.4.7",
|
|
||||||
"@angular/platform-browser-dynamic": "2.4.7",
|
|
||||||
"@angular/router": "3.4.7",
|
|
||||||
"alfresco-js-api": "~1.4.0",
|
"alfresco-js-api": "~1.4.0",
|
||||||
"core-js": "2.4.1",
|
"core-js": "2.4.1",
|
||||||
"hammerjs": "2.0.8",
|
"hammerjs": "2.0.8",
|
||||||
|
@ -53,7 +53,7 @@ describe('ActivitiFilters', () => {
|
|||||||
it('should return the filter task list', (done) => {
|
it('should return the filter task list', (done) => {
|
||||||
spyOn(activitiService, 'getProcessFilters').and.returnValue(Observable.fromPromise(fakeGlobalFilterPromise));
|
spyOn(activitiService, 'getProcessFilters').and.returnValue(Observable.fromPromise(fakeGlobalFilterPromise));
|
||||||
const appId = '1';
|
const appId = '1';
|
||||||
let change = new SimpleChange(null, appId);
|
let change = new SimpleChange(null, appId, true);
|
||||||
filterList.ngOnChanges({ 'appId': change });
|
filterList.ngOnChanges({ 'appId': change });
|
||||||
|
|
||||||
filterList.onSuccess.subscribe((res) => {
|
filterList.onSuccess.subscribe((res) => {
|
||||||
@ -77,7 +77,7 @@ describe('ActivitiFilters', () => {
|
|||||||
spyOn(activitiService, 'getDeployedApplications').and.returnValue(Observable.fromPromise(fakeDeployedApplicationsPromise));
|
spyOn(activitiService, 'getDeployedApplications').and.returnValue(Observable.fromPromise(fakeDeployedApplicationsPromise));
|
||||||
spyOn(activitiService, 'getProcessFilters').and.returnValue(Observable.fromPromise(fakeGlobalFilterPromise));
|
spyOn(activitiService, 'getProcessFilters').and.returnValue(Observable.fromPromise(fakeGlobalFilterPromise));
|
||||||
|
|
||||||
let change = new SimpleChange(null, 'test');
|
let change = new SimpleChange(null, 'test', true);
|
||||||
filterList.ngOnChanges({ 'appName': change });
|
filterList.ngOnChanges({ 'appName': change });
|
||||||
|
|
||||||
filterList.onSuccess.subscribe((res) => {
|
filterList.onSuccess.subscribe((res) => {
|
||||||
@ -94,7 +94,7 @@ describe('ActivitiFilters', () => {
|
|||||||
spyOn(activitiService, 'getProcessFilters').and.returnValue(Observable.fromPromise(fakeErrorFilterPromise));
|
spyOn(activitiService, 'getProcessFilters').and.returnValue(Observable.fromPromise(fakeErrorFilterPromise));
|
||||||
|
|
||||||
const appId = '1';
|
const appId = '1';
|
||||||
let change = new SimpleChange(null, appId);
|
let change = new SimpleChange(null, appId, true);
|
||||||
filterList.ngOnChanges({ 'appId': change });
|
filterList.ngOnChanges({ 'appId': change });
|
||||||
|
|
||||||
filterList.onError.subscribe((err) => {
|
filterList.onError.subscribe((err) => {
|
||||||
@ -109,7 +109,7 @@ describe('ActivitiFilters', () => {
|
|||||||
spyOn(activitiService, 'getDeployedApplications').and.returnValue(Observable.fromPromise(fakeErrorFilterPromise));
|
spyOn(activitiService, 'getDeployedApplications').and.returnValue(Observable.fromPromise(fakeErrorFilterPromise));
|
||||||
|
|
||||||
const appId = 'fake-app';
|
const appId = 'fake-app';
|
||||||
let change = new SimpleChange(null, appId);
|
let change = new SimpleChange(null, appId, true);
|
||||||
filterList.ngOnChanges({ 'appName': change });
|
filterList.ngOnChanges({ 'appName': change });
|
||||||
|
|
||||||
filterList.onError.subscribe((err) => {
|
filterList.onError.subscribe((err) => {
|
||||||
@ -137,7 +137,7 @@ describe('ActivitiFilters', () => {
|
|||||||
spyOn(filterList, 'getFiltersByAppId').and.stub();
|
spyOn(filterList, 'getFiltersByAppId').and.stub();
|
||||||
const appId = '1';
|
const appId = '1';
|
||||||
|
|
||||||
let change = new SimpleChange(null, appId);
|
let change = new SimpleChange(null, appId, true);
|
||||||
filterList.ngOnChanges({ 'appId': change });
|
filterList.ngOnChanges({ 'appId': change });
|
||||||
|
|
||||||
expect(filterList.getFiltersByAppId).toHaveBeenCalledWith(appId);
|
expect(filterList.getFiltersByAppId).toHaveBeenCalledWith(appId);
|
||||||
@ -147,7 +147,7 @@ describe('ActivitiFilters', () => {
|
|||||||
spyOn(filterList, 'getFiltersByAppId').and.stub();
|
spyOn(filterList, 'getFiltersByAppId').and.stub();
|
||||||
const appId = null;
|
const appId = null;
|
||||||
|
|
||||||
let change = new SimpleChange(null, appId);
|
let change = new SimpleChange(null, appId, true);
|
||||||
filterList.ngOnChanges({ 'appId': change });
|
filterList.ngOnChanges({ 'appId': change });
|
||||||
|
|
||||||
expect(filterList.getFiltersByAppId).toHaveBeenCalledWith(appId);
|
expect(filterList.getFiltersByAppId).toHaveBeenCalledWith(appId);
|
||||||
@ -157,7 +157,7 @@ describe('ActivitiFilters', () => {
|
|||||||
spyOn(filterList, 'getFiltersByAppName').and.stub();
|
spyOn(filterList, 'getFiltersByAppName').and.stub();
|
||||||
const appName = 'fake-app-name';
|
const appName = 'fake-app-name';
|
||||||
|
|
||||||
let change = new SimpleChange(null, appName);
|
let change = new SimpleChange(null, appName, true);
|
||||||
filterList.ngOnChanges({ 'appName': change });
|
filterList.ngOnChanges({ 'appName': change });
|
||||||
|
|
||||||
expect(filterList.getFiltersByAppName).toHaveBeenCalledWith(appName);
|
expect(filterList.getFiltersByAppName).toHaveBeenCalledWith(appName);
|
||||||
|
@ -75,7 +75,7 @@ describe('ActivitiProcessInstanceComments', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should load comments when processInstanceId specified', () => {
|
it('should load comments when processInstanceId specified', () => {
|
||||||
let change = new SimpleChange(null, '123');
|
let change = new SimpleChange(null, '123', true);
|
||||||
component.ngOnChanges({ 'processInstanceId': change });
|
component.ngOnChanges({ 'processInstanceId': change });
|
||||||
expect(getCommentsSpy).toHaveBeenCalled();
|
expect(getCommentsSpy).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
@ -83,7 +83,7 @@ describe('ActivitiProcessInstanceComments', () => {
|
|||||||
it('should emit an error when an error occurs loading comments', () => {
|
it('should emit an error when an error occurs loading comments', () => {
|
||||||
let emitSpy = spyOn(component.error, 'emit');
|
let emitSpy = spyOn(component.error, 'emit');
|
||||||
getCommentsSpy.and.returnValue(Observable.throw({}));
|
getCommentsSpy.and.returnValue(Observable.throw({}));
|
||||||
let change = new SimpleChange(null, '123');
|
let change = new SimpleChange(null, '123', true);
|
||||||
component.ngOnChanges({ 'processInstanceId': change });
|
component.ngOnChanges({ 'processInstanceId': change });
|
||||||
expect(emitSpy).toHaveBeenCalled();
|
expect(emitSpy).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
@ -94,7 +94,7 @@ describe('ActivitiProcessInstanceComments', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should display comments when the process has comments', async(() => {
|
it('should display comments when the process has comments', async(() => {
|
||||||
let change = new SimpleChange(null, '123');
|
let change = new SimpleChange(null, '123', true);
|
||||||
component.ngOnChanges({ 'processInstanceId': change });
|
component.ngOnChanges({ 'processInstanceId': change });
|
||||||
|
|
||||||
fixture.whenStable().then(() => {
|
fixture.whenStable().then(() => {
|
||||||
@ -115,8 +115,8 @@ describe('ActivitiProcessInstanceComments', () => {
|
|||||||
|
|
||||||
describe('change detection', () => {
|
describe('change detection', () => {
|
||||||
|
|
||||||
let change = new SimpleChange('123', '456');
|
let change = new SimpleChange('123', '456', true);
|
||||||
let nullChange = new SimpleChange('123', null);
|
let nullChange = new SimpleChange('123', null, true);
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
component.processInstanceId = '123';
|
component.processInstanceId = '123';
|
||||||
|
@ -85,7 +85,7 @@ describe('ActivitiProcessInstanceDetails', () => {
|
|||||||
|
|
||||||
it('should display a header when the processInstanceId is provided', async(() => {
|
it('should display a header when the processInstanceId is provided', async(() => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
component.ngOnChanges({ 'processInstanceId': new SimpleChange(null, '123') });
|
component.ngOnChanges({ 'processInstanceId': new SimpleChange(null, '123', true) });
|
||||||
fixture.whenStable().then(() => {
|
fixture.whenStable().then(() => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
let headerEl: DebugElement = fixture.debugElement.query(By.css('h2'));
|
let headerEl: DebugElement = fixture.debugElement.query(By.css('h2'));
|
||||||
@ -97,7 +97,7 @@ describe('ActivitiProcessInstanceDetails', () => {
|
|||||||
it('should display default details when the process instance has no name', async(() => {
|
it('should display default details when the process instance has no name', async(() => {
|
||||||
getProcessSpy = getProcessSpy.and.returnValue(Observable.of(exampleProcessNoName));
|
getProcessSpy = getProcessSpy.and.returnValue(Observable.of(exampleProcessNoName));
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
component.ngOnChanges({ 'processInstanceId': new SimpleChange(null, '123') });
|
component.ngOnChanges({ 'processInstanceId': new SimpleChange(null, '123', true) });
|
||||||
fixture.whenStable().then(() => {
|
fixture.whenStable().then(() => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
let headerEl: DebugElement = fixture.debugElement.query(By.css('h2'));
|
let headerEl: DebugElement = fixture.debugElement.query(By.css('h2'));
|
||||||
@ -108,8 +108,8 @@ describe('ActivitiProcessInstanceDetails', () => {
|
|||||||
|
|
||||||
describe('change detection', () => {
|
describe('change detection', () => {
|
||||||
|
|
||||||
let change = new SimpleChange('123', '456');
|
let change = new SimpleChange('123', '456', true);
|
||||||
let nullChange = new SimpleChange('123', null);
|
let nullChange = new SimpleChange('123', null, true);
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
component.processInstanceId = '123';
|
component.processInstanceId = '123';
|
||||||
|
@ -104,7 +104,7 @@ describe('ActivitiProcessInstanceTasks', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should display active tasks', () => {
|
it('should display active tasks', () => {
|
||||||
let change = new SimpleChange(null, exampleProcessInstance);
|
let change = new SimpleChange(null, exampleProcessInstance, true);
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
component.ngOnChanges({ 'processInstanceDetails': change });
|
component.ngOnChanges({ 'processInstanceDetails': change });
|
||||||
fixture.whenStable().then(() => {
|
fixture.whenStable().then(() => {
|
||||||
@ -117,7 +117,7 @@ describe('ActivitiProcessInstanceTasks', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should display completed tasks', () => {
|
it('should display completed tasks', () => {
|
||||||
let change = new SimpleChange(null, exampleProcessInstance);
|
let change = new SimpleChange(null, exampleProcessInstance, true);
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
component.ngOnChanges({ 'processInstanceDetails': change });
|
component.ngOnChanges({ 'processInstanceDetails': change });
|
||||||
fixture.whenStable().then(() => {
|
fixture.whenStable().then(() => {
|
||||||
|
@ -145,8 +145,8 @@ describe('ActivitiProcessInstanceVariables', () => {
|
|||||||
|
|
||||||
describe('change detection', () => {
|
describe('change detection', () => {
|
||||||
|
|
||||||
let change = new SimpleChange('123', '456');
|
let change = new SimpleChange('123', '456', true);
|
||||||
let nullChange = new SimpleChange('123', null);
|
let nullChange = new SimpleChange('123', null, true);
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
component.processInstanceId = '123';
|
component.processInstanceId = '123';
|
||||||
|
@ -295,7 +295,7 @@ describe('ActivitiProcessInstanceListComponent', () => {
|
|||||||
|
|
||||||
it('should reload the list when the appId parameter changes', (done) => {
|
it('should reload the list when the appId parameter changes', (done) => {
|
||||||
const appId = '1';
|
const appId = '1';
|
||||||
let change = new SimpleChange(null, appId);
|
let change = new SimpleChange(null, appId, true);
|
||||||
|
|
||||||
component.onSuccess.subscribe((res) => {
|
component.onSuccess.subscribe((res) => {
|
||||||
expect(res).toBeDefined();
|
expect(res).toBeDefined();
|
||||||
@ -311,7 +311,7 @@ describe('ActivitiProcessInstanceListComponent', () => {
|
|||||||
|
|
||||||
it('should reload the list when the processDefinitionKey parameter changes', (done) => {
|
it('should reload the list when the processDefinitionKey parameter changes', (done) => {
|
||||||
const processDefinitionKey = 'fakeprocess';
|
const processDefinitionKey = 'fakeprocess';
|
||||||
let change = new SimpleChange(null, processDefinitionKey);
|
let change = new SimpleChange(null, processDefinitionKey, true);
|
||||||
|
|
||||||
component.onSuccess.subscribe((res) => {
|
component.onSuccess.subscribe((res) => {
|
||||||
expect(res).toBeDefined();
|
expect(res).toBeDefined();
|
||||||
@ -327,7 +327,7 @@ describe('ActivitiProcessInstanceListComponent', () => {
|
|||||||
|
|
||||||
it('should reload the list when the state parameter changes', (done) => {
|
it('should reload the list when the state parameter changes', (done) => {
|
||||||
const state = 'open';
|
const state = 'open';
|
||||||
let change = new SimpleChange(null, state);
|
let change = new SimpleChange(null, state, true);
|
||||||
|
|
||||||
component.onSuccess.subscribe((res) => {
|
component.onSuccess.subscribe((res) => {
|
||||||
expect(res).toBeDefined();
|
expect(res).toBeDefined();
|
||||||
@ -343,7 +343,7 @@ describe('ActivitiProcessInstanceListComponent', () => {
|
|||||||
|
|
||||||
it('should reload the list when the sort parameter changes', (done) => {
|
it('should reload the list when the sort parameter changes', (done) => {
|
||||||
const sort = 'created-desc';
|
const sort = 'created-desc';
|
||||||
let change = new SimpleChange(null, sort);
|
let change = new SimpleChange(null, sort, true);
|
||||||
|
|
||||||
component.onSuccess.subscribe((res) => {
|
component.onSuccess.subscribe((res) => {
|
||||||
expect(res).toBeDefined();
|
expect(res).toBeDefined();
|
||||||
@ -359,7 +359,7 @@ describe('ActivitiProcessInstanceListComponent', () => {
|
|||||||
|
|
||||||
it('should sort the list when the sort parameter changes', (done) => {
|
it('should sort the list when the sort parameter changes', (done) => {
|
||||||
const sort = 'created-asc';
|
const sort = 'created-asc';
|
||||||
let change = new SimpleChange(null, sort);
|
let change = new SimpleChange(null, sort, true);
|
||||||
let sortSpy = spyOn(component.data, 'setSorting');
|
let sortSpy = spyOn(component.data, 'setSorting');
|
||||||
|
|
||||||
component.onSuccess.subscribe((res) => {
|
component.onSuccess.subscribe((res) => {
|
||||||
@ -374,7 +374,7 @@ describe('ActivitiProcessInstanceListComponent', () => {
|
|||||||
|
|
||||||
it('should reload the process list when the name parameter changes', (done) => {
|
it('should reload the process list when the name parameter changes', (done) => {
|
||||||
const name = 'FakeTaskName';
|
const name = 'FakeTaskName';
|
||||||
let change = new SimpleChange(null, name);
|
let change = new SimpleChange(null, name, true);
|
||||||
|
|
||||||
component.onSuccess.subscribe((res) => {
|
component.onSuccess.subscribe((res) => {
|
||||||
expect(res).toBeDefined();
|
expect(res).toBeDefined();
|
||||||
|
@ -78,7 +78,7 @@ describe('ActivitiStartProcessInstance', () => {
|
|||||||
describe('process definitions list', () => {
|
describe('process definitions list', () => {
|
||||||
|
|
||||||
it('should call service to fetch process definitions', () => {
|
it('should call service to fetch process definitions', () => {
|
||||||
let change = new SimpleChange(null, '123');
|
let change = new SimpleChange(null, '123', true);
|
||||||
component.ngOnChanges({ 'appId': change });
|
component.ngOnChanges({ 'appId': change });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ describe('ActivitiStartProcessInstance', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should call service to fetch process definitions with appId when provided', () => {
|
it('should call service to fetch process definitions with appId when provided', () => {
|
||||||
let change = new SimpleChange(null, '123');
|
let change = new SimpleChange(null, '123', true);
|
||||||
component.ngOnChanges({ 'appId': change });
|
component.ngOnChanges({ 'appId': change });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ describe('ActivitiStartProcessInstance', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should display the correct number of processes in the select list', () => {
|
it('should display the correct number of processes in the select list', () => {
|
||||||
let change = new SimpleChange(null, '123');
|
let change = new SimpleChange(null, '123', true);
|
||||||
component.ngOnChanges({ 'appId': change });
|
component.ngOnChanges({ 'appId': change });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ describe('ActivitiStartProcessInstance', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should display the correct process def details', async(() => {
|
it('should display the correct process def details', async(() => {
|
||||||
let change = new SimpleChange(null, '123');
|
let change = new SimpleChange(null, '123', true);
|
||||||
component.ngOnChanges({ 'appId': change });
|
component.ngOnChanges({ 'appId': change });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ describe('ActivitiStartProcessInstance', () => {
|
|||||||
|
|
||||||
it('should indicate an error to the user if process defs cannot be loaded', async(() => {
|
it('should indicate an error to the user if process defs cannot be loaded', async(() => {
|
||||||
getDefinitionsSpy = getDefinitionsSpy.and.returnValue(Observable.throw({}));
|
getDefinitionsSpy = getDefinitionsSpy.and.returnValue(Observable.throw({}));
|
||||||
let change = new SimpleChange(null, '123');
|
let change = new SimpleChange(null, '123', true);
|
||||||
component.ngOnChanges({ 'appId': change });
|
component.ngOnChanges({ 'appId': change });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ describe('ActivitiStartProcessInstance', () => {
|
|||||||
|
|
||||||
it('should show no process available message when no process definition is loaded', async(() => {
|
it('should show no process available message when no process definition is loaded', async(() => {
|
||||||
getDefinitionsSpy = getDefinitionsSpy.and.returnValue(Observable.of([]));
|
getDefinitionsSpy = getDefinitionsSpy.and.returnValue(Observable.of([]));
|
||||||
let change = new SimpleChange(null, '123');
|
let change = new SimpleChange(null, '123', true);
|
||||||
component.ngOnChanges({ 'appId': change });
|
component.ngOnChanges({ 'appId': change });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
@ -144,8 +144,8 @@ describe('ActivitiStartProcessInstance', () => {
|
|||||||
|
|
||||||
describe('input changes', () => {
|
describe('input changes', () => {
|
||||||
|
|
||||||
let change = new SimpleChange('123', '456');
|
let change = new SimpleChange('123', '456', true);
|
||||||
let nullChange = new SimpleChange('123', null);
|
let nullChange = new SimpleChange('123', null, true);
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
component.appId = '123';
|
component.appId = '123';
|
||||||
@ -177,7 +177,7 @@ describe('ActivitiStartProcessInstance', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
component.name = 'My new process';
|
component.name = 'My new process';
|
||||||
let change = new SimpleChange(null, '123');
|
let change = new SimpleChange(null, '123', true);
|
||||||
component.ngOnChanges({ 'appId': change });
|
component.ngOnChanges({ 'appId': change });
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -247,7 +247,7 @@ describe('ActivitiStartProcessInstance', () => {
|
|||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
component.name = 'My new process';
|
component.name = 'My new process';
|
||||||
let change = new SimpleChange(null, '123');
|
let change = new SimpleChange(null, '123', true);
|
||||||
component.ngOnChanges({ 'appId': change });
|
component.ngOnChanges({ 'appId': change });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
component.onProcessDefChange('my:process1');
|
component.onProcessDefChange('my:process1');
|
||||||
@ -279,7 +279,7 @@ describe('ActivitiStartProcessInstance', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
getDefinitionsSpy.and.returnValue(Observable.of(fakeProcessDefWithForm));
|
getDefinitionsSpy.and.returnValue(Observable.of(fakeProcessDefWithForm));
|
||||||
let change = new SimpleChange(null, '123');
|
let change = new SimpleChange(null, '123', true);
|
||||||
component.ngOnChanges({ 'appId': change });
|
component.ngOnChanges({ 'appId': change });
|
||||||
component.onProcessDefChange('my:process1');
|
component.onProcessDefChange('my:process1');
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
@ -40,15 +40,16 @@
|
|||||||
"alfresco"
|
"alfresco"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "2.4.7",
|
"@angular/common": "~4.0.0",
|
||||||
"@angular/compiler": "2.4.7",
|
"@angular/compiler": "~4.0.0",
|
||||||
"@angular/core": "2.4.7",
|
"@angular/core": "~4.0.0",
|
||||||
"@angular/forms": "2.4.7",
|
"@angular/forms": "~4.0.0",
|
||||||
"@angular/http": "2.4.7",
|
"@angular/http": "~4.0.0",
|
||||||
|
"@angular/platform-browser": "~4.0.0",
|
||||||
|
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||||
|
"@angular/router": "~4.0.0",
|
||||||
|
|
||||||
"@angular/material": "2.0.0-beta.1",
|
"@angular/material": "2.0.0-beta.1",
|
||||||
"@angular/platform-browser": "2.4.7",
|
|
||||||
"@angular/platform-browser-dynamic": "2.4.7",
|
|
||||||
"@angular/router": "3.4.7",
|
|
||||||
"alfresco-js-api": "~1.4.0",
|
"alfresco-js-api": "~1.4.0",
|
||||||
"core-js": "2.4.1",
|
"core-js": "2.4.1",
|
||||||
"hammerjs": "2.0.8",
|
"hammerjs": "2.0.8",
|
||||||
|
@ -180,7 +180,7 @@ describe('ActivitiChecklist', () => {
|
|||||||
checklistComponent.taskId = 'new-fake-task-id';
|
checklistComponent.taskId = 'new-fake-task-id';
|
||||||
checklistComponent.checklist.push(fakeTaskDetail);
|
checklistComponent.checklist.push(fakeTaskDetail);
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
let change = new SimpleChange(null, 'new-fake-task-id');
|
let change = new SimpleChange(null, 'new-fake-task-id', true);
|
||||||
checklistComponent.ngOnChanges({
|
checklistComponent.ngOnChanges({
|
||||||
taskId: change
|
taskId: change
|
||||||
});
|
});
|
||||||
@ -201,7 +201,7 @@ describe('ActivitiChecklist', () => {
|
|||||||
checklistComponent.checklist.push(fakeTaskDetail);
|
checklistComponent.checklist.push(fakeTaskDetail);
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
checklistComponent.taskId = null;
|
checklistComponent.taskId = null;
|
||||||
let change = new SimpleChange(null, 'new-fake-task-id');
|
let change = new SimpleChange(null, 'new-fake-task-id', true);
|
||||||
checklistComponent.ngOnChanges({
|
checklistComponent.ngOnChanges({
|
||||||
taskId: change
|
taskId: change
|
||||||
});
|
});
|
||||||
|
@ -74,7 +74,7 @@ describe('ActivitiComments', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should load comments when taskId specified', () => {
|
it('should load comments when taskId specified', () => {
|
||||||
let change = new SimpleChange(null, '123');
|
let change = new SimpleChange(null, '123', true);
|
||||||
component.ngOnChanges({ 'taskId': change });
|
component.ngOnChanges({ 'taskId': change });
|
||||||
|
|
||||||
expect(getCommentsSpy).toHaveBeenCalled();
|
expect(getCommentsSpy).toHaveBeenCalled();
|
||||||
@ -84,7 +84,7 @@ describe('ActivitiComments', () => {
|
|||||||
let emitSpy = spyOn(component.error, 'emit');
|
let emitSpy = spyOn(component.error, 'emit');
|
||||||
getCommentsSpy.and.returnValue(Observable.throw({}));
|
getCommentsSpy.and.returnValue(Observable.throw({}));
|
||||||
|
|
||||||
let change = new SimpleChange(null, '123');
|
let change = new SimpleChange(null, '123', true);
|
||||||
component.ngOnChanges({ 'taskId': change });
|
component.ngOnChanges({ 'taskId': change });
|
||||||
|
|
||||||
expect(emitSpy).toHaveBeenCalled();
|
expect(emitSpy).toHaveBeenCalled();
|
||||||
@ -96,7 +96,7 @@ describe('ActivitiComments', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should display comments when the task has comments', async(() => {
|
it('should display comments when the task has comments', async(() => {
|
||||||
let change = new SimpleChange(null, '123');
|
let change = new SimpleChange(null, '123', true);
|
||||||
component.ngOnChanges({ 'taskId': change });
|
component.ngOnChanges({ 'taskId': change });
|
||||||
|
|
||||||
fixture.whenStable().then(() => {
|
fixture.whenStable().then(() => {
|
||||||
@ -117,8 +117,8 @@ describe('ActivitiComments', () => {
|
|||||||
|
|
||||||
describe('change detection', () => {
|
describe('change detection', () => {
|
||||||
|
|
||||||
let change = new SimpleChange('123', '456');
|
let change = new SimpleChange('123', '456', true);
|
||||||
let nullChange = new SimpleChange('123', null);
|
let nullChange = new SimpleChange('123', null, true);
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
component.taskId = '123';
|
component.taskId = '123';
|
||||||
|
@ -64,7 +64,7 @@ describe('ActivitiFilters', () => {
|
|||||||
it('should return the filter task list', (done) => {
|
it('should return the filter task list', (done) => {
|
||||||
spyOn(activitiService, 'getTaskListFilters').and.returnValue(Observable.fromPromise(fakeGlobalFilterPromise));
|
spyOn(activitiService, 'getTaskListFilters').and.returnValue(Observable.fromPromise(fakeGlobalFilterPromise));
|
||||||
const appId = '1';
|
const appId = '1';
|
||||||
let change = new SimpleChange(null, appId);
|
let change = new SimpleChange(null, appId, true);
|
||||||
filterList.ngOnChanges({ 'appId': change });
|
filterList.ngOnChanges({ 'appId': change });
|
||||||
|
|
||||||
filterList.onSuccess.subscribe((res) => {
|
filterList.onSuccess.subscribe((res) => {
|
||||||
@ -88,7 +88,7 @@ describe('ActivitiFilters', () => {
|
|||||||
spyOn(activitiService, 'getDeployedApplications').and.returnValue(Observable.fromPromise(fakeDeployedApplicationsPromise));
|
spyOn(activitiService, 'getDeployedApplications').and.returnValue(Observable.fromPromise(fakeDeployedApplicationsPromise));
|
||||||
spyOn(activitiService, 'getTaskListFilters').and.returnValue(Observable.fromPromise(fakeGlobalFilterPromise));
|
spyOn(activitiService, 'getTaskListFilters').and.returnValue(Observable.fromPromise(fakeGlobalFilterPromise));
|
||||||
|
|
||||||
let change = new SimpleChange(null, 'test');
|
let change = new SimpleChange(null, 'test', true);
|
||||||
filterList.ngOnChanges({ 'appName': change });
|
filterList.ngOnChanges({ 'appName': change });
|
||||||
|
|
||||||
filterList.onSuccess.subscribe((res) => {
|
filterList.onSuccess.subscribe((res) => {
|
||||||
@ -105,7 +105,7 @@ describe('ActivitiFilters', () => {
|
|||||||
spyOn(activitiService, 'getTaskListFilters').and.returnValue(Observable.fromPromise(fakeErrorFilterPromise));
|
spyOn(activitiService, 'getTaskListFilters').and.returnValue(Observable.fromPromise(fakeErrorFilterPromise));
|
||||||
|
|
||||||
const appId = '1';
|
const appId = '1';
|
||||||
let change = new SimpleChange(null, appId);
|
let change = new SimpleChange(null, appId, true);
|
||||||
filterList.ngOnChanges({ 'appId': change });
|
filterList.ngOnChanges({ 'appId': change });
|
||||||
|
|
||||||
filterList.onError.subscribe((err) => {
|
filterList.onError.subscribe((err) => {
|
||||||
@ -120,7 +120,7 @@ describe('ActivitiFilters', () => {
|
|||||||
spyOn(activitiService, 'getDeployedApplications').and.returnValue(Observable.fromPromise(fakeErrorFilterPromise));
|
spyOn(activitiService, 'getDeployedApplications').and.returnValue(Observable.fromPromise(fakeErrorFilterPromise));
|
||||||
|
|
||||||
const appId = 'fake-app';
|
const appId = 'fake-app';
|
||||||
let change = new SimpleChange(null, appId);
|
let change = new SimpleChange(null, appId, true);
|
||||||
filterList.ngOnChanges({ 'appName': change });
|
filterList.ngOnChanges({ 'appName': change });
|
||||||
|
|
||||||
filterList.onError.subscribe((err) => {
|
filterList.onError.subscribe((err) => {
|
||||||
@ -148,7 +148,7 @@ describe('ActivitiFilters', () => {
|
|||||||
spyOn(filterList, 'getFiltersByAppId').and.stub();
|
spyOn(filterList, 'getFiltersByAppId').and.stub();
|
||||||
const appId = '1';
|
const appId = '1';
|
||||||
|
|
||||||
let change = new SimpleChange(null, appId);
|
let change = new SimpleChange(null, appId, true);
|
||||||
filterList.ngOnChanges({ 'appId': change });
|
filterList.ngOnChanges({ 'appId': change });
|
||||||
|
|
||||||
expect(filterList.getFiltersByAppId).toHaveBeenCalledWith(appId);
|
expect(filterList.getFiltersByAppId).toHaveBeenCalledWith(appId);
|
||||||
@ -158,7 +158,7 @@ describe('ActivitiFilters', () => {
|
|||||||
spyOn(filterList, 'getFiltersByAppId').and.stub();
|
spyOn(filterList, 'getFiltersByAppId').and.stub();
|
||||||
const appId = null;
|
const appId = null;
|
||||||
|
|
||||||
let change = new SimpleChange(null, appId);
|
let change = new SimpleChange(null, appId, true);
|
||||||
filterList.ngOnChanges({ 'appId': change });
|
filterList.ngOnChanges({ 'appId': change });
|
||||||
|
|
||||||
expect(filterList.getFiltersByAppId).toHaveBeenCalledWith(appId);
|
expect(filterList.getFiltersByAppId).toHaveBeenCalledWith(appId);
|
||||||
@ -168,7 +168,7 @@ describe('ActivitiFilters', () => {
|
|||||||
spyOn(filterList, 'getFiltersByAppName').and.stub();
|
spyOn(filterList, 'getFiltersByAppName').and.stub();
|
||||||
const appName = 'fake-app-name';
|
const appName = 'fake-app-name';
|
||||||
|
|
||||||
let change = new SimpleChange(null, appName);
|
let change = new SimpleChange(null, appName, true);
|
||||||
filterList.ngOnChanges({ 'appName': change });
|
filterList.ngOnChanges({ 'appName': change });
|
||||||
|
|
||||||
expect(filterList.getFiltersByAppName).toHaveBeenCalledWith(appName);
|
expect(filterList.getFiltersByAppName).toHaveBeenCalledWith(appName);
|
||||||
@ -187,7 +187,7 @@ describe('ActivitiFilters', () => {
|
|||||||
it('should load Default list when no appid or taskid are provided', () => {
|
it('should load Default list when no appid or taskid are provided', () => {
|
||||||
spyOn(filterList, 'getFiltersByAppId').and.stub();
|
spyOn(filterList, 'getFiltersByAppId').and.stub();
|
||||||
|
|
||||||
let change = new SimpleChange(null, null);
|
let change = new SimpleChange(null, null, true);
|
||||||
filterList.ngOnChanges({ 'appName': change });
|
filterList.ngOnChanges({ 'appName': change });
|
||||||
|
|
||||||
expect(filterList.getFiltersByAppId).toHaveBeenCalled();
|
expect(filterList.getFiltersByAppId).toHaveBeenCalled();
|
||||||
|
@ -120,8 +120,8 @@ describe('ActivitiTaskDetails', () => {
|
|||||||
|
|
||||||
describe('change detection', () => {
|
describe('change detection', () => {
|
||||||
|
|
||||||
let change = new SimpleChange('123', '456');
|
let change = new SimpleChange('123', '456', true);
|
||||||
let nullChange = new SimpleChange('123', null);
|
let nullChange = new SimpleChange('123', null, true);
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
component.taskId = '123';
|
component.taskId = '123';
|
||||||
|
@ -145,9 +145,9 @@ describe('ActivitiTaskList', () => {
|
|||||||
spyOn(taskListService, 'getTotalTasks').and.returnValue(Observable.of(fakeGlobalTotalTasks));
|
spyOn(taskListService, 'getTotalTasks').and.returnValue(Observable.of(fakeGlobalTotalTasks));
|
||||||
spyOn(taskListService, 'getTasks').and.returnValue(Observable.of(fakeGlobalTask));
|
spyOn(taskListService, 'getTasks').and.returnValue(Observable.of(fakeGlobalTask));
|
||||||
|
|
||||||
let state = new SimpleChange(null, 'open');
|
let state = new SimpleChange(null, 'open', true);
|
||||||
let processDefinitionKey = new SimpleChange(null, null);
|
let processDefinitionKey = new SimpleChange(null, null, true);
|
||||||
let assignment = new SimpleChange(null, 'fake-assignee');
|
let assignment = new SimpleChange(null, 'fake-assignee', true);
|
||||||
|
|
||||||
component.onSuccess.subscribe((res) => {
|
component.onSuccess.subscribe((res) => {
|
||||||
expect(res).toBeDefined();
|
expect(res).toBeDefined();
|
||||||
@ -186,9 +186,9 @@ describe('ActivitiTaskList', () => {
|
|||||||
spyOn(taskListService, 'getTotalTasks').and.returnValue(Observable.of(fakeGlobalTotalTasks));
|
spyOn(taskListService, 'getTotalTasks').and.returnValue(Observable.of(fakeGlobalTotalTasks));
|
||||||
spyOn(taskListService, 'getTasks').and.returnValue(Observable.of(fakeGlobalTask));
|
spyOn(taskListService, 'getTasks').and.returnValue(Observable.of(fakeGlobalTask));
|
||||||
|
|
||||||
let state = new SimpleChange(null, 'open');
|
let state = new SimpleChange(null, 'open', true);
|
||||||
let processDefinitionKey = new SimpleChange(null, 'fakeprocess');
|
let processDefinitionKey = new SimpleChange(null, 'fakeprocess', true);
|
||||||
let assignment = new SimpleChange(null, 'fake-assignee');
|
let assignment = new SimpleChange(null, 'fake-assignee', true);
|
||||||
|
|
||||||
component.onSuccess.subscribe((res) => {
|
component.onSuccess.subscribe((res) => {
|
||||||
expect(res).toBeDefined();
|
expect(res).toBeDefined();
|
||||||
@ -212,8 +212,8 @@ describe('ActivitiTaskList', () => {
|
|||||||
it('should throw an exception when the response is wrong', (done) => {
|
it('should throw an exception when the response is wrong', (done) => {
|
||||||
spyOn(taskListService, 'getTotalTasks').and.returnValue(Observable.throw(fakeErrorTaskList));
|
spyOn(taskListService, 'getTotalTasks').and.returnValue(Observable.throw(fakeErrorTaskList));
|
||||||
|
|
||||||
let state = new SimpleChange(null, 'open');
|
let state = new SimpleChange(null, 'open', true);
|
||||||
let assignment = new SimpleChange(null, 'fake-assignee');
|
let assignment = new SimpleChange(null, 'fake-assignee', true);
|
||||||
|
|
||||||
component.onError.subscribe((err) => {
|
component.onError.subscribe((err) => {
|
||||||
expect(err).toBeDefined();
|
expect(err).toBeDefined();
|
||||||
@ -328,7 +328,7 @@ describe('ActivitiTaskList', () => {
|
|||||||
|
|
||||||
it('should reload the list when the appId parameter changes', (done) => {
|
it('should reload the list when the appId parameter changes', (done) => {
|
||||||
const appId = '1';
|
const appId = '1';
|
||||||
let change = new SimpleChange(null, appId);
|
let change = new SimpleChange(null, appId, true);
|
||||||
|
|
||||||
component.onSuccess.subscribe((res) => {
|
component.onSuccess.subscribe((res) => {
|
||||||
expect(res).toBeDefined();
|
expect(res).toBeDefined();
|
||||||
@ -344,7 +344,7 @@ describe('ActivitiTaskList', () => {
|
|||||||
|
|
||||||
it('should reload the list when the processDefinitionKey parameter changes', (done) => {
|
it('should reload the list when the processDefinitionKey parameter changes', (done) => {
|
||||||
const processDefinitionKey = 'fakeprocess';
|
const processDefinitionKey = 'fakeprocess';
|
||||||
let change = new SimpleChange(null, processDefinitionKey);
|
let change = new SimpleChange(null, processDefinitionKey, true);
|
||||||
|
|
||||||
component.onSuccess.subscribe((res) => {
|
component.onSuccess.subscribe((res) => {
|
||||||
expect(res).toBeDefined();
|
expect(res).toBeDefined();
|
||||||
@ -360,7 +360,7 @@ describe('ActivitiTaskList', () => {
|
|||||||
|
|
||||||
it('should reload the list when the state parameter changes', (done) => {
|
it('should reload the list when the state parameter changes', (done) => {
|
||||||
const state = 'open';
|
const state = 'open';
|
||||||
let change = new SimpleChange(null, state);
|
let change = new SimpleChange(null, state, true);
|
||||||
|
|
||||||
component.onSuccess.subscribe((res) => {
|
component.onSuccess.subscribe((res) => {
|
||||||
expect(res).toBeDefined();
|
expect(res).toBeDefined();
|
||||||
@ -376,7 +376,7 @@ describe('ActivitiTaskList', () => {
|
|||||||
|
|
||||||
it('should reload the list when the sort parameter changes', (done) => {
|
it('should reload the list when the sort parameter changes', (done) => {
|
||||||
const sort = 'desc';
|
const sort = 'desc';
|
||||||
let change = new SimpleChange(null, sort);
|
let change = new SimpleChange(null, sort, true);
|
||||||
|
|
||||||
component.onSuccess.subscribe((res) => {
|
component.onSuccess.subscribe((res) => {
|
||||||
expect(res).toBeDefined();
|
expect(res).toBeDefined();
|
||||||
@ -392,7 +392,7 @@ describe('ActivitiTaskList', () => {
|
|||||||
|
|
||||||
it('should reload the process list when the name parameter changes', (done) => {
|
it('should reload the process list when the name parameter changes', (done) => {
|
||||||
const name = 'FakeTaskName';
|
const name = 'FakeTaskName';
|
||||||
let change = new SimpleChange(null, name);
|
let change = new SimpleChange(null, name, true);
|
||||||
|
|
||||||
component.onSuccess.subscribe((res) => {
|
component.onSuccess.subscribe((res) => {
|
||||||
expect(res).toBeDefined();
|
expect(res).toBeDefined();
|
||||||
@ -408,7 +408,7 @@ describe('ActivitiTaskList', () => {
|
|||||||
|
|
||||||
it('should reload the list when the assignment parameter changes', (done) => {
|
it('should reload the list when the assignment parameter changes', (done) => {
|
||||||
const assignment = 'assignee';
|
const assignment = 'assignee';
|
||||||
let change = new SimpleChange(null, assignment);
|
let change = new SimpleChange(null, assignment, true);
|
||||||
|
|
||||||
component.onSuccess.subscribe((res) => {
|
component.onSuccess.subscribe((res) => {
|
||||||
expect(res).toBeDefined();
|
expect(res).toBeDefined();
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { NgModule, ModuleWithProviders } from '@angular/core';
|
import { NgModule, ModuleWithProviders } from '@angular/core';
|
||||||
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
import { HttpModule, Http } from '@angular/http';
|
import { HttpModule, Http } from '@angular/http';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
@ -86,6 +87,7 @@ export function createTranslateLoader(http: Http, logService: LogService) {
|
|||||||
FormsModule,
|
FormsModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
HttpModule,
|
HttpModule,
|
||||||
|
BrowserAnimationsModule,
|
||||||
MaterialModule.forRoot(),
|
MaterialModule.forRoot(),
|
||||||
TranslateModule.forRoot({
|
TranslateModule.forRoot({
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
@ -105,6 +107,7 @@ export function createTranslateLoader(http: Http, logService: LogService) {
|
|||||||
...ALFRESCO_CORE_PROVIDERS
|
...ALFRESCO_CORE_PROVIDERS
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
|
BrowserAnimationsModule,
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
MaterialModule,
|
MaterialModule,
|
||||||
|
@ -44,17 +44,18 @@
|
|||||||
"alfresco"
|
"alfresco"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "2.4.7",
|
"@angular/animations": "~4.0.0",
|
||||||
"@angular/compiler": "2.4.7",
|
"@angular/common": "~4.0.0",
|
||||||
"@angular/compiler-cli": "2.4.7",
|
"@angular/compiler": "~4.0.0",
|
||||||
"@angular/core": "2.4.7",
|
"@angular/core": "~4.0.0",
|
||||||
"@angular/forms": "2.4.7",
|
"@angular/forms": "~4.0.0",
|
||||||
"@angular/http": "2.4.7",
|
"@angular/http": "~4.0.0",
|
||||||
|
"@angular/platform-browser": "~4.0.0",
|
||||||
|
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||||
|
"@angular/router": "~4.0.0",
|
||||||
|
"@angular/compiler-cli": "~4.0.0",
|
||||||
|
|
||||||
"@angular/material": "2.0.0-beta.1",
|
"@angular/material": "2.0.0-beta.1",
|
||||||
"@angular/platform-browser": "2.4.7",
|
|
||||||
"@angular/platform-browser-dynamic": "2.4.7",
|
|
||||||
"@angular/router": "3.4.7",
|
|
||||||
"@angular/upgrade": "2.4.7",
|
|
||||||
"alfresco-js-api": "~1.4.0",
|
"alfresco-js-api": "~1.4.0",
|
||||||
"core-js": "2.4.1",
|
"core-js": "2.4.1",
|
||||||
"dialog-polyfill": "0.4.7",
|
"dialog-polyfill": "0.4.7",
|
||||||
|
@ -33,7 +33,7 @@ const mockBackendResponse = (connection: MockConnection, response: string) => {
|
|||||||
|
|
||||||
describe('TranslateLoader', () => {
|
describe('TranslateLoader', () => {
|
||||||
let injector: Injector;
|
let injector: Injector;
|
||||||
let backend: MockBackend;
|
let backend: any;
|
||||||
let alfrescoTranslationService: AlfrescoTranslationService;
|
let alfrescoTranslationService: AlfrescoTranslationService;
|
||||||
let connection: MockConnection; // this will be set when a new connection is emitted from the backend.
|
let connection: MockConnection; // this will be set when a new connection is emitted from the backend.
|
||||||
let customLoader;
|
let customLoader;
|
||||||
|
@ -31,7 +31,7 @@ const mockBackendResponse = (connection: MockConnection, response: string) => {
|
|||||||
|
|
||||||
describe('AlfrescoTranslationService', () => {
|
describe('AlfrescoTranslationService', () => {
|
||||||
let injector: Injector;
|
let injector: Injector;
|
||||||
let backend: MockBackend;
|
let backend: any;
|
||||||
let alfrescoTranslationService: AlfrescoTranslationService;
|
let alfrescoTranslationService: AlfrescoTranslationService;
|
||||||
let connection: MockConnection; // this will be set when a new connection is emitted from the backend.
|
let connection: MockConnection; // this will be set when a new connection is emitted from the backend.
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { NotificationService } from './notification.service';
|
import { NotificationService } from './notification.service';
|
||||||
import { MdSnackBarModule } from '@angular/material';
|
import { MdSnackBarModule } from '@angular/material';
|
||||||
@ -24,7 +25,10 @@ describe('NotificationService', () => {
|
|||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [MdSnackBarModule.forRoot()],
|
imports: [
|
||||||
|
BrowserAnimationsModule,
|
||||||
|
MdSnackBarModule.forRoot()
|
||||||
|
],
|
||||||
declarations: [ComponentThatProvidesNotificationService],
|
declarations: [ComponentThatProvidesNotificationService],
|
||||||
providers: [
|
providers: [
|
||||||
NotificationService
|
NotificationService
|
||||||
|
@ -36,15 +36,16 @@
|
|||||||
"alfresco"
|
"alfresco"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "2.4.7",
|
"@angular/common": "~4.0.0",
|
||||||
"@angular/compiler": "2.4.7",
|
"@angular/compiler": "~4.0.0",
|
||||||
"@angular/core": "2.4.7",
|
"@angular/core": "~4.0.0",
|
||||||
"@angular/forms": "2.4.7",
|
"@angular/forms": "~4.0.0",
|
||||||
"@angular/http": "2.4.7",
|
"@angular/http": "~4.0.0",
|
||||||
|
"@angular/platform-browser": "~4.0.0",
|
||||||
|
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||||
|
"@angular/router": "~4.0.0",
|
||||||
|
|
||||||
"@angular/material": "2.0.0-beta.1",
|
"@angular/material": "2.0.0-beta.1",
|
||||||
"@angular/platform-browser": "2.4.7",
|
|
||||||
"@angular/platform-browser-dynamic": "2.4.7",
|
|
||||||
"@angular/router": "3.4.7",
|
|
||||||
"alfresco-js-api": "~1.4.0",
|
"alfresco-js-api": "~1.4.0",
|
||||||
"core-js": "2.4.1",
|
"core-js": "2.4.1",
|
||||||
"hammerjs": "2.0.8",
|
"hammerjs": "2.0.8",
|
||||||
|
@ -103,7 +103,7 @@ describe('DataTable', () => {
|
|||||||
let data = new ObjectDataTableAdapter([], []);
|
let data = new ObjectDataTableAdapter([], []);
|
||||||
|
|
||||||
expect(table.data).toBeUndefined();
|
expect(table.data).toBeUndefined();
|
||||||
table.ngOnChanges({'data': new SimpleChange('123', data)});
|
table.ngOnChanges({'data': new SimpleChange('123', data, true)});
|
||||||
expect(table.data).toEqual(data);
|
expect(table.data).toEqual(data);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ describe('PaginationComponent', () => {
|
|||||||
it('should update the summary on input pagination parameter change', () => {
|
it('should update the summary on input pagination parameter change', () => {
|
||||||
spyOn(paginationComponent, 'updateSummary');
|
spyOn(paginationComponent, 'updateSummary');
|
||||||
|
|
||||||
paginationComponent.ngOnChanges({pagination: new SimpleChange(null, new PaginationData(0, 0, 0, 20, true))});
|
paginationComponent.ngOnChanges({pagination: new SimpleChange(null, new PaginationData(0, 0, 0, 20, true), true)});
|
||||||
|
|
||||||
expect(paginationComponent.updateSummary).toHaveBeenCalled();
|
expect(paginationComponent.updateSummary).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
@ -44,15 +44,16 @@
|
|||||||
"alfresco"
|
"alfresco"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "2.4.7",
|
"@angular/common": "~4.0.0",
|
||||||
"@angular/compiler": "2.4.7",
|
"@angular/compiler": "~4.0.0",
|
||||||
"@angular/core": "2.4.7",
|
"@angular/core": "~4.0.0",
|
||||||
"@angular/forms": "2.4.7",
|
"@angular/forms": "~4.0.0",
|
||||||
"@angular/http": "2.4.7",
|
"@angular/http": "~4.0.0",
|
||||||
|
"@angular/platform-browser": "~4.0.0",
|
||||||
|
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||||
|
"@angular/router": "~4.0.0",
|
||||||
|
|
||||||
"@angular/material": "2.0.0-beta.1",
|
"@angular/material": "2.0.0-beta.1",
|
||||||
"@angular/platform-browser": "2.4.7",
|
|
||||||
"@angular/platform-browser-dynamic": "2.4.7",
|
|
||||||
"@angular/router": "3.4.7",
|
|
||||||
"alfresco-js-api": "~1.4.0",
|
"alfresco-js-api": "~1.4.0",
|
||||||
"core-js": "2.4.1",
|
"core-js": "2.4.1",
|
||||||
"hammerjs": "2.0.8",
|
"hammerjs": "2.0.8",
|
||||||
|
@ -460,7 +460,7 @@ describe('DocumentList', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
documentList.currentFolderId = 'wrong-id';
|
documentList.currentFolderId = 'wrong-id';
|
||||||
documentList.ngOnChanges({currentFolderId: new SimpleChange(null, documentList.currentFolderId)});
|
documentList.ngOnChanges({currentFolderId: new SimpleChange(null, documentList.currentFolderId, true)});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should require dataTable to check empty template', () => {
|
it('should require dataTable to check empty template', () => {
|
||||||
@ -526,7 +526,7 @@ describe('DocumentList', () => {
|
|||||||
it('should load folder by ID on init', () => {
|
it('should load folder by ID on init', () => {
|
||||||
documentList.currentFolderId = '1d26e465-dea3-42f3-b415-faa8364b9692';
|
documentList.currentFolderId = '1d26e465-dea3-42f3-b415-faa8364b9692';
|
||||||
spyOn(documentList, 'loadFolderNodesByFolderNodeId').and.returnValue(Promise.resolve());
|
spyOn(documentList, 'loadFolderNodesByFolderNodeId').and.returnValue(Promise.resolve());
|
||||||
documentList.ngOnChanges({folderNode: new SimpleChange(null, documentList.currentFolderId)});
|
documentList.ngOnChanges({folderNode: new SimpleChange(null, documentList.currentFolderId, true)});
|
||||||
expect(documentList.loadFolderNodesByFolderNodeId).toHaveBeenCalled();
|
expect(documentList.loadFolderNodesByFolderNodeId).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -176,7 +176,7 @@ describe('Document menu action', () => {
|
|||||||
describe('Check Permissions', () => {
|
describe('Check Permissions', () => {
|
||||||
|
|
||||||
it('should get the folder permission when folderId is changed', async(() => {
|
it('should get the folder permission when folderId is changed', async(() => {
|
||||||
let change = new SimpleChange('folder-id', 'new-folder-id');
|
let change = new SimpleChange('folder-id', 'new-folder-id', true);
|
||||||
component.ngOnChanges({ 'folderId': change });
|
component.ngOnChanges({ 'folderId': change });
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
@ -196,7 +196,7 @@ describe('Document menu action', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
it('should disable the create button if folder does not have any allowable operations', async(() => {
|
it('should disable the create button if folder does not have any allowable operations', async(() => {
|
||||||
let change = new SimpleChange('folder-id', 'new-folder-id');
|
let change = new SimpleChange('folder-id', 'new-folder-id', true);
|
||||||
component.ngOnChanges({ 'folderId': change });
|
component.ngOnChanges({ 'folderId': change });
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
@ -214,7 +214,7 @@ describe('Document menu action', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
it('should disable the create button if folder does not have create permission', async(() => {
|
it('should disable the create button if folder does not have create permission', async(() => {
|
||||||
let change = new SimpleChange('folder-id', 'new-folder-id');
|
let change = new SimpleChange('folder-id', 'new-folder-id', true);
|
||||||
component.ngOnChanges({ 'folderId': change });
|
component.ngOnChanges({ 'folderId': change });
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
@ -233,7 +233,7 @@ describe('Document menu action', () => {
|
|||||||
|
|
||||||
it('should not disable the option when disableWithNoPermission is false', async(() => {
|
it('should not disable the option when disableWithNoPermission is false', async(() => {
|
||||||
component.disableWithNoPermission = false;
|
component.disableWithNoPermission = false;
|
||||||
let change = new SimpleChange('folder-id', 'new-folder-id');
|
let change = new SimpleChange('folder-id', 'new-folder-id', true);
|
||||||
component.ngOnChanges({ 'folderId': change });
|
component.ngOnChanges({ 'folderId': change });
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
@ -251,7 +251,7 @@ describe('Document menu action', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
it('should emit permission event error when user does not have create permission', async(() => {
|
it('should emit permission event error when user does not have create permission', async(() => {
|
||||||
let change = new SimpleChange('folder-id', 'new-folder-id');
|
let change = new SimpleChange('folder-id', 'new-folder-id', true);
|
||||||
component.ngOnChanges({ 'folderId': change });
|
component.ngOnChanges({ 'folderId': change });
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
|
@ -48,15 +48,16 @@
|
|||||||
"alfresco"
|
"alfresco"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "2.4.7",
|
"@angular/common": "~4.0.0",
|
||||||
"@angular/compiler": "2.4.7",
|
"@angular/compiler": "~4.0.0",
|
||||||
"@angular/core": "2.4.7",
|
"@angular/core": "~4.0.0",
|
||||||
"@angular/forms": "2.4.7",
|
"@angular/forms": "~4.0.0",
|
||||||
"@angular/http": "2.4.7",
|
"@angular/http": "~4.0.0",
|
||||||
|
"@angular/platform-browser": "~4.0.0",
|
||||||
|
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||||
|
"@angular/router": "~4.0.0",
|
||||||
|
|
||||||
"@angular/material": "2.0.0-beta.1",
|
"@angular/material": "2.0.0-beta.1",
|
||||||
"@angular/platform-browser": "2.4.7",
|
|
||||||
"@angular/platform-browser-dynamic": "2.4.7",
|
|
||||||
"@angular/router": "3.4.7",
|
|
||||||
"alfresco-js-api": "~1.4.0",
|
"alfresco-js-api": "~1.4.0",
|
||||||
"hammerjs": "2.0.8",
|
"hammerjs": "2.0.8",
|
||||||
"ng2-alfresco-core": "1.4.0",
|
"ng2-alfresco-core": "1.4.0",
|
||||||
|
@ -44,15 +44,16 @@
|
|||||||
"alfresco"
|
"alfresco"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "2.4.7",
|
"@angular/common": "~4.0.0",
|
||||||
"@angular/compiler": "2.4.7",
|
"@angular/compiler": "~4.0.0",
|
||||||
"@angular/core": "2.4.7",
|
"@angular/core": "~4.0.0",
|
||||||
"@angular/forms": "2.4.7",
|
"@angular/forms": "~4.0.0",
|
||||||
"@angular/http": "2.4.7",
|
"@angular/http": "~4.0.0",
|
||||||
|
"@angular/platform-browser": "~4.0.0",
|
||||||
|
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||||
|
"@angular/router": "~4.0.0",
|
||||||
|
|
||||||
"@angular/material": "2.0.0-beta.1",
|
"@angular/material": "2.0.0-beta.1",
|
||||||
"@angular/platform-browser": "2.4.7",
|
|
||||||
"@angular/platform-browser-dynamic": "2.4.7",
|
|
||||||
"@angular/router": "3.4.7",
|
|
||||||
"alfresco-js-api": "~1.4.0",
|
"alfresco-js-api": "~1.4.0",
|
||||||
"core-js": "2.4.1",
|
"core-js": "2.4.1",
|
||||||
"hammerjs": "2.0.8",
|
"hammerjs": "2.0.8",
|
||||||
|
@ -255,7 +255,7 @@ describe('AlfrescoSearchComponent', () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
component.ngOnChanges({searchTerm: new SimpleChange('', 'searchTerm2')});
|
component.ngOnChanges({searchTerm: new SimpleChange('', 'searchTerm2', true)});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -23,15 +23,16 @@
|
|||||||
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "2.2.2",
|
"@angular/common": "~4.0.0",
|
||||||
"@angular/compiler": "2.2.2",
|
"@angular/compiler": "~4.0.0",
|
||||||
"@angular/core": "2.2.2",
|
"@angular/core": "~4.0.0",
|
||||||
"@angular/forms": "2.2.2",
|
"@angular/forms": "~4.0.0",
|
||||||
"@angular/http": "2.2.2",
|
"@angular/http": "~4.0.0",
|
||||||
|
"@angular/platform-browser": "~4.0.0",
|
||||||
|
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||||
|
"@angular/router": "~4.0.0",
|
||||||
|
|
||||||
"@angular/material": "2.0.0-beta.1",
|
"@angular/material": "2.0.0-beta.1",
|
||||||
"@angular/platform-browser": "2.2.2",
|
|
||||||
"@angular/platform-browser-dynamic": "2.2.2",
|
|
||||||
"@angular/router": "3.2.2",
|
|
||||||
"alfresco-js-api": "~1.4.0",
|
"alfresco-js-api": "~1.4.0",
|
||||||
"core-js": "2.4.1",
|
"core-js": "2.4.1",
|
||||||
"hammerjs": "2.0.8",
|
"hammerjs": "2.0.8",
|
||||||
|
@ -23,15 +23,16 @@
|
|||||||
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "2.4.7",
|
"@angular/common": "~4.0.0",
|
||||||
"@angular/compiler": "2.4.7",
|
"@angular/compiler": "~4.0.0",
|
||||||
"@angular/core": "2.4.7",
|
"@angular/core": "~4.0.0",
|
||||||
"@angular/forms": "2.4.7",
|
"@angular/forms": "~4.0.0",
|
||||||
"@angular/http": "2.4.7",
|
"@angular/http": "~4.0.0",
|
||||||
|
"@angular/platform-browser": "~4.0.0",
|
||||||
|
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||||
|
"@angular/router": "~4.0.0",
|
||||||
|
|
||||||
"@angular/material": "2.0.0-beta.1",
|
"@angular/material": "2.0.0-beta.1",
|
||||||
"@angular/platform-browser": "2.4.7",
|
|
||||||
"@angular/platform-browser-dynamic": "2.4.7",
|
|
||||||
"@angular/router": "3.4.7",
|
|
||||||
"alfresco-js-api": "~1.4.0",
|
"alfresco-js-api": "~1.4.0",
|
||||||
"core-js": "2.4.1",
|
"core-js": "2.4.1",
|
||||||
"hammerjs": "2.0.8",
|
"hammerjs": "2.0.8",
|
||||||
|
@ -45,15 +45,16 @@
|
|||||||
"alfresco"
|
"alfresco"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "2.4.7",
|
"@angular/common": "~4.0.0",
|
||||||
"@angular/compiler": "2.4.7",
|
"@angular/compiler": "~4.0.0",
|
||||||
"@angular/core": "2.4.7",
|
"@angular/core": "~4.0.0",
|
||||||
"@angular/forms": "2.4.7",
|
"@angular/forms": "~4.0.0",
|
||||||
"@angular/http": "2.4.7",
|
"@angular/http": "~4.0.0",
|
||||||
|
"@angular/platform-browser": "~4.0.0",
|
||||||
|
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||||
|
"@angular/router": "~4.0.0",
|
||||||
|
|
||||||
"@angular/material": "2.0.0-beta.1",
|
"@angular/material": "2.0.0-beta.1",
|
||||||
"@angular/platform-browser": "2.4.7",
|
|
||||||
"@angular/platform-browser-dynamic": "2.4.7",
|
|
||||||
"@angular/router": "3.4.7",
|
|
||||||
"alfresco-js-api": "~1.4.0",
|
"alfresco-js-api": "~1.4.0",
|
||||||
"core-js": "2.4.1",
|
"core-js": "2.4.1",
|
||||||
"hammerjs": "2.0.8",
|
"hammerjs": "2.0.8",
|
||||||
|
@ -175,7 +175,7 @@ describe('UploadButtonComponent', () => {
|
|||||||
|
|
||||||
spyOn(uploadService, 'getFolderNode').and.returnValue(Observable.of(fakeFolderNodeWithPermission));
|
spyOn(uploadService, 'getFolderNode').and.returnValue(Observable.of(fakeFolderNodeWithPermission));
|
||||||
|
|
||||||
component.ngOnChanges({ rootFolderId: new SimpleChange(null, component.rootFolderId) });
|
component.ngOnChanges({ rootFolderId: new SimpleChange(null, component.rootFolderId, true) });
|
||||||
component.onFilesAdded(fakeEvent);
|
component.onFilesAdded(fakeEvent);
|
||||||
let compiled = fixture.debugElement.nativeElement;
|
let compiled = fixture.debugElement.nativeElement;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
@ -189,7 +189,7 @@ describe('UploadButtonComponent', () => {
|
|||||||
|
|
||||||
spyOn(uploadService, 'getFolderNode').and.returnValue(Observable.of(fakeFolderNodeWithPermission));
|
spyOn(uploadService, 'getFolderNode').and.returnValue(Observable.of(fakeFolderNodeWithPermission));
|
||||||
|
|
||||||
component.ngOnChanges({ rootFolderId: new SimpleChange(null, component.rootFolderId) });
|
component.ngOnChanges({ rootFolderId: new SimpleChange(null, component.rootFolderId, true) });
|
||||||
component.onFilesAdded(fakeEvent);
|
component.onFilesAdded(fakeEvent);
|
||||||
let compiled = fixture.debugElement.nativeElement;
|
let compiled = fixture.debugElement.nativeElement;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
@ -204,7 +204,7 @@ describe('UploadButtonComponent', () => {
|
|||||||
|
|
||||||
spyOn(uploadService, 'getFolderNode').and.returnValue(Observable.of(fakeFolderNodeWithPermission));
|
spyOn(uploadService, 'getFolderNode').and.returnValue(Observable.of(fakeFolderNodeWithPermission));
|
||||||
|
|
||||||
component.ngOnChanges({ rootFolderId: new SimpleChange(null, component.rootFolderId) });
|
component.ngOnChanges({ rootFolderId: new SimpleChange(null, component.rootFolderId, true) });
|
||||||
uploadService.uploadFilesInTheQueue = jasmine.createSpy('uploadFilesInTheQueue');
|
uploadService.uploadFilesInTheQueue = jasmine.createSpy('uploadFilesInTheQueue');
|
||||||
|
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
@ -219,7 +219,7 @@ describe('UploadButtonComponent', () => {
|
|||||||
component.onSuccess = null;
|
component.onSuccess = null;
|
||||||
|
|
||||||
spyOn(uploadService, 'getFolderNode').and.returnValue(Observable.of(fakeFolderNodeWithPermission));
|
spyOn(uploadService, 'getFolderNode').and.returnValue(Observable.of(fakeFolderNodeWithPermission));
|
||||||
component.ngOnChanges({ rootFolderId: new SimpleChange(null, component.rootFolderId) });
|
component.ngOnChanges({ rootFolderId: new SimpleChange(null, component.rootFolderId, true) });
|
||||||
|
|
||||||
uploadService.uploadFilesInTheQueue = jasmine.createSpy('uploadFilesInTheQueue');
|
uploadService.uploadFilesInTheQueue = jasmine.createSpy('uploadFilesInTheQueue');
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ describe('UploadButtonComponent', () => {
|
|||||||
spyOn(uploadService, 'getFolderNode').and.returnValue(Observable.of(fakeFolderNodeWithPermission));
|
spyOn(uploadService, 'getFolderNode').and.returnValue(Observable.of(fakeFolderNodeWithPermission));
|
||||||
spyOn(uploadService, 'callApiCreateFolder').and.returnValue(fakeResolvePromise);
|
spyOn(uploadService, 'callApiCreateFolder').and.returnValue(fakeResolvePromise);
|
||||||
|
|
||||||
component.ngOnChanges({ rootFolderId: new SimpleChange(null, component.rootFolderId) });
|
component.ngOnChanges({ rootFolderId: new SimpleChange(null, component.rootFolderId, true) });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
component.onSuccess.subscribe(e => {
|
component.onSuccess.subscribe(e => {
|
||||||
expect(e.value).toEqual('File uploaded');
|
expect(e.value).toEqual('File uploaded');
|
||||||
@ -257,7 +257,7 @@ describe('UploadButtonComponent', () => {
|
|||||||
spyOn(uploadService, 'getFolderNode').and.returnValue(Observable.of(fakeFolderNodeWithPermission));
|
spyOn(uploadService, 'getFolderNode').and.returnValue(Observable.of(fakeFolderNodeWithPermission));
|
||||||
spyOn(uploadService, 'callApiCreateFolder').and.returnValue(fakeRejectPromise);
|
spyOn(uploadService, 'callApiCreateFolder').and.returnValue(fakeRejectPromise);
|
||||||
|
|
||||||
component.ngOnChanges({ rootFolderId: new SimpleChange(null, component.rootFolderId) });
|
component.ngOnChanges({ rootFolderId: new SimpleChange(null, component.rootFolderId, true) });
|
||||||
|
|
||||||
component.onError.subscribe(e => {
|
component.onError.subscribe(e => {
|
||||||
expect(e.value).toEqual('FILE_UPLOAD.MESSAGES.FOLDER_ALREADY_EXIST');
|
expect(e.value).toEqual('FILE_UPLOAD.MESSAGES.FOLDER_ALREADY_EXIST');
|
||||||
|
@ -23,15 +23,16 @@
|
|||||||
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "2.4.7",
|
"@angular/common": "~4.0.0",
|
||||||
"@angular/compiler": "2.4.7",
|
"@angular/compiler": "~4.0.0",
|
||||||
"@angular/core": "2.4.7",
|
"@angular/core": "~4.0.0",
|
||||||
"@angular/forms": "2.4.7",
|
"@angular/forms": "~4.0.0",
|
||||||
"@angular/http": "2.4.7",
|
"@angular/http": "~4.0.0",
|
||||||
|
"@angular/platform-browser": "~4.0.0",
|
||||||
|
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||||
|
"@angular/router": "~4.0.0",
|
||||||
|
|
||||||
"@angular/material": "2.0.0-beta.1",
|
"@angular/material": "2.0.0-beta.1",
|
||||||
"@angular/platform-browser": "2.4.7",
|
|
||||||
"@angular/platform-browser-dynamic": "2.4.7",
|
|
||||||
"@angular/router": "3.4.7",
|
|
||||||
"alfresco-js-api": "~1.4.0",
|
"alfresco-js-api": "~1.4.0",
|
||||||
"core-js": "2.4.1",
|
"core-js": "2.4.1",
|
||||||
"hammerjs": "2.0.8",
|
"hammerjs": "2.0.8",
|
||||||
|
@ -38,15 +38,16 @@
|
|||||||
"alfresco"
|
"alfresco"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "2.4.7",
|
"@angular/common": "~4.0.0",
|
||||||
"@angular/compiler": "2.4.7",
|
"@angular/compiler": "~4.0.0",
|
||||||
"@angular/core": "2.4.7",
|
"@angular/core": "~4.0.0",
|
||||||
"@angular/forms": "2.4.7",
|
"@angular/forms": "~4.0.0",
|
||||||
"@angular/http": "2.4.7",
|
"@angular/http": "~4.0.0",
|
||||||
|
"@angular/platform-browser": "~4.0.0",
|
||||||
|
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||||
|
"@angular/router": "~4.0.0",
|
||||||
|
|
||||||
"@angular/material": "2.0.0-beta.1",
|
"@angular/material": "2.0.0-beta.1",
|
||||||
"@angular/platform-browser": "2.4.7",
|
|
||||||
"@angular/platform-browser-dynamic": "2.4.7",
|
|
||||||
"@angular/router": "3.4.7",
|
|
||||||
"alfresco-js-api": "~1.4.0",
|
"alfresco-js-api": "~1.4.0",
|
||||||
"core-js": "2.4.1",
|
"core-js": "2.4.1",
|
||||||
"hammerjs": "2.0.8",
|
"hammerjs": "2.0.8",
|
||||||
|
@ -64,7 +64,7 @@ describe('Test ng2-alfresco-viewer Img viewer component ', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('If no url or blob are passed should thrown an error', () => {
|
it('If no url or blob are passed should thrown an error', () => {
|
||||||
let change = new SimpleChange(null, null);
|
let change = new SimpleChange(null, null, true);
|
||||||
expect(() => {
|
expect(() => {
|
||||||
component.ngOnChanges({ 'blobFile': change });
|
component.ngOnChanges({ 'blobFile': change });
|
||||||
}).toThrow(new Error('Attribute urlFile or blobFile is required'));
|
}).toThrow(new Error('Attribute urlFile or blobFile is required'));
|
||||||
@ -87,7 +87,7 @@ describe('Test ng2-alfresco-viewer Img viewer component ', () => {
|
|||||||
let blob = createFakeBlob();
|
let blob = createFakeBlob();
|
||||||
|
|
||||||
spyOn(service, 'createTrustedUrl').and.returnValue('fake-blob-url');
|
spyOn(service, 'createTrustedUrl').and.returnValue('fake-blob-url');
|
||||||
let change = new SimpleChange(null, blob);
|
let change = new SimpleChange(null, blob, true);
|
||||||
expect(() => {
|
expect(() => {
|
||||||
component.ngOnChanges({ 'blobFile': change });
|
component.ngOnChanges({ 'blobFile': change });
|
||||||
}).not.toThrow(new Error('Attribute urlFile or blobFile is required'));
|
}).not.toThrow(new Error('Attribute urlFile or blobFile is required'));
|
||||||
|
@ -65,7 +65,7 @@ describe('Test ng2-alfresco-viewer Media player component ', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('If no url or no blob are passed should thrown an error', () => {
|
it('If no url or no blob are passed should thrown an error', () => {
|
||||||
let change = new SimpleChange(null, null);
|
let change = new SimpleChange(null, null, true);
|
||||||
expect(() => {
|
expect(() => {
|
||||||
component.ngOnChanges({ 'blobFile': change });
|
component.ngOnChanges({ 'blobFile': change });
|
||||||
}).toThrow(new Error('Attribute urlFile or blobFile is required'));
|
}).toThrow(new Error('Attribute urlFile or blobFile is required'));
|
||||||
@ -89,7 +89,7 @@ describe('Test ng2-alfresco-viewer Media player component ', () => {
|
|||||||
let blob = createFakeBlob();
|
let blob = createFakeBlob();
|
||||||
|
|
||||||
spyOn(service, 'createTrustedUrl').and.returnValue('fake-blob-url');
|
spyOn(service, 'createTrustedUrl').and.returnValue('fake-blob-url');
|
||||||
let change = new SimpleChange(null, blob);
|
let change = new SimpleChange(null, blob, true);
|
||||||
expect(() => {
|
expect(() => {
|
||||||
component.ngOnChanges({ 'blobFile': change });
|
component.ngOnChanges({ 'blobFile': change });
|
||||||
}).not.toThrow(new Error('Attribute urlFile or blobFile is required'));
|
}).not.toThrow(new Error('Attribute urlFile or blobFile is required'));
|
||||||
|
@ -23,7 +23,9 @@ import { getTestBed, TestBed, async } from '@angular/core/testing';
|
|||||||
import { Injector } from '@angular/core';
|
import { Injector } from '@angular/core';
|
||||||
|
|
||||||
export class MockElementRef extends ElementRef {
|
export class MockElementRef extends ElementRef {
|
||||||
|
constructor() {
|
||||||
|
super(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
describe('ExtensionViewerComponent', () => {
|
describe('ExtensionViewerComponent', () => {
|
||||||
|
@ -23,15 +23,16 @@
|
|||||||
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "2.4.7",
|
"@angular/common": "~4.0.0",
|
||||||
"@angular/compiler": "2.4.7",
|
"@angular/compiler": "~4.0.0",
|
||||||
"@angular/core": "2.4.7",
|
"@angular/core": "~4.0.0",
|
||||||
"@angular/forms": "2.4.7",
|
"@angular/forms": "~4.0.0",
|
||||||
"@angular/http": "2.4.7",
|
"@angular/http": "~4.0.0",
|
||||||
|
"@angular/platform-browser": "~4.0.0",
|
||||||
|
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||||
|
"@angular/router": "~4.0.0",
|
||||||
|
|
||||||
"@angular/material": "2.0.0-beta.1",
|
"@angular/material": "2.0.0-beta.1",
|
||||||
"@angular/platform-browser": "2.4.7",
|
|
||||||
"@angular/platform-browser-dynamic": "2.4.7",
|
|
||||||
"@angular/router": "3.4.7",
|
|
||||||
"alfresco-js-api": "~1.4.0",
|
"alfresco-js-api": "~1.4.0",
|
||||||
"core-js": "2.4.1",
|
"core-js": "2.4.1",
|
||||||
"hammerjs": "2.0.8",
|
"hammerjs": "2.0.8",
|
||||||
|
@ -54,17 +54,17 @@
|
|||||||
"6": "bpm"
|
"6": "bpm"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "2.2.2",
|
"@angular/animations": "~4.0.0",
|
||||||
"@angular/compiler": "2.2.2",
|
"@angular/common": "~4.0.0",
|
||||||
"@angular/compiler-cli": "2.4.7",
|
"@angular/compiler": "~4.0.0",
|
||||||
"@angular/core": "2.2.2",
|
"@angular/core": "~4.0.0",
|
||||||
"@angular/forms": "2.2.2",
|
"@angular/forms": "~4.0.0",
|
||||||
"@angular/http": "2.2.2",
|
"@angular/http": "~4.0.0",
|
||||||
|
"@angular/platform-browser": "~4.0.0",
|
||||||
|
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||||
|
"@angular/router": "~4.0.0",
|
||||||
|
"@angular/compiler-cli": "~4.0.0",
|
||||||
"@angular/material": "2.0.0-beta.1",
|
"@angular/material": "2.0.0-beta.1",
|
||||||
"@angular/platform-browser": "2.2.2",
|
|
||||||
"@angular/platform-browser-dynamic": "2.2.2",
|
|
||||||
"@angular/router": "3.2.2",
|
|
||||||
"@angular/upgrade": "2.4.7",
|
|
||||||
"alfresco-js-api": "~1.4.0",
|
"alfresco-js-api": "~1.4.0",
|
||||||
"core-js": "2.4.1",
|
"core-js": "2.4.1",
|
||||||
"dialog-polyfill": "0.4.7",
|
"dialog-polyfill": "0.4.7",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user