11import { Routes } from '@angular/router' ;
22
3- import { HomeComponent } from './components/home-component/home-component' ;
43import { LoginComponent } from './components/welcome-layout/login-component/login-component' ;
54import { RegisterComponent } from './components/welcome-layout/register-component/register-component' ;
65import { authenticateGuard } from './guards/authenticate-guard' ;
@@ -9,20 +8,56 @@ import { SettingsComponent } from './components/settings-component/settings-comp
98import { ImportWizardComponent } from './components/import/import-wizard-component/import-wizard-component' ;
109import { MonthlyComparisonComponent } from './components/analytics/monthly-comparison-component/monthly-comparison-component' ;
1110import { TrackingComponent } from './components/tracking/tracking/tracking.component' ;
11+ import { DashboardComponent } from './components/dashboard-component/dashboard-component.component' ;
12+ import { HomeLayoutComponent } from './layouts/home-layout/home-layout.component' ;
13+ import { MovementsLayoutComponent } from './layouts/movements-layout/movements-layout.component' ;
14+ import { AnalyticsLayoutComponent } from './layouts/analytics-layout/analytics-layout.component' ;
1215
1316export const routes : Routes = [
1417 { path : '' , redirectTo : 'login' , pathMatch : 'full' } ,
15- { path : 'login' , component : LoginComponent } ,
16- { path : 'register' , component : RegisterComponent } ,
17- { path : 'home' , component : HomeComponent , canActivate : [ authenticateGuard ] } ,
18- { path : 'movements' , component : TrackingComponent , canActivate : [ authenticateGuard ] } ,
19- { path : 'balance' , component : BalanceComponent , canActivate : [ authenticateGuard ] } ,
20- { path : 'settings' , component : SettingsComponent , canActivate : [ authenticateGuard ] } ,
21- { path : 'import' , component : ImportWizardComponent , canActivate : [ authenticateGuard ] } ,
18+ { path : 'login' , component : LoginComponent , data : { breadcrumb : 'Login' } } ,
19+ { path : 'register' , component : RegisterComponent , data : { breadcrumb : 'Register' } } ,
2220 {
23- path : 'analytics/monthly-comparison ' ,
24- component : MonthlyComparisonComponent ,
21+ path : 'home ' ,
22+ component : HomeLayoutComponent ,
2523 canActivate : [ authenticateGuard ] ,
24+ data : { breadcrumb : 'Home' } ,
25+ children : [
26+ { path : '' , redirectTo : 'dashboard' , pathMatch : 'full' } ,
27+ { path : 'dashboard' , component : DashboardComponent , data : { breadcrumb : 'Dashboard' } } ,
28+ { path : 'balance' , component : BalanceComponent , data : { breadcrumb : 'Balance' } } ,
29+ ] ,
30+ } ,
31+ {
32+ path : 'movements' ,
33+ component : MovementsLayoutComponent ,
34+ canActivate : [ authenticateGuard ] ,
35+ data : { breadcrumb : 'Movements' } ,
36+ children : [
37+ { path : '' , redirectTo : 'tracking' , pathMatch : 'full' } ,
38+ { path : 'tracking' , component : TrackingComponent , data : { breadcrumb : 'Tracking' } } ,
39+ { path : 'import' , component : ImportWizardComponent , data : { breadcrumb : 'Import' } } ,
40+ ] ,
41+ } ,
42+ {
43+ path : 'analytics' ,
44+ component : AnalyticsLayoutComponent ,
45+ canActivate : [ authenticateGuard ] ,
46+ data : { breadcrumb : 'Analytics' } ,
47+ children : [
48+ { path : '' , redirectTo : 'monthly-comparison' , pathMatch : 'full' } ,
49+ {
50+ path : 'monthly-comparison' ,
51+ component : MonthlyComparisonComponent ,
52+ data : { breadcrumb : 'Monthly Comparison' } ,
53+ } ,
54+ ] ,
55+ } ,
56+ {
57+ path : 'settings' ,
58+ component : SettingsComponent ,
59+ canActivate : [ authenticateGuard ] ,
60+ data : { breadcrumb : 'Settings' } ,
2661 } ,
2762 { path : '**' , redirectTo : 'login' } ,
2863] ;
0 commit comments