Revize 5d32cbea
Přidáno uživatelem Václav Jirák před téměř 6 roky(ů)
webapp/src/app/add-vacation-dialog/add-vacation-dialog.component.ts | ||
---|---|---|
3 | 3 |
import {VacationType} from '../enums/common.enum'; |
4 | 4 |
import {FormControl} from '@angular/forms'; |
5 | 5 |
import {DateFormatterService} from '../services/util/date-formatter.service'; |
6 |
import {TranslateService} from '@ngx-translate/core'; |
|
6 | 7 |
|
7 | 8 |
@Component({ |
8 | 9 |
selector: 'app-add-days-off-dialog', |
... | ... | |
22 | 23 |
public dialogRef: MatDialogRef<AddVacationDialogComponent>, |
23 | 24 |
@Inject(MAT_DIALOG_DATA) public data: AddVacationDialogData, |
24 | 25 |
private snackBar: MatSnackBar, |
25 |
private dateFormatterService: DateFormatterService |
|
26 |
private dateFormatterService: DateFormatterService, |
|
27 |
private translateService: TranslateService |
|
26 | 28 |
) { |
27 | 29 |
if (this.data.fromTime == null) { |
28 | 30 |
this.data.fromTime = '08:00'; |
... | ... | |
36 | 38 |
|
37 | 39 |
onConfirmClick(): void { |
38 | 40 |
if (this.selectedVacationType == null) { |
39 |
this.snackBar.open('Nevybrán typ volna', 'Zavřít', { duration: 5000 }); |
|
41 |
this.translateService.get('error.vacationTypeNotSelected').subscribe((res: string) => { |
|
42 |
this.snackBar.open(res, 'X', { duration: 5000 }); |
|
43 |
}); |
|
40 | 44 |
} else { |
41 | 45 |
let data; |
42 | 46 |
const formattedDate = this.dateFormatterService.formatDate(this.data.date); |
Také k dispozici: Unified diff
Error and information messages modified - correct error messages from backend are displayed and information messages are translated