Compare commits
10 commits
employees-
...
main
Author | SHA1 | Date | |
---|---|---|---|
84b855b8aa | |||
1e42614b22 | |||
2582c5b568 | |||
f51619e172 | |||
6efe952831 | |||
2e9b48be7c | |||
60c5d41161 | |||
951ab76128 | |||
f941fff8d6 | |||
e5b2d7789f |
3 changed files with 14 additions and 8 deletions
|
@ -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">
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue