* Update E2 manager client to spec version 20190630
* Add configuration-driven mock of E2 getNodebIdList
* Revise front-end components to use prefix 'rd'
+* Revise the notification service to display multiple notifications
Version 1.0.4, 27 June 2019
---------------------------
"prefix": "rd",
"schematics": {
"@schematics/angular:component": {
- "styleext": "scss"
+ "styleext": "scss"
}
},
"architect": {
"src/assets"
],
"styles": [
- "node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss",
- "node_modules/@fortawesome/fontawesome-free/scss/solid.scss",
- "node_modules/@fortawesome/fontawesome-free/scss/regular.scss",
- "node_modules/@fortawesome/fontawesome-free/scss/brands.scss",
- "node_modules/angular-bootstrap-md/scss/bootstrap/bootstrap.scss",
- "node_modules/angular-bootstrap-md/scss/mdb-free.scss",
- "node_modules/material-design-icons/iconfont/material-icons.css",
- "src/styles.scss"
+ "node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss",
+ "node_modules/@fortawesome/fontawesome-free/scss/solid.scss",
+ "node_modules/@fortawesome/fontawesome-free/scss/regular.scss",
+ "node_modules/@fortawesome/fontawesome-free/scss/brands.scss",
+ "node_modules/angular-bootstrap-md/scss/bootstrap/bootstrap.scss",
+ "node_modules/angular-bootstrap-md/scss/mdb-free.scss",
+ "node_modules/material-design-icons/iconfont/material-icons.css",
+ "src/styles.scss",
+ "node_modules/ngx-toastr/toastr.css"
],
"scripts": [
"node_modules/chart.js/dist/Chart.js",
}
},
"@angular/animations": {
- "version": "8.0.3",
- "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-8.0.3.tgz",
- "integrity": "sha512-9zciJ4YRR0bodFSYgsgXdYMz8wKKyVjch7XZADGkWubXT8mGuwlpdPMlQ6n9Cwj8Ebu0u52WxMeQsX76K9RlYA==",
+ "version": "8.1.0",
+ "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-8.1.0.tgz",
+ "integrity": "sha512-v1paXrWQGsD+E4QBpwNUZ8dPj8hEn0b2kDVzYX6l/e9flUX6W2BWYx+BRuC4QBnNtTV9jiGsHT8FmQq/WztgWw==",
"requires": {
"tslib": "^1.9.0"
}
"dev": true
},
"js-yaml": {
- "version": "3.12.1",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.1.tgz",
- "integrity": "sha512-um46hB9wNOKlwkHgiuyEVAybXBjwFUV0Z/RaHJblRd9DXltue9FTYvzCr9ErQrK9Adz5MU4gHWVaNUfdmrC8qA==",
+ "version": "3.13.1",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
+ "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
"dev": true,
"requires": {
"argparse": "^1.0.7",
"resolved": "https://registry.npmjs.org/ng2-completer/-/ng2-completer-2.0.8.tgz",
"integrity": "sha512-WzxJ4u3vAHsfBUaFCloEBoirPZrnDabtWEKyDok7dtjhS1ZvcbwQ4asdXuDO0hZ0T1QC66U/PwLhKfkG501hVg=="
},
+ "ngx-toastr": {
+ "version": "10.0.4",
+ "resolved": "https://registry.npmjs.org/ngx-toastr/-/ngx-toastr-10.0.4.tgz",
+ "integrity": "sha512-iN+zr2Msae5wV334c1dytRhSYNdUz467jwv1NE91lMmllsMkpUzZlu8VdFCeTFt+/R4TWzz19xBRqhpp+OAuVA==",
+ "requires": {
+ "tslib": "^1.9.0"
+ }
+ },
"nice-try": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
},
"private": true,
"dependencies": {
- "@angular/animations": "^8.0.3",
+ "@angular/animations": "^8.1.0",
"@angular/cdk": "^7.3.7",
"@angular/common": "^8.0.3",
"@angular/compiler": "^8.0.3",
"material-design-icons": "^3.0.1",
"ng2-charts": "^1.6.0",
"ng2-completer": "^2.0.8",
+ "ngx-toastr": "^10.0.4",
"rxjs": "6.5.2",
"rxjs-compat": "6.3.3",
"tslib": "^1.10.0",
import { StatsComponent } from './stats/stats.component';
import { UiService } from './services/ui/ui.service';
import { UserComponent } from './admin/user.component';
+import { ToastrModule } from 'ngx-toastr';
@NgModule({
declarations: [
MDBBootstrapModule.forRoot(),
RdRoutingModule,
ReactiveFormsModule,
+ ToastrModule.forRoot()
],
exports: [
FormsModule,
*/
import { Injectable } from '@angular/core';
-import { MatSnackBar, MatSnackBarConfig } from '@angular/material';
+import { ToastrService } from 'ngx-toastr';
@Injectable({
providedIn: 'root'
})
export class NotificationService {
- constructor(public snackBar: MatSnackBar) { }
+ constructor(public toastr: ToastrService) { }
- successConfig: MatSnackBarConfig = {
- duration: 10000,
- horizontalPosition: 'right',
- verticalPosition: 'top'
+ successConfig = {
+ timeOut: 10000,
+ closeButton: true
};
- warningConfig: MatSnackBarConfig = {
- horizontalPosition: 'right',
- verticalPosition: 'top'
+ warningConfig = {
+ disableTimeOut: true,
+ closeButton: true
};
- errorConfig: MatSnackBarConfig = {
- horizontalPosition: 'right',
- verticalPosition: 'top'
+ errorConfig = {
+ disableTimeOut: true,
+ closeButton: true
};
success(msg: string) {
- this.successConfig['panelClass'] = ['notification', 'success', 'default'];
- this.snackBar.open(msg, '', this.successConfig);
+ this.toastr.success(msg, '', this.successConfig);
}
warn(msg: string) {
- this.warningConfig['panelClass'] = ['notification', 'warn', 'default'];
- this.snackBar.open(msg, 'Dismiss', this.warningConfig);
+ this.toastr.warning(msg, '', this.warningConfig);
}
error(msg: string) {
- this.errorConfig['panelClass'] = ['notification', 'error', 'default'];
- this.snackBar.open(msg, 'Dismiss', this.errorConfig);
+ this.toastr.error(msg, '', this.errorConfig);
}
+
}
@import '~bootstrap/dist/css/bootstrap.min.css';
@import '~@angular/material/prebuilt-themes/deeppurple-amber.css';
+
/* for sidenav to take a whole page */
html, body {
margin: 0;
text-align: center;
font-size: 20px;
}
-
-snack-bar-container.success.default {
- background-color: #5cb85c;
- color: #fff;
-}
-
-snack-bar-container.warn.default {
- background-color: #f99157;
- color: #fff;
-}
-
-snack-bar-container.error.default {
- background-color: #fc7169;
- color: #fff;
-}
-
-
-snack-bar-container.notification simple-snack-bar {
- font-size: 18px !important;
- font-weight: bold;
-}
\ No newline at end of file