This is an automated email from the ASF dual-hosted git repository.
riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
The following commit(s) were added to refs/heads/dev by this push:
new e3b82fe [hotfix] Fix bug that prevented historical notifications from
loading
e3b82fe is described below
commit e3b82fea0cea6b2182fdec399a70806d82b8c48b
Author: Dominik Riemer <[email protected]>
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