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';
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.
14 const routes: Routes = [{
16 component: StaffComponent,
17 resolve: {staffResolver : StaffResolver},
25 import('@eg/staff/acq/routing.module').then(m => m.AcqRoutingModule)
29 import('./booking/booking.module').then(m => m.BookingModule)
32 component: AboutComponent
35 component: StaffLoginComponent
37 // Attempt to login to the staff client w/o the needed permissions
39 path: 'login-not-allowed',
40 component: StaffLoginNotAllowedComponent
42 // Attempt to fetch a specific page the user does not have
44 path: 'no_permission',
45 component: StaffSplashComponent
48 component: StaffSplashComponent
52 import('./circ/routing.module').then(m => m.CircRoutingModule)
56 import('./cat/cat.module').then(m => m.CatModule)
60 import('./catalog/catalog.module').then(m => m.CatalogModule)
64 import('@eg/staff/reporter/routing.module').then(m => m.ReporterRoutingModule)
68 import('./sandbox/sandbox.module').then(m => m.SandboxModule)
72 import('@eg/staff/hopeless/hopeless.module').then(m => m.HopelessModule)
76 import('./admin/routing.module').then(m => m.AdminRoutingModule)
81 imports: [RouterModule.forChild(routes)],
82 exports: [RouterModule],
83 providers: [StaffResolver]
86 export class StaffRoutingModule {}