Revize 6496dcfb
Přidáno uživatelem Václav Jirák před téměř 6 roky(ů)
webapp/src/app/employees/edit-employee-dialog/edit-employee-dialog.component.ts | ||
---|---|---|
13 | 13 |
export class EditEmployeeDialogComponent implements OnInit { |
14 | 14 |
readonly _userTypes: string[] = ['EMPLOYER', 'EMPLOYEE']; |
15 | 15 |
private _sickDaysCount: number; |
16 |
private _vacationDaysCount: number;
|
|
16 |
private _addVacationHoursCount: number;
|
|
17 | 17 |
private _userType: UserType; |
18 | 18 |
private readonly _userId: number; |
19 |
|
|
19 | 20 |
@Output() postUserSettings = new EventEmitter<UserSettings>(); |
20 | 21 |
|
21 | 22 |
constructor(public dialogRef: MatDialogRef<EditEmployeeDialogComponent>, |
22 | 23 |
@Inject(MAT_DIALOG_DATA) public data: UserProfile, |
23 | 24 |
private snackBar: MatSnackBar) { |
24 | 25 |
this._sickDaysCount = data.sickDayCount; |
25 |
this._vacationDaysCount = data.vacationCount;
|
|
26 |
this._addVacationHoursCount = 0;
|
|
26 | 27 |
this._userType = data.role; |
27 | 28 |
this._userId = data.id; |
28 | 29 |
} |
... | ... | |
31 | 32 |
} |
32 | 33 |
|
33 | 34 |
onConfirmClick(): void { |
34 |
if (this._sickDaysCount == null || this._vacationDaysCount == null || this._userType == null) {
|
|
35 |
if (this._sickDaysCount == null || this._addVacationHoursCount == null || this._userType == null) {
|
|
35 | 36 |
this.snackBar.open('Vyplňte prosím všechny údaje', 'Zavřít'); |
36 | 37 |
} else { |
37 | 38 |
this.postUserSettings.emit({ |
38 | 39 |
id: this._userId, |
39 | 40 |
role: this._userType, |
40 | 41 |
sickDayCount: this._sickDaysCount, |
41 |
vacationCount: this._vacationDaysCount
|
|
42 |
vacationCount: this._addVacationHoursCount
|
|
42 | 43 |
}); |
43 | 44 |
|
44 | 45 |
this.dialogRef.close(); |
Také k dispozici: Unified diff
Set vacation changed to add vacation