|
1 | 1 | import { NgModule } from '@angular/core';
|
2 | 2 | import { Routes, RouterModule } from '@angular/router';
|
| 3 | + |
| 4 | +import { AzureGuardService } from './guards/azure-guard.service' |
3 | 5 | import { ReportsComponent } from './modules/reports/pages/reports.component';
|
4 | 6 | import { TimeClockComponent } from './modules/time-clock/pages/time-clock.component';
|
5 | 7 | import { TimeEntriesComponent } from './modules/time-entries/pages/time-entries.component';
|
6 | 8 | import { ProjectManagementComponent } from './modules/project-management/pages/project-management.component';
|
7 | 9 | import { ActivitiesManagementComponent } from './modules/activities-management/pages/activities-management.component';
|
| 10 | +import { HomeComponent } from './modules/home/home.component'; |
| 11 | +import { LoginComponent } from './modules/login/login.component'; |
8 | 12 |
|
9 | 13 | const routes: Routes = [
|
10 |
| - {path: 'reports', component: ReportsComponent}, |
11 |
| - {path: 'time-clock', component: TimeClockComponent}, |
12 |
| - {path: 'time-entries', component: TimeEntriesComponent}, |
13 |
| - {path: 'project-management', component: ProjectManagementComponent}, |
14 |
| - {path: 'activities-management', component: ActivitiesManagementComponent}, |
15 |
| - {path: '', pathMatch: 'full', redirectTo: 'time-clock'}, |
16 |
| - {path: '**', pathMatch: 'full', redirectTo: 'time-clock'}, |
| 14 | + |
| 15 | + { path: '', component: HomeComponent, canActivate:[AzureGuardService], |
| 16 | + children: [ |
| 17 | + { path: 'reports', component: ReportsComponent }, |
| 18 | + { path: 'time-clock', component: TimeClockComponent }, |
| 19 | + { path: 'time-entries', component: TimeEntriesComponent }, |
| 20 | + { path: 'project-management', component: ProjectManagementComponent }, |
| 21 | + { path: 'activities-management', component: ActivitiesManagementComponent }, |
| 22 | + {path: '', pathMatch: 'full', redirectTo: 'time-clock'}, |
| 23 | + ] |
| 24 | + }, |
| 25 | + { path: 'login', component: LoginComponent }, |
17 | 26 | ];
|
18 | 27 |
|
19 | 28 | @NgModule({
|
|
0 commit comments