2017-08-15 17:41:27 +01:00
import { NgModule } from '@angular/core' ;
import { Routes , RouterModule } from '@angular/router' ;
2017-08-16 15:54:36 +01:00
2017-08-15 17:41:27 +01:00
import { AuthGuard } from '../_guards/auth.guard' ;
2017-08-31 18:44:17 +01:00
import { OrgGuard } from '../_guards/org.guard' ;
import { CustomerGuard } from '../_guards/customer.guard' ;
2017-08-15 17:41:27 +01:00
import { DashboardComponent } from './dashboard.component' ;
2017-08-31 18:44:17 +01:00
import { DashboardCustomerComponent } from './dashboard-customer.component' ;
2017-08-15 17:41:27 +01:00
import { FullLayoutComponent } from '../layouts/full-layout.component' ;
2017-08-16 15:48:42 +01:00
import { AccountEditComponent } from './account-edit.component' ;
import { AddDataComponent } from './add-data.component' ;
2017-09-01 15:02:05 +01:00
import { FeedbackComponent } from './feedback.component' ;
2017-09-06 16:05:35 +01:00
import { TransactionLogComponent } from './transaction-log.component' ;
2017-09-19 17:22:19 +01:00
import { PayrollLogComponent } from './payroll-log.component' ;
2017-11-10 18:41:35 +00:00
import { LeaderboardComponent } from './leaderboard.component' ;
2017-09-26 17:31:40 +01:00
import { MapComponent } from './map.component' ;
2017-11-14 12:47:28 +00:00
import { TrailMapComponent } from './trail-map.component' ;
2017-08-15 17:41:27 +01:00
// Using child path to allow for FullLayout theming
const routes : Routes = [
2017-08-16 15:54:36 +01:00
{ path : '' , redirectTo : '/dashboard' , pathMatch : 'full' } ,
2017-08-15 17:41:27 +01:00
{
path : '' ,
component : FullLayoutComponent ,
canActivate : [ AuthGuard ] ,
children : [
{
path : 'dashboard' ,
component : DashboardComponent ,
data : { title : 'Dashboard' } ,
2017-08-31 18:44:17 +01:00
canActivate : [ OrgGuard ] ,
} ,
{
path : 'dashboard-customer' ,
component : DashboardCustomerComponent ,
data : { title : 'Customer Dashboard' } ,
canActivate : [ CustomerGuard ] ,
2017-08-15 17:41:27 +01:00
} ,
2017-08-16 15:48:42 +01:00
{
path : 'account-edit' ,
component : AccountEditComponent ,
2017-11-10 17:15:11 +00:00
data : { title : 'Edit Account' } ,
2017-08-16 15:48:42 +01:00
} ,
{
path : 'add-data' ,
component : AddDataComponent ,
data : { title : 'Add Transaction' } ,
2017-09-01 15:02:05 +01:00
} ,
2017-11-10 17:15:11 +00:00
{
path : 'leaderboard' ,
component : LeaderboardComponent ,
data : { title : 'Leaderboards' } ,
2017-11-13 12:39:31 +00:00
canActivate : [ CustomerGuard ] ,
2017-11-10 17:15:11 +00:00
} ,
2017-09-06 16:05:35 +01:00
{
path : 'transaction-log' ,
component : TransactionLogComponent ,
data : { title : 'Transaction Log' } ,
} ,
2017-09-26 17:31:40 +01:00
{
path : 'map' ,
component : MapComponent ,
2017-11-13 12:39:31 +00:00
data : { title : 'Purchase Map' } ,
2017-09-26 17:31:40 +01:00
} ,
2017-11-14 12:47:28 +00:00
{
path : 'story-trail' ,
component : TrailMapComponent ,
2017-11-29 15:23:03 +00:00
data : { title : 'Lancaster Independent Story' } ,
2017-11-14 12:47:28 +00:00
} ,
2017-09-19 17:22:19 +01:00
{
path : 'payroll-log' ,
component : PayrollLogComponent ,
data : { title : 'Payroll Log' } ,
canActivate : [ OrgGuard ] ,
} ,
2017-09-01 15:02:05 +01:00
{
path : 'feedback' ,
component : FeedbackComponent ,
data : { title : 'Give Feedback' } ,
2017-08-15 17:41:27 +01:00
}
] ,
}
] ;
@NgModule ( {
imports : [ RouterModule . forChild ( routes ) ] ,
exports : [ RouterModule ]
} )
export class DashboardRoutingModule { }