Issue1317 (#1346)
* activate holidays * issue1317 add correct route * tslint bugs are fixed merging based on @BLasan approval, thanks Benura and @gustavao
This commit is contained in:
@@ -7,6 +7,7 @@ import { MatDialog } from '@angular/material/dialog';
|
||||
import { OrganizationService } from 'app/organization/organization.service';
|
||||
|
||||
/** Custom Components. */
|
||||
import { ConfirmationDialogComponent } from '../../../shared/confirmation-dialog/confirmation-dialog.component';
|
||||
import { DeleteDialogComponent } from '../../../shared/delete-dialog/delete-dialog.component';
|
||||
|
||||
/**
|
||||
@@ -52,4 +53,21 @@ export class ViewHolidaysComponent {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate holiday.
|
||||
*/
|
||||
activateHoliday() {
|
||||
const unAssignStaffDialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
||||
data: { heading: 'Holiday', dialogContext: `Are you sure you want to activate ${this.holidayData.name} holiday` }
|
||||
});
|
||||
unAssignStaffDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
|
||||
if (response.confirm) {
|
||||
this.organizationService.activateHoliday(this.holidayData.id)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['/organization/holidays']);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user