Compare commits

..

No commits in common. "v1.52.2" and "v1.52.1" have entirely different histories.

3 changed files with 27 additions and 33 deletions

View file

@ -77,7 +77,6 @@ jobs:
validate-docker-frontend:
runs-on: ubuntu-latest
name: Docker frontend validation
needs: changed_files
if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
container:
image: catthehacker/ubuntu:act-latest
@ -94,7 +93,6 @@ jobs:
validate-docker-backend:
runs-on: ubuntu-latest
name: Docker backend validation
needs: changed_files
if: ${{ needs.changed_files.outputs.backend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
container:
image: catthehacker/ubuntu:act-latest

View file

@ -2,11 +2,9 @@
<div class="modal-card max-w-md w-full">
<h2 class="modal-heading text-center">Anmelden</h2>
@if (errorMessage()) {
<div class="bg-accent-red text-white p-4 rounded mb-4">
{{ errorMessage() }}
</div>
}
<div *ngIf="errorMessage" class="bg-accent-red text-white p-4 rounded mb-4">
{{ errorMessage }}
</div>
<form [formGroup]="loginForm" (ngSubmit)="onSubmit()" class="space-y-4">
<div>
@ -21,13 +19,14 @@
placeholder="Gib deinen Benutzernamen oder E-Mail ein"
/>
@if (form['usernameOrEmail'].touched && form['usernameOrEmail'].errors) {
<div class="text-accent-red mt-1 text-sm">
@if (form['usernameOrEmail'].errors['required']) {
<span>Benutzername oder E-Mail ist erforderlich</span>
}
</div>
}
<div
*ngIf="form['usernameOrEmail'].touched && form['usernameOrEmail'].errors"
class="text-accent-red mt-1 text-sm"
>
<span *ngIf="form['usernameOrEmail'].errors?.['required']">
Benutzername oder E-Mail ist erforderlich
</span>
</div>
</div>
<div>
@ -42,22 +41,21 @@
placeholder="Gib dein Passwort ein"
/>
@if (form['password'].touched && form['password'].errors) {
<div class="text-accent-red mt-1 text-sm">
@if (form['password'].errors['required']) {
<span>Passwort ist erforderlich</span>
}
</div>
}
<div
*ngIf="form['password'].touched && form['password'].errors"
class="text-accent-red mt-1 text-sm"
>
<span *ngIf="form['password'].errors?.['required']">Passwort ist erforderlich</span>
</div>
</div>
<div class="pt-2">
<button
type="submit"
[disabled]="loginForm.invalid || isLoading()"
[disabled]="loginForm.invalid || isLoading"
class="button-primary w-full py-2.5 rounded"
>
{{ isLoading() ? 'Anmeldung läuft...' : 'Anmelden' }}
{{ isLoading ? 'Anmeldung läuft...' : 'Anmelden' }}
</button>
</div>
</form>

View file

@ -1,8 +1,8 @@
import { Component, signal } from '@angular/core';
import { Component } from '@angular/core';
import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
import { Router, RouterLink } from '@angular/router';
import { LoginRequest } from '../../../model/auth/LoginRequest';
import { AuthService } from '@service/auth.service';
import { AuthService } from '../../../service/auth.service';
import { CommonModule } from '@angular/common';
@Component({
@ -13,8 +13,8 @@ import { CommonModule } from '@angular/common';
})
export class LoginComponent {
loginForm: FormGroup;
errorMessage = signal('');
isLoading = signal(false);
errorMessage = '';
isLoading = false;
constructor(
private fb: FormBuilder,
@ -36,8 +36,8 @@ export class LoginComponent {
return;
}
this.isLoading.set(true);
this.errorMessage.set('');
this.isLoading = true;
this.errorMessage = '';
const loginRequest: LoginRequest = {
usernameOrEmail: this.form['usernameOrEmail'].value,
@ -49,10 +49,8 @@ export class LoginComponent {
this.router.navigate(['/home']);
},
error: (err) => {
this.isLoading.set(false);
this.errorMessage.set(
err.error?.message || 'Failed to login. Please check your credentials.'
);
this.isLoading = false;
this.errorMessage = err.error?.message || 'Failed to login. Please check your credentials.';
},
});
}