From dc825be361f7928676844af711921b8d61c5c76d Mon Sep 17 00:00:00 2001 From: ABNER SILVA DE OLIVEIRA Date: Mon, 28 Mar 2016 10:13:15 -0300 Subject: [PATCH] fixed tslint warnings --- src/app/environment/environment-home.component.ts | 10 +++++----- src/app/environment/environment.component.spec.ts | 2 +- src/app/environment/environment.component.ts | 2 +- src/app/layout/services/body-state-classes.service.spec.ts | 2 +- src/app/main/main.component.ts | 2 +- src/lib/ng-noosfero-api/http/environment.service.ts | 16 ++++++++-------- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/app/environment/environment-home.component.ts b/src/app/environment/environment-home.component.ts index eb22086..f989de2 100644 --- a/src/app/environment/environment-home.component.ts +++ b/src/app/environment/environment-home.component.ts @@ -18,18 +18,18 @@ import {NotificationService} from "../shared/services/notification.service"; }) @Inject(EnvironmentService, "$log", "$sce") export class EnvironmentHomeComponent { - + environment: noosfero.Environment; - + constructor(private environmentService: EnvironmentService, private $sce: ng.ISCEService) { environmentService.getByIdentifier("default").then((result: noosfero.Environment) => { this.environment = result; }); } - + getEnvironmentDescription() { - if(this.environment && this.environment.settings && this.environment.settings.description){ - return this.$sce.trustAsHtml(this.environment.settings.description); + if (this.environment && this.environment.settings && this.environment.settings.description) { + return this.$sce.trustAsHtml(this.environment.settings.description); } else { return ""; diff --git a/src/app/environment/environment.component.spec.ts b/src/app/environment/environment.component.spec.ts index 8a64298..982bdea 100644 --- a/src/app/environment/environment.component.spec.ts +++ b/src/app/environment/environment.component.spec.ts @@ -28,7 +28,7 @@ describe("Components", () => { environmentServiceMock.getByIdentifier('default').and.returnValue(environmentResponse.promise); environmentServiceMock.getBoxes = jasmine.createSpy("getBoxes").and.returnValue(getBoxesResponse.promise); }); - + it("get the default environment", done => { let component: EnvironmentComponent = new EnvironmentComponent(environmentServiceMock, $state, notificationMock); $rootScope.$apply(); diff --git a/src/app/environment/environment.component.ts b/src/app/environment/environment.component.ts index d05df28..dc69467 100644 --- a/src/app/environment/environment.component.ts +++ b/src/app/environment/environment.component.ts @@ -29,7 +29,7 @@ import {EnvironmentHomeComponent} from "./environment-home.component"; controllerAs: "vm" } } - } + } ]) @Inject(EnvironmentService, "$state") export class EnvironmentComponent { diff --git a/src/app/layout/services/body-state-classes.service.spec.ts b/src/app/layout/services/body-state-classes.service.spec.ts index 1ee2c9a..8dfe619 100644 --- a/src/app/layout/services/body-state-classes.service.spec.ts +++ b/src/app/layout/services/body-state-classes.service.spec.ts @@ -113,7 +113,7 @@ describe("BodyStateClasses Service", () => { $rootScope = helpers.mocks.scopeWithEvents(); bodyElJq.addClass = (className: string) => { bodyEl.className = className; - } + }; bodyElJq.removeClass = jasmine.createSpy("removeClass"); let service = getService(); diff --git a/src/app/main/main.component.ts b/src/app/main/main.component.ts index 5a31bff..7cef8e7 100644 --- a/src/app/main/main.component.ts +++ b/src/app/main/main.component.ts @@ -8,7 +8,7 @@ import {BoxesComponent} from "../layout/boxes/boxes.component"; import {BlockComponent} from "../layout/blocks/block.component"; import {EnvironmentComponent} from "../environment/environment.component"; import {EnvironmentHomeComponent} from "../environment/environment-home.component"; -import {PeopleBlockComponent} from "../layout/blocks/people-block/people-block.component" +import {PeopleBlockComponent} from "../layout/blocks/people-block/people-block.component"; import {LinkListBlockComponent} from "./../layout/blocks/link-list/link-list.component"; import {RecentDocumentsBlockComponent} from "../layout/blocks/recent-documents/recent-documents.component"; import {ProfileImageBlockComponent} from "../layout/blocks/profile-image-block/profile-image-block.component"; diff --git a/src/lib/ng-noosfero-api/http/environment.service.ts b/src/lib/ng-noosfero-api/http/environment.service.ts index 4567594..20b3eca 100644 --- a/src/lib/ng-noosfero-api/http/environment.service.ts +++ b/src/lib/ng-noosfero-api/http/environment.service.ts @@ -7,15 +7,15 @@ export class EnvironmentService { private _currentEnvironmentPromise: ng.IDeferred; constructor(private restangular: restangular.IService, private $q: ng.IQService) { - + } - getEnvironmentPeople(params: any) : ng.IPromise { + getEnvironmentPeople(params: any): ng.IPromise { let p = this.restangular.one('people').get(params); let deferred = this.$q.defer(); p.then(this.getHandleSuccessFunctionKeyArray("people", deferred)); p.catch(this.getHandleErrorFunction(deferred)); - return deferred.promise; + return deferred.promise; } getByIdentifier(identifier: string): ng.IPromise { @@ -25,7 +25,7 @@ export class EnvironmentService { p.catch(this.getHandleErrorFunction(deferred)); return deferred.promise; } - + getBoxes(id: number) { let p = this.restangular.one('environments', id).customGET("boxes"); let deferred = this.$q.defer(); @@ -33,7 +33,7 @@ export class EnvironmentService { p.catch(this.getHandleErrorFunction(deferred)); return deferred.promise; } - + /** TODO - Please, use the base class RestangularService * (description) * @@ -66,12 +66,12 @@ export class EnvironmentService { * @param {restangular.IResponse} response (description) */ let successFunction = (response: restangular.IResponse): void => { - let data = this.restangular.stripRestangular(response.data) + let data = this.restangular.stripRestangular(response.data); deferred.resolve(data); }; return successFunction; } - + /** * TODO - use restangular service as base class, and this will not be necessary here anymore */ @@ -88,5 +88,5 @@ export class EnvironmentService { deferred.resolve(data); }; return successFunction; - } + } } -- libgit2 0.21.2