diff --git a/Kaizen/ClientApp/src/app/core/material.module.ts b/Kaizen/ClientApp/src/app/core/material.module.ts index 7af957f2..dba5ddd4 100644 --- a/Kaizen/ClientApp/src/app/core/material.module.ts +++ b/Kaizen/ClientApp/src/app/core/material.module.ts @@ -1,5 +1,6 @@ import { NgModule } from '@angular/core'; import { MatAutocompleteModule } from '@angular/material/autocomplete'; +import { MatBadgeModule } from '@angular/material/badge'; import { MatButtonModule } from '@angular/material/button'; import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; @@ -32,6 +33,7 @@ import { MatTreeModule } from '@angular/material/tree'; const MaterialModules = [ MatAutocompleteModule, + MatBadgeModule, MatButtonModule, MatCardModule, MatCheckboxModule, diff --git a/Kaizen/ClientApp/src/app/shared/components/notifications/notifications.component.html b/Kaizen/ClientApp/src/app/shared/components/notifications/notifications.component.html new file mode 100644 index 00000000..0936a64a --- /dev/null +++ b/Kaizen/ClientApp/src/app/shared/components/notifications/notifications.component.html @@ -0,0 +1,21 @@ + + +
+
+ {{ notification.icon }} + + {{ notification.title }} + + {{ notification.message }} + + +
+
+ visibility + + delete + +
+
diff --git a/Kaizen/ClientApp/src/app/shared/components/notifications/notifications.component.scss b/Kaizen/ClientApp/src/app/shared/components/notifications/notifications.component.scss new file mode 100644 index 00000000..ccdf3a23 --- /dev/null +++ b/Kaizen/ClientApp/src/app/shared/components/notifications/notifications.component.scss @@ -0,0 +1,34 @@ +.notification-button { + max-width: 600px; + max-height: 300px; + min-height: 70px; + height: auto; + align-content: center !important; + align-items: center !important; + display: flex !important; + line-height: 30px !important; + white-space: normal; + + span { + display: block; + } + small { + display: block; + color: rgba(0, 0, 0, 0.5); + line-height: 20px; + } +} + +.mat-menu-panel { + max-width: fit-content !important; + max-height: 300px; +} + +::ng-deep.notification-menu { + width: fit-content; +} + +::ng-deep.mat-menu-panel { + max-width: none !important; + max-height: 300px !important; +} diff --git a/Kaizen/ClientApp/src/app/shared/components/notifications/notifications.component.spec.ts b/Kaizen/ClientApp/src/app/shared/components/notifications/notifications.component.spec.ts new file mode 100644 index 00000000..90c67e28 --- /dev/null +++ b/Kaizen/ClientApp/src/app/shared/components/notifications/notifications.component.spec.ts @@ -0,0 +1,28 @@ +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; +import { AppModule } from '@app/app.module'; +import { SharedModule } from '@shared/shared.module'; +import { NotificationsComponent } from './notifications.component'; + +describe('NotificationsComponent', () => { + let component: NotificationsComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ HttpClientTestingModule, RouterTestingModule, SharedModule, AppModule ], + declarations: [ NotificationsComponent ] + }).compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(NotificationsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Kaizen/ClientApp/src/app/shared/components/notifications/notifications.component.ts b/Kaizen/ClientApp/src/app/shared/components/notifications/notifications.component.ts new file mode 100644 index 00000000..f0cb29d0 --- /dev/null +++ b/Kaizen/ClientApp/src/app/shared/components/notifications/notifications.component.ts @@ -0,0 +1,18 @@ +import { Component, OnDestroy, OnInit } from '@angular/core'; +import { NewClientSignalrService } from '@modules/clients/services/new-client-signalr.service'; +import { NotificationItem } from '@shared/models/notification-item'; + +@Component({ + selector: 'app-notifications', + templateUrl: './notifications.component.html', + styleUrls: [ './notifications.component.scss' ] +}) +export class NotificationsComponent implements OnInit, OnDestroy { + notifications: NotificationItem[] = []; + + constructor(private clientSignalR: NewClientSignalrService) {} + + ngOnInit(): void {} + + ngOnDestroy(): void {} +} diff --git a/Kaizen/ClientApp/src/app/shared/layouts/dashboard-layout/dashboard-layout.component.html b/Kaizen/ClientApp/src/app/shared/layouts/dashboard-layout/dashboard-layout.component.html index a94d4cd2..5de9d99b 100644 --- a/Kaizen/ClientApp/src/app/shared/layouts/dashboard-layout/dashboard-layout.component.html +++ b/Kaizen/ClientApp/src/app/shared/layouts/dashboard-layout/dashboard-layout.component.html @@ -84,9 +84,7 @@ Ecolplag
- + diff --git a/Kaizen/ClientApp/src/app/shared/models/notification-item.ts b/Kaizen/ClientApp/src/app/shared/models/notification-item.ts new file mode 100644 index 00000000..9ad8077d --- /dev/null +++ b/Kaizen/ClientApp/src/app/shared/models/notification-item.ts @@ -0,0 +1,6 @@ +export interface NotificationItem { + icon: string; + title: string; + message: string; + url?: string; +} diff --git a/Kaizen/ClientApp/src/app/shared/shared.module.ts b/Kaizen/ClientApp/src/app/shared/shared.module.ts index 3e51c155..3e57b480 100644 --- a/Kaizen/ClientApp/src/app/shared/shared.module.ts +++ b/Kaizen/ClientApp/src/app/shared/shared.module.ts @@ -42,6 +42,7 @@ import { PaymentMethodPipe } from './pipes/payment-method.pipe'; import { PeriodicityPipe } from './pipes/periodicity.pipe'; import { ServiceRequestStatePipe } from './pipes/service-request-state.pipe'; import { WorkOrderStatePipe } from './pipes/work-order-state.pipe'; +import { NotificationsComponent } from './components/notifications/notifications.component'; @NgModule({ declarations: [ @@ -81,7 +82,8 @@ import { WorkOrderStatePipe } from './pipes/work-order-state.pipe'; PaymentMethodPipe, PeriodicityPipe, ServiceRequestStatePipe, - WorkOrderStatePipe + WorkOrderStatePipe, + NotificationsComponent ], imports: [ CommonModule, FlexLayoutModule, FormsModule, MaterialModule, ReactiveFormsModule, RouterModule ], exports: [