From: Afreen Misbah Date: Thu, 9 Oct 2025 11:37:47 +0000 (+0530) Subject: mgr/dashboard: Fix color issue of notification panel X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=831cfdcd8fd0c30991f810035bf5d590c30c570e;p=ceph-ci.git mgr/dashboard: Fix color issue of notification panel The global header css of navigation panel was overriding the color of notifications. Signed-off-by: Afreen Misbah --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notification-panel/notification-area/notification-area.component.html b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notification-panel/notification-area/notification-area.component.html index 03135a10b5e..8dd5a48e7d7 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notification-panel/notification-area/notification-area.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notification-panel/notification-area/notification-area.component.html @@ -1,11 +1,10 @@ -
- +
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notification-panel/notification-area/notification-area.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notification-panel/notification-area/notification-area.component.ts index 8bba8a443df..4330990616d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notification-panel/notification-area/notification-area.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notification-panel/notification-area/notification-area.component.ts @@ -16,9 +16,10 @@ export class NotificationAreaComponent implements OnInit, OnDestroy { readonly notificationIconMap = { [NotificationType.success]: 'success', - [NotificationType.error]: 'danger', - [NotificationType.info]: 'info', - [NotificationType.warning]: 'warning' + [NotificationType.error]: 'error', + [NotificationType.info]: 'infoCircle', + [NotificationType.warning]: 'warning', + default: 'infoCircle' } as const; constructor(private notificationService: NotificationService) {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notifications/notifications.component.html b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notifications/notifications.component.html index ed6aecdcec0..8daf9176b30 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notifications/notifications.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notifications/notifications.component.html @@ -3,9 +3,9 @@ [ngClass]="{ 'running': hasRunningTasks }" (click)="togglePanel($event)">
- + + {{ notificationCount }} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/icon/icon.component.scss b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/icon/icon.component.scss index a10d058b8a7..544c16f6a24 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/icon/icon.component.scss +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/icon/icon.component.scss @@ -1,27 +1,40 @@ @use '@carbon/styles/scss/theme'; +/* +!important required to override the parent component's carbon css. + +e.g. carbon header adds following which changes colors of notification panel icons: + +.cds--btn.cds--btn--icon-only.cds--header__action svg { + fill: var(--cds-icon-secondary, #c6c6c6); + } + +Also using 'fill' as that is coming from carbon (see above example). +Using `color` in css and seyting svg will fill="currentColor does not work. +*/ + .success-icon { - color: theme.$support-success; + fill: theme.$support-success !important; } .danger-icon { - color: theme.$support-error; + fill: theme.$support-error !important; } //@TODO: this naming needs to be changed // Do this after converting Icons enum to const .infoCircle-icon { - color: theme.$support-info; + fill: theme.$support-info !important; } .warning-icon { - color: theme.$support-caution-major; + fill: theme.$support-caution-major !important; } .error-icon { - color: theme.$support-error; + fill: theme.$support-error !important; } .info-icon { - color: theme.$support-info; + fill: theme.$support-info !important; } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/icons.enum.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/icons.enum.ts index 197e1ab2396..697fc17d101 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/icons.enum.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/icons.enum.ts @@ -99,7 +99,9 @@ export enum Icons { stack2x = 'fa fa-stack-2x', // To stack regularly sized icon pulse = 'fa fa-pulse', // To have spinner rotate with 8 steps spin = 'fa fa-spin', // To get any icon to rotate - inverse = 'fa fa-inverse' // To get an alternative icon color + inverse = 'fa fa-inverse', // To get an alternative icon color + notification = 'notification', + error = 'error--filled' } export enum IconSize { @@ -110,11 +112,13 @@ export enum IconSize { } export const ICON_TYPE = { + check: 'check', copy: 'copy', danger: 'danger', + edit: 'edit', + error: 'error--filled', infoCircle: 'info-circle', + notification: 'notification', success: 'success', - warning: 'warning', - edit: 'edit', - check: 'check' + warning: 'warning' } as const;