diff --git a/src/app/shared/notifications/notification/notification.component.scss b/src/app/shared/notifications/notification/notification.component.scss
index 318153add8..c433cd1e4d 100644
--- a/src/app/shared/notifications/notification/notification.component.scss
+++ b/src/app/shared/notifications/notification/notification.component.scss
@@ -1,40 +1,28 @@
-.alert-dismissible .close {
- top: -13px;
- right: -15px;
+@import '../../../../styles/variables.scss';
+
+.close {
+ outline: none !important
}
-.notificationClose:focus {
- outline: none !important;
+.notification-icon {
+ min-width: 3rem;
}
-.icon {
- //float: left;
- //padding: 5px;
-}
-
-.alert-dismissible {
- padding: 10px;
-}
-
-.sn-title, .sn-content, .sn-html {
- position: relative;
- left: 20px;
-}
-
-.sn-progress-loader {
- position: absolute;
- top: 0;
- left: 1px;
- width: 99%;
+.notification-progress-loader {
+ top: -1px;
+ left: 0;
height: 1px;
}
-.sn-progress-loader span {
- float: left;
- height: 100%;
+.alert-success .notification-progress-loader span {
+ background: darken(adjust-hue(map-get($theme-colors, success), -10), 10%);
+}
+.alert-danger .notification-progress-loader span {
+ background: darken(adjust-hue(map-get($theme-colors, danger), -10), 10%);
+}
+.alert-info .notification-progress-loader span {
+ background: darken(adjust-hue(map-get($theme-colors, info), -10), 10%);
+}
+.alert-warning .notification-progress-loader span {
+ background: darken(adjust-hue(map-get($theme-colors, warning), -10), 10%);
}
-
-.alert-success .sn-progress-loader span { background: #CBC1AD; }
-.alert-danger .sn-progress-loader span { background: #D5BABA; }
-.alert-info .sn-progress-loader span { background: #B4C9CF; }
-.alert-warning .sn-progress-loader span { background: #DBD1BD; }
diff --git a/src/app/shared/notifications/notifications-board/notifications-board.component.html b/src/app/shared/notifications/notifications-board/notifications-board.component.html
index d4ed0e1166..8f6cbc3a78 100644
--- a/src/app/shared/notifications/notifications-board/notifications-board.component.html
+++ b/src/app/shared/notifications/notifications-board/notifications-board.component.html
@@ -1,4 +1,4 @@
-
+
diff --git a/src/app/shared/notifications/notifications-board/notifications-board.component.scss b/src/app/shared/notifications/notifications-board/notifications-board.component.scss
index 18281d0967..0dd1584c4e 100644
--- a/src/app/shared/notifications/notifications-board/notifications-board.component.scss
+++ b/src/app/shared/notifications/notifications-board/notifications-board.component.scss
@@ -1,41 +1,43 @@
-.simple-notification-wrapper {
- position: fixed;
+@import '../../../../styles/variables';
+@import '../../../../styles/mixins';
+
+.notifications-wrapper {
width: 300px;
z-index: 1051;
}
-.simple-notification-wrapper.left {
+.notifications-wrapper.left {
left: 20px;
}
-.simple-notification-wrapper.top {
+.notifications-wrapper.top {
top: 20px;
}
-.simple-notification-wrapper.right {
+.notifications-wrapper.right {
right: 20px;
}
-.simple-notification-wrapper.bottom {
+.notifications-wrapper.bottom {
bottom: 20px;
}
-.simple-notification-wrapper.center {
+.notifications-wrapper.center {
left: 50%;
transform: translateX(-50%);
}
-.simple-notification-wrapper.middle {
+.notifications-wrapper.middle {
top: 50%;
transform: translateY(-50%);
}
-.simple-notification-wrapper.middle.center {
+.notifications-wrapper.middle.center {
transform: translate(-50%, -50%);
}
-@media (max-width: 340px) {
- .simple-notification-wrapper {
+@media screen and (max-width: map-get($grid-breakpoints, sm)) {
+ .notifications-wrapper {
width: auto;
left: 20px;
right: 20px;
diff --git a/src/app/shared/notifications/notifications-board/notifications-board.component.ts b/src/app/shared/notifications/notifications-board/notifications-board.component.ts
index 77696afcd0..59c9f04dbc 100644
--- a/src/app/shared/notifications/notifications-board/notifications-board.component.ts
+++ b/src/app/shared/notifications/notifications-board/notifications-board.component.ts
@@ -7,14 +7,16 @@ import {
OnInit,
ViewEncapsulation
} from '@angular/core';
-import { NotificationsService } from '../notifications.service';
+
import { Store } from '@ngrx/store';
+import { Subscription } from 'rxjs/Subscription';
+import { difference } from 'lodash';
+
+import { NotificationsService } from '../notifications.service';
import { AppState } from '../../../app.reducer';
import { notificationsStateSelector } from '../selectors';
-import { difference } from 'lodash';
import { INotification } from '../models/notification.model';
import { NotificationsState } from '../notifications.reducers';
-import { Subscription } from 'rxjs/Subscription';
import { INotificationBoardOptions } from '../../../../config/notifications-config.interfaces';
@Component({
diff --git a/src/app/shared/notifications/notifications.service.ts b/src/app/shared/notifications/notifications.service.ts
index 025f7231f9..799ca9f5ac 100644
--- a/src/app/shared/notifications/notifications.service.ts
+++ b/src/app/shared/notifications/notifications.service.ts
@@ -1,4 +1,4 @@
-import { Injectable } from '@angular/core';
+import { Inject, Injectable } from '@angular/core';
import { INotification, Notification } from './models/notification.model';
import { NotificationType } from './models/notification-type';
import { NotificationOptions } from './models/notification-options.model';
@@ -6,11 +6,13 @@ import { uniqueId } from 'lodash';
import { Store } from '@ngrx/store';
import { NewNotificationAction, RemoveAllNotificationsAction, RemoveNotificationAction } from './notifications.actions';
import { Observable } from 'rxjs/Observable';
+import { GLOBAL_CONFIG, GlobalConfig } from '../../../config';
@Injectable()
export class NotificationsService {
- constructor(private store: Store) {
+ constructor(@Inject(GLOBAL_CONFIG) public config: GlobalConfig,
+ private store: Store) {
}
private add(notification: Notification) {
@@ -21,7 +23,7 @@ export class NotificationsService {
success(title: any = Observable.of(''),
content: any = Observable.of(''),
- options = new NotificationOptions(),
+ options: NotificationOptions = this.getDefaultOptions(),
html?: any): INotification {
const notification = new Notification(uniqueId(), NotificationType.Success, title, content, options, html);
this.add(notification);
@@ -30,7 +32,7 @@ export class NotificationsService {
error(title: any = Observable.of(''),
content: any = Observable.of(''),
- options = new NotificationOptions(),
+ options: NotificationOptions = this.getDefaultOptions(),
html?: any): INotification {
const notification = new Notification(uniqueId(), NotificationType.Error, title, content, options, html);
this.add(notification);
@@ -39,7 +41,7 @@ export class NotificationsService {
info(title: any = Observable.of(''),
content: any = Observable.of(''),
- options = new NotificationOptions(),
+ options: NotificationOptions = this.getDefaultOptions(),
html?: any): INotification {
const notification = new Notification(uniqueId(), NotificationType.Info, title, content, options, html);
this.add(notification);
@@ -48,7 +50,7 @@ export class NotificationsService {
warning(title: any = Observable.of(''),
content: any = Observable.of(''),
- options = new NotificationOptions(),
+ options: NotificationOptions = this.getDefaultOptions(),
html?: any): INotification {
const notification = new Notification(uniqueId(), NotificationType.Warning, title, content, options, html);
this.add(notification);
@@ -65,4 +67,11 @@ export class NotificationsService {
this.store.dispatch(actionRemoveAll);
}
+ private getDefaultOptions(): NotificationOptions {
+ return new NotificationOptions(
+ this.config.notifications.timeOut,
+ this.config.notifications.clickToClose,
+ this.config.notifications.animate
+ );
+ }
}
diff --git a/src/config/notifications-config.interfaces.ts b/src/config/notifications-config.interfaces.ts
index 6bd28a69d1..49cdf277c3 100644
--- a/src/config/notifications-config.interfaces.ts
+++ b/src/config/notifications-config.interfaces.ts
@@ -1,7 +1,11 @@
import { Config } from './config.interface';
+import { NotificationAnimationsType } from '../app/shared/notifications/models/notification-animations-type';
export interface INotificationBoardOptions extends Config {
rtl: boolean;
position: ['top' | 'bottom' | 'middle', 'right' | 'left' | 'center'];
maxStack: number;
+ timeOut: number;
+ clickToClose: boolean;
+ animate: NotificationAnimationsType;
}