mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
tslint arrow-parens rule (#4003)
This commit is contained in:
@@ -48,7 +48,7 @@ export class ActivitiContentService {
|
||||
return from(apiService.activiti.alfrescoApi.getContentInFolder(accountShortId, folderId))
|
||||
.pipe(
|
||||
map(this.toJsonArray),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ export class ActivitiContentService {
|
||||
return from(apiService.activiti.alfrescoApi.getRepositories(opts))
|
||||
.pipe(
|
||||
map(this.toJsonArray),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ export class ActivitiContentService {
|
||||
}))
|
||||
.pipe(
|
||||
map(this.toJson),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ export class ActivitiContentService {
|
||||
return from(apiService.activiti.contentApi.createTemporaryRelatedContent(params))
|
||||
.pipe(
|
||||
map(this.toJson),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -229,14 +229,14 @@ describe('EcmModelService', () => {
|
||||
|
||||
it('Should create an ECM type with properties', (done) => {
|
||||
spyOn(service, 'createEcmType').and.callFake(() => {
|
||||
return new Observable(observer => {
|
||||
return new Observable((observer) => {
|
||||
observer.next();
|
||||
observer.complete();
|
||||
});
|
||||
});
|
||||
|
||||
spyOn(service, 'addPropertyToAType').and.callFake(() => {
|
||||
return new Observable(observer => {
|
||||
return new Observable((observer) => {
|
||||
observer.next();
|
||||
observer.complete();
|
||||
});
|
||||
@@ -251,14 +251,14 @@ describe('EcmModelService', () => {
|
||||
|
||||
it('Should return the already existing type', (done) => {
|
||||
spyOn(service, 'searchEcmType').and.callFake(() => {
|
||||
return new Observable(observer => {
|
||||
return new Observable((observer) => {
|
||||
observer.next({test: 'I-EXIST'});
|
||||
observer.complete();
|
||||
});
|
||||
});
|
||||
|
||||
spyOn(service, 'createEcmTypeWithProperties').and.callFake(() => {
|
||||
return new Observable(observer => {
|
||||
return new Observable((observer) => {
|
||||
observer.next();
|
||||
observer.complete();
|
||||
});
|
||||
@@ -273,14 +273,14 @@ describe('EcmModelService', () => {
|
||||
|
||||
it('Should create an ECM type with properties if the ecm Type is not defined already', (done) => {
|
||||
spyOn(service, 'searchEcmType').and.callFake(() => {
|
||||
return new Observable(observer => {
|
||||
return new Observable((observer) => {
|
||||
observer.next();
|
||||
observer.complete();
|
||||
});
|
||||
});
|
||||
|
||||
spyOn(service, 'createEcmTypeWithProperties').and.callFake(() => {
|
||||
return new Observable(observer => {
|
||||
return new Observable((observer) => {
|
||||
observer.next();
|
||||
observer.complete();
|
||||
});
|
||||
@@ -295,14 +295,14 @@ describe('EcmModelService', () => {
|
||||
|
||||
it('Should create an ECM model for the activiti if not defined already', (done) => {
|
||||
spyOn(service, 'searchActivitiEcmModel').and.callFake(() => {
|
||||
return new Observable(observer => {
|
||||
return new Observable((observer) => {
|
||||
observer.next();
|
||||
observer.complete();
|
||||
});
|
||||
});
|
||||
|
||||
spyOn(service, 'createActivitiEcmModel').and.callFake(() => {
|
||||
return new Observable(observer => {
|
||||
return new Observable((observer) => {
|
||||
observer.next();
|
||||
observer.complete();
|
||||
});
|
||||
@@ -317,14 +317,14 @@ describe('EcmModelService', () => {
|
||||
|
||||
it('If a model for the activiti is already define has to save the new type', (done) => {
|
||||
spyOn(service, 'searchActivitiEcmModel').and.callFake(() => {
|
||||
return new Observable(observer => {
|
||||
return new Observable((observer) => {
|
||||
observer.next({test: 'I-EXIST'});
|
||||
observer.complete();
|
||||
});
|
||||
});
|
||||
|
||||
spyOn(service, 'saveFomType').and.callFake(() => {
|
||||
return new Observable(observer => {
|
||||
return new Observable((observer) => {
|
||||
observer.next();
|
||||
observer.complete();
|
||||
});
|
||||
|
@@ -36,22 +36,22 @@ export class EcmModelService {
|
||||
}
|
||||
|
||||
public createEcmTypeForActivitiForm(formName: string, form: FormModel): Observable<any> {
|
||||
return new Observable(observer => {
|
||||
return new Observable((observer) => {
|
||||
this.searchActivitiEcmModel().subscribe(
|
||||
model => {
|
||||
(model) => {
|
||||
if (!model) {
|
||||
this.createActivitiEcmModel(formName, form).subscribe(typeForm => {
|
||||
this.createActivitiEcmModel(formName, form).subscribe((typeForm) => {
|
||||
observer.next(typeForm);
|
||||
observer.complete();
|
||||
});
|
||||
} else {
|
||||
this.saveFomType(formName, form).subscribe(typeForm => {
|
||||
this.saveFomType(formName, form).subscribe((typeForm) => {
|
||||
observer.next(typeForm);
|
||||
observer.complete();
|
||||
});
|
||||
}
|
||||
},
|
||||
err => this.handleError(err)
|
||||
(err) => this.handleError(err)
|
||||
);
|
||||
});
|
||||
|
||||
@@ -59,38 +59,38 @@ export class EcmModelService {
|
||||
|
||||
searchActivitiEcmModel() {
|
||||
return this.getEcmModels().pipe(map(function (ecmModels: any) {
|
||||
return ecmModels.list.entries.find(model => model.entry.name === EcmModelService.MODEL_NAME);
|
||||
return ecmModels.list.entries.find((model) => model.entry.name === EcmModelService.MODEL_NAME);
|
||||
}));
|
||||
}
|
||||
|
||||
createActivitiEcmModel(formName: string, form: FormModel): Observable<any> {
|
||||
return new Observable(observer => {
|
||||
return new Observable((observer) => {
|
||||
this.createEcmModel(EcmModelService.MODEL_NAME, EcmModelService.MODEL_NAMESPACE).subscribe(
|
||||
model => {
|
||||
(model) => {
|
||||
this.logService.info('model created', model);
|
||||
this.activeEcmModel(EcmModelService.MODEL_NAME).subscribe(
|
||||
modelActive => {
|
||||
(modelActive) => {
|
||||
this.logService.info('model active', modelActive);
|
||||
this.createEcmTypeWithProperties(formName, form).subscribe(typeCreated => {
|
||||
this.createEcmTypeWithProperties(formName, form).subscribe((typeCreated) => {
|
||||
observer.next(typeCreated);
|
||||
observer.complete();
|
||||
});
|
||||
},
|
||||
err => this.handleError(err)
|
||||
(err) => this.handleError(err)
|
||||
);
|
||||
},
|
||||
err => this.handleError(err)
|
||||
(err) => this.handleError(err)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
saveFomType(formName: string, form: FormModel): Observable<any> {
|
||||
return new Observable(observer => {
|
||||
return new Observable((observer) => {
|
||||
this.searchEcmType(formName, EcmModelService.MODEL_NAME).subscribe(
|
||||
ecmType => {
|
||||
(ecmType) => {
|
||||
this.logService.info('custom types', ecmType);
|
||||
if (!ecmType) {
|
||||
this.createEcmTypeWithProperties(formName, form).subscribe(typeCreated => {
|
||||
this.createEcmTypeWithProperties(formName, form).subscribe((typeCreated) => {
|
||||
observer.next(typeCreated);
|
||||
observer.complete();
|
||||
});
|
||||
@@ -99,31 +99,31 @@ export class EcmModelService {
|
||||
observer.complete();
|
||||
}
|
||||
},
|
||||
err => this.handleError(err)
|
||||
(err) => this.handleError(err)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
public createEcmTypeWithProperties(formName: string, form: FormModel): Observable<any> {
|
||||
return new Observable(observer => {
|
||||
return new Observable((observer) => {
|
||||
this.createEcmType(formName, EcmModelService.MODEL_NAME, EcmModelService.TYPE_MODEL).subscribe(
|
||||
typeCreated => {
|
||||
(typeCreated) => {
|
||||
this.logService.info('type Created', typeCreated);
|
||||
this.addPropertyToAType(EcmModelService.MODEL_NAME, formName, form).subscribe(
|
||||
propertyAdded => {
|
||||
(propertyAdded) => {
|
||||
this.logService.info('property Added', propertyAdded);
|
||||
observer.next(typeCreated);
|
||||
observer.complete();
|
||||
},
|
||||
err => this.handleError(err));
|
||||
(err) => this.handleError(err));
|
||||
},
|
||||
err => this.handleError(err));
|
||||
(err) => this.handleError(err));
|
||||
});
|
||||
}
|
||||
|
||||
public searchEcmType(typeName: string, modelName: string): Observable<any> {
|
||||
return this.getEcmType(modelName).pipe(map(function (customTypes: any) {
|
||||
return customTypes.list.entries.find(type => type.entry.prefixedName === typeName || type.entry.title === typeName);
|
||||
return customTypes.list.entries.find((type) => type.entry.prefixedName === typeName || type.entry.title === typeName);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ export class EcmModelService {
|
||||
return from(this.apiService.getInstance().core.customModelApi.activateCustomModel(modelName))
|
||||
.pipe(
|
||||
map(this.toJson),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ export class EcmModelService {
|
||||
return from(this.apiService.getInstance().core.customModelApi.createCustomModel('DRAFT', '', modelName, modelName, nameSpace))
|
||||
.pipe(
|
||||
map(this.toJson),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ export class EcmModelService {
|
||||
return from(this.apiService.getInstance().core.customModelApi.getAllCustomModel())
|
||||
.pipe(
|
||||
map(this.toJson),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ export class EcmModelService {
|
||||
return from(this.apiService.getInstance().core.customModelApi.getAllCustomType(modelName))
|
||||
.pipe(
|
||||
map(this.toJson),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ export class EcmModelService {
|
||||
return from(this.apiService.getInstance().core.customModelApi.createCustomType(modelName, name, parentType, typeName, ''))
|
||||
.pipe(
|
||||
map(this.toJson),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ export class EcmModelService {
|
||||
return from(this.apiService.getInstance().core.customModelApi.addPropertyToType(modelName, name, properties))
|
||||
.pipe(
|
||||
map(this.toJson),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
|
||||
}
|
||||
|
@@ -94,7 +94,7 @@ describe('Form service', () => {
|
||||
let simpleResponseBody = { id: 1, modelType: 'test' };
|
||||
|
||||
it('should fetch and parse process definitions', (done) => {
|
||||
service.getProcessDefinitions().subscribe(result => {
|
||||
service.getProcessDefinitions().subscribe((result) => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/process-definitions')).toBeTruthy();
|
||||
expect(result).toEqual(JSON.parse(jasmine.Ajax.requests.mostRecent().response).data);
|
||||
done();
|
||||
@@ -108,7 +108,7 @@ describe('Form service', () => {
|
||||
});
|
||||
|
||||
it('should fetch and parse tasks', (done) => {
|
||||
service.getTasks().subscribe(result => {
|
||||
service.getTasks().subscribe((result) => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/tasks/query')).toBeTruthy();
|
||||
expect(result).toEqual(JSON.parse(jasmine.Ajax.requests.mostRecent().response).data);
|
||||
done();
|
||||
@@ -122,7 +122,7 @@ describe('Form service', () => {
|
||||
});
|
||||
|
||||
it('should fetch and parse the task by id', (done) => {
|
||||
service.getTask('1').subscribe(result => {
|
||||
service.getTask('1').subscribe((result) => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/tasks/1')).toBeTruthy();
|
||||
expect(result.id).toEqual('1');
|
||||
done();
|
||||
@@ -182,7 +182,7 @@ describe('Form service', () => {
|
||||
});
|
||||
|
||||
it('should get task form by id', (done) => {
|
||||
service.getTaskForm('1').subscribe(result => {
|
||||
service.getTaskForm('1').subscribe((result) => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/task-forms/1')).toBeTruthy();
|
||||
expect(result.id).toEqual(1);
|
||||
done();
|
||||
@@ -196,7 +196,7 @@ describe('Form service', () => {
|
||||
});
|
||||
|
||||
it('should get form definition by id', (done) => {
|
||||
service.getFormDefinitionById('1').subscribe(result => {
|
||||
service.getFormDefinitionById('1').subscribe((result) => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/form-models/1')).toBeTruthy();
|
||||
expect(result.id).toEqual(1);
|
||||
done();
|
||||
@@ -218,7 +218,7 @@ describe('Form service', () => {
|
||||
]
|
||||
};
|
||||
|
||||
service.getFormDefinitionByName(formName).subscribe(result => {
|
||||
service.getFormDefinitionByName(formName).subscribe((result) => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith(`models?filter=myReusableForms&filterText=${formName}&modelType=2`)).toBeTruthy();
|
||||
expect(result).toEqual(formId);
|
||||
done();
|
||||
@@ -241,7 +241,7 @@ describe('Form service', () => {
|
||||
});
|
||||
processApiSpy.getProcessDefinitionStartForm.and.returnValue(Promise.resolve({ id: '1' }));
|
||||
|
||||
service.getStartFormDefinition('myprocess:1').subscribe(result => {
|
||||
service.getStartFormDefinition('myprocess:1').subscribe((result) => {
|
||||
expect(processApiSpy.getProcessDefinitionStartForm).toHaveBeenCalledWith('myprocess:1');
|
||||
done();
|
||||
});
|
||||
@@ -309,7 +309,7 @@ describe('Form service', () => {
|
||||
});
|
||||
|
||||
it('should get all the forms with modelType=2', (done) => {
|
||||
service.getForms().subscribe(result => {
|
||||
service.getForms().subscribe((result) => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('models?modelType=2')).toBeTruthy();
|
||||
expect(result.length).toEqual(2);
|
||||
done();
|
||||
@@ -330,7 +330,7 @@ describe('Form service', () => {
|
||||
it('should search for Form with modelType=2', (done) => {
|
||||
let response = { data: [{ id: 1, name: 'findMe' }, { id: 2, name: 'testForm' }] };
|
||||
|
||||
service.searchFrom('findMe').subscribe(result => {
|
||||
service.searchFrom('findMe').subscribe((result) => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('models?modelType=2')).toBeTruthy();
|
||||
expect(result.name).toEqual('findMe');
|
||||
expect(result.id).toEqual(1);
|
||||
@@ -345,7 +345,7 @@ describe('Form service', () => {
|
||||
});
|
||||
|
||||
it('should create a Form with modelType=2', (done) => {
|
||||
service.createForm('testName').subscribe(result => {
|
||||
service.createForm('testName').subscribe((result) => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/models')).toBeTruthy();
|
||||
expect(JSON.parse(jasmine.Ajax.requests.mostRecent().params).modelType).toEqual(2);
|
||||
expect(JSON.parse(jasmine.Ajax.requests.mostRecent().params).name).toEqual('testName');
|
||||
@@ -365,7 +365,7 @@ describe('Form service', () => {
|
||||
let data = [{ name: 'name' }, { name: 'email' }];
|
||||
let formDefinitionModel = new FormDefinitionModel(formId, name, 'testUserName', '2016-09-05T14:41:19.049Z', data);
|
||||
|
||||
service.addFieldsToAForm(formId, formDefinitionModel).subscribe(result => {
|
||||
service.addFieldsToAForm(formId, formDefinitionModel).subscribe((result) => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/form-models/' + formId)).toBeTruthy();
|
||||
expect(JSON.parse(jasmine.Ajax.requests.mostRecent().params).formRepresentation.name).toEqual(name);
|
||||
done();
|
||||
@@ -382,7 +382,7 @@ describe('Form service', () => {
|
||||
spyOn(service, 'getUserProfileImageApi').and.returnValue('/app/rest/users/2002/picture');
|
||||
let fakeFilter: string = 'whatever';
|
||||
|
||||
service.getWorkflowUsers(fakeFilter).subscribe(result => {
|
||||
service.getWorkflowUsers(fakeFilter).subscribe((result) => {
|
||||
expect(result).toBeDefined();
|
||||
expect(result.length).toBe(3);
|
||||
expect(result[0].id).toBe(2002);
|
||||
@@ -400,7 +400,7 @@ describe('Form service', () => {
|
||||
it('should return list of groups', (done) => {
|
||||
let fakeFilter: string = 'whatever';
|
||||
|
||||
service.getWorkflowGroups(fakeFilter).subscribe(result => {
|
||||
service.getWorkflowGroups(fakeFilter).subscribe((result) => {
|
||||
expect(result).toBeDefined();
|
||||
expect(result.length).toBe(2);
|
||||
expect(result[0].id).toBe('2004');
|
||||
@@ -433,7 +433,7 @@ describe('Form service', () => {
|
||||
|
||||
stubAddFieldsToAForm();
|
||||
|
||||
service.createFormFromANode(nameForm).subscribe(result => {
|
||||
service.createFormFromANode(nameForm).subscribe((result) => {
|
||||
expect(result.id).toEqual(formId);
|
||||
done();
|
||||
});
|
||||
|
@@ -118,20 +118,20 @@ export class FormService {
|
||||
* @returns The new form
|
||||
*/
|
||||
createFormFromANode(formName: string): Observable<any> {
|
||||
return new Observable(observer => {
|
||||
return new Observable((observer) => {
|
||||
this.createForm(formName).subscribe(
|
||||
form => {
|
||||
(form) => {
|
||||
this.ecmModelService.searchEcmType(formName, EcmModelService.MODEL_NAME).subscribe(
|
||||
customType => {
|
||||
(customType) => {
|
||||
let formDefinitionModel = new FormDefinitionModel(form.id, form.name, form.lastUpdatedByFullName, form.lastUpdated, customType.entry.properties);
|
||||
this.addFieldsToAForm(form.id, formDefinitionModel).subscribe(formData => {
|
||||
this.addFieldsToAForm(form.id, formDefinitionModel).subscribe((formData) => {
|
||||
observer.next(formData);
|
||||
observer.complete();
|
||||
}, err => this.handleError(err));
|
||||
}, (err) => this.handleError(err));
|
||||
},
|
||||
err => this.handleError(err));
|
||||
(err) => this.handleError(err));
|
||||
},
|
||||
err => this.handleError(err));
|
||||
(err) => this.handleError(err));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -193,9 +193,9 @@ export class FormService {
|
||||
)
|
||||
.pipe(
|
||||
map(function (forms: any) {
|
||||
return forms.data.find(formData => formData.name === name);
|
||||
return forms.data.find((formData) => formData.name === name);
|
||||
}),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ export class FormService {
|
||||
return from(this.modelsApi.getModels(opts))
|
||||
.pipe(
|
||||
map(this.toJsonArray),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ export class FormService {
|
||||
return from(this.processApi.getProcessDefinitions({}))
|
||||
.pipe(
|
||||
map(this.toJsonArray),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ export class FormService {
|
||||
return from(this.processInstanceVariablesApi.getProcessInstanceVariables(processInstanceId))
|
||||
.pipe(
|
||||
map(this.toJson),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ export class FormService {
|
||||
return from(this.taskApi.listTasks({}))
|
||||
.pipe(
|
||||
map(this.toJsonArray),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ export class FormService {
|
||||
return from(this.taskApi.getTask(taskId))
|
||||
.pipe(
|
||||
map(this.toJson),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ export class FormService {
|
||||
|
||||
return from(this.taskApi.saveTaskForm(taskId, body))
|
||||
.pipe(
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ export class FormService {
|
||||
|
||||
return from(this.taskApi.completeTaskForm(taskId, body))
|
||||
.pipe(
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ export class FormService {
|
||||
return from(this.taskApi.getTaskForm(taskId))
|
||||
.pipe(
|
||||
map(this.toJson),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -322,7 +322,7 @@ export class FormService {
|
||||
return from(this.editorApi.getForm(formId))
|
||||
.pipe(
|
||||
map(this.toJson),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ export class FormService {
|
||||
return from(this.modelsApi.getModels(opts))
|
||||
.pipe(
|
||||
map(this.getFormId),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -354,7 +354,7 @@ export class FormService {
|
||||
return from(this.processApi.getProcessInstanceStartForm(processId))
|
||||
.pipe(
|
||||
map(this.toJson),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ export class FormService {
|
||||
return from(this.processApi.getProcessInstance(processId))
|
||||
.pipe(
|
||||
map(this.toJson),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -380,7 +380,7 @@ export class FormService {
|
||||
return from(this.processApi.getProcessDefinitionStartForm(processId))
|
||||
.pipe(
|
||||
map(this.toJson),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -393,7 +393,7 @@ export class FormService {
|
||||
getRestFieldValues(taskId: string, field: string): Observable<any> {
|
||||
return from(this.taskApi.getRestFieldValues(taskId, field))
|
||||
.pipe(
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -406,7 +406,7 @@ export class FormService {
|
||||
getRestFieldValuesByProcessId(processDefinitionId: string, field: string): Observable<any> {
|
||||
return from(this.processApi.getRestFieldValues(processDefinitionId, field))
|
||||
.pipe(
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -420,7 +420,7 @@ export class FormService {
|
||||
getRestFieldValuesColumnByProcessId(processDefinitionId: string, field: string, column?: string): Observable<any> {
|
||||
return from(this.processApi.getRestTableFieldValues(processDefinitionId, field, column))
|
||||
.pipe(
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -434,7 +434,7 @@ export class FormService {
|
||||
getRestFieldValuesColumn(taskId: string, field: string, column?: string): Observable<any> {
|
||||
return from(this.taskApi.getRestFieldValuesColumn(taskId, field, column))
|
||||
.pipe(
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -467,7 +467,7 @@ export class FormService {
|
||||
}),
|
||||
combineAll(),
|
||||
defaultIfEmpty([]),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -485,7 +485,7 @@ export class FormService {
|
||||
return from(this.groupsApi.getGroups(option))
|
||||
.pipe(
|
||||
map((response: any) => <GroupModel[]> response.data || []),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -65,7 +65,7 @@ describe('NodeService', () => {
|
||||
}
|
||||
};
|
||||
|
||||
service.getNodeMetadata('-nodeid-').subscribe(result => {
|
||||
service.getNodeMetadata('-nodeid-').subscribe((result) => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('nodes/-nodeid-')).toBeTruthy();
|
||||
let node = new NodeMetadata({
|
||||
test: 'test',
|
||||
@@ -94,7 +94,7 @@ describe('NodeService', () => {
|
||||
}
|
||||
};
|
||||
|
||||
service.getNodeMetadata('-nodeid-').subscribe(result => {
|
||||
service.getNodeMetadata('-nodeid-').subscribe((result) => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('nodes/-nodeid-')).toBeTruthy();
|
||||
let node = new NodeMetadata({
|
||||
test: 'test',
|
||||
@@ -123,7 +123,7 @@ describe('NodeService', () => {
|
||||
isFolder: true
|
||||
};
|
||||
|
||||
service.createNodeMetadata('typeTest', EcmModelService.MODEL_NAMESPACE, data, '/Sites/swsdp/documentLibrary', 'testNode').subscribe(result => {
|
||||
service.createNodeMetadata('typeTest', EcmModelService.MODEL_NAMESPACE, data, '/Sites/swsdp/documentLibrary', 'testNode').subscribe((result) => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('-root-/children')).toBeTruthy();
|
||||
expect(result).toEqual(responseBody);
|
||||
done();
|
||||
@@ -142,7 +142,7 @@ describe('NodeService', () => {
|
||||
testdata: 'testdata'
|
||||
};
|
||||
|
||||
service.createNodeMetadata('typeTest', EcmModelService.MODEL_NAMESPACE, data, '/Sites/swsdp/documentLibrary').subscribe(result => {
|
||||
service.createNodeMetadata('typeTest', EcmModelService.MODEL_NAMESPACE, data, '/Sites/swsdp/documentLibrary').subscribe((result) => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('-root-/children')).toBeTruthy();
|
||||
expect(JSON.parse(jasmine.Ajax.requests.mostRecent().params).properties[EcmModelService.MODEL_NAMESPACE + ':test']).toBeDefined();
|
||||
expect(JSON.parse(jasmine.Ajax.requests.mostRecent().params).properties[EcmModelService.MODEL_NAMESPACE + ':testdata']).toBeDefined();
|
||||
@@ -162,7 +162,7 @@ describe('NodeService', () => {
|
||||
testdata: 'testdata'
|
||||
};
|
||||
|
||||
service.createNodeMetadata('typeTest', EcmModelService.MODEL_NAMESPACE, data, '/Sites/swsdp/documentLibrary').subscribe(result => {
|
||||
service.createNodeMetadata('typeTest', EcmModelService.MODEL_NAMESPACE, data, '/Sites/swsdp/documentLibrary').subscribe((result) => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('-root-/children')).toBeTruthy();
|
||||
expect(JSON.parse(jasmine.Ajax.requests.mostRecent().params).name).toBeDefined();
|
||||
done();
|
||||
|
@@ -146,7 +146,7 @@ describe('ProcessContentService', () => {
|
||||
it('should return the unsupported content when the file is an image', (done) => {
|
||||
let contentId: number = 888;
|
||||
|
||||
service.getFileContent(contentId).subscribe(result => {
|
||||
service.getFileContent(contentId).subscribe((result) => {
|
||||
expect(result.id).toEqual(contentId);
|
||||
expect(result.name).toEqual('fake-name.jpg');
|
||||
expect(result.simpleType).toEqual('image');
|
||||
@@ -164,7 +164,7 @@ describe('ProcessContentService', () => {
|
||||
it('should return the supported content when the file is a pdf', (done) => {
|
||||
let contentId: number = 999;
|
||||
|
||||
service.getFileContent(contentId).subscribe(result => {
|
||||
service.getFileContent(contentId).subscribe((result) => {
|
||||
expect(result.id).toEqual(contentId);
|
||||
expect(result.name).toEqual('fake-name.pdf');
|
||||
expect(result.simpleType).toEqual('pdf');
|
||||
@@ -189,7 +189,7 @@ describe('ProcessContentService', () => {
|
||||
let contentId: number = 999;
|
||||
let blob = createFakeBlob();
|
||||
spyOn(service, 'getContentThumbnail').and.returnValue(of(blob));
|
||||
service.getContentThumbnail(contentId).subscribe(result => {
|
||||
service.getContentThumbnail(contentId).subscribe((result) => {
|
||||
expect(result).toEqual(jasmine.any(Blob));
|
||||
expect(result.size).toEqual(48);
|
||||
expect(result.type).toEqual('image/png');
|
||||
|
@@ -45,7 +45,7 @@ export class ProcessContentService {
|
||||
*/
|
||||
createTemporaryRawRelatedContent(file: any): Observable<RelatedContentRepresentation> {
|
||||
return from(this.contentApi.createTemporaryRawRelatedContent(file))
|
||||
.pipe(catchError(err => this.handleError(err)));
|
||||
.pipe(catchError((err) => this.handleError(err)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -55,7 +55,7 @@ export class ProcessContentService {
|
||||
*/
|
||||
getFileContent(contentId: number): Observable<RelatedContentRepresentation> {
|
||||
return from(this.contentApi.getContent(contentId))
|
||||
.pipe(catchError(err => this.handleError(err)));
|
||||
.pipe(catchError((err) => this.handleError(err)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -65,7 +65,7 @@ export class ProcessContentService {
|
||||
*/
|
||||
getFileRawContent(contentId: number): Observable<Blob> {
|
||||
return from(this.contentApi.getRawContent(contentId))
|
||||
.pipe(catchError(err => this.handleError(err)));
|
||||
.pipe(catchError((err) => this.handleError(err)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,7 +74,7 @@ export class ProcessContentService {
|
||||
* @returns Binary data of the content preview
|
||||
*/
|
||||
getContentPreview(contentId: number): Observable<Blob> {
|
||||
return new Observable(observer => {
|
||||
return new Observable((observer) => {
|
||||
this.contentApi.getContentPreview(contentId).then(
|
||||
(result) => {
|
||||
observer.next(result);
|
||||
@@ -112,7 +112,7 @@ export class ProcessContentService {
|
||||
*/
|
||||
getContentThumbnail(contentId: number): Observable<Blob> {
|
||||
return from(this.contentApi.getContentThumbnail(contentId))
|
||||
.pipe(catchError(err => this.handleError(err)));
|
||||
.pipe(catchError((err) => this.handleError(err)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,7 +122,7 @@ export class ProcessContentService {
|
||||
*/
|
||||
getTaskRelatedContent(taskId: string): Observable<any> {
|
||||
return from(this.contentApi.getRelatedContentForTask(taskId))
|
||||
.pipe(catchError(err => this.handleError(err)));
|
||||
.pipe(catchError((err) => this.handleError(err)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -132,7 +132,7 @@ export class ProcessContentService {
|
||||
*/
|
||||
getProcessRelatedContent(processId: string): Observable<any> {
|
||||
return from(this.contentApi.getRelatedContentForProcessInstance(processId))
|
||||
.pipe(catchError(err => this.handleError(err)));
|
||||
.pipe(catchError((err) => this.handleError(err)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -142,7 +142,7 @@ export class ProcessContentService {
|
||||
*/
|
||||
deleteRelatedContent(contentId: number): Observable<any> {
|
||||
return from(this.contentApi.deleteContent(contentId))
|
||||
.pipe(catchError(err => this.handleError(err)));
|
||||
.pipe(catchError((err) => this.handleError(err)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -154,7 +154,7 @@ export class ProcessContentService {
|
||||
*/
|
||||
createProcessRelatedContent(processInstanceId: string, content: any, opts?: any): Observable<any> {
|
||||
return from(this.contentApi.createRelatedContentOnProcessInstance(processInstanceId, content, opts))
|
||||
.pipe(catchError(err => this.handleError(err)));
|
||||
.pipe(catchError((err) => this.handleError(err)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -166,7 +166,7 @@ export class ProcessContentService {
|
||||
*/
|
||||
createTaskRelatedContent(taskId: string, file: any, opts?: any) {
|
||||
return from(this.contentApi.createRelatedContentOnTask(taskId, file, opts))
|
||||
.pipe(catchError(err => this.handleError(err)));
|
||||
.pipe(catchError((err) => this.handleError(err)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -38,11 +38,11 @@ export class WidgetVisibilityService {
|
||||
|
||||
public refreshVisibility(form: FormModel) {
|
||||
if (form && form.tabs && form.tabs.length > 0) {
|
||||
form.tabs.map(tabModel => this.refreshEntityVisibility(tabModel));
|
||||
form.tabs.map((tabModel) => this.refreshEntityVisibility(tabModel));
|
||||
}
|
||||
|
||||
if (form) {
|
||||
form.getFormFields().map(field => this.refreshEntityVisibility(field));
|
||||
form.getFormFields().map((field) => this.refreshEntityVisibility(field));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ export class WidgetVisibilityService {
|
||||
if (field.value && field.value.name) {
|
||||
value = field.value.name;
|
||||
} else if (field.options) {
|
||||
let option = field.options.find(opt => opt.id === field.value);
|
||||
let option = field.options.find((opt) => opt.id === field.value);
|
||||
if (option) {
|
||||
value = this.getValueFromOption(fieldId, option);
|
||||
}
|
||||
@@ -188,14 +188,14 @@ export class WidgetVisibilityService {
|
||||
|
||||
private getFormVariableValue(form: FormModel, name: string) {
|
||||
if (form.json.variables) {
|
||||
let formVariable = form.json.variables.find(formVar => formVar.name === name);
|
||||
let formVariable = form.json.variables.find((formVar) => formVar.name === name);
|
||||
return formVariable ? formVariable.value : formVariable;
|
||||
}
|
||||
}
|
||||
|
||||
private getProcessVariableValue(name: string, processVarList: TaskProcessVariableModel[]) {
|
||||
if (this.processVarList) {
|
||||
let processVariable = this.processVarList.find(variable => variable.id === name);
|
||||
let processVariable = this.processVarList.find((variable) => variable.id === name);
|
||||
return processVariable ? processVariable.value : processVariable;
|
||||
}
|
||||
}
|
||||
@@ -248,12 +248,12 @@ export class WidgetVisibilityService {
|
||||
getTaskProcessVariable(taskId: string): Observable<TaskProcessVariableModel[]> {
|
||||
return from(this.apiService.getInstance().activiti.taskFormsApi.getTaskFormVariables(taskId))
|
||||
.pipe(
|
||||
map(res => {
|
||||
map((res) => {
|
||||
let jsonRes = this.toJson(res);
|
||||
this.processVarList = <TaskProcessVariableModel[]> jsonRes;
|
||||
return jsonRes;
|
||||
}),
|
||||
catchError(err => this.handleError(err))
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user