summaryrefslogtreecommitdiffstats
path: root/stories/ng2-component-lab/components/notifications-example.component.ts
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2018-05-21 20:19:48 +0000
committerGerrit Code Review <gerrit@onap.org>2018-05-21 20:19:48 +0000
commit05b37297177e8a342668c15e5d6f738b51f7aedd (patch)
treee236c96df52a13f935292db8aa73e84d0c41ad8a /stories/ng2-component-lab/components/notifications-example.component.ts
parent884dfb789593d2a3cc319047ab1f0215778aec9f (diff)
parent1994c98063c27a41797dec01f2ca9fcbe33ceab0 (diff)
Merge "init commit onap ui"2.0.0-ONAPbeijing2.0.0-ONAP
Diffstat (limited to 'stories/ng2-component-lab/components/notifications-example.component.ts')
-rw-r--r--stories/ng2-component-lab/components/notifications-example.component.ts57
1 files changed, 57 insertions, 0 deletions
diff --git a/stories/ng2-component-lab/components/notifications-example.component.ts b/stories/ng2-component-lab/components/notifications-example.component.ts
new file mode 100644
index 0000000..91dd95e
--- /dev/null
+++ b/stories/ng2-component-lab/components/notifications-example.component.ts
@@ -0,0 +1,57 @@
+import { Component, Input, ViewChild } from "@angular/core";
+import { NotificationsService } from "../../../src/angular/notifications/services/notifications.service";
+import { NotificationSettings } from "../../../src/angular/notifications/utilities/notification.config";
+import { InnerNotifContent } from "../../../src/angular/notifications/notification-inner-content-example.component";
+
+@Component({
+ selector: "notifications-example",
+ template: `
+ <div>
+ <span>Send Success Notification</span>
+ <sdc-button (click)="sendSuccessNotif()" text="Click Me!"></sdc-button>
+ </div>
+ <div>
+ <span>Send Warning Notification</span>
+ <sdc-button (click)="sendWarnNotif()" text="Click Me!"></sdc-button>
+ </div>
+ <div>
+ <span>Send Info Notification</span>
+ <sdc-button (click)="sendInfoNotif()" text="Click Me!"></sdc-button>
+ </div>
+ <div>
+ <span>Send Success MultipleLine Notification</span>
+ <sdc-button (click)="sendMultipleLinesSuceessNotif()" text="Click Me!"></sdc-button>
+ </div>
+ <div>
+ <span>Send Success Custom Notification</span>
+ <sdc-button (click)="sendSuccessCustomNotif()" text="Click Me!"></sdc-button>
+ </div>
+ <sdc-notification-container>
+ </sdc-notification-container>
+`
+})
+export class NotificationsExample {
+
+ constructor(private notifsService : NotificationsService) {
+ }
+
+ sendSuccessNotif() {
+ this.notifsService.push(new NotificationSettings("success", 'notif success message test', 'Notif Title Success'));
+ }
+
+ sendMultipleLinesSuceessNotif() {
+ this.notifsService.push(new NotificationSettings("success", 'notif success message test with a lot of test so we can test multiple line case lets just add blabla bcdesfg hijklmnop qrstuvw xyz abcdesfg hijklmnop qrstuvw xyz', 'Notif Title Success'));
+ }
+
+ sendWarnNotif() {
+ this.notifsService.push(new NotificationSettings("warn", 'notif warn message test', 'Notif Title Warn'));
+ }
+
+ sendInfoNotif() {
+ this.notifsService.push(new NotificationSettings("info", 'notif info message test', 'Notif Title Info'));
+ }
+
+ sendSuccessCustomNotif() {
+ this.notifsService.push(new NotificationSettings( "info", 'notif XYZ', 'Notif Custom XYZ', 10000, false, true, InnerNotifContent, { notifyText : "notif info custom inner message test", notifyTitle : "Notif Custom Inner Title Info"}));
+ }
+}