]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Added header action for tasks and notifications
authorAfreen Misbah <afreen@ibm.com>
Tue, 16 Dec 2025 14:09:32 +0000 (19:39 +0530)
committerAfreen Misbah <afreen@ibm.com>
Mon, 26 Jan 2026 06:45:48 +0000 (12:15 +0530)
- removed the custom css and using carbon component
- fixed unit tests of notification page

Signed-off-by: Afreen Misbah <afreen@ibm.com>
15 files changed:
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation.module.ts
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.ts
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notification-panel/notification-footer/notification-footer.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notification-panel/notification-footer/notification-footer.component.ts
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notification-panel/notification-panel/notification-panel.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notification-panel/notifications-page/notifications-page.component.html
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notification-panel/notifications-page/notifications-page.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notification-panel/notifications-page/notifications-page.component.ts
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notifications/notifications.component.html
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notifications/notifications.component.scss
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notifications/notifications.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/icon/icon.component.scss
src/pybind/mgr/dashboard/frontend/src/app/shared/components/icon/icon.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/enum/icons.enum.ts

index 089f47a16f2cb77a517fd7a60fd57034f36c5f65..9b642e8f35fed2243b93c446f525d9615ad2cae7 100644 (file)
@@ -42,6 +42,7 @@ import SettingsIcon from '@carbon/icons/es/settings/20';
 import HelpIcon from '@carbon/icons/es/help/20';
 import NotificationIcon from '@carbon/icons/es/notification/20';
 import NotificationOffIcon from '@carbon/icons/es/notification--off/20';
+import NotificationNewIcon from '@carbon/icons/es/notification--new/20';
 import LaunchIcon from '@carbon/icons/es/launch/16';
 import DashboardIcon from '@carbon/icons/es/template/20';
 import ClusterIcon from '@carbon/icons/es/web-services--cluster/20';
@@ -58,6 +59,7 @@ import ErrorFilledIcon from '@carbon/icons/es/error--filled/16';
 import InformationFilledIcon from '@carbon/icons/es/information--filled/16';
 import WarningFilledIcon from '@carbon/icons/es/warning--filled/16';
 import NotificationFilledIcon from '@carbon/icons/es/notification--filled/16';
+
 import CloseIcon from '@carbon/icons/es/close/16';
 import { NotificationPanelComponent } from './notification-panel/notification-panel/notification-panel.component';
 import { NotificationHeaderComponent } from './notification-panel/notification-header/notification-header.component';
@@ -139,6 +141,7 @@ export class NavigationModule {
       InformationFilledIcon,
       WarningFilledIcon,
       NotificationFilledIcon,
+      NotificationNewIcon,
       CloseIcon
     ]);
   }
index 3b024375066d0347e9552e3a8f1b1514a66e41dc..20f4d50b5932d2306aeeec750cfde6b1eae28263 100644 (file)
@@ -1,8 +1,5 @@
 <div class="cd-navbar-main">
-  <!-- ************************ -->
-  <!-- NOTIFICATIONS     -->
-  <!-- ************************ -->
-  <cd-notifications-sidebar></cd-notifications-sidebar>
+  <cd-notification-panel *ngIf="isNotifPanelOpen"></cd-notification-panel>
   <!-- ************************ -->
   <!-- HEADER                   -->
   <!-- ************************ -->
         </ng-container>
       </cds-header-menu>
     </cds-header-navigation>
-
     <cds-header-global>
       <cds-header-navigation>
         <cd-language-selector class="d-flex"></cd-language-selector>
       </cds-header-navigation>
-      <div class="cds--btn cds--btn--icon-only cds--header__action"
-           (click)="toggleSidebar()">
-        <cd-notifications></cd-notifications>
-      </div>
+      <cds-header-action
+        description=""
+        [(active)]="isNotifPanelOpen">
+          <cd-notifications></cd-notifications>
+      </cds-header-action>
       <div class="cds--btn cds--btn--icon-only cds--header__action">
         <cd-dashboard-help></cd-dashboard-help>
       </div>
