X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=webapp%2Fsrc%2Fapp%2Fservices%2Falert.service.ts;h=aee582742c9c64b0479581ab357f0ee8944268c4;hb=fb2f6b918beb0a994ad304bfd678ef0c5c562210;hp=2978e846717874919ac414c44637792976df71d4;hpb=c51d5034d527578da70bdd41b9ce13f28455c598;p=src%2Fxds%2Fxds-agent.git diff --git a/webapp/src/app/services/alert.service.ts b/webapp/src/app/services/alert.service.ts index 2978e84..aee5827 100644 --- a/webapp/src/app/services/alert.service.ts +++ b/webapp/src/app/services/alert.service.ts @@ -4,7 +4,7 @@ import { Observable } from 'rxjs/Observable'; import { Subject } from 'rxjs/Subject'; -export type AlertType = "danger" | "warning" | "info" | "success"; +export type AlertType = 'danger' | 'warning' | 'info' | 'success'; export interface IAlert { type: AlertType; @@ -22,7 +22,7 @@ export class AlertService { private _alerts: IAlert[]; private alertsSubject = >new Subject(); private uid = 0; - private defaultDissmissTmo = 5; // in seconds + private defaultDismissTmo = 5; // in seconds constructor(private sanitizer: DomSanitizer) { this.alerts = this.alertsSubject.asObservable(); @@ -32,20 +32,20 @@ export class AlertService { public error(msg: string, dismissTime?: number) { this.add({ - type: "danger", msg: msg, dismissible: true, dismissTimeout: dismissTime + type: 'danger', msg: msg, dismissible: true, dismissTimeout: dismissTime }); } public warning(msg: string, dismissible?: boolean) { - this.add({ type: "warning", msg: msg, dismissible: true, dismissTimeout: (dismissible ? this.defaultDissmissTmo : 0) }); + this.add({ type: 'warning', msg: msg, dismissible: true, dismissTimeout: (dismissible ? this.defaultDismissTmo : 0) }); } public info(msg: string) { - this.add({ type: "info", msg: msg, dismissible: true, dismissTimeout: this.defaultDissmissTmo }); + this.add({ type: 'info', msg: msg, dismissible: true, dismissTimeout: this.defaultDismissTmo }); } public add(al: IAlert) { - let msg = String(al.msg).replace("\n", "
"); + const msg = String(al.msg).replace('\n', '
'); this._alerts.push({ show: true, type: al.type, @@ -59,7 +59,7 @@ export class AlertService { } public del(al: IAlert) { - let idx = this._alerts.findIndex((a) => a.id === al.id); + const idx = this._alerts.findIndex((a) => a.id === al.id); if (idx > -1) { this._alerts.splice(idx, 1); }