From 7c37d8a06be60b66b030b7ab616ca075269ab70e Mon Sep 17 00:00:00 2001 From: Tiago Melo Date: Tue, 27 Mar 2018 21:25:15 +0100 Subject: [PATCH] mgr/dashboard: Add notification component This component is used on the navigation bar and will show the user the 10 most recent notifications. Signed-off-by: Tiago Melo --- .../app/core/navigation/navigation.module.ts | 5 +- .../navigation/navigation.component.html | 4 ++ .../navigation/navigation.component.spec.ts | 32 ++++++----- .../notifications.component.html | 53 +++++++++++++++++++ .../notifications.component.scss | 5 ++ .../notifications.component.spec.ts | 33 ++++++++++++ .../notifications/notifications.component.ts | 29 ++++++++++ .../frontend/src/styles/popover.scss | 44 +++++++++++++++ 8 files changed, 191 insertions(+), 14 deletions(-) create mode 100644 src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notifications/notifications.component.html create mode 100644 src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notifications/notifications.component.scss create mode 100644 src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notifications/notifications.component.spec.ts create mode 100644 src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notifications/notifications.component.ts create mode 100644 src/pybind/mgr/dashboard/frontend/src/styles/popover.scss diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation.module.ts index 823d4feea18..6c11b05fd07 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation.module.ts @@ -3,22 +3,25 @@ import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; +import { PopoverModule } from 'ngx-bootstrap/popover'; import { AppRoutingModule } from '../../app-routing.module'; import { SharedModule } from '../../shared/shared.module'; import { AuthModule } from '../auth/auth.module'; import { NavigationComponent } from './navigation/navigation.component'; +import { NotificationsComponent } from './notifications/notifications.component'; @NgModule({ imports: [ CommonModule, AuthModule, BsDropdownModule.forRoot(), + PopoverModule.forRoot(), AppRoutingModule, SharedModule, RouterModule ], - declarations: [NavigationComponent], + declarations: [NavigationComponent, NotificationsComponent], exports: [NavigationComponent] }) export class NavigationModule {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html index cd7e8040c81..a00e7cef6fe 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html @@ -218,6 +218,10 @@