From 5beed95078c5eec21113c9b5fede1c167e653a5e Mon Sep 17 00:00:00 2001 From: Sonja Galovic Date: Mon, 4 Apr 2022 00:40:39 +0200 Subject: Odradjen prikaz svih obavestenja korisniku u okviru aplikacije. (umesto alerta ide mat-dialog) --- .../alert-dialog/alert-dialog.component.css | 0 .../alert-dialog/alert-dialog.component.html | 7 ++++++ .../alert-dialog/alert-dialog.component.spec.ts | 25 +++++++++++++++++++ .../_modals/alert-dialog/alert-dialog.component.ts | 28 ++++++++++++++++++++++ 4 files changed, 60 insertions(+) create mode 100644 frontend/src/app/_modals/alert-dialog/alert-dialog.component.css create mode 100644 frontend/src/app/_modals/alert-dialog/alert-dialog.component.html create mode 100644 frontend/src/app/_modals/alert-dialog/alert-dialog.component.spec.ts create mode 100644 frontend/src/app/_modals/alert-dialog/alert-dialog.component.ts (limited to 'frontend/src/app/_modals/alert-dialog') diff --git a/frontend/src/app/_modals/alert-dialog/alert-dialog.component.css b/frontend/src/app/_modals/alert-dialog/alert-dialog.component.css new file mode 100644 index 00000000..e69de29b diff --git a/frontend/src/app/_modals/alert-dialog/alert-dialog.component.html b/frontend/src/app/_modals/alert-dialog/alert-dialog.component.html new file mode 100644 index 00000000..82365193 --- /dev/null +++ b/frontend/src/app/_modals/alert-dialog/alert-dialog.component.html @@ -0,0 +1,7 @@ +

{{data.title}}

+
+ {{data.message}} +
+
+ +
\ No newline at end of file diff --git a/frontend/src/app/_modals/alert-dialog/alert-dialog.component.spec.ts b/frontend/src/app/_modals/alert-dialog/alert-dialog.component.spec.ts new file mode 100644 index 00000000..a93fc493 --- /dev/null +++ b/frontend/src/app/_modals/alert-dialog/alert-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AlertDialogComponent } from './alert-dialog.component'; + +describe('AlertDialogComponent', () => { + let component: AlertDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ AlertDialogComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(AlertDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/src/app/_modals/alert-dialog/alert-dialog.component.ts b/frontend/src/app/_modals/alert-dialog/alert-dialog.component.ts new file mode 100644 index 00000000..e15f3c6f --- /dev/null +++ b/frontend/src/app/_modals/alert-dialog/alert-dialog.component.ts @@ -0,0 +1,28 @@ +import { Component, OnInit } from '@angular/core'; +import { Inject} from '@angular/core'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; + +interface DialogData { + title: string; + message: string; +} + +@Component({ + selector: 'app-alert-dialog', + templateUrl: './alert-dialog.component.html', + styleUrls: ['./alert-dialog.component.css'] +}) +export class AlertDialogComponent { + + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: DialogData, + //public dialog: MatDialog + ) {} + + onOkClick(): void { + this.dialogRef.close(); + } + + +} -- cgit v1.2.3