You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2020/09/18 06:51:47 UTC

[incubator-streampipes] branch rel/0.67.0 updated: [hotfix] Fix bug that prevented historical notifications from loading

This is an automated email from the ASF dual-hosted git repository.

riemer pushed a commit to branch rel/0.67.0
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git


The following commit(s) were added to refs/heads/rel/0.67.0 by this push:
     new 8e2840d  [hotfix] Fix bug that prevented historical notifications from loading
8e2840d is described below

commit 8e2840df38b45b9d6c9e1edec83c1af65287470e
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Fri Sep 18 08:51:29 2020 +0200

    [hotfix] Fix bug that prevented historical notifications from loading
---
 ui/src/app/notifications/notifications.component.ts   | 8 +++++++-
 ui/src/app/notifications/utils/notifications.utils.ts | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ui/src/app/notifications/notifications.component.ts b/ui/src/app/notifications/notifications.component.ts
index 7f52228..3568850 100644
--- a/ui/src/app/notifications/notifications.component.ts
+++ b/ui/src/app/notifications/notifications.component.ts
@@ -75,6 +75,9 @@ export class NotificationsComponent implements OnInit, OnDestroy {
 
     ngOnInit() {
         this.getPipelinesWithNotifications();
+    }
+
+    createSubscription() {
         this.subscription = this.rxStompService.watch("/topic/" +this.notificationTopic).subscribe((message: Message) => {
             let scrollToBottom = false;
             if ((this.notificationContainer.nativeElement.scrollHeight - this.notificationContainer.nativeElement.scrollTop) <= (this.notificationContainer.nativeElement.clientHeight + 10) &&
@@ -113,6 +116,7 @@ export class NotificationsComponent implements OnInit, OnDestroy {
             if (this.existingNotifications.length > 0) {
                 this.pipelinesWithNotificationsPresent = true;
                 this.selectNotification(this.existingNotifications[0]);
+                this.createSubscription();
             }
         });
     }
@@ -176,7 +180,9 @@ export class NotificationsComponent implements OnInit, OnDestroy {
     }
 
     ngOnDestroy(): void {
-        this.subscription.unsubscribe();
+        if (this.subscription) {
+            this.subscription.unsubscribe();
+        }
         this.NotificationCountService.unlockIncreaseUpdate();
     }
 };
diff --git a/ui/src/app/notifications/utils/notifications.utils.ts b/ui/src/app/notifications/utils/notifications.utils.ts
index c2ee380..956fc3b 100644
--- a/ui/src/app/notifications/utils/notifications.utils.ts
+++ b/ui/src/app/notifications/utils/notifications.utils.ts
@@ -24,7 +24,7 @@ export class NotificationUtils {
     }
 
     static makeNotificationId(pipelineId: string, notificationTitle: string) {
-        let vizName = notificationTitle.replace(/\\s/g, '-');
+        let vizName = notificationTitle.replace(/\s/g, '-');
         return pipelineId + '-' + vizName;
     }
 }
\ No newline at end of file