]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/eg2/src/app/staff/routing.module.ts
LP#1850547: Angular Acquistions Search
[Evergreen.git] / Open-ILS / src / eg2 / src / app / staff / routing.module.ts
1 import {NgModule} from '@angular/core';
2 import {RouterModule, Routes} from '@angular/router';
3 import {StaffResolver} from './resolver.service';
4 import {StaffComponent} from './staff.component';
5 import {StaffLoginComponent} from './login.component';
6 import {StaffSplashComponent} from './splash.component';
7 import {AboutComponent} from './about.component';
8
9 // Not using 'canActivate' because it's called before all resolvers,
10 // even the parent resolver, but the resolvers parse the IDL, load settings,
11 // etc.  Chicken, meet egg.
12
13 const routes: Routes = [{
14   path: '',
15   component: StaffComponent,
16   resolve: {staffResolver : StaffResolver},
17   children: [{
18     path: '',
19     redirectTo: 'splash',
20     pathMatch: 'full',
21   }, {
22     path: 'acq',
23     loadChildren: () =>
24       import('@eg/staff/acq/routing.module').then(m => m.AcqRoutingModule)
25   }, {
26     path: 'booking',
27     loadChildren: () =>
28       import('./booking/booking.module').then(m => m.BookingModule)
29   }, {
30     path: 'about',
31     component: AboutComponent
32   }, {
33     path: 'login',
34     component: StaffLoginComponent
35   }, {
36     path: 'splash',
37     component: StaffSplashComponent
38   }, {
39     path: 'circ',
40     loadChildren: () =>
41       import('./circ/routing.module').then(m => m.CircRoutingModule)
42   }, {
43     path: 'cat',
44     loadChildren: () =>
45       import('./cat/routing.module').then(m => m.CatRoutingModule)
46   }, {
47     path: 'catalog',
48     loadChildren: () =>
49       import('./catalog/catalog.module').then(m => m.CatalogModule)
50   }, {
51     path: 'sandbox',
52     loadChildren: () =>
53       import('./sandbox/sandbox.module').then(m => m.SandboxModule)
54   }, {
55     path: 'admin',
56     loadChildren: () =>
57       import('./admin/routing.module').then(m => m.AdminRoutingModule)
58   }]
59 }];
60
61 @NgModule({
62   imports: [RouterModule.forChild(routes)],
63   exports: [RouterModule],
64   providers: [StaffResolver]
65 })
66
67 export class StaffRoutingModule {}
68