]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notifications/notifications.component.ts
Import ceph 15.2.8
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / core / navigation / notifications / notifications.component.ts
index b6cee7649d3b1a9967caf8a94bf13e91c2289dc9..27d74360cddedcca0b8683267d9551b4812faffa 100644 (file)
@@ -3,6 +3,7 @@ import { Component, OnDestroy, OnInit } from '@angular/core';
 import { Subscription } from 'rxjs';
 
 import { Icons } from '../../../shared/enum/icons.enum';
+import { CdNotification } from '../../../shared/models/cd-notification';
 import { NotificationService } from '../../../shared/services/notification.service';
 import { SummaryService } from '../../../shared/services/summary.service';
 
@@ -14,6 +15,7 @@ import { SummaryService } from '../../../shared/services/summary.service';
 export class NotificationsComponent implements OnInit, OnDestroy {
   icons = Icons;
   hasRunningTasks = false;
+  hasNotifications = false;
   private subs = new Subscription();
 
   constructor(
@@ -27,6 +29,12 @@ export class NotificationsComponent implements OnInit, OnDestroy {
         this.hasRunningTasks = summary.executing_tasks.length > 0;
       })
     );
+
+    this.subs.add(
+      this.notificationService.data$.subscribe((notifications: CdNotification[]) => {
+        this.hasNotifications = notifications.length > 0;
+      })
+    );
   }
 
   ngOnDestroy(): void {