Migrate from window.console to LogService

This commit is contained in:
Denys Vuika
2017-01-05 21:06:30 +00:00
parent 2d98a04f87
commit d42f41ec00
106 changed files with 1177 additions and 1171 deletions

View File

@@ -16,7 +16,7 @@
*/
import { Component, ElementRef, Input, Output, EventEmitter, SimpleChanges } from '@angular/core';
import { AlfrescoTranslateService } from 'ng2-alfresco-core';
import { AlfrescoTranslateService, LogService } from 'ng2-alfresco-core';
import { DiagramsService } from '../services/diagrams.service';
import { DiagramColorService } from '../services/diagram-color.service';
import { RaphaelService } from './raphael/raphael.service';
@@ -57,17 +57,16 @@ export class DiagramComponent {
PADDING_HEIGHT: number = 60;
private diagram: DiagramModel;
private elementRef: ElementRef;
constructor(elementRef: ElementRef,
constructor(private elementRef: ElementRef,
private translateService: AlfrescoTranslateService,
private diagramColorService: DiagramColorService,
private raphaelService: RaphaelService,
private diagramsService: DiagramsService) {
private diagramsService: DiagramsService,
private logService: LogService) {
if (translateService) {
translateService.addTranslationFolder('ng2-activiti-diagrams', 'node_modules/ng2-activiti-diagrams/src');
}
this.elementRef = elementRef;
}
ngOnChanges(changes: SimpleChanges) {
@@ -86,7 +85,7 @@ export class DiagramComponent {
},
(err: any) => {
this.onError.emit(err);
console.log(err);
this.logService.error(err);
}
);
}

View File

@@ -16,6 +16,7 @@
*/
import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core';
import { LogService } from 'ng2-alfresco-core';
import { Point } from './models/point';
import { RaphaelBase } from './raphael-base';
import { RaphaelService } from './raphael.service';
@@ -43,19 +44,20 @@ export class RaphaelMultilineTextDirective extends RaphaelBase implements OnInit
TEXT_PADDING = 3;
constructor(public elementRef: ElementRef,
raphaelService: RaphaelService) {
raphaelService: RaphaelService,
private logService: LogService) {
super(elementRef, raphaelService);
}
ngOnInit() {
console.log(this.elementRef);
this.logService.log(this.elementRef);
if (this.text === null || this.text === undefined) {
this.text = '';
}
this.draw(this.position, this.text);
}
public draw(position: Point, text: string) {
draw(position: Point, text: string) {
let textPaper = this.paper.text(position.x + this.TEXT_PADDING, position.y + this.TEXT_PADDING, text).attr({
'text-anchor': 'middle',
'font-family': 'Arial',

View File

@@ -16,16 +16,17 @@
*/
import { Injectable } from '@angular/core';
import { AuthService, SettingsService } from 'ng2-alfresco-core';
import { Observable } from 'rxjs/Rx';
import { Response, Http, Headers, RequestOptions } from '@angular/http';
import { AuthService, SettingsService, LogService } from 'ng2-alfresco-core';
@Injectable()
export class DiagramsService {
constructor(private authService: AuthService,
private http: Http,
private settingsService: SettingsService) {
private settingsService: SettingsService,
private logService: LogService) {
}
getProcessDefinitionModel(processDefinitionId: string): Observable<any> {
@@ -53,7 +54,7 @@ export class DiagramsService {
}
private handleError(error: Response) {
console.error(error);
this.logService.error(error);
return Observable.throw(error.json().error || 'Server error');
}
}