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

View file

@ -2,11 +2,9 @@
<div class="modal-card max-w-md w-full"> <div class="modal-card max-w-md w-full">
<h2 class="modal-heading text-center">Anmelden</h2> <h2 class="modal-heading text-center">Anmelden</h2>
@if (errorMessage()) { <div *ngIf="errorMessage" class="bg-accent-red text-white p-4 rounded mb-4">
<div class="bg-accent-red text-white p-4 rounded mb-4"> {{ errorMessage }}
{{ errorMessage() }}
</div> </div>
}
<form [formGroup]="loginForm" (ngSubmit)="onSubmit()" class="space-y-4"> <form [formGroup]="loginForm" (ngSubmit)="onSubmit()" class="space-y-4">
<div> <div>
@ -21,13 +19,14 @@
placeholder="Gib deinen Benutzernamen oder E-Mail ein" placeholder="Gib deinen Benutzernamen oder E-Mail ein"
/> />
@if (form['usernameOrEmail'].touched && form['usernameOrEmail'].errors) { <div
<div class="text-accent-red mt-1 text-sm"> *ngIf="form['usernameOrEmail'].touched && form['usernameOrEmail'].errors"
@if (form['usernameOrEmail'].errors['required']) { class="text-accent-red mt-1 text-sm"
<span>Benutzername oder E-Mail ist erforderlich</span> >
} <span *ngIf="form['usernameOrEmail'].errors?.['required']">
Benutzername oder E-Mail ist erforderlich
</span>
</div> </div>
}
</div> </div>
<div> <div>
@ -42,22 +41,21 @@
placeholder="Gib dein Passwort ein" placeholder="Gib dein Passwort ein"
/> />
@if (form['password'].touched && form['password'].errors) { <div
<div class="text-accent-red mt-1 text-sm"> *ngIf="form['password'].touched && form['password'].errors"
@if (form['password'].errors['required']) { class="text-accent-red mt-1 text-sm"
<span>Passwort ist erforderlich</span> >
} <span *ngIf="form['password'].errors?.['required']">Passwort ist erforderlich</span>
</div> </div>
}
</div> </div>
<div class="pt-2"> <div class="pt-2">
<button <button
type="submit" type="submit"
[disabled]="loginForm.invalid || isLoading()" [disabled]="loginForm.invalid || isLoading"
class="button-primary w-full py-2.5 rounded" class="button-primary w-full py-2.5 rounded"
> >
{{ isLoading() ? 'Anmeldung läuft...' : 'Anmelden' }} {{ isLoading ? 'Anmeldung läuft...' : 'Anmelden' }}
</button> </button>
</div> </div>
</form> </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 { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
import { Router, RouterLink } from '@angular/router'; import { Router, RouterLink } from '@angular/router';
import { LoginRequest } from '../../../model/auth/LoginRequest'; import { LoginRequest } from '../../../model/auth/LoginRequest';
import { AuthService } from '@service/auth.service'; import { AuthService } from '../../../service/auth.service';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
@Component({ @Component({
@ -13,8 +13,8 @@ import { CommonModule } from '@angular/common';
}) })
export class LoginComponent { export class LoginComponent {
loginForm: FormGroup; loginForm: FormGroup;
errorMessage = signal(''); errorMessage = '';
isLoading = signal(false); isLoading = false;
constructor( constructor(
private fb: FormBuilder, private fb: FormBuilder,
@ -36,8 +36,8 @@ export class LoginComponent {
return; return;
} }
this.isLoading.set(true); this.isLoading = true;
this.errorMessage.set(''); this.errorMessage = '';
const loginRequest: LoginRequest = { const loginRequest: LoginRequest = {
usernameOrEmail: this.form['usernameOrEmail'].value, usernameOrEmail: this.form['usernameOrEmail'].value,
@ -49,10 +49,8 @@ export class LoginComponent {
this.router.navigate(['/home']); this.router.navigate(['/home']);
}, },
error: (err) => { error: (err) => {
this.isLoading.set(false); this.isLoading = false;
this.errorMessage.set( this.errorMessage = err.error?.message || 'Failed to login. Please check your credentials.';
err.error?.message || 'Failed to login. Please check your credentials.'
);
}, },
}); });
} }