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' ;
2018-01-17 17:36:28 +00:00
import { CategoryMonthComponent } from './category-month.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' ;
2019-07-09 14:22:19 +01:00
import { MoreStuffComponent } from './more-graphs-and-tables.component' ;
2019-07-04 16:36:06 +01:00
import { SuppliersComponent } from './suppliers.component' ;
2021-03-21 16:35:04 +00:00
import { TopicsEditComponent } from './topics-edit.component' ;
2020-11-01 18:05:20 +00:00
import { SendPushNotificationComponent } from './send-push-notification.component' ;
2019-07-09 14:22:19 +01:00
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 ,
2020-10-17 18:52:03 +01:00
data : { title : 'Record Transaction' } ,
2017-09-01 15:02:05 +01:00
} ,
2020-11-01 18:05:20 +00:00
{
path : 'notify' ,
component : SendPushNotificationComponent ,
data : { title : 'Send Message' } ,
} ,
2021-03-21 16:35:04 +00:00
{
path : 'edit-topics' ,
component : TopicsEditComponent ,
data : { title : 'Edit Topics' } ,
} ,
{
path : 'edit-subscriptions' ,
component : SubscriptionsEditComponent ,
data : { title : 'Edit Subscriptions' } ,
} ,
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' } ,
} ,
2018-01-17 17:36:28 +00:00
{
path : 'category-month' ,
component : CategoryMonthComponent ,
2018-01-24 13:18:51 +00:00
data : { title : 'Budget' } ,
2018-01-17 17:36:28 +00:00
} ,
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-12-08 14:01:46 +00:00
data : { title : 'Story Trail' } ,
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 ,
2020-10-17 18:54:44 +01:00
data : { title : 'Submit Feedback' } ,
2019-07-04 15:34:42 +01:00
} ,
{
2019-07-04 16:36:06 +01:00
path : 'suppliers' ,
component : SuppliersComponent ,
data : { title : 'Suppliers' }
2019-07-09 14:22:19 +01:00
} ,
{
path : 'more-graphs-and-tables' ,
component : MoreStuffComponent ,
2019-08-06 16:51:44 +01:00
data : { title : 'Infographics' }
2017-08-15 17:41:27 +01:00
}
] ,
}
] ;
@NgModule ( {
imports : [ RouterModule . forChild ( routes ) ] ,
exports : [ RouterModule ]
} )
export class DashboardRoutingModule { }