LP1969641 Show useful lack of staff working location message
[evergreen-equinox.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 {StaffLoginNotAllowedComponent} from './login-not-allowed.component';
7 import {StaffSplashComponent} from './splash.component';
8 import {AboutComponent} from './about.component';
9
10 // Not using 'canActivate' because it's called before all resolvers,
11 // even the parent resolver, but the resolvers parse the IDL, load settings,
12 // etc.  Chicken, meet egg.
13
14 const routes: Routes = [{
15   path: '',
16   component: StaffComponent,
17   resolve: {staffResolver : StaffResolver},
18   children: [{
19     path: '',
20     redirectTo: 'splash',
21     pathMatch: 'full',
22   }, {
23     path: 'acq',
24     loadChildren: () =>
25       import('@eg/staff/acq/routing.module').then(m => m.AcqRoutingModule)
26   }, {
27     path: 'booking',
28     loadChildren: () =>
29       import('./booking/booking.module').then(m => m.BookingModule)
30   }, {
31     path: 'about',
32     component: AboutComponent
33   }, {
34     path: 'login',
35     component: StaffLoginComponent
36   }, {
37     // Attempt to login to the staff client w/o the needed permissions
38     // or work org unit.
39     path: 'login-not-allowed',
40     component: StaffLoginNotAllowedComponent
41   }, {
42     // Attempt to fetch a specific page the user does not have
43     // access to.
44     path: 'no_permission',
45     component: StaffSplashComponent
46   }, {
47     path: 'splash',
48     component: StaffSplashComponent
49   }, {
50     path: 'circ',
51     loadChildren: () =>
52       import('./circ/routing.module').then(m => m.CircRoutingModule)
53   }, {
54     path: 'cat',
55     loadChildren: () =>
56       import('./cat/cat.module').then(m => m.CatModule)
57   }, {
58     path: 'catalog',
59     loadChildren: () =>
60       import('./catalog/catalog.module').then(m => m.CatalogModule)
61   }, {
62     path: 'reporter',
63     loadChildren: () =>
64       import('@eg/staff/reporter/routing.module').then(m => m.ReporterRoutingModule)
65   }, {
66     path: 'sandbox',
67     loadChildren: () =>
68       import('./sandbox/sandbox.module').then(m => m.SandboxModule)
69   }, {
70     path: 'hopeless',
71     loadChildren: () =>
72       import('@eg/staff/hopeless/hopeless.module').then(m => m.HopelessModule)
73   }, {
74     path: 'admin',
75     loadChildren: () =>
76       import('./admin/routing.module').then(m => m.AdminRoutingModule)
77   }]
78 }];
79
80 @NgModule({
81   imports: [RouterModule.forChild(routes)],
82   exports: [RouterModule],
83   providers: [StaffResolver]
84 })
85
86 export class StaffRoutingModule {}
87