activated typescript strict mode
This commit is contained in:
@@ -11,7 +11,7 @@ import {faSignOutAlt} from '@fortawesome/free-solid-svg-icons/faSignOutAlt';
|
||||
styleUrls: ['./info.component.less'],
|
||||
})
|
||||
export class InfoComponent implements OnInit {
|
||||
public user$: Observable<User>;
|
||||
public user$: Observable<User | null> | null = null;
|
||||
public faSignOut = faSignOutAlt;
|
||||
|
||||
public constructor(private userService: UserService) {}
|
||||
|
||||
@@ -19,5 +19,7 @@ export class RolePipe implements PipeTransform {
|
||||
case 'presenter':
|
||||
return 'Präsentator';
|
||||
}
|
||||
|
||||
return 'keine Rolle';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ import {faTimes} from '@fortawesome/free-solid-svg-icons/faTimes';
|
||||
styleUrls: ['./user.component.less'],
|
||||
})
|
||||
export class UserComponent {
|
||||
public id: string;
|
||||
public name: string;
|
||||
public roles: string[];
|
||||
public id = '';
|
||||
public name = '';
|
||||
public roles: string[] = [];
|
||||
public ROLE_TYPES = ROLE_TYPES;
|
||||
public edit = false;
|
||||
public faClose = faTimes;
|
||||
|
||||
@@ -11,18 +11,18 @@ import {faUserPlus} from '@fortawesome/free-solid-svg-icons/faUserPlus';
|
||||
styleUrls: ['./login.component.less'],
|
||||
})
|
||||
export class LoginComponent implements OnInit {
|
||||
public form: FormGroup;
|
||||
public errorMessage: string;
|
||||
public form: FormGroup = new FormGroup({
|
||||
user: new FormControl(null, [Validators.required, Validators.email]),
|
||||
pass: new FormControl(null, [Validators.required]),
|
||||
});
|
||||
public errorMessage = '';
|
||||
public faSignIn = faSignInAlt;
|
||||
public faNewUser = faUserPlus;
|
||||
|
||||
public constructor(private userService: UserService, private router: Router) {}
|
||||
|
||||
public ngOnInit(): void {
|
||||
this.form = new FormGroup({
|
||||
user: new FormControl(null, [Validators.required, Validators.email]),
|
||||
pass: new FormControl(null, [Validators.required]),
|
||||
});
|
||||
this.form.reset;
|
||||
}
|
||||
|
||||
public async onLogin(): Promise<void> {
|
||||
|
||||
@@ -9,17 +9,17 @@ import {faUserPlus} from '@fortawesome/free-solid-svg-icons/faUserPlus';
|
||||
styleUrls: ['./new.component.less'],
|
||||
})
|
||||
export class NewComponent implements OnInit {
|
||||
public form: FormGroup;
|
||||
public form: FormGroup = this.fb.group({
|
||||
email: new FormControl(null, [Validators.required, Validators.email]),
|
||||
name: new FormControl(null, [Validators.required]),
|
||||
password: new FormControl(null, [Validators.required, Validators.minLength(6)]),
|
||||
});
|
||||
public faNewUser = faUserPlus;
|
||||
|
||||
public constructor(private fb: FormBuilder, private userService: UserService) {}
|
||||
|
||||
public ngOnInit(): void {
|
||||
this.form = this.fb.group({
|
||||
email: new FormControl(null, [Validators.required, Validators.email]),
|
||||
name: new FormControl(null, [Validators.required]),
|
||||
password: new FormControl(null, [Validators.required, Validators.minLength(6)]),
|
||||
});
|
||||
this.form.reset();
|
||||
}
|
||||
|
||||
public async onCreate(): Promise<void> {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {AbstractControl, FormControl, FormGroup, Validators} from '@angular/forms';
|
||||
import {FormControl, FormGroup, Validators} from '@angular/forms';
|
||||
import {Router} from '@angular/router';
|
||||
import {UserService} from '../../../services/user/user.service';
|
||||
import {faWindowRestore} from '@fortawesome/free-solid-svg-icons/faWindowRestore';
|
||||
@@ -10,18 +10,17 @@ import {faWindowRestore} from '@fortawesome/free-solid-svg-icons/faWindowRestore
|
||||
styleUrls: ['./password.component.less'],
|
||||
})
|
||||
export class PasswordComponent implements OnInit {
|
||||
public form: FormGroup;
|
||||
public errorMessage: string;
|
||||
public form: FormGroup = new FormGroup({
|
||||
user: new FormControl(null, [Validators.required, Validators.email]),
|
||||
});
|
||||
|
||||
public errorMessage = '';
|
||||
public faNewPassword = faWindowRestore;
|
||||
|
||||
public constructor(public userService: UserService, private router: Router) {}
|
||||
|
||||
public ngOnInit(): void {
|
||||
const required = (c: AbstractControl) => Validators.required(c);
|
||||
const email = Validators.email;
|
||||
this.form = new FormGroup({
|
||||
user: new FormControl(null, [required, email]),
|
||||
});
|
||||
this.form.reset();
|
||||
}
|
||||
|
||||
public async onResetPassword(): Promise<void> {
|
||||
|
||||
@@ -24,7 +24,18 @@ import {LogoModule} from '../../widget-modules/components/logo/logo.module';
|
||||
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
|
||||
|
||||
@NgModule({
|
||||
declarations: [LoginComponent, AuthMessagePipe, InfoComponent, LogoutComponent, RolePipe, PasswordComponent, PasswordSendComponent, UsersComponent, UserComponent, NewComponent],
|
||||
declarations: [
|
||||
LoginComponent,
|
||||
AuthMessagePipe,
|
||||
InfoComponent,
|
||||
LogoutComponent,
|
||||
RolePipe,
|
||||
PasswordComponent,
|
||||
PasswordSendComponent,
|
||||
UsersComponent,
|
||||
UserComponent,
|
||||
NewComponent,
|
||||
],
|
||||
imports: [
|
||||
CommonModule,
|
||||
UserRoutingModule,
|
||||
|
||||
Reference in New Issue
Block a user