Commit 0827e401 authored by Lukas Mauß's avatar Lukas Mauß Committed by Klaus-Dieter Quibeldey-Cirkel

Resolve "Do not show the registration form, but let the session creator continue as a guest."

parent d26f8375
......@@ -7,7 +7,6 @@ import { LanguageService } from '../../../services/util/language.service';
import { AuthenticationService } from '../../../services/http/authentication.service';
import { User } from '../../../models/user';
import { UserRole } from '../../../models/user-roles.enum';
import { LoginComponent } from '../../shared/login/login.component';
@Component({
selector: 'app-new-landing',
......@@ -33,18 +32,9 @@ export class NewLandingComponent implements OnInit {
createSession() {
if (!this.user) {
this.openLoginDialog();
return;
} else if (this.user.role === 0) {
if (this.user.isGuest) {
this.authenticationService.logout();
this.authenticationService.guestLogin(1).subscribe(login => {
this.openCreateRoomDialog();
});
} else {
this.authenticationService.logout();
this.openLoginDialog();
}
this.authenticationService.guestLogin(UserRole.CREATOR).subscribe( () => {
this.openCreateRoomDialog();
});
} else {
this.openCreateRoomDialog();
}
......@@ -56,20 +46,6 @@ export class NewLandingComponent implements OnInit {
});
}
openLoginDialog(): void {
const dialogRef = this.dialog.open(LoginComponent, {
width: '350px'
});
dialogRef.componentInstance.role = UserRole.CREATOR;
dialogRef.componentInstance.isStandard = false;
dialogRef.afterClosed()
.subscribe(result => {
if (this.user) {
this.openCreateRoomDialog();
}
});
}
cookiesDisabled(): boolean {
return localStorage.getItem('cookieAccepted') === 'false';
}
......
<div fxLayout="column" fxLayoutAlign="space-around">
<button id="focus_button_guest" (click)="guestLogin()" class="guest" mat-flat-button type="button" aria-labelledby="guest-login-description"
matTooltip="{{'login.guest-login-tooltip' | translate}}">
{{ 'login.guest-login' | translate }}
</button>
</div>
<mat-divider></mat-divider>
<form
fxLayout="column"
fxLayoutGap="10px"
......@@ -32,6 +25,10 @@
<button id="focus_button_user" class="login" mat-flat-button type="submit" aria-labelledby="login-description">
{{ 'login.login' | translate }}
</button>
<button id="focus_button_guest" (click)="guestLogin()" class="guest" mat-flat-button type="button" aria-labelledby="guest-login-description"
matTooltip="{{'login.guest-login-tooltip' | translate}}">
{{ 'login.guest-login' | translate }}
</button>
<div class="forgot-password">
<a
href=""
......
......@@ -10,7 +10,7 @@
.guest {
background-color: var(--primary);
color: var(--on-primary);
margin: 10px 0 20px 0!important;
margin-bottom: 10px;
}
.login {
......
Markdown is supported
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