Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 5d32cbea

Přidáno uživatelem Václav Jirák před téměř 6 roky(ů)

Error and information messages modified - correct error messages from backend are displayed and information messages are translated

Zobrazit rozdíly:

webapp/src/app/employees/edit-employee-dialog/edit-employee-dialog.component.ts
3 3
import {UserType} from '../../enums/common.enum';
4 4
import {UserProfile} from '../../models/user.model';
5 5
import {UserSettings} from '../../models/settings.model';
6
import {TranslateService} from '@ngx-translate/core';
6 7

  
7 8

  
8 9
@Component({
......
21 22

  
22 23
  constructor(public dialogRef: MatDialogRef<EditEmployeeDialogComponent>,
23 24
              @Inject(MAT_DIALOG_DATA) public data: UserProfile,
24
              private snackBar: MatSnackBar) {
25
              private snackBar: MatSnackBar,
26
              private translateService: TranslateService
27
  ) {
25 28
    this._sickDaysCount = data.sickDayCount;
26 29
    this._addVacationHoursCount = 0;
27 30
    this._userType = data.role;
......
33 36

  
34 37
  onConfirmClick(): void {
35 38
    if (this._sickDaysCount == null || this._addVacationHoursCount == null || this._userType == null) {
36
      this.snackBar.open('Vyplňte prosím všechny údaje', 'Zavřít');
39
      this.translateService.get('error.missingField').subscribe((res: string) => {
40
        this.snackBar.open(res, 'X', { duration: 5000 });
41
      });
37 42
    } else {
38 43
      this.postUserSettings.emit({
39 44
        id: this._userId,

Také k dispozici: Unified diff