index 612ef52ddc3707312e5e4be6133f0609ca48ad3f..2864776c94c6f5994db79e214305370fcf5aff6c 100644 (file)
@@ -33,7 +33,7 @@ export class NavigationComponent implements OnInit, OnDestroy {
   clusterTokenStatus: object = {};
   summaryData: any;
 
-  rightSidebarOpen = false; // rightSidebar only opens when width is less than 768px
+  isNotifPanelOpen = false;
   showMenuSidebar = true;
 
   simplebar = {
@@ -161,8 +161,8 @@ export class NavigationComponent implements OnInit, OnDestroy {
     this.displayedSubMenu[menu] = !this.displayedSubMenu[menu];
   }
 
-  toggleRightSidebar() {
-    this.rightSidebarOpen = !this.rightSidebarOpen;
+  toggleSidebar() {
+    this.isNotifPanelOpen = !this.isNotifPanelOpen;
   }
 
   onClusterSelection(value: object) {
@@ -210,9 +210,7 @@ export class NavigationComponent implements OnInit, OnDestroy {
       }
     );
   }
-  toggleSidebar() {
-    this.notificationService.toggleSidebar(true, true);
-  }
+
   trackByFn(item: any) {
     return item;
   }
index 65d51d6af8ff8f3f2f16df4f65876ad83e31fba5..608a4ebff346919a87d5bc7bc8873184cc7fab80 100644 (file)
@@ -1,5 +1,11 @@
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { NotificationFooterComponent } from './notification-footer.component';
+import { NotificationService } from '~/app/shared/services/notification.service';
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+
+class MockNotificationService {
+  toggleSidebar = () => {};
+}
 
 describe('NotificationFooterComponent', () => {
   let component: NotificationFooterComponent;
@@ -7,7 +13,9 @@ describe('NotificationFooterComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [NotificationFooterComponent]
+      declarations: [NotificationFooterComponent],
+      providers: [{ provide: NotificationService, useClass: MockNotificationService }],
+      schemas: [CUSTOM_ELEMENTS_SCHEMA]
     }).compileComponents();
   });
 
index 5dcf0d39c367438208b4d46d090f13254a93fa3c..f26660ef3aafddaf8ea411d4a84a8ca56f48a78e 100644 (file)
@@ -4,7 +4,8 @@ import { NotificationService } from '~/app/shared/services/notification.service'
 @Component({
   selector: 'cd-notification-footer',
   templateUrl: './notification-footer.component.html',
-  styleUrls: ['./notification-footer.component.scss']
+  styleUrls: ['./notification-footer.component.scss'],
+  standalone: false
 })
 export class NotificationFooterComponent {
   constructor(public notificationService: NotificationService) {}
index e2df0faf7c40979666eebc9d2501c0c455f92c6e..67bc2924686cabaeef26765e07af91a28d198ad6 100644 (file)
@@ -1,6 +1,6 @@
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { NotificationPanelComponent } from './notification-panel.component';
-import { NotificationService } from '../../../shared/services/notification.service';
+import { NotificationService } from '~/app/shared/services/notification.service';
 
 describe('NotificationPanelComponent', () => {
   let component: NotificationPanelComponent;
index 1e6d3e67d935c2c0a7bdd95ed1b64ed5467a96a4..bbc832bef4ac10147f8673f80e79e4a0cdf7bc32 100644 (file)
@@ -1,4 +1,4 @@
-<div 
+<div
   cdsGrid
   [useCssGrid]="true"
   [fullWidth]="true"
@@ -61,7 +61,7 @@
           cdsRow>
         <svg
           cdsIcon="notification"
-          size="48"
+          size="20"
           class="empty-icon"></svg>
         <p *ngIf="searchText">No notifications match your search</p>
         <p *ngIf="!searchText">No notifications available</p>
@@ -70,7 +70,7 @@
   <!-- Right Panel - Notifications Details -->
   <div cdsCol
        [columnNumbers]="{sm: 12, md: 12, lg: 9}">
-    <div 
+    <div
       cdsGrid
       [fullWidth]="true"
       *ngIf="selectedNotification"
index 64e7f2728ff5eab0a328fbefb5b122f3d9507529..ddac8594b1dfaa45684ac57bac5aaf2bb89e6620 100644 (file)
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { FormsModule } from '@angular/forms';
-import { BehaviorSubject } from 'rxjs';
+import { BehaviorSubject, Subscription } from 'rxjs';
 import {
   IconModule,
   SearchModule,
   StructuredListModule,
-  TagModule
+  TagModule,
+  GridModule
 } from 'carbon-components-angular';
 
 import { NotificationsPageComponent } from './notifications-page.component';
-import { NotificationService } from '~/app/shared/services/notification.service';
 import { CdNotification } from '~/app/shared/models/cd-notification';
 import { NotificationType } from '~/app/shared/enum/notification-type.enum';
-import { SharedModule } from '~/app/shared/shared.module';
+import { NotificationService } from '~/app/shared/services/notification.service';
+import { PrometheusAlertService } from '~/app/shared/services/prometheus-alert.service';
+import { PrometheusNotificationService } from '~/app/shared/services/prometheus-notification.service';
+import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
+import { ChangeDetectorRef } from '@angular/core';
 
 describe('NotificationsPageComponent', () => {
   let component: NotificationsPageComponent;
   let fixture: ComponentFixture<NotificationsPageComponent>;
-  let notificationService: NotificationService;
   let mockNotifications: CdNotification[];
   let dataSourceSubject: BehaviorSubject<CdNotification[]>;
+  let notificationService: any;
 
-  // Mock notification service
+  // Create mocks
   const createMockNotificationService = () => {
     dataSourceSubject = new BehaviorSubject<CdNotification[]>([]);
     return {
       data$: dataSourceSubject.asObservable(),
-      dataSource: dataSourceSubject,
+      dataSource: {
+        getValue: () => dataSourceSubject.getValue(),
+        next: (value: CdNotification[]) => dataSourceSubject.next(value)
+      },
       remove: jasmine.createSpy('remove')
     };
   };
 
+  const mockPrometheusAlertService = {
+    refresh: jasmine.createSpy('refresh')
+  };
+
+  const mockPrometheusNotificationService = {
+    refresh: jasmine.createSpy('refresh')
+  };
+
+  const mockAuthStorageService = {
+    getPermissions: jasmine.createSpy('getPermissions').and.returnValue({
+      prometheus: { read: false },
+      configOpt: { read: false }
+    })
+  };
+
+  const mockChangeDetectorRef = {
+    detectChanges: jasmine.createSpy('detectChanges')
+  };
+
+  // Create mock notifications
+  const createMockNotification = (overrides: any): CdNotification => {
+    return {
+      title: overrides.title || '',
+      message: overrides.message || '',
+      application: overrides.application || '',
+      timestamp: overrides.timestamp || new Date().toISOString(),
+      type: overrides.type || NotificationType.info,
+      priority: 'normal',
+      textClass: '',
+      iconClass: '',
+      duration: 0,
+      borderClass: '',
+      timeout: 0,
+      id: '',
+      isError: false,
+      isFinishedTask: false,
+      progress: 0,
+      progressText: '',
+      task: undefined,
+      error: undefined,
+      isSilent: false,
+      silentNotifications: [],
+      userData: undefined,
+      alertSilenced: false,
+      ...overrides
+    } as CdNotification;
+  };
+
   beforeEach(async () => {
     mockNotifications = [
-      {
+      createMockNotification({
         title: 'Success Notification',
         message: 'Operation completed successfully',
-        timestamp: new Date().toISOString(),
         type: NotificationType.success,
-        application: 'TestApp'
-      },
-      {
+        application: 'TestApp',
+        timestamp: new Date().toISOString()
+      }),
+      createMockNotification({
         title: 'Error Notification',
         message: 'An error occurred',
-        timestamp: new Date(Date.now() - 86400000).toISOString(), // Yesterday
         type: NotificationType.error,
-        application: 'TestApp'
-      },
-      {
+        application: 'TestApp',
+        timestamp: new Date(Date.now() - 86400000).toISOString()
+      }),
+      createMockNotification({
         title: 'Info Notification',
         message: 'System update available',
-        timestamp: new Date(Date.now() - 172800000).toISOString(), // 2 days ago
         type: NotificationType.info,
-        application: 'Updates'
-      }
+        application: 'Updates',
+        timestamp: new Date(Date.now() - 172800000).toISOString()
+      })
     ];
 
+    const mockNotificationService = createMockNotificationService();
+    notificationService = mockNotificationService; // Store reference
+
     await TestBed.configureTestingModule({
-      imports: [
-        FormsModule,
-        SharedModule,
-        IconModule,
-        SearchModule,
-        StructuredListModule,
-        TagModule
-      ],
+      imports: [FormsModule, GridModule, IconModule, SearchModule, StructuredListModule, TagModule],
       declarations: [NotificationsPageComponent],
-      providers: [{ provide: NotificationService, useFactory: createMockNotificationService }]
+      providers: [
+        { provide: NotificationService, useValue: mockNotificationService },
+        { provide: PrometheusAlertService, useValue: mockPrometheusAlertService },
+        { provide: PrometheusNotificationService, useValue: mockPrometheusNotificationService },
+        { provide: AuthStorageService, useValue: mockAuthStorageService },
+        { provide: ChangeDetectorRef, useValue: mockChangeDetectorRef }
+      ]
     }).compileComponents();
-
-    notificationService = TestBed.inject(NotificationService);
   });
 
   beforeEach(() => {
     fixture = TestBed.createComponent(NotificationsPageComponent);
     component = fixture.componentInstance;
+
+    // Update the data source with mock notifications BEFORE ngOnInit
     dataSourceSubject.next(mockNotifications);
+
+    // Initialize the component
     fixture.detectChanges();
   });
 
+  afterEach(() => {
+    if (component['interval']) {
+      window.clearInterval(component['interval']);
+    }
+  });
+
   it('should create', () => {
     expect(component).toBeTruthy();
   });
@@ -133,15 +198,11 @@ describe('NotificationsPageComponent', () => {
         preventDefault: jasmine.createSpy('preventDefault')
       };
 
-      // Set up the dataSource with notifications
-      dataSourceSubject.next(mockNotifications);
-      fixture.detectChanges();
-
       component.removeNotification(notification, mockEvent as any);
 
       expect(mockEvent.stopPropagation).toHaveBeenCalled();
       expect(mockEvent.preventDefault).toHaveBeenCalled();
-      expect(notificationService.remove).toHaveBeenCalledWith(0); // Should be called with index 0
+      expect(notificationService.remove).toHaveBeenCalledWith(0); // FIXED: use notificationService
     });
 
     it('should clear selection if removed notification was selected', () => {
@@ -152,10 +213,6 @@ describe('NotificationsPageComponent', () => {
         preventDefault: jasmine.createSpy('preventDefault')
       };
 
-      // Set up the dataSource with notifications
-      dataSourceSubject.next(mockNotifications);
-      fixture.detectChanges();
-
       component.removeNotification(notification, mockEvent as any);
 
       expect(component.selectedNotification).toBeNull();
@@ -231,9 +288,33 @@ describe('NotificationsPageComponent', () => {
     });
   });
 
+  it('should set up interval for Prometheus alerts when permissions exist', () => {
+    mockAuthStorageService.getPermissions.and.returnValue({
+      prometheus: { read: true },
+      configOpt: { read: true }
+    });
+
+    // Re-initialize component to trigger ngOnInit with new permissions
+    fixture = TestBed.createComponent(NotificationsPageComponent);
+    component = fixture.componentInstance;
+    dataSourceSubject.next(mockNotifications);
+    fixture.detectChanges();
+
+    expect(component['interval']).toBeDefined();
+  });
+
   it('should unsubscribe on destroy', () => {
+    component['sub'] = new Subscription();
     const unsubscribeSpy = spyOn(component['sub'], 'unsubscribe');
+
+    if (!component['interval']) {
+      component['interval'] = window.setInterval(() => {}, 5000);
+    }
+    const clearIntervalSpy = spyOn(window, 'clearInterval');
+
     component.ngOnDestroy();
+
     expect(unsubscribeSpy).toHaveBeenCalled();
+    expect(clearIntervalSpy).toHaveBeenCalled();
   });
 });
index f507941a2147c797b1ce83ae65993cf4ecf5454d..d8952ec0fe42cf378ca99af945ccf4a296258d12 100644 (file)
@@ -1,4 +1,11 @@
-import { Component, OnInit, OnDestroy, AfterViewInit, ChangeDetectorRef, AfterViewChecked } from '@angular/core';
+import {
+  Component,
+  OnInit,
+  OnDestroy,
+  AfterViewInit,
+  ChangeDetectorRef,
+  AfterViewChecked
+} from '@angular/core';
 import { Subscription } from 'rxjs';
 import { NotificationService } from '~/app/shared/services/notification.service';
 import { CdNotification } from '~/app/shared/models/cd-notification';
@@ -10,9 +17,11 @@ import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
 @Component({
   selector: 'cd-notifications-page',
   templateUrl: './notifications-page.component.html',
-  styleUrls: ['./notifications-page.component.scss']
+  styleUrls: ['./notifications-page.component.scss'],
+  standalone: false
 })
-export class NotificationsPageComponent implements OnInit, OnDestroy, AfterViewInit, AfterViewChecked {
+export class NotificationsPageComponent
+  implements OnInit, OnDestroy, AfterViewInit, AfterViewChecked {
   notifications: CdNotification[] = [];
   selectedNotification: CdNotification | null = null;
   searchText: string = '';
index 77eaddcb63279346f2c8c2aa6e92eaa18eb48869..da785b10266b3bd1c77837a6fc65c47080a682ae 100644 (file)
@@ -1,24 +1,15 @@
-<a i18n-title
-   title="Tasks and Notifications"
-   [ngClass]="{ 'running': hasRunningTasks }"
-   (click)="togglePanel($event)">
-  <div class="notification-icon-wrapper">
-    <cd-icon type="notification"
-             *ngIf="!isMuted"
-             size="20">
-    </cd-icon>
-    <svg *ngIf="isMuted"
-         cdsIcon="notification--off"
-         size="20"
-         title="Notifications muted"></svg>
-    <span class="notification-count"
-          *ngIf="notificationCount > 0">
-      {{ notificationCount }}
-    </span>
-  </div>
-  <span class="d-md-none"
-        i18n>Tasks and Notifications</span>
-</a>
-<s-v><main></main></s-v>
-<cd-notification-panel *ngIf="isPanelOpen && useNewPanel"></cd-notification-panel>
-<cd-notifications-sidebar *ngIf="isPanelOpen && !useNewPanel"></cd-notifications-sidebar>
+@if(isMuted) {
+  <cd-icon type="notificationOff"
+          [size]="iconSize">
+</cd-icon>
+}
+@else if(!isMuted && hasRunningTasks) {
+  <cd-icon type="notificationNew"
+          [size]="iconSize">
+  </cd-icon>
+}
+@else {
+  <cd-icon type="notification"
+          [size]="iconSize">
+  </cd-icon>
+}
index 2ef1e08d03243c3a47e713196abfe544ad65b34d..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,55 +0,0 @@
-@use './src/styles/vendor/variables' as vv;
-@use '@carbon/styles/scss/spacing';
-@use '@carbon/styles/scss/theme' as *;
-@use '@carbon/styles/scss/type';
-
-.running i {
-  color: vv.$primary;
-}
-
-.running:hover i {
-  color: vv.$white;
-}
-
-a {
-  .dot {
-    background-color: vv.$primary-500;
-    border: 2px solid vv.$secondary;
-    border-radius: 50%;
-    height: 11px;
-    position: absolute;
-    right: 17px;
-    top: 10px;
-    width: 10px;
-  }
-
-  &:hover .dot {
-    background-color: vv.$white;
-    border-color: vv.$primary-500;
-  }
-}
-
-.notification-icon-wrapper {
-  position: relative;
-  display: inline-flex;
-  padding: spacing.$spacing-04;
-  cursor: pointer;
-  border-radius: spacing.$spacing-01;
-  transition: background-color 0.2s ease;
-}
-
-.notification-count {
-  position: absolute;
-  top: spacing.$spacing-02;
-  right: spacing.$spacing-02;
-  min-width: spacing.$spacing-04;
-  height: spacing.$spacing-04;
-  padding: 0 spacing.$spacing-01;
-  border-radius: spacing.$spacing-02;
-  background-color: $support-error;
-  color: $text-on-color;
-  font-size: spacing.$spacing-04;
-  line-height: spacing.$spacing-04;
-  text-align: center;
-  font-weight: 500;
-}
index bbeff3ed75497013d8581e0b32b4f2fbbe90f22c..ff0a276959d3dc3fe6cc933f30b85048e43b52a4 100644 (file)
@@ -1,8 +1,8 @@
-import { Component, OnDestroy, OnInit } from '@angular/core';
+import { Component, Input, OnDestroy, OnInit } from '@angular/core';
 
 import { Subscription } from 'rxjs';
 
-import { Icons } from '~/app/shared/enum/icons.enum';
+import { ICON_TYPE, IconSize } from '~/app/shared/enum/icons.enum';
 import { CdNotification } from '~/app/shared/models/cd-notification';
 import { NotificationService } from '~/app/shared/services/notification.service';
 import { SummaryService } from '~/app/shared/services/summary.service';
@@ -14,11 +14,11 @@ import { SummaryService } from '~/app/shared/services/summary.service';
   standalone: false
 })
 export class NotificationsComponent implements OnInit, OnDestroy {
-  icons = Icons;
+  @Input() isPanelOpen: boolean = false;
+  icons = ICON_TYPE;
+  iconSize = IconSize.size20;
   hasRunningTasks = false;
   hasNotifications = false;
-  isPanelOpen = false;
-  useNewPanel = true;
   notificationCount = 0;
   isMuted = false;
   private subs = new Subscription();
@@ -42,12 +42,6 @@ export class NotificationsComponent implements OnInit, OnDestroy {
       })
     );
 
-    this.subs.add(
-      this.notificationService.panelState$.subscribe((state) => {
-        this.isPanelOpen = state.isOpen;
-        this.useNewPanel = state.useNewPanel;
-      })
-    );
     this.subs.add(
       this.notificationService.muteState$.subscribe((isMuted) => {
         this.isMuted = isMuted;
@@ -55,12 +49,6 @@ export class NotificationsComponent implements OnInit, OnDestroy {
     );
   }
 
-  togglePanel(event: Event) {
-    event.preventDefault();
-    event.stopPropagation();
-    this.notificationService.toggleSidebar(!this.isPanelOpen, this.useNewPanel);
-  }
-
   ngOnDestroy(): void {
     this.subs.unsubscribe();
   }
index 2024593ec224214048a56f65a063324c892e0b5d..7f88eb3dd0b204596095e5a65bda62b2fe2e23b6 100644 (file)
@@ -42,3 +42,7 @@ Using `color` in css and seyting svg will fill="currentColor does not work.
 .deploy-icon {
   fill: theme.$layer-selected-disabled !important;
 }
+
+.notificationNew-icon circle {
+  fill: theme.$support-error !important;
+}
index 5266aeae32330de6ed62db9ba781decff8c9c26e..5af1ff726544850b155a0231ff5a2d380f7cc9f7 100644 (file)
@@ -1,11 +1,12 @@
-import { Component, Input, OnInit } from '@angular/core';
+import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core';
 import { ICON_TYPE, Icons, IconSize } from '../../enum/icons.enum';
 
 @Component({
   selector: 'cd-icon',
   templateUrl: './icon.component.html',
   styleUrl: './icon.component.scss',
-  standalone: false
+  standalone: false,
+  encapsulation: ViewEncapsulation.None
 })
 export class IconComponent implements OnInit {
   @Input() type!: keyof typeof ICON_TYPE;
index 5f45acf054e62af07a5f7635f5624ebe90e45df1..27b1f333754b5eb4c463eafc7485d3ceade2ef53 100644 (file)
@@ -102,7 +102,9 @@ export enum Icons {
   spin = 'fa fa-spin', //  To get any icon to rotate
   inverse = 'fa fa-inverse', // To get an alternative icon color
   notification = 'notification',
-  error = 'error--filled'
+  error = 'error--filled',
+  notificationOff = 'notification--off',
+  notificationNew = 'notification--new'
 }
 
 export enum IconSize {
@@ -121,6 +123,8 @@ export const ICON_TYPE = {
   error: 'error--filled',
   infoCircle: 'info-circle',
   notification: 'notification',
+  notificationOff: 'notification--off',
+  notificationNew: 'notification--new',
   success: 'success',
   warning: 'warning'
 } as const;