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