1
|
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
2
|
import {DaysOff} from '../shared/days-off.model';
|
3
|
import {OffDayType} from '../shared/off-day-type';
|
4
|
|
5
|
@Component({
|
6
|
selector: 'app-coming-days-off',
|
7
|
templateUrl: './oncoming-days-off.component.html',
|
8
|
styleUrls: ['./oncoming-days-off.component.sass']
|
9
|
})
|
10
|
export class OncomingDaysOffComponent implements OnInit {
|
11
|
|
12
|
@Input() oncomingDaysOff: DaysOff[];
|
13
|
@Output() daysOffRemovedAction = new EventEmitter<{daysOff: DaysOff}>();
|
14
|
|
15
|
constructor() { }
|
16
|
|
17
|
ngOnInit() {
|
18
|
}
|
19
|
|
20
|
private daysOffRemoved( removedDaysOff: DaysOff ) {
|
21
|
this.daysOffRemovedAction.emit( {daysOff: removedDaysOff } );
|
22
|
}
|
23
|
|
24
|
// TODO
|
25
|
// days-off-approval duplicate
|
26
|
private offDayTypeToString(taskType: OffDayType): string {
|
27
|
switch (taskType) {
|
28
|
case OffDayType.ExtraVacation:
|
29
|
return 'Extra dovolená';
|
30
|
case OffDayType.Sickday:
|
31
|
return 'Sickdays';
|
32
|
}
|
33
|
}
|
34
|
}
|