Wire up Simple Reporter into the Staff Client Interface
authorJason Boyer <JBoyer@equinoxOLI.org>
Tue, 14 Dec 2021 19:15:13 +0000 (14:15 -0500)
committerMike Rylander <mrylander@gmail.com>
Thu, 24 Mar 2022 19:10:16 +0000 (15:10 -0400)
Sponsored-by: C/W MARS
Sponsored-by: Missouri Evergreen Consortium

Signed-off-by: Jason Boyer <JBoyer@equinoxOLI.org>
Signed-off-by: rfrasur <rfrasur@library.in.gov>
Signed-off-by: Mike Rylander <mrylander@gmail.com>

Open-ILS/src/eg2/src/app/staff/nav.component.html
Open-ILS/src/eg2/src/app/staff/routing.module.ts
Open-ILS/src/eg2/src/app/staff/splash.component.html
Open-ILS/src/eg2/src/app/staff/splash.component.ts
Open-ILS/src/templates/staff/navbar.tt2

index 6440486..b7e0e08 100644 (file)
             <span class="material-icons" aria-hidden="true">insert_chart</span>
             <span i18n>Reports</span>
           </a>
+          <a class="dropdown-item" routerLink="/staff/reporter/simple">
+            <span class="material-icons" aria-hidden="true">insert_chart</span>
+            <span i18n>Simple Reports</span>
+          </a>
         </div>
       </div>
     </div>
index 21e7427..d7981d7 100644 (file)
@@ -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)
index 6f95510..d9e6b76 100644 (file)
@@ -85,3 +85,4 @@
 
 </div>
 
+<eg-string #noPermissionString i18n-text text="Sorry, you do not have permission to access this"></eg-string>
index ccf9522..7882450 100644 (file)
@@ -2,6 +2,8 @@ import {Component, OnInit, AfterViewInit, Directive, ElementRef, Renderer2} from
 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({
@@ -10,6 +12,7 @@ import {Router} from '@angular/router';
 
 export class StaffSplashComponent implements OnInit {
 
+    @ViewChild('noPermissionString', { static: true }) noPermissionString: StringComponent;
     catSearchQuery: string;
     portalEntries: any[][] = [];
     portalHeaders: any[] = [];
@@ -19,7 +22,8 @@ export class StaffSplashComponent implements OnInit {
         private pcrud: PcrudService,
         private auth: AuthService,
         private org: OrgService,
-        private router: Router
+        private router: Router,
+        private toast: ToastService
     ) {}
 
     ngOnInit() {
@@ -87,6 +91,14 @@ export class StaffSplashComponent implements OnInit {
                 });
             }
         );
+
+        if (this.router.url === '/staff/no_permission') {
+            this.noPermissionString.current()
+                .then(str => {
+                    this.toast.danger(str);
+                    this.router.navigate(['/staff']);
+                });
+        }
     }
 
     searchCatalog(): void {
index 3a66c3d..7c532eb 100644 (file)
               [% l('Reports') %]
             </a>
           </li>
+          <li>
+            <a href="/eg2/staff/reporter/simple" target="_self">
+              <span class="glyphicon glyphicon-object-align-bottom" 
+                aria-hidden="true"></span>
+              [% l('Simple Reports') %]
+            </a>
+          </li>
         </ul> <!-- admin dropdown -->
       </li>
     </ul> <!-- end left side entries -->