Compare commits

...
This repository has been archived on 2025-04-26. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.

10 commits

Author SHA1 Message Date
84b855b8aa Merge pull request 'employee-detail-english' (#83) from employee-detail-english into main
All checks were successful
Playwright Tests / test (push) Successful in 2m32s
Reviewed-on: #83
Reviewed-by: Jan Gleytenhoover <jan@kjan.email>
2025-01-22 14:15:50 +00:00
1e42614b22 Merge pull request 'refactor: remove required validator from newSkill field' (#84) from fix/fix-save-not-working into main
All checks were successful
Playwright Tests / test (push) Successful in 2m25s
Reviewed-on: #84
2025-01-22 11:36:25 +00:00
2582c5b568
refactor(mitarbeiter-form): remove console log statements
All checks were successful
Playwright Tests / test (pull_request) Successful in 2m20s
2025-01-22 12:35:10 +01:00
f51619e172
refactor: remove required validator from newSkill field
All checks were successful
Playwright Tests / test (pull_request) Successful in 2m12s
2025-01-22 12:31:09 +01:00
6efe952831 Merge pull request 'Fix selecting nothing' (#81) from fix/fix-selecting-nothing-as-skill into main
All checks were successful
Playwright Tests / test (push) Successful in 1m55s
Reviewed-on: #81
2025-01-22 11:17:44 +00:00
2e9b48be7c fix(qualifikation-form): prevent adding invalid employee ID
All checks were successful
Playwright Tests / test (pull_request) Successful in 2m7s
2025-01-22 11:14:55 +00:00
60c5d41161 fix(mitarbeiter-form): prevent adding skill with invalid id 2025-01-22 11:14:55 +00:00
951ab76128 Changed employee detail page to english
All checks were successful
Playwright Tests / test (pull_request) Successful in 2m40s
2025-01-22 12:10:40 +01:00
f941fff8d6 Changed employee detail page to english 2025-01-22 12:09:58 +01:00
e5b2d7789f Merge pull request 'Employee Details page' (#80) from employees-detailseite into main
All checks were successful
Playwright Tests / test (push) Successful in 2m24s
Reviewed-on: #80
2025-01-22 11:04:44 +00:00
3 changed files with 14 additions and 8 deletions

View file

@ -1,16 +1,16 @@
<div class="container"> <div class="container">
<div class="d-flex flex-col" style="height: 100%;"> <div class="d-flex flex-col" style="height: 100%;">
<div class="p-3" style="width: 100%;"> <div class="p-3" style="width: 100%;">
<button class="btn btn-primary" (click)="goToEmployeePage()">Zurück</button> <button class="btn btn-primary" (click)="goToEmployeePage()">Back</button>
<div class="row align-items-start pt-3"> <div class="row align-items-start pt-3">
<div class="col"> <div class="col">
<h1>{{ employee.firstName }} {{ employee.lastName }} </h1> <h1>{{ employee.firstName }} {{ employee.lastName }} </h1>
<p><strong>Straße: </strong>{{ employee.street }}</p> <p><strong>Street: </strong>{{ employee.street }}</p>
<p><strong>Postleitzahl: </strong>{{ employee.postcode }}</p> <p><strong>Postal Code: </strong>{{ employee.postcode }}</p>
<p><strong>Stadt: </strong>{{ employee.city }}</p> <p><strong>City: </strong>{{ employee.city }}</p>
<p><strong>Telefonnummer: </strong>{{ employee.phone }}s</p> <p><strong>Phone number: </strong>{{ employee.phone }}s</p>
<button class="btn btn-danger" (click)="deleteEmployee(currentId)">Löschen</button> <button class="btn btn-danger" (click)="deleteEmployee(currentId)">Delete</button>
<button class="ms-3 btn btn-primary" (click)="editEmployee(currentId)">Bearbeiten</button> <button class="ms-3 btn btn-primary" (click)="editEmployee(currentId)">Edit</button>
</div> </div>
<div class="col"> <div class="col">

View file

@ -38,7 +38,7 @@ export class MitarbeiterFormComponent {
postcode: new FormControl(this.mitarbeiter.postcode, [Validators.required, Validators.minLength(5), Validators.maxLength(5)]), postcode: new FormControl(this.mitarbeiter.postcode, [Validators.required, Validators.minLength(5), Validators.maxLength(5)]),
city: new FormControl(this.mitarbeiter.city, Validators.required), city: new FormControl(this.mitarbeiter.city, Validators.required),
phone: new FormControl(this.mitarbeiter.phone, [Validators.required, Validators.pattern('^[- +()0-9]+$')]), phone: new FormControl(this.mitarbeiter.phone, [Validators.required, Validators.pattern('^[- +()0-9]+$')]),
newSkill: new FormControl(null, Validators.required) // Added newSkill: new FormControl(null)
}); });
} }
@ -82,6 +82,9 @@ export class MitarbeiterFormComponent {
addSkill() { addSkill() {
const id = Number(this.mitarbeiterForm.get("newSkill")?.value); const id = Number(this.mitarbeiterForm.get("newSkill")?.value);
if (!id) {
return;
}
this.allSkills.subscribe(skills => { this.allSkills.subscribe(skills => {
const newSkill = skills.filter(skill => skill.id == id)[0]; const newSkill = skills.filter(skill => skill.id == id)[0];
this.mitarbeiter.skillSet?.push(newSkill); this.mitarbeiter.skillSet?.push(newSkill);

View file

@ -55,6 +55,9 @@ export class QualifikationFormComponent {
addEmployee() { addEmployee() {
const employeeId = Number(this.skillForm.get("newEmployee")?.value); const employeeId = Number(this.skillForm.get("newEmployee")?.value);
if (!employeeId) {
return;
}
const employee = this.addableEmployees.find(emp => emp.id === employeeId); const employee = this.addableEmployees.find(emp => emp.id === employeeId);
if (employee) { if (employee) {