From 06c05ea9b5dc11ac1a66ffd781c3ae70cbeaedfb Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Fri, 19 Aug 2016 13:37:54 +0100 Subject: [PATCH] move form to activity js api --- demo-shell-ng2/tslint.json | 2 +- ng2-components/ng2-activiti-form/package.json | 1 + .../src/services/form.service.spec.ts | 234 +++++++---------- .../src/services/form.service.ts | 117 +++------ ng2-components/ng2-activiti-form/tslint.json | 2 +- .../activiti-tasklist.service.spec.ts | 1 - .../ng2-activiti-tasklist/tslint.json | 2 +- ng2-components/ng2-alfresco-core/tslint.json | 2 +- .../ng2-alfresco-datatable/tslint.json | 238 +++++++++--------- .../ng2-alfresco-documentlist/tslint.json | 2 +- ng2-components/ng2-alfresco-login/tslint.json | 2 +- .../ng2-alfresco-search/tslint.json | 2 +- .../ng2-alfresco-upload/tslint.json | 2 +- .../ng2-alfresco-viewer/tslint.json | 2 +- 14 files changed, 258 insertions(+), 351 deletions(-) diff --git a/demo-shell-ng2/tslint.json b/demo-shell-ng2/tslint.json index 8c48e76469..e550ac11d4 100644 --- a/demo-shell-ng2/tslint.json +++ b/demo-shell-ng2/tslint.json @@ -26,7 +26,7 @@ "label-undefined": true, "max-line-length": [ true, - 140 + 180 ], "member-ordering": [ true, diff --git a/ng2-components/ng2-activiti-form/package.json b/ng2-components/ng2-activiti-form/package.json index 2e71ddd712..2c4c5965c4 100644 --- a/ng2-components/ng2-activiti-form/package.json +++ b/ng2-components/ng2-activiti-form/package.json @@ -80,6 +80,7 @@ "karma-coverage": "1.0.0", "karma-coveralls": "1.1.2", "karma-jasmine": "1.0.2", + "karma-jasmine-ajax": "0.1.13", "karma-jasmine-html-reporter": "0.2.0", "karma-jasmine-ajax": "0.1.13", "karma-mocha-reporter": "2.0.3", diff --git a/ng2-components/ng2-activiti-form/src/services/form.service.spec.ts b/ng2-components/ng2-activiti-form/src/services/form.service.spec.ts index 57cbb1ed40..a3521290f4 100644 --- a/ng2-components/ng2-activiti-form/src/services/form.service.spec.ts +++ b/ng2-components/ng2-activiti-form/src/services/form.service.spec.ts @@ -15,81 +15,57 @@ * limitations under the License. */ -import { it, describe, expect, beforeEach } from '@angular/core/testing'; -import { Http, RequestOptionsArgs, Response, ResponseOptions } from '@angular/http'; -import { Observable } from 'rxjs/Rx'; +import { it, inject, describe, expect, beforeEach, beforeEachProviders, afterEach } from '@angular/core/testing'; import { AlfrescoAuthenticationService, AlfrescoSettingsService } from 'ng2-alfresco-core'; - +import { Response, ResponseOptions } from '@angular/http'; import { FormService } from './form.service'; import { FormValues } from './../components/widgets/core/index'; +declare let jasmine: any; + describe('FormService', () => { - let http: Http; - let responseBody: any; - let formService: FormService; - let authService: AlfrescoAuthenticationService; - let settingsService: AlfrescoSettingsService; + let responseBody: any, formService: FormService; - let createResponse = (url, body): Observable => { - return Observable.create(observer => { - let response = new Response(new ResponseOptions({ - url: url, - body: body - })); - observer.next(response); - observer.complete(); - }); - }; - - beforeEach(() => { - - http = { - get(url: string, options?: RequestOptionsArgs): Observable { - return createResponse(url, responseBody); - }, - post(url: string, body: any, options?: RequestOptionsArgs): Observable { - return createResponse(url, responseBody); - } - }; - - settingsService = new AlfrescoSettingsService(); - settingsService.setProviders([]); - - authService = new AlfrescoAuthenticationService(settingsService, null); - formService = new FormService(http, authService, settingsService); + beforeEachProviders(() => { + return [ + FormService, + AlfrescoSettingsService, + AlfrescoAuthenticationService + ]; }); - it('should resolve host address via settings service', () => { - const url = ''; - settingsService.bpmHost = url; - expect(formService.getHostAddress()).toBe(url); + beforeEach(inject([FormService], (service: FormService) => { + jasmine.Ajax.install(); + formService = service; + })); + + afterEach(() => { + jasmine.Ajax.uninstall(); }); it('should fetch and parse process definitions', (done) => { - spyOn(http, 'get').and.callThrough(); - responseBody = { data: [ - { id: '1' }, - { id: '2' } + {id: '1'}, + {id: '2'} ] }; formService.getProcessDefinitions().subscribe(result => { - expect(http.get).toHaveBeenCalled(); - - let args: any[] = (http).get.calls.argsFor(0); - expect(args[0].endsWith('/process-definitions')).toBeTruthy(); - - expect(result).toEqual(responseBody.data); + expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/process-definitions')).toBeTruthy(); + expect(result).toEqual(JSON.parse(jasmine.Ajax.requests.mostRecent().response).data); done(); }); + + jasmine.Ajax.requests.mostRecent().respondWith({ + 'status': 200, + contentType: 'application/json', + responseText: JSON.stringify(responseBody) + }); }); it('should fetch and parse tasks', (done) => { - spyOn(http, 'post').and.callThrough(); - responseBody = { data: [ { id: '1' }, @@ -98,126 +74,130 @@ describe('FormService', () => { }; formService.getTasks().subscribe(result => { - expect(http.post).toHaveBeenCalled(); - - let args: any[] = (http).post.calls.argsFor(0); - expect(args[0].endsWith('/tasks/query')).toBeTruthy(); - - expect(result).toEqual(responseBody.data); + expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/tasks/query')).toBeTruthy(); + expect(result).toEqual(JSON.parse(jasmine.Ajax.requests.mostRecent().response).data); done(); }); + + jasmine.Ajax.requests.mostRecent().respondWith({ + 'status': 200, + contentType: 'application/json', + responseText: JSON.stringify(responseBody) + }); }); it('should fetch and parse the task by id', (done) => { - spyOn(http, 'get').and.callThrough(); - responseBody = { id: '1' }; formService.getTask('1').subscribe(result => { - expect(http.get).toHaveBeenCalled(); - - let args: any[] = (http).get.calls.argsFor(0); - expect(args[0].endsWith('/tasks/1')).toBeTruthy(); - - expect(result).toEqual(responseBody); + expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/tasks/1')).toBeTruthy(); + expect(result.id).toEqual(responseBody.id); done(); }); + + jasmine.Ajax.requests.mostRecent().respondWith({ + 'status': 200, + contentType: 'application/json', + responseText: JSON.stringify(responseBody) + }); }); it('should save task form', (done) => { - spyOn(http, 'post').and.callThrough(); - let values = { field1: 'one', field2: 'two' }; formService.saveTaskForm('1', values).subscribe(() => { - expect(http.post).toHaveBeenCalled(); - - let args: any[] = (http).post.calls.argsFor(0); - expect(args[0].endsWith('/task-forms/1/save-form')).toBeTruthy(); - expect(args[1]).toEqual(JSON.stringify({ values: values })); - + expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/task-forms/1/save-form')).toBeTruthy(); + expect(JSON.parse(jasmine.Ajax.requests.mostRecent().params).values.field1).toEqual(values.field1); + expect(JSON.parse(jasmine.Ajax.requests.mostRecent().params).values.field2).toEqual(values.field2); done(); }); + + jasmine.Ajax.requests.mostRecent().respondWith({ + 'status': 200, + contentType: 'application/json', + responseText: JSON.stringify(responseBody) + }); }); it('should complete task form', (done) => { - spyOn(http, 'post').and.callThrough(); - let values = { field1: 'one', field2: 'two' }; formService.completeTaskForm('1', values).subscribe(() => { - expect(http.post).toHaveBeenCalled(); - - let args: any[] = (http).post.calls.argsFor(0); - expect(args[0].endsWith('/task-forms/1')).toBeTruthy(); - expect(args[1]).toEqual(JSON.stringify({ values: values })); - + expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/task-forms/1')).toBeTruthy(); + expect(JSON.parse(jasmine.Ajax.requests.mostRecent().params).values.field1).toEqual(values.field1); + expect(JSON.parse(jasmine.Ajax.requests.mostRecent().params).values.field2).toEqual(values.field2); done(); }); + + jasmine.Ajax.requests.mostRecent().respondWith({ + 'status': 200, + contentType: 'application/json', + responseText: JSON.stringify(responseBody) + }); }); it('should complete task form with a specific outcome', (done) => { - spyOn(http, 'post').and.callThrough(); - let values = { field1: 'one', field2: 'two' }; formService.completeTaskForm('1', values, 'custom').subscribe(() => { - expect(http.post).toHaveBeenCalled(); - - let args: any[] = (http).post.calls.argsFor(0); - expect(args[0].endsWith('/task-forms/1')).toBeTruthy(); - expect(args[1]).toEqual(JSON.stringify({ values: values, outcome: 'custom' })); + expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/task-forms/1')).toBeTruthy(); + expect(JSON.parse(jasmine.Ajax.requests.mostRecent().params).values.field2).toEqual(values.field2); + expect(JSON.parse(jasmine.Ajax.requests.mostRecent().params).outcome).toEqual('custom' ); done(); }); + + jasmine.Ajax.requests.mostRecent().respondWith({ + 'status': 200, + contentType: 'application/json', + responseText: JSON.stringify(responseBody) + }); }); it('should get task form by id', (done) => { - spyOn(http, 'get').and.callThrough(); - - responseBody = { id: '1' }; + responseBody = { id: 1 }; formService.getTaskForm('1').subscribe(result => { - expect(http.get).toHaveBeenCalled(); - - let args: any[] = (http).get.calls.argsFor(0); - expect(args[0].endsWith('/task-forms/1')).toBeTruthy(); - - expect(result).toEqual(responseBody); + expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/task-forms/1')).toBeTruthy(); + expect(result.id).toEqual(responseBody.id); done(); }); + + jasmine.Ajax.requests.mostRecent().respondWith({ + 'status': 200, + contentType: 'application/json', + responseText: JSON.stringify(responseBody) + }); }); it('should get form definition by id', (done) => { - spyOn(http, 'get').and.callThrough(); - - responseBody = { id: '1' }; + responseBody = { id: 1 }; formService.getFormDefinitionById('1').subscribe(result => { - expect(http.get).toHaveBeenCalled(); - - let args: any[] = (http).get.calls.argsFor(0); - expect(args[0].endsWith('/form-models/1')).toBeTruthy(); - - expect(result).toEqual(responseBody); + expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/form-models/1')).toBeTruthy(); + expect(result.id).toEqual(responseBody.id); done(); }); + + jasmine.Ajax.requests.mostRecent().respondWith({ + 'status': 200, + contentType: 'application/json', + responseText: JSON.stringify(responseBody) + }); }); it('should get form definition id by name', (done) => { - spyOn(http, 'get').and.callThrough(); - const formName = 'form1'; const formId = 1; responseBody = { @@ -227,14 +207,16 @@ describe('FormService', () => { }; formService.getFormDefinitionByName(formName).subscribe(result => { - expect(http.get).toHaveBeenCalled(); - - let args: any[] = (http).get.calls.argsFor(0); - expect(args[0].endsWith(`models?filter=myReusableForms&filterText=${formName}&modelType=2`)).toBeTruthy(); - + expect(jasmine.Ajax.requests.mostRecent().url.endsWith(`models?filter=myReusableForms&filterText=${formName}&modelType=2`)).toBeTruthy(); expect(result).toEqual(formId); done(); }); + http://localhost:9999/activiti-app/api/enterprise/models?filter=myReusableForms&modelType=2" + jasmine.Ajax.requests.mostRecent().respondWith({ + 'status': 200, + contentType: 'application/json', + responseText: JSON.stringify(responseBody) + }); }); it('should not get form id from response', () => { @@ -253,30 +235,6 @@ describe('FormService', () => { expect(formService.getFormId(null)).toBeNull(); }); - it('should convert response to json object', () => { - let data = { id: 1 }; - let response = new Response(new ResponseOptions({ body: data })); - expect(formService.toJson(response)).toEqual(data); - }); - - it('should fallback to empty json object', () => { - let response = new Response(new ResponseOptions({ body: null })); - expect(formService.toJson(response)).toEqual({}); - - expect(formService.toJson(null)).toEqual({}); - }); - - it('should convert response to json array', () => { - let payload = { - data: [ - { id: 1 } - ] - }; - - let response = new Response(new ResponseOptions({ body: JSON.stringify(payload) })); - expect(formService.toJsonArray(response)).toEqual(payload.data); - }); - it('should fallback to empty json array', () => { expect(formService.toJsonArray(null)).toEqual([]); diff --git a/ng2-components/ng2-activiti-form/src/services/form.service.ts b/ng2-components/ng2-activiti-form/src/services/form.service.ts index dc8092ece2..8ff0e5eda5 100644 --- a/ng2-components/ng2-activiti-form/src/services/form.service.ts +++ b/ng2-components/ng2-activiti-form/src/services/form.service.ts @@ -15,12 +15,10 @@ * limitations under the License. */ -import { Injectable } from '@angular/core'; -import { Response, Http, Headers, RequestOptions } from '@angular/http'; -import { Observable } from 'rxjs/Rx'; -import { AlfrescoAuthenticationService } from 'ng2-alfresco-core'; -import { FormValues } from './../components/widgets/core/index'; -import { AlfrescoSettingsService } from 'ng2-alfresco-core'; +import {Injectable} from '@angular/core'; +import {Observable} from 'rxjs/Rx'; +import {AlfrescoAuthenticationService} from 'ng2-alfresco-core'; +import {FormValues} from './../components/widgets/core/index'; @Injectable() export class FormService { @@ -28,92 +26,60 @@ export class FormService { static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error'; static GENERIC_ERROR_MESSAGE: string = 'Server error'; - constructor(private http: Http, - private authService: AlfrescoAuthenticationService, - private alfrescoSettingsService: AlfrescoSettingsService) { - } - - getHostAddress(): string { - return this.alfrescoSettingsService.bpmHost; + constructor(private authService: AlfrescoAuthenticationService) { } getProcessDefinitions(): Observable { - let url = `${this.getHostAddress()}/activiti-app/api/enterprise/process-definitions`; - let options = this.getRequestOptions(); - return this.http - .get(url, options) + return Observable.fromPromise(this.authService.getAlfrescoApi().activiti.processApi.getProcessDefinitions({})) .map(this.toJsonArray) .catch(this.handleError); } getTasks(): Observable { - let url = `${this.getHostAddress()}/activiti-app/api/enterprise/tasks/query`; - let body = JSON.stringify({}); - let options = this.getRequestOptions(); - - return this.http - .post(url, body, options) + return Observable.fromPromise(this.authService.getAlfrescoApi().activiti.taskApi.listTasks({})) .map(this.toJsonArray) .catch(this.handleError); } - getTask(id: string): Observable { - let url = `${this.getHostAddress()}/activiti-app/api/enterprise/tasks/${id}`; - let options = this.getRequestOptions(); - - return this.http - .get(url, options) + getTask(taskId: string): Observable { + return Observable.fromPromise(this.authService.getAlfrescoApi().activiti.taskApi.getTask(taskId)) .map(this.toJson) .catch(this.handleError); } - saveTaskForm(id: string, formValues: FormValues): Observable { - let url = `${this.getHostAddress()}/activiti-app/api/enterprise/task-forms/${id}/save-form`; - let body = JSON.stringify({ values: formValues }); - let options = this.getRequestOptions(); + saveTaskForm(taskId: string, formValues: FormValues): Observable { + let body = JSON.stringify({values: formValues}); - return this.http - .post(url, body, options) + return Observable.fromPromise(this.authService.getAlfrescoApi().activiti.taskApi.saveTaskForm(taskId, body)) .catch(this.handleError); } /** * Complete Task Form - * @param id Task Id + * @param taskId Task Id * @param formValues Form Values * @param outcome Form Outcome * @returns {any} */ - completeTaskForm(id: string, formValues: FormValues, outcome?: string): Observable { - let url = `${this.getHostAddress()}/activiti-app/api/enterprise/task-forms/${id}`; - let data: any = { values: formValues }; + completeTaskForm(taskId: string, formValues: FormValues, outcome?: string): Observable { + let data: any = {values: formValues}; if (outcome) { data.outcome = outcome; } let body = JSON.stringify(data); - let options = this.getRequestOptions(); - return this.http - .post(url, body, options) + return Observable.fromPromise(this.authService.getAlfrescoApi().activiti.taskApi.completeTaskForm(taskId, body)) .catch(this.handleError); } - getTaskForm(id: string): Observable { - let url = `${this.getHostAddress()}/activiti-app/api/enterprise/task-forms/${id}`; - let options = this.getRequestOptions(); - - return this.http - .get(url, options) + getTaskForm(taskId: string): Observable { + return Observable.fromPromise(this.authService.getAlfrescoApi().activiti.taskApi.getTaskForm(taskId)) .map(this.toJson) .catch(this.handleError); } - getFormDefinitionById(id: string): Observable { - let url = `${this.getHostAddress()}/activiti-app/app/rest/form-models/${id}`; - let options = this.getRequestOptions(); - - return this.http - .get(url, options) + getFormDefinitionById(formId: string): Observable { + return Observable.fromPromise(this.authService.getAlfrescoApi().activiti.editorApi.getForm(formId)) .map(this.toJson) .catch(this.handleError); } @@ -124,53 +90,37 @@ export class FormService { * @returns {Promise|Promise} */ getFormDefinitionByName(name: string): Observable { - let url = `${this.getHostAddress()}/activiti-app/app/rest/models?filter=myReusableForms&filterText=${name}&modelType=2`; - let options = this.getRequestOptions(); + let opts = { + 'filter': 'myReusableForms', + 'filterText': name, + 'modelType': 2 + }; - return this.http - .get(url, options) + return Observable.fromPromise(this.authService.getAlfrescoApi().activiti.modelsApi.getModels(opts)) .map(this.getFormId) .catch(this.handleError); } - private getHeaders(): Headers { - return new Headers({ - 'Accept': 'application/json', - 'Content-Type': 'application/json', - 'Authorization': this.authService.getTicket('BPM') - }); - } - - private getRequestOptions(): RequestOptions { - let headers = this.getHeaders(); - return new RequestOptions({headers: headers}); - } - - getFormId(res: Response) { + getFormId(res: any) { let result = null; - if (res) { - let body = res.json(); - if (body && body.data && body.data.length > 0) { - result = body.data[0].id; - } + if (res && res.data && res.data.length > 0) { + result = res.data[0].id; } return result; } - toJson(res: Response) { + toJson(res: any) { if (res) { - let body = res.json(); - return body || {}; + return res || {}; } return {}; } - toJsonArray(res: Response) { + toJsonArray(res: any) { if (res) { - let body = res.json(); - return body.data || []; + return res.data || []; } return []; } @@ -184,5 +134,4 @@ export class FormService { console.error(errMsg); return Observable.throw(errMsg); } - } diff --git a/ng2-components/ng2-activiti-form/tslint.json b/ng2-components/ng2-activiti-form/tslint.json index 828c3d4f6c..0a34e57fec 100644 --- a/ng2-components/ng2-activiti-form/tslint.json +++ b/ng2-components/ng2-activiti-form/tslint.json @@ -24,7 +24,7 @@ "label-undefined": true, "max-line-length": [ true, - 140 + 180 ], "member-ordering": [ true, diff --git a/ng2-components/ng2-activiti-tasklist/src/services/activiti-tasklist.service.spec.ts b/ng2-components/ng2-activiti-tasklist/src/services/activiti-tasklist.service.spec.ts index a9fa61b30e..861dad158f 100644 --- a/ng2-components/ng2-activiti-tasklist/src/services/activiti-tasklist.service.spec.ts +++ b/ng2-components/ng2-activiti-tasklist/src/services/activiti-tasklist.service.spec.ts @@ -101,7 +101,6 @@ describe('ActivitiTaskListService', () => { ]; }); - beforeEach(inject([ActivitiTaskListService], (activitiTaskListService: ActivitiTaskListService) => { jasmine.Ajax.install(); service = activitiTaskListService; diff --git a/ng2-components/ng2-activiti-tasklist/tslint.json b/ng2-components/ng2-activiti-tasklist/tslint.json index d9374e0015..85e9df53c1 100644 --- a/ng2-components/ng2-activiti-tasklist/tslint.json +++ b/ng2-components/ng2-activiti-tasklist/tslint.json @@ -24,7 +24,7 @@ "label-undefined": true, "max-line-length": [ true, - 140 + 180 ], "member-ordering": [ true, diff --git a/ng2-components/ng2-alfresco-core/tslint.json b/ng2-components/ng2-alfresco-core/tslint.json index dde69dd07e..23d636b1eb 100644 --- a/ng2-components/ng2-alfresco-core/tslint.json +++ b/ng2-components/ng2-alfresco-core/tslint.json @@ -24,7 +24,7 @@ "label-undefined": true, "max-line-length": [ true, - 140 + 180 ], "member-ordering": [ true, diff --git a/ng2-components/ng2-alfresco-datatable/tslint.json b/ng2-components/ng2-alfresco-datatable/tslint.json index 828c3d4f6c..85e9df53c1 100644 --- a/ng2-components/ng2-alfresco-datatable/tslint.json +++ b/ng2-components/ng2-alfresco-datatable/tslint.json @@ -1,121 +1,121 @@ { - "rules": { - "align": [ - true, - "parameters", - "statements" - ], - "ban": false, - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "curly": true, - "eofline": true, - "forin": true, - "indent": [ - true, - "spaces" - ], - "interface-name": false, - "jsdoc-format": true, - "label-position": true, - "label-undefined": true, - "max-line-length": [ - true, - 140 - ], - "member-ordering": [ - true, - "static-before-instance", - "variables-before-functions" - ], - "no-any": false, - "no-arg": true, - "no-bitwise": false, - "no-conditional-assignment": true, - "no-consecutive-blank-lines": false, - "no-console": [ - true, - "debug", - "info", - "time", - "timeEnd", - "trace" - ], - "no-construct": true, - "no-constructor-vars": false, - "no-debugger": true, - "no-duplicate-key": true, - "no-duplicate-variable": true, - "no-empty": false, - "no-eval": true, - "no-inferrable-types": false, - "no-internal-module": true, - "no-require-imports": true, - "no-shadowed-variable": true, - "no-switch-case-fall-through": true, - "no-trailing-whitespace": true, - "no-unreachable": true, - "no-unused-expression": true, - "no-unused-variable": true, - "no-use-before-declare": true, - "no-var-keyword": true, - "no-var-requires": true, - "object-literal-sort-keys": false, - "one-line": [ - true, - "check-open-brace", - "check-catch", - "check-else", - "check-whitespace" - ], - "quotemark": [ - true, - "single", - "avoid-escape" - ], - "radix": true, - "semicolon": true, - "switch-default": true, - "trailing-comma": [ - true, - { - "multiline": "never", - "singleline": "never" - } - ], - "triple-equals": [ - true, - "allow-null-check" - ], - "typedef": false, - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - } - ], - "use-strict": false, - "variable-name": [ - true, - "check-format", - "allow-leading-underscore", - "ban-keywords" - ], - "whitespace": [ - true, - "check-branch", - "check-operator", - "check-separator", - "check-type", - "check-module", - "check-decl" - ] - } + "rules": { + "align": [ + true, + "parameters", + "statements" + ], + "ban": false, + "class-name": true, + "comment-format": [ + true, + "check-space" + ], + "curly": true, + "eofline": true, + "forin": true, + "indent": [ + true, + "spaces" + ], + "interface-name": false, + "jsdoc-format": true, + "label-position": true, + "label-undefined": true, + "max-line-length": [ + true, + 180 + ], + "member-ordering": [ + true, + "static-before-instance", + "variables-before-functions" + ], + "no-any": false, + "no-arg": true, + "no-bitwise": false, + "no-conditional-assignment": true, + "no-consecutive-blank-lines": false, + "no-console": [ + true, + "debug", + "info", + "time", + "timeEnd", + "trace" + ], + "no-construct": true, + "no-constructor-vars": false, + "no-debugger": true, + "no-duplicate-key": true, + "no-duplicate-variable": true, + "no-empty": false, + "no-eval": true, + "no-inferrable-types": false, + "no-internal-module": true, + "no-require-imports": true, + "no-shadowed-variable": true, + "no-switch-case-fall-through": true, + "no-trailing-whitespace": true, + "no-unreachable": true, + "no-unused-expression": true, + "no-unused-variable": true, + "no-use-before-declare": true, + "no-var-keyword": true, + "no-var-requires": true, + "object-literal-sort-keys": false, + "one-line": [ + true, + "check-open-brace", + "check-catch", + "check-else", + "check-whitespace" + ], + "quotemark": [ + true, + "single", + "avoid-escape" + ], + "radix": true, + "semicolon": true, + "switch-default": true, + "trailing-comma": [ + true, + { + "multiline": "never", + "singleline": "never" + } + ], + "triple-equals": [ + true, + "allow-null-check" + ], + "typedef": false, + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + } + ], + "use-strict": false, + "variable-name": [ + true, + "check-format", + "allow-leading-underscore", + "ban-keywords" + ], + "whitespace": [ + true, + "check-branch", + "check-operator", + "check-separator", + "check-type", + "check-module", + "check-decl" + ] + } } diff --git a/ng2-components/ng2-alfresco-documentlist/tslint.json b/ng2-components/ng2-alfresco-documentlist/tslint.json index 828c3d4f6c..b57f9928d2 100644 --- a/ng2-components/ng2-alfresco-documentlist/tslint.json +++ b/ng2-components/ng2-alfresco-documentlist/tslint.json @@ -24,7 +24,7 @@ "label-undefined": true, "max-line-length": [ true, - 140 + 180 ], "member-ordering": [ true, diff --git a/ng2-components/ng2-alfresco-login/tslint.json b/ng2-components/ng2-alfresco-login/tslint.json index d9374e0015..85e9df53c1 100644 --- a/ng2-components/ng2-alfresco-login/tslint.json +++ b/ng2-components/ng2-alfresco-login/tslint.json @@ -24,7 +24,7 @@ "label-undefined": true, "max-line-length": [ true, - 140 + 180 ], "member-ordering": [ true, diff --git a/ng2-components/ng2-alfresco-search/tslint.json b/ng2-components/ng2-alfresco-search/tslint.json index 828c3d4f6c..0a34e57fec 100644 --- a/ng2-components/ng2-alfresco-search/tslint.json +++ b/ng2-components/ng2-alfresco-search/tslint.json @@ -24,7 +24,7 @@ "label-undefined": true, "max-line-length": [ true, - 140 + 180 ], "member-ordering": [ true, diff --git a/ng2-components/ng2-alfresco-upload/tslint.json b/ng2-components/ng2-alfresco-upload/tslint.json index d9374e0015..85e9df53c1 100644 --- a/ng2-components/ng2-alfresco-upload/tslint.json +++ b/ng2-components/ng2-alfresco-upload/tslint.json @@ -24,7 +24,7 @@ "label-undefined": true, "max-line-length": [ true, - 140 + 180 ], "member-ordering": [ true, diff --git a/ng2-components/ng2-alfresco-viewer/tslint.json b/ng2-components/ng2-alfresco-viewer/tslint.json index 828c3d4f6c..0a34e57fec 100644 --- a/ng2-components/ng2-alfresco-viewer/tslint.json +++ b/ng2-components/ng2-alfresco-viewer/tslint.json @@ -24,7 +24,7 @@ "label-undefined": true, "max-line-length": [ true, - 140 + 180 ], "member-ordering": [ true,