This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
FoodLoop-Web/src/app/dashboard/dashboard.routing.ts

97 lines
2.9 KiB
TypeScript
Raw Normal View History

import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AuthGuard } from '../_guards/auth.guard';
import { OrgGuard } from '../_guards/org.guard';
import { CustomerGuard } from '../_guards/customer.guard';
import { DashboardComponent } from './dashboard.component';
import { DashboardCustomerComponent } from './dashboard-customer.component';
import { FullLayoutComponent } from '../layouts/full-layout.component';
import { AccountEditComponent } from './account-edit.component';
import { AddDataComponent } from './add-data.component';
import { FeedbackComponent } from './feedback.component';
import { TransactionLogComponent } from './transaction-log.component';
import { CategoryMonthComponent } from './category-month.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';
import { TrailMapComponent } from './trail-map.component';
// Using child path to allow for FullLayout theming
const routes: Routes = [
{ path: '', redirectTo: '/dashboard', pathMatch: 'full' },
{
path: '',
component: FullLayoutComponent,
canActivate: [AuthGuard],
children: [
{
path: 'dashboard',
component: DashboardComponent,
data: { title: 'Dashboard' },
canActivate: [OrgGuard],
},
{
path: 'dashboard-customer',
component: DashboardCustomerComponent,
data: { title: 'Customer Dashboard' },
canActivate: [CustomerGuard],
},
{
path: 'account-edit',
component: AccountEditComponent,
data: { title: 'Edit Account' },
},
{
path: 'add-data',
component: AddDataComponent,
data: { title: 'Add Transaction' },
},
{
path: 'leaderboard',
component: LeaderboardComponent,
data: { title: 'Leaderboards' },
canActivate: [CustomerGuard],
},
{
path: 'transaction-log',
component: TransactionLogComponent,
data: { title: 'Transaction Log' },
},
{
path: 'category-month',
component: CategoryMonthComponent,
data: { title: 'Month Category' },
},
2017-09-26 16:31:40 +00:00
{
path: 'map',
component: MapComponent,
data: { title: 'Purchase Map' },
2017-09-26 16:31:40 +00:00
},
{
path: 'story-trail',
component: TrailMapComponent,
data: { title: 'Story Trail' },
},
2017-09-19 16:22:19 +00:00
{
path: 'payroll-log',
component: PayrollLogComponent,
data: { title: 'Payroll Log' },
canActivate: [OrgGuard],
},
{
path: 'feedback',
component: FeedbackComponent,
data: { title: 'Give Feedback' },
}
],
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class DashboardRoutingModule {}