Code Review
/
src
/
xds
/
xds-agent.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fixed webapp build and error message.
[src/xds/xds-agent.git]
/
webapp
/
src
/
app
/
services
/
alert.service.ts
diff --git
a/webapp/src/app/services/alert.service.ts
b/webapp/src/app/services/alert.service.ts
index
2978e84
..
aee5827
100644
(file)
--- 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';
import { Subject } from 'rxjs/Subject';
-export type AlertType =
"danger" | "warning" | "info" | "success"
;
+export type AlertType =
'danger' | 'warning' | 'info' | 'success'
;
export interface IAlert {
type: AlertType;
export interface IAlert {
type: AlertType;
@@
-22,7
+22,7
@@
export class AlertService {
private _alerts: IAlert[];
private alertsSubject = <Subject<IAlert[]>>new Subject();
private uid = 0;
private _alerts: IAlert[];
private alertsSubject = <Subject<IAlert[]>>new Subject();
private uid = 0;
- private defaultDis
s
missTmo = 5; // in seconds
+ private defaultDismissTmo = 5; // in seconds
constructor(private sanitizer: DomSanitizer) {
this.alerts = this.alertsSubject.asObservable();
constructor(private sanitizer: DomSanitizer) {
this.alerts = this.alertsSubject.asObservable();
@@
-32,20
+32,20
@@
export class AlertService {
public error(msg: string, dismissTime?: number) {
this.add({
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) {
});
}
public warning(msg: string, dismissible?: boolean) {
- this.add({ type:
"warning", msg: msg, dismissible: true, dismissTimeout: (dismissible ? this.defaultDis
smissTmo : 0) });
+ this.add({ type:
'warning', msg: msg, dismissible: true, dismissTimeout: (dismissible ? this.defaultDi
smissTmo : 0) });
}
public info(msg: string) {
}
public info(msg: string) {
- this.add({ type:
"info", msg: msg, dismissible: true, dismissTimeout: this.defaultDis
smissTmo });
+ this.add({ type:
'info', msg: msg, dismissible: true, dismissTimeout: this.defaultDi
smissTmo });
}
public add(al: IAlert) {
}
public add(al: IAlert) {
-
let msg = String(al.msg).replace("\n", "<br>"
);
+
const msg = String(al.msg).replace('\n', '<br>'
);
this._alerts.push({
show: true,
type: al.type,
this._alerts.push({
show: true,
type: al.type,
@@
-59,7
+59,7
@@
export class AlertService {
}
public del(al: IAlert) {
}
public del(al: IAlert) {
-
le
t idx = this._alerts.findIndex((a) => a.id === al.id);
+
cons
t idx = this._alerts.findIndex((a) => a.id === al.id);
if (idx > -1) {
this._alerts.splice(idx, 1);
}
if (idx > -1) {
this._alerts.splice(idx, 1);
}