From d5816fe4e4113c0712e816155d1367c53836ee9b Mon Sep 17 00:00:00 2001 From: Jason Boyer Date: Tue, 14 Dec 2021 14:15:13 -0500 Subject: [PATCH] Wire up Simple Reporter into the Staff Client Interface Sponsored-by: C/W MARS Sponsored-by: Missouri Evergreen Consortium Signed-off-by: Jason Boyer --- Open-ILS/src/eg2/src/app/staff/nav.component.html | 4 ++++ Open-ILS/src/eg2/src/app/staff/routing.module.ts | 7 +++++++ Open-ILS/src/eg2/src/app/staff/splash.component.html | 1 + Open-ILS/src/eg2/src/app/staff/splash.component.ts | 16 ++++++++++++++-- Open-ILS/src/templates/staff/navbar.tt2 | 7 +++++++ 5 files changed, 33 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/nav.component.html b/Open-ILS/src/eg2/src/app/staff/nav.component.html index 6040ccf465..c8b3f0e166 100644 --- a/Open-ILS/src/eg2/src/app/staff/nav.component.html +++ b/Open-ILS/src/eg2/src/app/staff/nav.component.html @@ -399,6 +399,10 @@ Reports + + + Simple Reports + diff --git a/Open-ILS/src/eg2/src/app/staff/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/routing.module.ts index 21e7427537..d7981d7053 100644 --- a/Open-ILS/src/eg2/src/app/staff/routing.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/routing.module.ts @@ -33,6 +33,9 @@ const routes: Routes = [{ path: 'login', component: StaffLoginComponent }, { + path: 'no_permission', + component: StaffSplashComponent + }, { path: 'splash', component: StaffSplashComponent }, { @@ -48,6 +51,10 @@ const routes: Routes = [{ loadChildren: () => import('./catalog/catalog.module').then(m => m.CatalogModule) }, { + path: 'reporter', + loadChildren: () => + import('@eg/staff/reporter/routing.module').then(m => m.ReporterRoutingModule) + }, { path: 'sandbox', loadChildren: () => import('./sandbox/sandbox.module').then(m => m.SandboxModule) diff --git a/Open-ILS/src/eg2/src/app/staff/splash.component.html b/Open-ILS/src/eg2/src/app/staff/splash.component.html index 450a3e5916..9230ecd4e1 100644 --- a/Open-ILS/src/eg2/src/app/staff/splash.component.html +++ b/Open-ILS/src/eg2/src/app/staff/splash.component.html @@ -141,3 +141,4 @@ + diff --git a/Open-ILS/src/eg2/src/app/staff/splash.component.ts b/Open-ILS/src/eg2/src/app/staff/splash.component.ts index 6756b6519c..1a1b200697 100644 --- a/Open-ILS/src/eg2/src/app/staff/splash.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/splash.component.ts @@ -1,4 +1,6 @@ -import {Component, OnInit, Renderer2} from '@angular/core'; +import {Component, OnInit, Renderer2, ViewChild} from '@angular/core'; +import {ToastService} from '@eg/share/toast/toast.service'; +import {StringComponent} from '@eg/share/string/string.component'; import {Router} from '@angular/router'; @Component({ @@ -7,17 +9,27 @@ import {Router} from '@angular/router'; export class StaffSplashComponent implements OnInit { + @ViewChild('noPermissionString', { static: true }) noPermissionString: StringComponent; catSearchQuery: string; constructor( private renderer: Renderer2, - private router: Router + private router: Router, + private toast: ToastService ) {} ngOnInit() { // Focus catalog search form this.renderer.selectRootElement('#catalog-search-input').focus(); + + if (this.router.url === '/staff/no_permission') { + this.noPermissionString.current() + .then(str => { + this.toast.danger(str); + this.router.navigate(['/staff']); + }); + } } searchCatalog(): void { diff --git a/Open-ILS/src/templates/staff/navbar.tt2 b/Open-ILS/src/templates/staff/navbar.tt2 index bb0409a524..972e56292f 100644 --- a/Open-ILS/src/templates/staff/navbar.tt2 +++ b/Open-ILS/src/templates/staff/navbar.tt2 @@ -553,6 +553,13 @@ [% l('Reports') %] +
  • + + + [% l('Simple Reports') %] + +
  • -- 2.11.0