X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-frontend%2Fsrc%2Fapp%2Fservices%2Fui%2Fnotification.service.ts;h=647712545b9c538d700bac2c27ddb8638cfb8ce2;hb=1ddf7dedd6f254a9d31af409a860f8a6573d26c6;hp=30f80214789ee72ee143369a9ef35d240d68e071;hpb=8d590e9e52984c2fd4ea4da2a015cdf0cf88b7d2;p=portal%2Fric-dashboard.git diff --git a/webapp-frontend/src/app/services/ui/notification.service.ts b/webapp-frontend/src/app/services/ui/notification.service.ts index 30f80214..64771254 100644 --- a/webapp-frontend/src/app/services/ui/notification.service.ts +++ b/webapp-frontend/src/app/services/ui/notification.service.ts @@ -28,25 +28,34 @@ export class NotificationService { constructor(public snackBar: MatSnackBar) { } - config: MatSnackBarConfig = { - duration: 3000, + successConfig: MatSnackBarConfig = { + duration: 10000, horizontalPosition: 'right', verticalPosition: 'top' }; + warningConfig: MatSnackBarConfig = { + horizontalPosition: 'right', + verticalPosition: 'top' + }; + + errorConfig: MatSnackBarConfig = { + horizontalPosition: 'right', + verticalPosition: 'top' + }; success(msg: string) { - this.config['panelClass'] = ['notification', 'success', 'default']; - this.snackBar.open(msg, '', this.config); + this.successConfig['panelClass'] = ['notification', 'success', 'default']; + this.snackBar.open(msg, '', this.successConfig); } warn(msg: string) { - this.config['panelClass'] = ['notification', 'warn', 'default']; - this.snackBar.open(msg, '', this.config); + this.warningConfig['panelClass'] = ['notification', 'warn', 'default']; + this.snackBar.open(msg, 'Dismiss', this.warningConfig); } error(msg: string) { - this.config['panelClass'] = ['notification', 'error', 'default']; - this.snackBar.open(msg, '', this.config); + this.errorConfig['panelClass'] = ['notification', 'error', 'default']; + this.snackBar.open(msg, 'Dismiss', this.errorConfig); } }