blob: 2412be7e04bf54e2a44af00ce465a6f6ed240c23 [file] [log] [blame]
kumaran.m3b4814a2020-05-01 19:48:54 +05301/*
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*/
SANDHYA.JS0a34dfa2023-04-25 23:59:41 +053018/* eslint-disable @typescript-eslint/no-explicit-any */
kumaran.m3b4814a2020-05-01 19:48:54 +053019/**
20 * @file Routing Module
21 */
22import { Routes } from '@angular/router';
23import { AuthGuardService } from 'AuthGuardService';
SANDHYA.JSa9816552022-04-12 09:07:08 +053024import { ChangePasswordComponent } from 'ChangePasswordComponent';
kumaran.m3b4814a2020-05-01 19:48:54 +053025import { LayoutComponent } from 'LayoutComponent';
26import { LoginComponent } from 'LoginComponent';
27import { PageNotFoundComponent } from 'PageNotFound';
28
29/** Exporting a function using Routes @exports AppRoutes */
30export 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: '',
SANDHYA.JS0a34dfa2023-04-25 23:59:41 +053042 // eslint-disable-next-line node/no-unsupported-features/es-syntax
kumaran.m3b4814a2020-05-01 19:48:54 +053043 loadChildren: async (): Promise<any> => import('./dashboard/DashboardModule')
44 .then((m: typeof import('./dashboard/DashboardModule')) => m.DashboardModule),
45 canActivate: [AuthGuardService]
46 },
47 {
48 path: 'packages',
SANDHYA.JS0a34dfa2023-04-25 23:59:41 +053049 // eslint-disable-next-line node/no-unsupported-features/es-syntax
kumaran.m3b4814a2020-05-01 19:48:54 +053050 loadChildren: async (): Promise<any> => import('./packages/PackagesModule')
51 .then((m: typeof import('./packages/PackagesModule')) => m.PackagesModule),
52 canActivate: [AuthGuardService]
53 },
54 {
55 path: 'instances',
SANDHYA.JS0a34dfa2023-04-25 23:59:41 +053056 // eslint-disable-next-line node/no-unsupported-features/es-syntax
kumaran.m3b4814a2020-05-01 19:48:54 +053057 loadChildren: async (): Promise<any> => import('./instances/InstancesModule')
58 .then((m: typeof import('./instances/InstancesModule')) => m.InstancesModule),
59 canActivate: [AuthGuardService]
60 },
61 {
62 path: 'vim',
SANDHYA.JS0a34dfa2023-04-25 23:59:41 +053063 // eslint-disable-next-line node/no-unsupported-features/es-syntax
kumaran.m3b4814a2020-05-01 19:48:54 +053064 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',
SANDHYA.JS0a34dfa2023-04-25 23:59:41 +053070 // eslint-disable-next-line node/no-unsupported-features/es-syntax
kumaran.m3b4814a2020-05-01 19:48:54 +053071 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',
SANDHYA.JS0a34dfa2023-04-25 23:59:41 +053077 // eslint-disable-next-line node/no-unsupported-features/es-syntax
kumaran.m3b4814a2020-05-01 19:48:54 +053078 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',
SANDHYA.JS0a34dfa2023-04-25 23:59:41 +053084 // eslint-disable-next-line node/no-unsupported-features/es-syntax
kumaran.m3b4814a2020-05-01 19:48:54 +053085 loadChildren: async (): Promise<any> => import('./users/UsersModule')
86 .then((m: typeof import('./users/UsersModule')) => m.UsersModule),
87 canActivate: [AuthGuardService]
88 },
89 {
90 path: 'projects',
SANDHYA.JS0a34dfa2023-04-25 23:59:41 +053091 // eslint-disable-next-line node/no-unsupported-features/es-syntax
kumaran.m3b4814a2020-05-01 19:48:54 +053092 loadChildren: async (): Promise<any> => import('./projects/ProjectsModule')
93 .then((m: typeof import('./projects/ProjectsModule')) => m.ProjectsModule),
94 canActivate: [AuthGuardService]
95 },
96 {
97 path: 'roles',
SANDHYA.JS0a34dfa2023-04-25 23:59:41 +053098 // eslint-disable-next-line node/no-unsupported-features/es-syntax
kumaran.m3b4814a2020-05-01 19:48:54 +053099 loadChildren: async (): Promise<any> => import('./roles/RolesModule')
100 .then((m: typeof import('./roles/RolesModule')) => m.RolesModule),
101 canActivate: [AuthGuardService]
102 },
103 {
104 path: 'k8s',
SANDHYA.JS0a34dfa2023-04-25 23:59:41 +0530105 // eslint-disable-next-line node/no-unsupported-features/es-syntax
kumaran.m3b4814a2020-05-01 19:48:54 +0530106 loadChildren: async (): Promise<any> => import('./k8s/K8sModule')
107 .then((m: typeof import('./k8s/K8sModule')) => m.K8sModule),
108 canActivate: [AuthGuardService]
Barath Kumar R403234e2020-07-07 15:48:58 +0530109 },
110 {
111 path: 'repos',
SANDHYA.JS0a34dfa2023-04-25 23:59:41 +0530112 // eslint-disable-next-line node/no-unsupported-features/es-syntax
Barath Kumar R403234e2020-07-07 15:48:58 +0530113 loadChildren: async (): Promise<any> => import('./osm-repositories/OsmRepositoriesModule')
114 .then((m: typeof import('./osm-repositories/OsmRepositoriesModule')) => m.OsmRepositoriesModule),
115 canActivate: [AuthGuardService]
kumaran.m3b4814a2020-05-01 19:48:54 +0530116 }
117 ]
118 },
119 {
SANDHYA.JSa9816552022-04-12 09:07:08 +0530120 path: 'changepassword',
121 component: ChangePasswordComponent,
122 canActivate: [AuthGuardService]
123 },
124 {
SANDHYA.JS6c686082024-06-10 21:39:41 +0530125 path: 'forgotpassword',
126 component: ChangePasswordComponent
127 },
128 {
129 path: 'forgotpassword/changepassword/:id',
130 component: ChangePasswordComponent,
131 canActivate: [AuthGuardService]
132 },
133 {
kumaran.m3b4814a2020-05-01 19:48:54 +0530134 path: '**',
135 component: PageNotFoundComponent
136 }
137];