Skip to content
Snippets Groups Projects
Commit 52545eb8 authored by Lukas Mauß's avatar Lukas Mauß
Browse files

Add loading spinner

Add errorpage for not existing room-links
parent 0f879a39
1 merge request!64Resolve "participant home screen - room logic"
<div fxLayout="column" fxLayoutAlign="start" fxLayoutGap="20px" fxFill> <div fxLayout="column" fxLayoutAlign="start" fxLayoutGap="20px" fxFill>
<div fxLayout="row" fxLayoutAlign="center"> <div fxLayout="row" fxLayoutAlign="center">
<mat-card> <mat-progress-spinner *ngIf="isLoading" mode="indeterminate"></mat-progress-spinner>
<mat-card *ngIf="room">
<mat-card-header> <mat-card-header>
<mat-card-title><h3 class="subheading-2">{{ room.name }}</h3></mat-card-title> <mat-card-title><h3 class="subheading-2">{{ room.name }}</h3></mat-card-title>
<mat-card-subtitle>{{ room.shortId }}</mat-card-subtitle> <mat-card-subtitle>{{ room.shortId }}</mat-card-subtitle>
...@@ -13,7 +14,7 @@ ...@@ -13,7 +14,7 @@
</mat-card-content> </mat-card-content>
<mat-divider></mat-divider> <mat-divider></mat-divider>
<mat-card-actions> <mat-card-actions>
<button mat-icon-button color="primary" matTooltip="Ask something" routerLink="/room/{{roomId}}/create-comment"> <button mat-icon-button color="primary" matTooltip="Ask something" routerLink="room/{{room.id}}/create-comment">
<mat-icon>question_answer</mat-icon> <mat-icon>question_answer</mat-icon>
</button> </button>
<button mat-icon-button color="primary" matTooltip="Give feedback"> <button mat-icon-button color="primary" matTooltip="Give feedback">
...@@ -30,6 +31,9 @@ ...@@ -30,6 +31,9 @@
</button> </button>
</mat-card-actions> </mat-card-actions>
</mat-card> </mat-card>
<div *ngIf="!isLoading && !room">
Error: room could not be found!
</div>
</div> </div>
<button mat-button color="primary" (click)="goBack()">Back</button> <button mat-button color="primary" (click)="goBack()">Back</button>
</div> </div>
...@@ -12,6 +12,7 @@ import { ActivatedRoute } from '@angular/router'; ...@@ -12,6 +12,7 @@ import { ActivatedRoute } from '@angular/router';
export class ParticipantRoomComponent implements OnInit { export class ParticipantRoomComponent implements OnInit {
room: Room; room: Room;
isLoading = true;
constructor(private location: Location, constructor(private location: Location,
private roomService: RoomService, private roomService: RoomService,
...@@ -26,7 +27,10 @@ export class ParticipantRoomComponent implements OnInit { ...@@ -26,7 +27,10 @@ export class ParticipantRoomComponent implements OnInit {
getRoom(id: string): void { getRoom(id: string): void {
this.roomService.getRoom(id) this.roomService.getRoom(id)
.subscribe(room => this.room = room); .subscribe(room => {
this.room = room;
this.isLoading = false;
});
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment