Fix Bug 2121: NG-UI uses unmaintained Chokidar version
[osm/NG-UI.git] / src / app / approutes.module.ts
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 /* eslint-disable @typescript-eslint/no-explicit-any */
19 /**
20  * @file Routing Module
21  */
22 import { Routes } from '@angular/router';
23 import { AuthGuardService } from 'AuthGuardService';
24 import { ChangePasswordComponent } from 'ChangePasswordComponent';
25 import { LayoutComponent } from 'LayoutComponent';
26 import { LoginComponent } from 'LoginComponent';
27 import { PageNotFoundComponent } from 'PageNotFound';
28
29 /** Exporting a function using Routes @exports AppRoutes */
30 export const appRoutes: Routes = [
31     {
32         path: 'login',
33         component: LoginComponent
34     },
35     {
36         path: '',
37         component: LayoutComponent,
38         canActivate: [AuthGuardService],
39         children: [
40             {
41                 path: '',
42                 // eslint-disable-next-line node/no-unsupported-features/es-syntax
43                 loadChildren: async (): Promise<any> => import('./dashboard/DashboardModule')
44                     .then((m: typeof import('./dashboard/DashboardModule')) => m.DashboardModule),
45                 canActivate: [AuthGuardService]
46             },
47             {
48                 path: 'packages',
49                 // eslint-disable-next-line node/no-unsupported-features/es-syntax
50                 loadChildren: async (): Promise<any> => import('./packages/PackagesModule')
51                     .then((m: typeof import('./packages/PackagesModule')) => m.PackagesModule),
52                 canActivate: [AuthGuardService]
53             },
54             {
55                 path: 'instances',
56                 // eslint-disable-next-line node/no-unsupported-features/es-syntax
57                 loadChildren: async (): Promise<any> => import('./instances/InstancesModule')
58                     .then((m: typeof import('./instances/InstancesModule')) => m.InstancesModule),
59                 canActivate: [AuthGuardService]
60             },
61             {
62                 path: 'vim',
63                 // eslint-disable-next-line node/no-unsupported-features/es-syntax
64                 loadChildren: async (): Promise<any> => import('./vim-accounts/VimAccountsModule')
65                     .then((m: typeof import('./vim-accounts/VimAccountsModule')) => m.VimAccountsModule),
66                 canActivate: [AuthGuardService]
67             },
68             {
69                 path: 'wim',
70                 // eslint-disable-next-line node/no-unsupported-features/es-syntax
71                 loadChildren: async (): Promise<any> => import('./wim-accounts/WIMAccountsModule')
72                     .then((m: typeof import('./wim-accounts/WIMAccountsModule')) => m.WIMAccountsModule),
73                 canActivate: [AuthGuardService]
74             },
75             {
76                 path: 'sdn',
77                 // eslint-disable-next-line node/no-unsupported-features/es-syntax
78                 loadChildren: async (): Promise<any> => import('./sdn-controller/SDNControllerModule')
79                     .then((m: typeof import('./sdn-controller/SDNControllerModule')) => m.SDNControllerModule),
80                 canActivate: [AuthGuardService]
81             },
82             {
83                 path: 'users',
84                 // eslint-disable-next-line node/no-unsupported-features/es-syntax
85                 loadChildren: async (): Promise<any> => import('./users/UsersModule')
86                     .then((m: typeof import('./users/UsersModule')) => m.UsersModule),
87                 canActivate: [AuthGuardService]
88             },
89             {
90                 path: 'projects',
91                 // eslint-disable-next-line node/no-unsupported-features/es-syntax
92                 loadChildren: async (): Promise<any> => import('./projects/ProjectsModule')
93                     .then((m: typeof import('./projects/ProjectsModule')) => m.ProjectsModule),
94                 canActivate: [AuthGuardService]
95             },
96             {
97                 path: 'roles',
98                 // eslint-disable-next-line node/no-unsupported-features/es-syntax
99                 loadChildren: async (): Promise<any> => import('./roles/RolesModule')
100                     .then((m: typeof import('./roles/RolesModule')) => m.RolesModule),
101                 canActivate: [AuthGuardService]
102             },
103             {
104                 path: 'k8s',
105                 // eslint-disable-next-line node/no-unsupported-features/es-syntax
106                 loadChildren: async (): Promise<any> => import('./k8s/K8sModule')
107                     .then((m: typeof import('./k8s/K8sModule')) => m.K8sModule),
108                 canActivate: [AuthGuardService]
109             },
110             {
111                 path: 'repos',
112                 // eslint-disable-next-line node/no-unsupported-features/es-syntax
113                 loadChildren: async (): Promise<any> => import('./osm-repositories/OsmRepositoriesModule')
114                     .then((m: typeof import('./osm-repositories/OsmRepositoriesModule')) => m.OsmRepositoriesModule),
115                 canActivate: [AuthGuardService]
116             }
117         ]
118     },
119     {
120         path: 'changepassword',
121         component: ChangePasswordComponent,
122         canActivate: [AuthGuardService]
123     },
124     {
125         path: '**',
126         component: PageNotFoundComponent
127     }
128 ];