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