From: Jason Boyer Date: Tue, 14 Dec 2021 19:15:13 +0000 (-0500) Subject: Wire up Simple Reporter into the Staff Client Interface X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=86647a63c796bf7ffe849ec9827e2e781d48a237;p=evergreen%2Fpines.git Wire up Simple Reporter into the Staff Client Interface Sponsored-by: C/W MARS Sponsored-by: Missouri Evergreen Consortium Signed-off-by: Jason Boyer Signed-off-by: rfrasur Signed-off-by: Mike Rylander --- 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 980449ede7..504198bda9 100644 --- a/Open-ILS/src/eg2/src/app/staff/nav.component.html +++ b/Open-ILS/src/eg2/src/app/staff/nav.component.html @@ -397,6 +397,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 cf46f42ec4..3ca6c62c1e 100644 --- a/Open-ILS/src/eg2/src/app/staff/splash.component.html +++ b/Open-ILS/src/eg2/src/app/staff/splash.component.html @@ -189,3 +189,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..3531d23d78 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,9 @@ -import {Component, OnInit, Renderer2} from '@angular/core'; +import {Component, OnInit, AfterViewInit, Directive, ElementRef, Renderer2} from '@angular/core'; +import {OrgService} from '@eg/core/org.service'; +import {AuthService} from '@eg/core/auth.service'; +import {PcrudService} from '@eg/core/pcrud.service'; +import {ToastService} from '@eg/share/toast/toast.service'; +import {StringComponent} from '@eg/share/string/string.component'; import {Router} from '@angular/router'; @Component({ @@ -7,17 +12,51 @@ 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 pcrud: PcrudService, + private auth: AuthService, + private org: OrgService, + private router: Router, + private toast: ToastService ) {} ngOnInit() { - // Focus catalog search form - this.renderer.selectRootElement('#catalog-search-input').focus(); + // munge the results so that we don't need to + // care if there are gaps in the page_col or col_pos + // sequences + filteredPortalEntries.forEach((col) => { + if (col !== undefined) { + const filtered = col.filter(x => x !== undefined); + this.portalEntries.push(filtered); + filtered.forEach((entry) => { + if (entry.entry_type() === 'header') { + this.portalHeaders[this.portalEntries.length - 1] = entry; + } + }); + } + }); + // supply an empty header entry in case a column was + // defined without a header + this.portalEntries.forEach((col, i) => { + if (this.portalHeaders.length <= i) { + this.portalHeaders[i] = undefined; + } + }); + } + ); + + 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 9cd7800714..0ede61216a 100644 --- a/Open-ILS/src/templates/staff/navbar.tt2 +++ b/Open-ILS/src/templates/staff/navbar.tt2 @@ -549,6 +549,13 @@ [% l('Reports') %] +
  • + + + [% l('Simple Reports') %] + +