| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 1 | /* |
| 2 | Copyright 2020 TATA ELXSI |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the 'License'); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | |
| 16 | Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in) |
| 17 | */ |
| 18 | /** |
| 19 | * @file Routing Module |
| 20 | */ |
| 21 | import { Routes } from '@angular/router'; |
| 22 | import { AuthGuardService } from 'AuthGuardService'; |
| SANDHYA.JS | a981655 | 2022-04-12 09:07:08 +0530 | [diff] [blame] | 23 | import { ChangePasswordComponent } from 'ChangePasswordComponent'; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 24 | import { LayoutComponent } from 'LayoutComponent'; |
| 25 | import { LoginComponent } from 'LoginComponent'; |
| 26 | import { PageNotFoundComponent } from 'PageNotFound'; |
| 27 | |
| 28 | /** Exporting a function using Routes @exports AppRoutes */ |
| 29 | export const appRoutes: Routes = [ |
| 30 | { |
| 31 | path: 'login', |
| 32 | component: LoginComponent |
| 33 | }, |
| 34 | { |
| 35 | path: '', |
| 36 | component: LayoutComponent, |
| 37 | canActivate: [AuthGuardService], |
| 38 | children: [ |
| 39 | { |
| 40 | path: '', |
| 41 | // tslint:disable-next-line: no-any |
| 42 | loadChildren: async (): Promise<any> => import('./dashboard/DashboardModule') |
| 43 | .then((m: typeof import('./dashboard/DashboardModule')) => m.DashboardModule), |
| 44 | canActivate: [AuthGuardService] |
| 45 | }, |
| 46 | { |
| 47 | path: 'packages', |
| 48 | // tslint:disable-next-line: no-any |
| 49 | loadChildren: async (): Promise<any> => import('./packages/PackagesModule') |
| 50 | .then((m: typeof import('./packages/PackagesModule')) => m.PackagesModule), |
| 51 | canActivate: [AuthGuardService] |
| 52 | }, |
| 53 | { |
| 54 | path: 'instances', |
| 55 | // tslint:disable-next-line: no-any |
| 56 | loadChildren: async (): Promise<any> => import('./instances/InstancesModule') |
| 57 | .then((m: typeof import('./instances/InstancesModule')) => m.InstancesModule), |
| 58 | canActivate: [AuthGuardService] |
| 59 | }, |
| 60 | { |
| 61 | path: 'vim', |
| 62 | // tslint:disable-next-line: no-any |
| 63 | loadChildren: async (): Promise<any> => import('./vim-accounts/VimAccountsModule') |
| 64 | .then((m: typeof import('./vim-accounts/VimAccountsModule')) => m.VimAccountsModule), |
| 65 | canActivate: [AuthGuardService] |
| 66 | }, |
| 67 | { |
| 68 | path: 'wim', |
| 69 | // tslint:disable-next-line: no-any |
| 70 | loadChildren: async (): Promise<any> => import('./wim-accounts/WIMAccountsModule') |
| 71 | .then((m: typeof import('./wim-accounts/WIMAccountsModule')) => m.WIMAccountsModule), |
| 72 | canActivate: [AuthGuardService] |
| 73 | }, |
| 74 | { |
| 75 | path: 'sdn', |
| 76 | // tslint:disable-next-line: no-any |
| 77 | loadChildren: async (): Promise<any> => import('./sdn-controller/SDNControllerModule') |
| 78 | .then((m: typeof import('./sdn-controller/SDNControllerModule')) => m.SDNControllerModule), |
| 79 | canActivate: [AuthGuardService] |
| 80 | }, |
| 81 | { |
| 82 | path: 'users', |
| 83 | // tslint:disable-next-line: no-any |
| 84 | loadChildren: async (): Promise<any> => import('./users/UsersModule') |
| 85 | .then((m: typeof import('./users/UsersModule')) => m.UsersModule), |
| 86 | canActivate: [AuthGuardService] |
| 87 | }, |
| 88 | { |
| 89 | path: 'projects', |
| 90 | // tslint:disable-next-line: no-any |
| 91 | loadChildren: async (): Promise<any> => import('./projects/ProjectsModule') |
| 92 | .then((m: typeof import('./projects/ProjectsModule')) => m.ProjectsModule), |
| 93 | canActivate: [AuthGuardService] |
| 94 | }, |
| 95 | { |
| 96 | path: 'roles', |
| 97 | // tslint:disable-next-line: no-any |
| 98 | loadChildren: async (): Promise<any> => import('./roles/RolesModule') |
| 99 | .then((m: typeof import('./roles/RolesModule')) => m.RolesModule), |
| 100 | canActivate: [AuthGuardService] |
| 101 | }, |
| 102 | { |
| 103 | path: 'k8s', |
| 104 | // tslint:disable-next-line: no-any |
| 105 | loadChildren: async (): Promise<any> => import('./k8s/K8sModule') |
| 106 | .then((m: typeof import('./k8s/K8sModule')) => m.K8sModule), |
| 107 | canActivate: [AuthGuardService] |
| Barath Kumar R | 403234e | 2020-07-07 15:48:58 +0530 | [diff] [blame] | 108 | }, |
| 109 | { |
| 110 | path: 'repos', |
| 111 | // tslint:disable-next-line: no-any |
| 112 | loadChildren: async (): Promise<any> => import('./osm-repositories/OsmRepositoriesModule') |
| 113 | .then((m: typeof import('./osm-repositories/OsmRepositoriesModule')) => m.OsmRepositoriesModule), |
| 114 | canActivate: [AuthGuardService] |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 115 | } |
| 116 | ] |
| 117 | }, |
| 118 | { |
| SANDHYA.JS | a981655 | 2022-04-12 09:07:08 +0530 | [diff] [blame] | 119 | path: 'changepassword', |
| 120 | component: ChangePasswordComponent, |
| 121 | canActivate: [AuthGuardService] |
| 122 | }, |
| 123 | { |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 124 | path: '**', |
| 125 | component: PageNotFoundComponent |
| 126 | } |
| 127 | ]; |