1
|
import { Component, EventEmitter, Output, Input } from '@angular/core';
|
2
|
import {Requests} from '../models/requests.model'; // TODO
|
3
|
import {VacationType} from '../enums/common.enum';
|
4
|
|
5
|
@Component({
|
6
|
selector: 'app-days-off-approval',
|
7
|
templateUrl: './days-off-approval.component.html',
|
8
|
styleUrls: ['./days-off-approval.component.sass']
|
9
|
})
|
10
|
export class DaysOffApprovalComponent {
|
11
|
|
12
|
@Input() daysOffRequests: Requests;
|
13
|
@Output() daysOffApprovalEvent = new EventEmitter<{requestId: number, approved: boolean}>();
|
14
|
|
15
|
constructor() { }
|
16
|
|
17
|
daysOffApprovalCompleted(reqId: number, isApproved: boolean ) {
|
18
|
this.daysOffApprovalEvent.emit({requestId: reqId, approved: isApproved});
|
19
|
}
|
20
|
|
21
|
private daysOffTypeToString(vacationType: VacationType): string {
|
22
|
switch (vacationType) {
|
23
|
case VacationType.VACATION:
|
24
|
return 'Extra dovolená';
|
25
|
case VacationType.SICKDAY:
|
26
|
return 'Sickdays';
|
27
|
}
|
28
|
}
|
29
|
}
|