2020-10-01 15:21:22 +00:00
|
|
|
import { CommonModule } from '@angular/common';
|
2023-07-23 02:42:21 +00:00
|
|
|
import { NgModule, inject } from '@angular/core';
|
|
|
|
import { ActivatedRouteSnapshot, RouterModule, RouterStateSnapshot, Routes } from '@angular/router';
|
2020-10-10 03:15:05 +00:00
|
|
|
|
|
|
|
import { AttendanceTypeResolver } from '../attendance/attendance-type-resolver.service';
|
2020-10-01 15:21:22 +00:00
|
|
|
import { AuthGuard } from '../auth/auth-guard.service';
|
2020-10-10 03:15:05 +00:00
|
|
|
|
|
|
|
import { EmployeeAttendanceResolver } from './employee-attendance-resolver.service';
|
2020-10-01 15:21:22 +00:00
|
|
|
import { EmployeeAttendanceComponent } from './employee-attendance.component';
|
2018-05-25 13:49:00 +00:00
|
|
|
|
|
|
|
const employeeEmployeeAttendanceRoutes: Routes = [
|
|
|
|
{
|
2019-06-12 14:04:50 +00:00
|
|
|
path: '',
|
2018-05-25 13:49:00 +00:00
|
|
|
component: EmployeeAttendanceComponent,
|
2023-07-23 02:42:21 +00:00
|
|
|
canActivate: [
|
|
|
|
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) =>
|
|
|
|
inject(AuthGuard).canActivate(route, state),
|
|
|
|
],
|
2018-05-25 13:49:00 +00:00
|
|
|
data: {
|
2020-10-01 15:21:22 +00:00
|
|
|
permission: 'Attendance',
|
2018-05-25 13:49:00 +00:00
|
|
|
},
|
|
|
|
resolve: {
|
2023-07-23 02:42:21 +00:00
|
|
|
info: (route: ActivatedRouteSnapshot) => inject(EmployeeAttendanceResolver).resolve(route),
|
|
|
|
attendanceTypes: () => inject(AttendanceTypeResolver).resolve(),
|
2018-05-25 13:49:00 +00:00
|
|
|
},
|
2020-10-01 15:21:22 +00:00
|
|
|
runGuardsAndResolvers: 'always',
|
2018-05-25 13:49:00 +00:00
|
|
|
},
|
|
|
|
{
|
2019-06-12 14:04:50 +00:00
|
|
|
path: ':id',
|
2018-05-25 13:49:00 +00:00
|
|
|
component: EmployeeAttendanceComponent,
|
2023-07-23 02:42:21 +00:00
|
|
|
canActivate: [
|
|
|
|
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) =>
|
|
|
|
inject(AuthGuard).canActivate(route, state),
|
|
|
|
],
|
2018-05-25 13:49:00 +00:00
|
|
|
data: {
|
2020-10-01 15:21:22 +00:00
|
|
|
permission: 'Attendance',
|
2018-05-25 13:49:00 +00:00
|
|
|
},
|
|
|
|
resolve: {
|
2023-07-23 02:42:21 +00:00
|
|
|
info: (route: ActivatedRouteSnapshot) => inject(EmployeeAttendanceResolver).resolve(route),
|
|
|
|
attendanceTypes: () => inject(AttendanceTypeResolver).resolve(),
|
2018-05-25 13:49:00 +00:00
|
|
|
},
|
2020-10-01 15:21:22 +00:00
|
|
|
runGuardsAndResolvers: 'always',
|
|
|
|
},
|
2018-05-25 13:49:00 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
@NgModule({
|
2020-10-01 15:21:22 +00:00
|
|
|
imports: [CommonModule, RouterModule.forChild(employeeEmployeeAttendanceRoutes)],
|
|
|
|
exports: [RouterModule],
|
|
|
|
providers: [EmployeeAttendanceResolver],
|
2018-05-25 13:49:00 +00:00
|
|
|
})
|
2020-10-01 15:21:22 +00:00
|
|
|
export class EmployeeAttendanceRoutingModule {}
|