Commit dc825be361f7928676844af711921b8d61c5c76d

Authored by ABNER SILVA DE OLIVEIRA
1 parent 5b549e23
Exists in master and in 1 other branch dev-fixes

fixed tslint warnings

src/app/environment/environment-home.component.ts
@@ -18,18 +18,18 @@ import {NotificationService} from "../shared/services/notification.service"; @@ -18,18 +18,18 @@ import {NotificationService} from "../shared/services/notification.service";
18 }) 18 })
19 @Inject(EnvironmentService, "$log", "$sce") 19 @Inject(EnvironmentService, "$log", "$sce")
20 export class EnvironmentHomeComponent { 20 export class EnvironmentHomeComponent {
21 - 21 +
22 environment: noosfero.Environment; 22 environment: noosfero.Environment;
23 - 23 +
24 constructor(private environmentService: EnvironmentService, private $sce: ng.ISCEService) { 24 constructor(private environmentService: EnvironmentService, private $sce: ng.ISCEService) {
25 environmentService.getByIdentifier("default").then((result: noosfero.Environment) => { 25 environmentService.getByIdentifier("default").then((result: noosfero.Environment) => {
26 this.environment = result; 26 this.environment = result;
27 }); 27 });
28 } 28 }
29 - 29 +
30 getEnvironmentDescription() { 30 getEnvironmentDescription() {
31 - if(this.environment && this.environment.settings && this.environment.settings.description){  
32 - return this.$sce.trustAsHtml(this.environment.settings.description); 31 + if (this.environment && this.environment.settings && this.environment.settings.description) {
  32 + return this.$sce.trustAsHtml(this.environment.settings.description);
33 } 33 }
34 else { 34 else {
35 return ""; 35 return "";
src/app/environment/environment.component.spec.ts
@@ -28,7 +28,7 @@ describe("Components", () => { @@ -28,7 +28,7 @@ describe("Components", () => {
28 environmentServiceMock.getByIdentifier('default').and.returnValue(environmentResponse.promise); 28 environmentServiceMock.getByIdentifier('default').and.returnValue(environmentResponse.promise);
29 environmentServiceMock.getBoxes = jasmine.createSpy("getBoxes").and.returnValue(getBoxesResponse.promise); 29 environmentServiceMock.getBoxes = jasmine.createSpy("getBoxes").and.returnValue(getBoxesResponse.promise);
30 }); 30 });
31 - 31 +
32 it("get the default environment", done => { 32 it("get the default environment", done => {
33 let component: EnvironmentComponent = new EnvironmentComponent(environmentServiceMock, $state, notificationMock); 33 let component: EnvironmentComponent = new EnvironmentComponent(environmentServiceMock, $state, notificationMock);
34 $rootScope.$apply(); 34 $rootScope.$apply();
src/app/environment/environment.component.ts
@@ -29,7 +29,7 @@ import {EnvironmentHomeComponent} from "./environment-home.component"; @@ -29,7 +29,7 @@ import {EnvironmentHomeComponent} from "./environment-home.component";
29 controllerAs: "vm" 29 controllerAs: "vm"
30 } 30 }
31 } 31 }
32 - } 32 + }
33 ]) 33 ])
34 @Inject(EnvironmentService, "$state") 34 @Inject(EnvironmentService, "$state")
35 export class EnvironmentComponent { 35 export class EnvironmentComponent {
src/app/layout/services/body-state-classes.service.spec.ts
@@ -113,7 +113,7 @@ describe("BodyStateClasses Service", () => { @@ -113,7 +113,7 @@ describe("BodyStateClasses Service", () => {
113 $rootScope = <any>helpers.mocks.scopeWithEvents(); 113 $rootScope = <any>helpers.mocks.scopeWithEvents();
114 bodyElJq.addClass = (className: string) => { 114 bodyElJq.addClass = (className: string) => {
115 bodyEl.className = className; 115 bodyEl.className = className;
116 - } 116 + };
117 bodyElJq.removeClass = jasmine.createSpy("removeClass"); 117 bodyElJq.removeClass = jasmine.createSpy("removeClass");
118 118
119 let service = getService(); 119 let service = getService();
src/app/main/main.component.ts
@@ -8,7 +8,7 @@ import {BoxesComponent} from &quot;../layout/boxes/boxes.component&quot;; @@ -8,7 +8,7 @@ import {BoxesComponent} from &quot;../layout/boxes/boxes.component&quot;;
8 import {BlockComponent} from "../layout/blocks/block.component"; 8 import {BlockComponent} from "../layout/blocks/block.component";
9 import {EnvironmentComponent} from "../environment/environment.component"; 9 import {EnvironmentComponent} from "../environment/environment.component";
10 import {EnvironmentHomeComponent} from "../environment/environment-home.component"; 10 import {EnvironmentHomeComponent} from "../environment/environment-home.component";
11 -import {PeopleBlockComponent} from "../layout/blocks/people-block/people-block.component" 11 +import {PeopleBlockComponent} from "../layout/blocks/people-block/people-block.component";
12 import {LinkListBlockComponent} from "./../layout/blocks/link-list/link-list.component"; 12 import {LinkListBlockComponent} from "./../layout/blocks/link-list/link-list.component";
13 import {RecentDocumentsBlockComponent} from "../layout/blocks/recent-documents/recent-documents.component"; 13 import {RecentDocumentsBlockComponent} from "../layout/blocks/recent-documents/recent-documents.component";
14 import {ProfileImageBlockComponent} from "../layout/blocks/profile-image-block/profile-image-block.component"; 14 import {ProfileImageBlockComponent} from "../layout/blocks/profile-image-block/profile-image-block.component";
src/lib/ng-noosfero-api/http/environment.service.ts
@@ -7,15 +7,15 @@ export class EnvironmentService { @@ -7,15 +7,15 @@ export class EnvironmentService {
7 private _currentEnvironmentPromise: ng.IDeferred<noosfero.Environment>; 7 private _currentEnvironmentPromise: ng.IDeferred<noosfero.Environment>;
8 8
9 constructor(private restangular: restangular.IService, private $q: ng.IQService) { 9 constructor(private restangular: restangular.IService, private $q: ng.IQService) {
10 - 10 +
11 } 11 }
12 12
13 - getEnvironmentPeople(params: any) : ng.IPromise<noosfero.Person[]> { 13 + getEnvironmentPeople(params: any): ng.IPromise<noosfero.Person[]> {
14 let p = this.restangular.one('people').get(params); 14 let p = this.restangular.one('people').get(params);
15 let deferred = this.$q.defer<noosfero.Person[]>(); 15 let deferred = this.$q.defer<noosfero.Person[]>();
16 p.then(this.getHandleSuccessFunctionKeyArray<noosfero.Person[]>("people", deferred)); 16 p.then(this.getHandleSuccessFunctionKeyArray<noosfero.Person[]>("people", deferred));
17 p.catch(this.getHandleErrorFunction<noosfero.Person[]>(deferred)); 17 p.catch(this.getHandleErrorFunction<noosfero.Person[]>(deferred));
18 - return deferred.promise; 18 + return deferred.promise;
19 } 19 }
20 20
21 getByIdentifier(identifier: string): ng.IPromise<noosfero.Environment> { 21 getByIdentifier(identifier: string): ng.IPromise<noosfero.Environment> {
@@ -25,7 +25,7 @@ export class EnvironmentService { @@ -25,7 +25,7 @@ export class EnvironmentService {
25 p.catch(this.getHandleErrorFunction<noosfero.Environment>(deferred)); 25 p.catch(this.getHandleErrorFunction<noosfero.Environment>(deferred));
26 return deferred.promise; 26 return deferred.promise;
27 } 27 }
28 - 28 +
29 getBoxes(id: number) { 29 getBoxes(id: number) {
30 let p = this.restangular.one('environments', id).customGET("boxes"); 30 let p = this.restangular.one('environments', id).customGET("boxes");
31 let deferred = this.$q.defer<noosfero.Box[]>(); 31 let deferred = this.$q.defer<noosfero.Box[]>();
@@ -33,7 +33,7 @@ export class EnvironmentService { @@ -33,7 +33,7 @@ export class EnvironmentService {
33 p.catch(this.getHandleErrorFunction<noosfero.Box[]>(deferred)); 33 p.catch(this.getHandleErrorFunction<noosfero.Box[]>(deferred));
34 return deferred.promise; 34 return deferred.promise;
35 } 35 }
36 - 36 +
37 /** TODO - Please, use the base class RestangularService 37 /** TODO - Please, use the base class RestangularService
38 * (description) 38 * (description)
39 * 39 *
@@ -66,12 +66,12 @@ export class EnvironmentService { @@ -66,12 +66,12 @@ export class EnvironmentService {
66 * @param {restangular.IResponse} response (description) 66 * @param {restangular.IResponse} response (description)
67 */ 67 */
68 let successFunction = (response: restangular.IResponse): void => { 68 let successFunction = (response: restangular.IResponse): void => {
69 - let data = this.restangular.stripRestangular(response.data) 69 + let data = this.restangular.stripRestangular(response.data);
70 deferred.resolve(data); 70 deferred.resolve(data);
71 }; 71 };
72 return successFunction; 72 return successFunction;
73 } 73 }
74 - 74 +
75 /** 75 /**
76 * TODO - use restangular service as base class, and this will not be necessary here anymore 76 * TODO - use restangular service as base class, and this will not be necessary here anymore
77 */ 77 */
@@ -88,5 +88,5 @@ export class EnvironmentService { @@ -88,5 +88,5 @@ export class EnvironmentService {
88 deferred.resolve(data); 88 deferred.resolve(data);
89 }; 89 };
90 return successFunction; 90 return successFunction;
91 - } 91 + }
92 } 92 }