Merge "adding catalog-service for mod2"
[dcaegen2/platform.git] / mod2 / ui / src / app / app-routing.module.ts
1 /* 
2  *  # ============LICENSE_START=======================================================
3  *  # Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
4  *  # ================================================================================
5  *  # Licensed under the Apache License, Version 2.0 (the "License");
6  *  # you may not use this file except in compliance with the License.
7  *  # You may obtain a copy of the License at
8  *  #
9  *  #      http://www.apache.org/licenses/LICENSE-2.0
10  *  #
11  *  # Unless required by applicable law or agreed to in writing, software
12  *  # distributed under the License is distributed on an "AS IS" BASIS,
13  *  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  # See the License for the specific language governing permissions and
15  *  # limitations under the License.
16  *  # ============LICENSE_END=========================================================
17  */
18
19 import { NgModule } from '@angular/core';
20 import { Routes, RouterModule, NavigationStart, NavigationEnd, Route} from '@angular/router';
21 import { HomeComponent } from './home/home.component';
22 import { OnboardingToolsComponent } from './onboarding-tools/onboarding-tools.component';
23 import { CompSpecsComponent } from './comp-specs/comp-specs.component';
24 import { MsInstancesComponent } from './msInstances/msInstances.component';
25 import { LoginComponent } from './login/login.component';
26 import { RegisterComponent } from './register/register.component';
27 import { ResetPasswordComponent } from './reset-password/reset-password.component';
28 import { AuthGuard } from './guards/auth.guard';
29 import { RoleGuard } from './guards/role.guard';
30 import { UserManagementComponent } from './user-management/user-management.component';
31 import { LoginGuard } from './guards/login.guard';
32 import { MicroservicesComponent } from './microservices/microservices.component';
33 import { BlueprintsComponent } from './blueprints/blueprints.component';
34 import { CompSpecValidationComponent } from './comp-spec-validation/comp-spec-validation.component';
35
36 const routes: Routes = [
37   { path: '',  component: HomeComponent, canActivate:[LoginGuard]},
38   { path: 'home', component: HomeComponent, canActivate:[AuthGuard] },
39   { path: 'login', component: LoginComponent, canActivate:[LoginGuard]},
40   { path: 'register', component: RegisterComponent, canActivate:[AuthGuard, RoleGuard] },
41   { path: 'reset-password', component: ResetPasswordComponent, canActivate:[AuthGuard]},
42   { path: 'users', component: UserManagementComponent, canActivate:[AuthGuard, RoleGuard]},
43   { path: 'OnboardingTools', component: OnboardingToolsComponent, canActivate:[AuthGuard] },
44   { path: 'CompSpecs', component: CompSpecsComponent, canActivate:[AuthGuard]},
45   { path: 'ms-instances', component: MsInstancesComponent, canActivate:[AuthGuard] },
46   { path: 'base-microservices', component: MicroservicesComponent, canActivate: [AuthGuard] },
47   { path: 'blueprints', component: BlueprintsComponent, canActivate: [AuthGuard] },
48   { path: 'spec-validator', component: CompSpecValidationComponent, canActivate: [AuthGuard] }
49 ];
50
51 @NgModule({
52   imports: [RouterModule.forRoot(routes)],
53   exports: [RouterModule]
54 })
55 export class AppRoutingModule { }