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.html | ||
---|---|---|
27 | 27 |
<input |
28 | 28 |
matInput |
29 | 29 |
type="number" |
30 |
placeholder="Sickdays"
|
|
30 |
placeholder="{{'editEmployee.setSickdays' | translate}}"
|
|
31 | 31 |
min="0" |
32 | 32 |
step="0.5" |
33 | 33 |
[(ngModel)]="_sickDaysCount" |
... | ... | |
41 | 41 |
<input |
42 | 42 |
matInput |
43 | 43 |
type="number" |
44 |
placeholder="{{'basic.vacation' | translate}}"
|
|
44 |
placeholder="{{'editEmployee.addVacation' | translate}}"
|
|
45 | 45 |
min="0" |
46 | 46 |
step="0.5" |
47 |
[(ngModel)]="_vacationDaysCount"
|
|
47 |
[(ngModel)]="_addVacationHoursCount"
|
|
48 | 48 |
> |
49 | 49 |
</mat-form-field> |
50 | 50 |
</div> |
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(); |
webapp/src/app/employees/employees-list.component.ts | ||
---|---|---|
123 | 123 |
const parsedSettings = { |
124 | 124 |
notificationDate: new Date(parsedDate.getFullYear(), parsedDate.getMonth(), parsedDate.getDate()), |
125 | 125 |
notificationTime: parsedDate.getHours() + ':' + parsedDate.getMinutes(), |
126 |
sickdaysCount: settingsData.sickDayCount
|
|
126 |
sickDayCount: settingsData.sickDayCount
|
|
127 | 127 |
}; |
128 | 128 |
|
129 | 129 |
this.dialog.open(DefaultSettingsDialogComponent, { |
webapp/src/app/services/api/user.service.ts | ||
---|---|---|
127 | 127 |
} |
128 | 128 |
|
129 | 129 |
putNotificationSettingsWithLanguage(settings: NotificationSettings, language: Languages) { |
130 |
console.log(settings); |
|
131 | 130 |
return this.makePutNotificationSettingsApiCall(settings, language); |
132 | 131 |
} |
133 | 132 |
/** |
... | ... | |
242 | 241 |
} |
243 | 242 |
|
244 | 243 |
/** |
245 |
* Změna nastavení notifikace uživatele podle id
|
|
244 |
* Změna nastavení notifikace |
|
246 | 245 |
* PUT /user/settings?[lang=<CZ,EN>] |
247 | 246 |
* @param settings notification setting to be set for given user |
248 | 247 |
* @param language specified language |
webapp/src/app/services/util/menu.service.ts | ||
---|---|---|
39 | 39 |
const menuItems: MenuItem[] = []; |
40 | 40 |
menuItems.push({name: 'menuItem.dashboard', routePath: 'dashboard'}); |
41 | 41 |
if (profile.role === UserType.EMPLOYER) { |
42 |
menuItems.push({name: 'menuItem.employers', routePath: 'employees'});
|
|
42 |
menuItems.push({name: 'menuItem.employees', routePath: 'employees'});
|
|
43 | 43 |
} |
44 | 44 |
|
45 | 45 |
return menuItems; |
webapp/src/assets/i18n/cs.json | ||
---|---|---|
27 | 27 |
}, |
28 | 28 |
"menuItem": { |
29 | 29 |
"dashboard": "Dashboard", |
30 |
"employers": "Zaměstnanci" |
|
30 |
"employees": "Zaměstnanci" |
|
31 |
}, |
|
32 |
"editEmployee": { |
|
33 |
"setSickdays": "Nastavení počtu sickdays (dny)", |
|
34 |
"addVacation": "Přidání dovolené (hodiny)" |
|
31 | 35 |
}, |
32 | 36 |
"basic": { |
33 | 37 |
"name": "Jméno", |
webapp/src/assets/i18n/en.json | ||
---|---|---|
27 | 27 |
}, |
28 | 28 |
"menuItem": { |
29 | 29 |
"dashboard": "Dashboard", |
30 |
"employers": "Employers" |
|
30 |
"employees": "Employees" |
|
31 |
}, |
|
32 |
"editEmployee": { |
|
33 |
"setSickdays": "Set number of sickdays (days)", |
|
34 |
"addVacation": "Add vacation (hours)" |
|
31 | 35 |
}, |
32 | 36 |
"basic": { |
33 | 37 |
"name": "Name", |
Také k dispozici: Unified diff
Set vacation changed to add vacation