diff --git a/src/app/app.module.ts b/src/app/app.module.ts index fbcf98c9852d1481d1c2d6cd2bdf555fe8bf72a7..507e71248617ef61bbdfc9361df82b0bd3bbaab2 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -104,7 +104,8 @@ import { RoomDeletionComponent } from './room-deletion/room-deletion.component'; entryComponents: [ RegisterComponent, PasswordResetComponent, - RoomCreationComponent + RoomCreationComponent, + RoomDeletionComponent ], imports: [ AppRoutingModule, diff --git a/src/app/creator-room/creator-room.component.html b/src/app/creator-room/creator-room.component.html index 0cc2f6c50e540198f048ec96935cf7b3daab4ed6..45fba2492937d4cfb219c7f0b358573c2936b219 100644 --- a/src/app/creator-room/creator-room.component.html +++ b/src/app/creator-room/creator-room.component.html @@ -36,7 +36,7 @@ <button *ngIf="modify" (click)="updateRoom(roomName.valueOf(), roomShortID.valueOf(), roomDescription.valueOf())" mat-button color="primary" matTooltip="Update room's details"> Update room </button> - <button mat-button color="warn" (click)="showDeletionDialog()"> + <button mat-button color="warn" (click)="openDeletionRoomDialog()"> Delete room </button> <button mat-button color="primary" (click)="goBack()"> diff --git a/src/app/creator-room/creator-room.component.ts b/src/app/creator-room/creator-room.component.ts index f841923a4684504bb981bf4885100f2cf9d57ead..c8fa21df3009b4af5b3e03a5d23995b48489c99d 100644 --- a/src/app/creator-room/creator-room.component.ts +++ b/src/app/creator-room/creator-room.component.ts @@ -5,6 +5,8 @@ import { RoomComponent } from '../room/room.component'; import { Room } from '../room'; import { Location } from '@angular/common'; import { NotificationService } from '../notification.service'; +import { MatDialog } from '@angular/material'; +import { RoomDeletionComponent } from '../room-deletion/room-deletion.component'; @Component({ selector: 'app-creator-room', @@ -22,6 +24,7 @@ export class CreatorRoomComponent extends RoomComponent implements OnInit { constructor(protected roomService: RoomService, protected notification: NotificationService, protected route: ActivatedRoute, + public dialog: MatDialog, protected location: Location) { super(roomService, route, location); } @@ -60,6 +63,7 @@ export class CreatorRoomComponent extends RoomComponent implements OnInit { .subscribe(() => this.goBack()); } } + showDeletionDialog(): void { this.deleteDialog = true; } @@ -73,4 +77,10 @@ export class CreatorRoomComponent extends RoomComponent implements OnInit { this.notification.show(msg); this.delete(room); } + + openDeletionRoomDialog(): void { + this.dialog.open(RoomDeletionComponent, { + width: '350px' + }); + } } diff --git a/src/app/room-deletion/room-deletion.component.html b/src/app/room-deletion/room-deletion.component.html index de04499b0bc6e7a4a1853406b7b2df9b52ee9bcb..73ef4288a321f96d675dcb6fd2b715ab4f267fd0 100644 --- a/src/app/room-deletion/room-deletion.component.html +++ b/src/app/room-deletion/room-deletion.component.html @@ -1,3 +1,12 @@ -<p> - room-deletion works! -</p> +<mat-card> + <mat-card-header><h3>Do you really want to delete this room?<br>This action can not be undone.</h3> + </mat-card-header> + <mat-card-content> + <button mat-raised-button color="warn"> + Delete room + </button> + <button mat-raised-button color="primary"> + Leave + </button> + </mat-card-content> +</mat-card>