LP#626157 Ang2 consistent naming; less custom css
authorBill Erickson <berickxx@gmail.com>
Tue, 12 Dec 2017 16:26:24 +0000 (11:26 -0500)
committerBill Erickson <berickxx@gmail.com>
Tue, 12 Dec 2017 16:26:24 +0000 (11:26 -0500)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
66 files changed:
Open-ILS/webby-src/src/app/app.component.ts [new file with mode: 0644]
Open-ILS/webby-src/src/app/app.module.ts [new file with mode: 0644]
Open-ILS/webby-src/src/app/base.component.ts [deleted file]
Open-ILS/webby-src/src/app/base.module.ts [deleted file]
Open-ILS/webby-src/src/app/resolver.service.ts
Open-ILS/webby-src/src/app/routing.module.ts
Open-ILS/webby-src/src/app/share/unapi.ts
Open-ILS/webby-src/src/app/staff/admin/admin.module.ts [deleted file]
Open-ILS/webby-src/src/app/staff/admin/app.module.ts [new file with mode: 0644]
Open-ILS/webby-src/src/app/staff/admin/routing.module.ts
Open-ILS/webby-src/src/app/staff/admin/workstation/admin-ws.module.ts [deleted file]
Open-ILS/webby-src/src/app/staff/admin/workstation/app.module.ts [new file with mode: 0644]
Open-ILS/webby-src/src/app/staff/admin/workstation/routing.module.ts
Open-ILS/webby-src/src/app/staff/app.component.css [new file with mode: 0644]
Open-ILS/webby-src/src/app/staff/app.component.html [new file with mode: 0644]
Open-ILS/webby-src/src/app/staff/app.component.ts [new file with mode: 0644]
Open-ILS/webby-src/src/app/staff/app.module.ts [new file with mode: 0644]
Open-ILS/webby-src/src/app/staff/catalog/app.component.html [new file with mode: 0644]
Open-ILS/webby-src/src/app/staff/catalog/app.component.ts [new file with mode: 0644]
Open-ILS/webby-src/src/app/staff/catalog/app.module.ts [new file with mode: 0644]
Open-ILS/webby-src/src/app/staff/catalog/app.service.ts [new file with mode: 0644]
Open-ILS/webby-src/src/app/staff/catalog/catalog.component.html [deleted file]
Open-ILS/webby-src/src/app/staff/catalog/catalog.component.ts [deleted file]
Open-ILS/webby-src/src/app/staff/catalog/catalog.module.ts [deleted file]
Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.css [deleted file]
Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.html
Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.ts
Open-ILS/webby-src/src/app/staff/catalog/record/pagination.component.css [deleted file]
Open-ILS/webby-src/src/app/staff/catalog/record/pagination.component.ts
Open-ILS/webby-src/src/app/staff/catalog/record/record.component.css [deleted file]
Open-ILS/webby-src/src/app/staff/catalog/record/record.component.ts
Open-ILS/webby-src/src/app/staff/catalog/result/facets.component.css [deleted file]
Open-ILS/webby-src/src/app/staff/catalog/result/facets.component.ts
Open-ILS/webby-src/src/app/staff/catalog/result/pagination.component.ts
Open-ILS/webby-src/src/app/staff/catalog/result/record.component.css [deleted file]
Open-ILS/webby-src/src/app/staff/catalog/result/record.component.html
Open-ILS/webby-src/src/app/staff/catalog/result/record.component.ts
Open-ILS/webby-src/src/app/staff/catalog/result/results.component.css [deleted file]
Open-ILS/webby-src/src/app/staff/catalog/result/results.component.ts
Open-ILS/webby-src/src/app/staff/catalog/routing.module.ts
Open-ILS/webby-src/src/app/staff/catalog/search-form.component.ts
Open-ILS/webby-src/src/app/staff/catalog/staff-catalog.service.ts [deleted file]
Open-ILS/webby-src/src/app/staff/circ/app.module.ts [new file with mode: 0644]
Open-ILS/webby-src/src/app/staff/circ/circ.module.ts [deleted file]
Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/app.component.html [new file with mode: 0644]
Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/app.component.ts [new file with mode: 0644]
Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/app.module.ts [new file with mode: 0644]
Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/bcsearch-routing.module.ts [deleted file]
Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/bcsearch.component.html [deleted file]
Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/bcsearch.component.ts [deleted file]
Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/bcsearch.module.ts [deleted file]
Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/routing.module.ts [new file with mode: 0644]
Open-ILS/webby-src/src/app/staff/circ/routing.module.ts
Open-ILS/webby-src/src/app/staff/resolver.service.ts
Open-ILS/webby-src/src/app/staff/routing.module.ts
Open-ILS/webby-src/src/app/staff/share/bib-summary.component.css [deleted file]
Open-ILS/webby-src/src/app/staff/share/bib-summary.component.html
Open-ILS/webby-src/src/app/staff/share/bib-summary.component.ts
Open-ILS/webby-src/src/app/staff/splash.component.css [deleted file]
Open-ILS/webby-src/src/app/staff/splash.component.ts
Open-ILS/webby-src/src/app/staff/staff.component.css [deleted file]
Open-ILS/webby-src/src/app/staff/staff.component.html [deleted file]
Open-ILS/webby-src/src/app/staff/staff.component.ts [deleted file]
Open-ILS/webby-src/src/app/staff/staff.module.ts [deleted file]
Open-ILS/webby-src/src/main.ts
Open-ILS/webby-src/src/styles.css

diff --git a/Open-ILS/webby-src/src/app/app.component.ts b/Open-ILS/webby-src/src/app/app.component.ts
new file mode 100644 (file)
index 0000000..d049f7a
--- /dev/null
@@ -0,0 +1,11 @@
+import {Component} from '@angular/core';
+
+@Component({
+  selector: 'eg-root',
+  template: '<router-outlet></router-outlet>'
+})
+
+export class EgBaseComponent {
+}
+
+
diff --git a/Open-ILS/webby-src/src/app/app.module.ts b/Open-ILS/webby-src/src/app/app.module.ts
new file mode 100644 (file)
index 0000000..d9d06e3
--- /dev/null
@@ -0,0 +1,56 @@
+/**
+ * EgBaseModule is the shared starting point for all apps.
+ * It provides the root router and a simple welcome page for 
+ * users that end up here accidentally.
+ */
+import {BrowserModule} from '@angular/platform-browser';
+import {NgModule} from '@angular/core';
+import {Router} from '@angular/router'; // Debugging
+import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; // ng-bootstrap
+import {CookieModule} from 'ngx-cookie'; // import CookieMonster
+
+import {EgBaseComponent} from './app.component';
+import {EgBaseRoutingModule} from './routing.module';
+import {WelcomeComponent} from './welcome.component';
+
+// Import and 'provide' globally required services.
+import {EgEventService} from '@eg/core/event';
+import {EgStoreService} from '@eg/core/store';
+import {EgIdlService} from '@eg/core/idl';
+import {EgNetService} from '@eg/core/net';
+import {EgAuthService} from '@eg/core/auth';
+import {EgPcrudService} from '@eg/core/pcrud';
+import {EgOrgService} from '@eg/core/org';
+
+@NgModule({
+  declarations: [
+    EgBaseComponent,
+    WelcomeComponent
+  ],
+  imports: [
+    EgBaseRoutingModule,
+    BrowserModule,
+    NgbModule.forRoot(),
+    CookieModule.forRoot()
+  ],
+  providers: [
+    EgEventService,
+    EgStoreService,
+    EgIdlService,
+    EgNetService,
+    EgAuthService,
+    EgPcrudService,
+    EgOrgService
+  ],
+  exports: [],
+  bootstrap: [EgBaseComponent]
+})
+
+export class EgBaseModule { 
+    constructor(router: Router) {
+        /*
+        console.debug('Routes: ', 
+            JSON.stringify(router.config, undefined, 2));
+        */
+    }
+}
diff --git a/Open-ILS/webby-src/src/app/base.component.ts b/Open-ILS/webby-src/src/app/base.component.ts
deleted file mode 100644 (file)
index b72bedb..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-import { Component } from '@angular/core';
-
-@Component({
-  selector: 'eg-root',
-  template: '<router-outlet></router-outlet>'
-})
-
-export class EgBaseComponent {
-}
-
-
diff --git a/Open-ILS/webby-src/src/app/base.module.ts b/Open-ILS/webby-src/src/app/base.module.ts
deleted file mode 100644 (file)
index f462f84..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * EgBaseModule is the shared starting point for all apps.
- * It provides the root router and a simple welcome page for 
- * users that end up here accidentally.
- */
-import {BrowserModule} from '@angular/platform-browser';
-import {NgModule} from '@angular/core';
-import {Router} from '@angular/router'; // Debugging
-import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
-import {CookieModule} from 'ngx-cookie'; // import CookieMonster
-import {HttpClientModule} from '@angular/common/http';
-
-import {EgBaseComponent} from './base.component';
-import {EgBaseRoutingModule} from './routing.module';
-import {WelcomeComponent} from './welcome.component';
-
-// Import and 'provide' globally required services.
-import {EgEventService} from '@eg/core/event';
-import {EgStoreService} from '@eg/core/store';
-import {EgIdlService} from '@eg/core/idl';
-import {EgNetService} from '@eg/core/net';
-import {EgAuthService} from '@eg/core/auth';
-import {EgPcrudService} from '@eg/core/pcrud';
-import {EgOrgService} from '@eg/core/org';
-
-@NgModule({
-  declarations: [
-    EgBaseComponent,
-    WelcomeComponent
-  ],
-  imports: [
-    EgBaseRoutingModule,
-    BrowserModule,
-    NgbModule.forRoot(),
-    CookieModule.forRoot(),
-    HttpClientModule
-  ],
-  providers: [
-    EgEventService,
-    EgStoreService,
-    EgIdlService,
-    EgNetService,
-    EgAuthService,
-    EgPcrudService,
-    EgOrgService
-  ],
-  exports: [
-  ],
-  bootstrap: [EgBaseComponent]
-})
-
-export class EgBaseModule { 
-    constructor(router: Router) {
-        /*
-        console.debug('Routes: ', 
-            JSON.stringify(router.config, undefined, 2));
-        */
-    }
-}
index b699fce..7ffa74b 100644 (file)
@@ -19,10 +19,13 @@ export class EgBaseResolver implements Resolve<Promise<void>> {
 
         console.debug('EgBaseResolver:resolve()');
 
-        // Safe to assume some data is needed by all applications.
+        // Load data common to all applications.
+
         this.idl.parseIdl();
 
         return this.org.fetchOrgs();
-        // load other common stuff...
+        // Note that authentication happens at a deeper level, since 
+        // some applications (e.g. a public catalog) do not require
+        // up-front authentication to access.
     }
 }
index 8085267..7d7e70e 100644 (file)
@@ -14,7 +14,7 @@ const routes: Routes = [
   }, {
     path: 'staff', 
     resolve : {startup : EgBaseResolver},
-    loadChildren: './staff/staff.module#EgStaffModule'
+    loadChildren: './staff/app.module#EgStaffModule'
   }
 ];
 
index 3de344b..28c2589 100644 (file)
@@ -1,6 +1,5 @@
 import {Injectable, EventEmitter} from '@angular/core';
 import {EgOrgService} from '@eg/core/org';
-import {HttpClient} from '@angular/common/http';
 
 /*
 TODO: Add Display Fields to UNAPI
@@ -21,10 +20,7 @@ interface EgUnapiParams {
 @Injectable()
 export class EgUnapiService {
 
-    constructor(
-        private org: EgOrgService,
-        private http: HttpClient
-    ) {}
+    constructor(private org: EgOrgService) {}
 
     createUrl(params: EgUnapiParams): string {
         let depth = params.depth || 0;
diff --git a/Open-ILS/webby-src/src/app/staff/admin/admin.module.ts b/Open-ILS/webby-src/src/app/staff/admin/admin.module.ts
deleted file mode 100644 (file)
index f66ab52..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-import { CommonModule } from '@angular/common';
-import { NgModule }     from '@angular/core';
-import { EgAdminRoutingModule } from './routing.module';
-
-@NgModule({
-  declarations: [],
-  imports: [ EgAdminRoutingModule ]
-})
-
-export class EgAdminModule {}
diff --git a/Open-ILS/webby-src/src/app/staff/admin/app.module.ts b/Open-ILS/webby-src/src/app/staff/admin/app.module.ts
new file mode 100644 (file)
index 0000000..1061331
--- /dev/null
@@ -0,0 +1,10 @@
+import {CommonModule} from '@angular/common';
+import {NgModule}     from '@angular/core';
+import {EgAdminRoutingModule} from './routing.module';
+
+@NgModule({
+  declarations: [],
+  imports: [EgAdminRoutingModule]
+})
+
+export class EgAdminModule {}
index 39de569..5341889 100644 (file)
@@ -1,17 +1,17 @@
-import { NgModule } from '@angular/core';
-import { RouterModule, Routes } from '@angular/router';
+import {NgModule} from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
 
 const routes: Routes = [{ 
   path: '',
   children : [{
     path: 'workstation',
-    loadChildren: '@eg/staff/admin/workstation/admin-ws.module#EgAdminWsModule'
+    loadChildren: '@eg/staff/admin/workstation/app.module#EgAdminWsModule'
   }]
 }];
 
 @NgModule({
-  imports: [ RouterModule.forChild(routes) ],
-  exports: [ RouterModule ]
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule]
 })
 
 export class EgAdminRoutingModule {}
diff --git a/Open-ILS/webby-src/src/app/staff/admin/workstation/admin-ws.module.ts b/Open-ILS/webby-src/src/app/staff/admin/workstation/admin-ws.module.ts
deleted file mode 100644 (file)
index d6c5b0e..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-import {NgModule} from '@angular/core';
-import {CommonModule} from '@angular/common';
-import {EgStaffModule} from '../../staff.module';
-import {EgAdminWsRoutingModule} from './routing.module';
-import {EgWorkstationsComponent} from './workstations.component';
-
-@NgModule({
-  declarations: [
-    EgWorkstationsComponent
-  ],
-  imports: [
-    EgStaffModule,
-    EgAdminWsRoutingModule,
-    CommonModule
-  ]
-})
-
-export class EgAdminWsModule {}
-
diff --git a/Open-ILS/webby-src/src/app/staff/admin/workstation/app.module.ts b/Open-ILS/webby-src/src/app/staff/admin/workstation/app.module.ts
new file mode 100644 (file)
index 0000000..71015df
--- /dev/null
@@ -0,0 +1,19 @@
+import {NgModule} from '@angular/core';
+import {CommonModule} from '@angular/common';
+import {EgStaffModule} from '../../app.module';
+import {EgAdminWsRoutingModule} from './routing.module';
+import {EgWorkstationsComponent} from './workstations.component';
+
+@NgModule({
+  declarations: [
+    EgWorkstationsComponent
+  ],
+  imports: [
+    EgStaffModule,
+    EgAdminWsRoutingModule,
+    CommonModule
+  ]
+})
+
+export class EgAdminWsModule {}
+
index ebf7829..c65a5e7 100644 (file)
@@ -1,16 +1,17 @@
-import { NgModule }             from '@angular/core';
-import { RouterModule, Routes } from '@angular/router';
-import { EgWorkstationsComponent } from './workstations.component';
+import {NgModule}             from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
+import {EgWorkstationsComponent} from './workstations.component';
 
 const routes: Routes = [
+  // TODO: load each sub-app lazily
   { path: 'workstations',
     component: EgWorkstationsComponent
   }
 ];
 
 @NgModule({
-  imports: [ RouterModule.forChild(routes) ],
-  exports: [ RouterModule ]
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule]
 })
 
 export class EgAdminWsRoutingModule {}
diff --git a/Open-ILS/webby-src/src/app/staff/app.component.css b/Open-ILS/webby-src/src/app/staff/app.component.css
new file mode 100644 (file)
index 0000000..508d879
--- /dev/null
@@ -0,0 +1,8 @@
+#staff-content-container {
+  width: 95%;
+  margin-top:56px;
+  padding-right: 10px;
+  padding-left: 10px;
+  margin-right: auto;
+  margin-left: auto;
+}
diff --git a/Open-ILS/webby-src/src/app/staff/app.component.html b/Open-ILS/webby-src/src/app/staff/app.component.html
new file mode 100644 (file)
index 0000000..7bd463a
--- /dev/null
@@ -0,0 +1,8 @@
+<!-- top navigation bar -->
+<eg-staff-nav-bar></eg-staff-nav-bar>
+
+<div id='staff-content-container'>
+  <!-- page content -->
+  <router-outlet></router-outlet>
+</div>
+
diff --git a/Open-ILS/webby-src/src/app/staff/app.component.ts b/Open-ILS/webby-src/src/app/staff/app.component.ts
new file mode 100644 (file)
index 0000000..48b6a66
--- /dev/null
@@ -0,0 +1,73 @@
+import { Component, OnInit } from '@angular/core';
+import { Router, ActivatedRoute, NavigationEnd } from '@angular/router';
+import { EgAuthService, EgAuthWsState } from '@eg/core/auth';
+import { EgNetService } from '@eg/core/net';
+
+@Component({
+  templateUrl: 'app.component.html',
+  styleUrls: ['app.component.css']
+})
+
+export class EgStaffComponent implements OnInit {
+
+    readonly loginPath = '/staff/login';
+    readonly wsAdminPath = '/staff/admin/workstation/workstations';
+
+    constructor(
+        private router: Router,
+        private route: ActivatedRoute,
+        private net: EgNetService,
+        private auth: EgAuthService
+    ) {}
+
+    ngOnInit() {
+
+        console.debug('EgStaffComponent:ngOnInit()');
+
+        // Fires on all in-app router navigation, but not initial page load.
+        this.router.events.subscribe(routeEvent => {
+            if (routeEvent instanceof NavigationEnd) {
+                //console.debug(`EgStaffComponent routing to ${routeEvent.url}`);
+                this.basicAuthChecks(routeEvent);
+            }
+        });
+
+        // Redirect to the login page on any auth timeout events.
+        this.net.authExpired$.subscribe(uhOh => {
+            console.debug('Auth session has expired. Redirecting to login');
+            this.auth.redirectUrl = this.router.url;
+            this.router.navigate(['/staff/login']);
+        });
+
+        this.route.data.subscribe((data: {staffResolver : any}) => {
+            console.debug('EgStaff ngOnInit complete');
+     
+      });
+    }
+
+    /**
+     * Verifying auth token on every route is overkill, since an expired
+     * token will make itself known with the first API call, but we do
+     * want to prevent navigation from the login or workstation admin
+     * page, since these can be accessed without a valid authtoken or
+     * workstation, respectively, once the initial route resolvers
+     * have done their jobs.
+     */
+    basicAuthChecks(routeEvent: NavigationEnd): void {
+
+        // Access to login page is always granted
+        if (routeEvent.url == this.loginPath) return;
+
+        if (!this.auth.token()) 
+            this.router.navigate([this.loginPath]);
+
+        // Access to workstation admin page is granted regardless
+        // of workstation validity.
+        if (routeEvent.url == this.wsAdminPath) return;
+
+        if (this.auth.workstationState != EgAuthWsState.VALID)
+            this.router.navigate([this.wsAdminPath]);
+    }
+}
+
+
diff --git a/Open-ILS/webby-src/src/app/staff/app.module.ts b/Open-ILS/webby-src/src/app/staff/app.module.ts
new file mode 100644 (file)
index 0000000..7b53d7f
--- /dev/null
@@ -0,0 +1,37 @@
+import {CommonModule} from '@angular/common';
+import {NgModule} from '@angular/core';
+import {FormsModule} from '@angular/forms';
+import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
+import {EgBaseModule} from '@eg/app.module';
+
+import {EgStaffComponent} from './app.component';
+import {EgStaffRoutingModule} from './routing.module';
+import {EgStaffNavComponent} from './nav.component';
+import {EgStaffLoginComponent} from './login.component';
+import {EgStaffSplashComponent} from './splash.component';
+import {EgOrgSelectComponent} from '@eg/share/org-select.component';
+
+@NgModule({
+  declarations: [
+    EgStaffComponent,
+    EgStaffNavComponent,
+    EgStaffSplashComponent,
+    EgStaffLoginComponent,
+    EgOrgSelectComponent
+  ],
+  imports: [
+    EgStaffRoutingModule,
+    FormsModule,
+    NgbModule
+  ],
+  exports: [
+    // Components available to all staff/sub modules
+    EgOrgSelectComponent,
+    FormsModule,
+    NgbModule
+  ]
+})
+
+export class EgStaffModule { 
+
+}
diff --git a/Open-ILS/webby-src/src/app/staff/catalog/app.component.html b/Open-ILS/webby-src/src/app/staff/catalog/app.component.html
new file mode 100644 (file)
index 0000000..1596454
--- /dev/null
@@ -0,0 +1,6 @@
+<!-- search form sits atop every catalog page -->
+<eg-catalog-search-form></eg-catalog-search-form>
+
+<!-- search results, record details, etc. -->
+<router-outlet></router-outlet>
+
diff --git a/Open-ILS/webby-src/src/app/staff/catalog/app.component.ts b/Open-ILS/webby-src/src/app/staff/catalog/app.component.ts
new file mode 100644 (file)
index 0000000..a5ca68f
--- /dev/null
@@ -0,0 +1,17 @@
+import {Component, OnInit} from '@angular/core';
+import {StaffCatalogService} from './app.service';
+
+@Component({
+  templateUrl: 'app.component.html'
+})
+export class EgCatalogComponent implements OnInit {
+
+    constructor(private staffCat: StaffCatalogService) {}
+
+    ngOnInit() {
+        // Create the search context that will be used by all 
+        // of my child components.
+        this.staffCat.createContext();
+    }
+}
+
diff --git a/Open-ILS/webby-src/src/app/staff/catalog/app.module.ts b/Open-ILS/webby-src/src/app/staff/catalog/app.module.ts
new file mode 100644 (file)
index 0000000..b76cc0b
--- /dev/null
@@ -0,0 +1,48 @@
+import {CommonModule} from '@angular/common';
+import {NgModule} from '@angular/core';
+import {EgStaffModule} from '../app.module';
+import {EgUnapiService} from '@eg/share/unapi';
+import {EgCatalogRoutingModule} from './routing.module';
+import {EgCatalogService} from '@eg/share/catalog/catalog.service';
+import {EgCatalogUrlService} from '@eg/share/catalog/catalog-url.service';
+import {EgCatalogComponent} from './app.component';
+import {SearchFormComponent} from './search-form.component';
+import {ResultsComponent} from './result/results.component';
+import {RecordComponent} from './record/record.component';
+import {CopiesComponent} from './record/copies.component';
+import {EgBibSummaryComponent} from '../share/bib-summary.component';
+import {ResultPaginationComponent} from './result/pagination.component';
+import {ResultFacetsComponent} from './result/facets.component';
+import {ResultRecordComponent} from './result/record.component';
+import {StaffCatalogService} from './app.service';
+import {RecordPaginationComponent} from './record/pagination.component';
+
+@NgModule({
+  declarations: [
+    EgCatalogComponent,
+    ResultsComponent,
+    RecordComponent,
+    CopiesComponent,
+    EgBibSummaryComponent,
+    SearchFormComponent,
+    ResultRecordComponent,
+    ResultFacetsComponent,
+    ResultPaginationComponent,
+    RecordPaginationComponent
+  ],
+  imports: [
+    EgStaffModule,
+    CommonModule,
+    EgCatalogRoutingModule
+  ],
+  providers: [
+    EgUnapiService,
+    EgCatalogService,
+    EgCatalogUrlService,
+    StaffCatalogService
+  ]
+})
+
+export class EgCatalogModule { 
+
+}
diff --git a/Open-ILS/webby-src/src/app/staff/catalog/app.service.ts b/Open-ILS/webby-src/src/app/staff/catalog/app.service.ts
new file mode 100644 (file)
index 0000000..625206e
--- /dev/null
@@ -0,0 +1,69 @@
+import {Injectable} from '@angular/core';
+import {Router, ActivatedRoute} from '@angular/router';
+import {EgOrgService} from '@eg/core/org';
+import {EgCatalogService} from '@eg/share/catalog/catalog.service';
+import {EgCatalogUrlService} from '@eg/share/catalog/catalog-url.service';
+import {CatalogSearchContext} from '@eg/share/catalog/search-context';
+
+/**
+ * Shared bits needed by the staff version of the catalog.
+ */
+
+@Injectable()
+export class StaffCatalogService {
+
+    searchContext: CatalogSearchContext;
+    routeIndex: number = 0;
+
+    constructor(
+        private router: Router,
+        private route: ActivatedRoute,
+        private org: EgOrgService,
+        private cat: EgCatalogService,
+        private catUrl: EgCatalogUrlService
+    ) { }
+
+    createContext(): void {
+        // Initialize the search context from the load-time URL params.
+        // Do this here so the search form and other context data are
+        // applied on every page, not just the search results page.  The
+        // search results pages will handle running the actual search.
+        this.searchContext = 
+            this.catUrl.fromUrlParams(this.route.snapshot.queryParamMap);
+
+        this.searchContext.org = this.org;
+        this.searchContext.isStaff = true;
+
+        // TODO: UI / settings
+        if (!this.searchContext.pager.limit)
+          this.searchContext.pager.limit = 20;
+    }
+
+    /**
+     * Redirect to the search results page while propagating the current
+     * search paramters into the URL.  Let the search results component
+     * execute the actual search.
+     */
+    search(): void {
+        let params = this.catUrl.toUrlParams(this.searchContext);
+
+        // Avoid redirect on empty-query searches
+        if (params.query[0] == '') return;
+        
+        // Force a new search every time this method is called, even if
+        // it's the same as the active search.  Since router navigation
+        // exits early when the route + params is identical, add a
+        // random token to the route params to force a full navigation.
+        // This also resolves a problem where only removing secondary+
+        // versions of a query param fail to cause a route navigation.
+        // (E.g. going from two query= params to one).  Investigation
+        // pending.
+        params.ridx=''+this.routeIndex++;
+
+        this.router.navigate(
+          ['/staff/catalog/search'], {queryParams: params});
+    }
+
+}
+
+
diff --git a/Open-ILS/webby-src/src/app/staff/catalog/catalog.component.html b/Open-ILS/webby-src/src/app/staff/catalog/catalog.component.html
deleted file mode 100644 (file)
index 1596454..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<!-- search form sits atop every catalog page -->
-<eg-catalog-search-form></eg-catalog-search-form>
-
-<!-- search results, record details, etc. -->
-<router-outlet></router-outlet>
-
diff --git a/Open-ILS/webby-src/src/app/staff/catalog/catalog.component.ts b/Open-ILS/webby-src/src/app/staff/catalog/catalog.component.ts
deleted file mode 100644 (file)
index 47ec5e7..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-import {Component, OnInit} from '@angular/core';
-import {StaffCatalogService} from './staff-catalog.service';
-
-@Component({
-  templateUrl: 'catalog.component.html'
-})
-export class EgCatalogComponent implements OnInit {
-
-    constructor(private staffCat: StaffCatalogService) {}
-
-    ngOnInit() {
-        // Create the search context that will be used by all 
-        // of my child components.
-        this.staffCat.createContext();
-    }
-}
-
diff --git a/Open-ILS/webby-src/src/app/staff/catalog/catalog.module.ts b/Open-ILS/webby-src/src/app/staff/catalog/catalog.module.ts
deleted file mode 100644 (file)
index e1833d0..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-import {CommonModule} from '@angular/common';
-import {NgModule} from '@angular/core';
-import {EgStaffModule} from '../staff.module';
-import {EgUnapiService} from '@eg/share/unapi';
-import {EgCatalogRoutingModule} from './routing.module';
-import {EgCatalogService} from '@eg/share/catalog/catalog.service';
-import {EgCatalogUrlService} from '@eg/share/catalog/catalog-url.service';
-import {EgCatalogComponent} from './catalog.component';
-import {SearchFormComponent} from './search-form.component';
-import {ResultsComponent} from './result/results.component';
-import {RecordComponent} from './record/record.component';
-import {CopiesComponent} from './record/copies.component';
-import {EgBibSummaryComponent} from '../share/bib-summary.component';
-import {ResultPaginationComponent} from './result/pagination.component';
-import {ResultFacetsComponent} from './result/facets.component';
-import {ResultRecordComponent} from './result/record.component';
-import {StaffCatalogService} from './staff-catalog.service';
-import {RecordPaginationComponent} from './record/pagination.component';
-
-@NgModule({
-  declarations: [
-    EgCatalogComponent,
-    ResultsComponent,
-    RecordComponent,
-    CopiesComponent,
-    EgBibSummaryComponent,
-    SearchFormComponent,
-    ResultRecordComponent,
-    ResultFacetsComponent,
-    ResultPaginationComponent,
-    RecordPaginationComponent
-  ],
-  imports: [
-    EgStaffModule,
-    CommonModule,
-    EgCatalogRoutingModule
-  ],
-  providers: [
-    EgUnapiService,
-    EgCatalogService,
-    EgCatalogUrlService,
-    StaffCatalogService
-  ]
-})
-
-export class EgCatalogModule { 
-
-}
diff --git a/Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.css b/Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.css
deleted file mode 100644 (file)
index 6c08652..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-
-.d-flex > div:not(first-child) {
-  padding-left: 3px;
-  /*
-  border-left: 1px solid rgba(0,0,0,0.2);
-  */
-}
-/*
-.eg-copies .pagination {margin: 0px 0px 0px 0px}
-*/
index 79984ff..84e9d8e 100644 (file)
@@ -1,12 +1,3 @@
-<style>
-  /* common card-tight class, see also bib-summary.css */
-.eg-copies .card-body {
-  padding: .25rem;
-}
-.eg-copies .list-group-item {
-  padding: .25rem;
-}
-</style>
 <div class='eg-copies w-100'>
   <ul class="pagination mb-1">
     <li class="page-item" [ngClass]="{disabled : pager.offset == 0}">
       </a>
     </li>
   </ul>
-  <div class='card w-100'>
+  <div class='card tight-card w-100'>
     <div class="card-header font-weight-bold d-flex bg-info">
       <div class="flex-1" i18n>Location</div>
-      <div class="flex-1" i18n>Call Number / Copy Notes</div>
-      <div class="flex-1" i18n>Barcode</div>
-      <div class="flex-1" i18n>Shelving Location</div>
-      <div class="flex-1" i18n>Circulation Modifier</div>
-      <div class="flex-1" i18n>Age Hold Protection</div>
-      <div class="flex-1" i18n>Active/Create Date</div>
-      <div class="flex-1" i18n>Holdable?</div>
-      <div class="flex-1" i18n>Status</div>
-      <div class="flex-1" i18n>Due Date</div>
+      <div class="flex-1 pl-1" i18n>Call Number / Copy Notes</div>
+      <div class="flex-1 pl-1" i18n>Barcode</div>
+      <div class="flex-1 pl-1" i18n>Shelving Location</div>
+      <div class="flex-1 pl-1" i18n>Circulation Modifier</div>
+      <div class="flex-1 pl-1" i18n>Age Hold Protection</div>
+      <div class="flex-1 pl-1" i18n>Active/Create Date</div>
+      <div class="flex-1 pl-1" i18n>Holdable?</div>
+      <div class="flex-1 pl-1" i18n>Status</div>
+      <div class="flex-1 pl-1" i18n>Due Date</div>
     </div>
     <div class="card-body">
       <ul class="list-group list-group-flush" *ngIf="copies && copies.length">
           [ngClass]="{'list-group-item-info': (idx % 2) == 1}">
           <div class="d-flex">
             <div class="flex-1" i18n>{{orgName(copy.circ_lib)}}</div>
-            <div class="flex-1" i18n>
+            <div class="flex-1 pl-1" i18n>
               {{copy.call_number_prefix_label}}
               {{copy.call_number_label}}
               {{copy.call_number_suffix_label}}
             </div>
-            <div class="flex-1" i18n>
+            <div class="flex-1 pl-1" i18n>
               {{copy.barcode}}
               <a class="pl-1" href="/eg/staff/cat/item/{{copy.id}}" i18n>View</a>
               | 
               <a class="pl-1" href="/eg/staff/cat/item/{{copy.id}}/edit" i18n>Edit</a>
             </div>
-            <div class="flex-1" i18n>{{copy.copy_location}}</div>
-            <div class="flex-1" i18n>{{copy.circ_modifier || ''}}</div>
-            <div class="flex-1" i18n>{{copy.age_protect}}</div>
-            <div class="flex-1" i18n>
+            <div class="flex-1 pl-1" i18n>{{copy.copy_location}}</div>
+            <div class="flex-1 pl-1" i18n>{{copy.circ_modifier || ''}}</div>
+            <div class="flex-1 pl-1" i18n>{{copy.age_protect}}</div>
+            <div class="flex-1 pl-1" i18n>
               {{copy.active_date || copy.create_date | date:'shortDate'}}
             </div>
-            <div class="flex-1">
+            <div class="flex-1 pl-1">
               <span *ngIf="holdable(copy)" i18n>Yes</span>
               <span *ngIf="!holdable(copy)" i18n>No</span>
             </div>
-            <div class="flex-1" i18n>{{copy.copy_status}}</div>
-            <div class="flex-1" i18n>{{copy.due_date | date:'shortDate'}}</div>
+            <div class="flex-1 pl-1" i18n>{{copy.copy_status}}</div>
+            <div class="flex-1 pl-1" i18n>{{copy.due_date | date:'shortDate'}}</div>
           </div>
         </li>
       </ul>
index 94ad3c7..f234eba 100644 (file)
@@ -1,12 +1,11 @@
 import {Component, OnInit, Input} from '@angular/core';
 import {EgNetService} from '@eg/core/net';
-import {StaffCatalogService} from '../staff-catalog.service';
+import {StaffCatalogService} from '../app.service';
 import {Pager} from '@eg/share/util/pager';
 import {EgOrgService} from '@eg/core/org';
 
 @Component({
   selector: 'eg-catalog-copies',
-  styleUrls: ['copies.component.css'],
   templateUrl: 'copies.component.html'
 })
 export class CopiesComponent implements OnInit {
diff --git a/Open-ILS/webby-src/src/app/staff/catalog/record/pagination.component.css b/Open-ILS/webby-src/src/app/staff/catalog/record/pagination.component.css
deleted file mode 100644 (file)
index 8b6be46..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-/* Bootstrap default is 20px */
-/*
-.pagination {margin: 0px 0px 0px 0px}
-*/
-
-
index 4abdef1..a7535f6 100644 (file)
@@ -3,13 +3,12 @@ import {Router} from '@angular/router';
 import {EgCatalogService} from '@eg/share/catalog/catalog.service';
 import {CatalogSearchContext} from '@eg/share/catalog/search-context';
 import {EgCatalogUrlService} from '@eg/share/catalog/catalog-url.service';
-import {StaffCatalogService} from '../staff-catalog.service';
+import {StaffCatalogService} from '../app.service';
 import {Pager} from '@eg/share/util/pager';
 
 
 @Component({
   selector: 'eg-catalog-record-pagination',
-  styleUrls: ['pagination.component.css'],
   templateUrl: 'pagination.component.html'
 })
 export class RecordPaginationComponent implements OnInit {
diff --git a/Open-ILS/webby-src/src/app/staff/catalog/record/record.component.css b/Open-ILS/webby-src/src/app/staff/catalog/record/record.component.css
deleted file mode 100644 (file)
index e69de29..0000000
index 37ded3b..78552eb 100644 (file)
@@ -5,12 +5,11 @@ import {EgIdlObject} from '@eg/core/idl';
 import {CatalogSearchContext, CatalogSearchState} 
   from '@eg/share/catalog/search-context';
 import {EgCatalogService} from '@eg/share/catalog/catalog.service';
-import {StaffCatalogService} from '../staff-catalog.service';
+import {StaffCatalogService} from '../app.service';
 import {EgBibSummaryComponent} from '../../share/bib-summary.component';
 
 @Component({
   selector: 'eg-catalog-record',
-  styleUrls: ['record.component.css'],
   templateUrl: 'record.component.html'
 })
 export class RecordComponent implements OnInit {
diff --git a/Open-ILS/webby-src/src/app/staff/catalog/result/facets.component.css b/Open-ILS/webby-src/src/app/staff/catalog/result/facets.component.css
deleted file mode 100644 (file)
index e69de29..0000000
index d6bc2cf..8101ced 100644 (file)
@@ -1,7 +1,7 @@
 import {Component, OnInit, Input} from '@angular/core';
 import {EgCatalogService} from '@eg/share/catalog/catalog.service';
 import {CatalogSearchContext, FacetFilter} from '@eg/share/catalog/search-context';
-import {StaffCatalogService} from '../staff-catalog.service';
+import {StaffCatalogService} from '../app.service';
 
 export const FACET_CONFIG = {
     display: [
@@ -16,7 +16,6 @@ export const FACET_CONFIG = {
 
 @Component({
   selector: 'eg-catalog-result-facets',
-  styleUrls: ['facets.component.css'],
   templateUrl: 'facets.component.html'
 })
 export class ResultFacetsComponent implements OnInit {
index 917491d..8dbb4d8 100644 (file)
@@ -1,7 +1,7 @@
 import {Component, OnInit, Input} from '@angular/core';
 import {EgCatalogService} from '@eg/share/catalog/catalog.service';
 import {CatalogSearchContext} from '@eg/share/catalog/search-context';
-import {StaffCatalogService} from '../staff-catalog.service';
+import {StaffCatalogService} from '../app.service';
 
 @Component({
   selector: 'eg-catalog-result-pagination',
diff --git a/Open-ILS/webby-src/src/app/staff/catalog/result/record.component.css b/Open-ILS/webby-src/src/app/staff/catalog/result/record.component.css
deleted file mode 100644 (file)
index ff8aab3..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-
-.cat-record-row {
-  margin-bottom:10px;
-  padding:9px;
-  /*
-  background-color: #f5f5f5;
-  border: 1px solid #e3e3e3;
-  */
-}
-
-.weak-text-1 {
-  font-size: 85%;
-}
-
-
-.with-material-icon {
-    display: inline-flex;
-    vertical-align: middle;
-    align-items: center;
-}
-
-.card-body {
-  padding: 7px;
-}
-
index a9268bc..c9a0cd9 100644 (file)
   egDateFilter's
 -->
 
-<div class="cat-record-row col-12 card card-body bg-light">
-  <div class="row">
-    <div class="col-1">
-      <!-- TODO router links -->
-      <a href="./cat/catalog/record/{{bibSummary.id}}">
-        <img style="height:80px"
-          src="/opac/extras/ac/jacket/small/r/{{bibSummary.id}}"/>
-      </a>
-    </div>
-    <div class="col-5">
-      <div class="row">
-        <div class="col-12 font-weight-bold">
-          <!-- nbsp allows the column to take shape when no value exists -->
-          <span class="font-weight-light font-italic">
-            #{{index + 1 + searchContext.pager.offset}}
-          </span>
-          <a href="javascript:void(0)"
-            (click)="navigatToRecord(bibSummary.id)">
-            {{bibSummary.title || '&nbsp;'}}
-          </a>
-        </div>
+<div class="col-12 card tight-card mb-2 bg-light">
+  <div class="card-body">
+    <div class="row">
+      <div class="col-1">
+        <!-- TODO router links -->
+        <a href="./cat/catalog/record/{{bibSummary.id}}">
+          <img style="height:80px"
+            src="/opac/extras/ac/jacket/small/r/{{bibSummary.id}}"/>
+        </a>
       </div>
-      <div class="row pt-2">
-        <div class="col-12">
-          <!-- nbsp allows the column to take shape when no value exists -->
-          <a href="javascript:void(0)"
-            (click)="searchAuthor(bibSummary)">
-            {{bibSummary.author || '&nbsp;'}}
-          </a>
+      <div class="col-5">
+        <div class="row">
+          <div class="col-12 font-weight-bold">
+            <!-- nbsp allows the column to take shape when no value exists -->
+            <span class="font-weight-light font-italic">
+              #{{index + 1 + searchContext.pager.offset}}
+            </span>
+            <a href="javascript:void(0)"
+              (click)="navigatToRecord(bibSummary.id)">
+              {{bibSummary.title || '&nbsp;'}}
+            </a>
+          </div>
         </div>
-      </div>
-      <div class="row pt-2">
-        <div class="col-12">
-          <span>
-            <img class="pad-right-min"
-              src="/images/format_icons/icon_format/{{bibSummary.ccvms.icon_format.code}}.png"/>
-            <span>{{bibSummary.ccvms.icon_format.label}}</span>
-          </span>
-          <span style='pl-2'>{{bibSummary.edition}}</span>
-          <span style='pl-2'>{{bibSummary.pubdate}}</span>
+        <div class="row pt-2">
+          <div class="col-12">
+            <!-- nbsp allows the column to take shape when no value exists -->
+            <a href="javascript:void(0)"
+              (click)="searchAuthor(bibSummary)">
+              {{bibSummary.author || '&nbsp;'}}
+            </a>
+          </div>
         </div>
-      </div>
-    </div>
-    <div class="col-2">
-      <div class="row" [ngClass]="{'pt-2':copyIndex > 0}" 
-        *ngFor="let copyCount of bibSummary.copyCounts; let copyIdx = index">
-        <div class="w-100" *ngIf="copyCount.type == 'staff'">
-          <div class="float-left text-left w-50">
-            <span class="pr-1">
-            {{copyCount.available}} / {{copyCount.count}} items
+        <div class="row pt-2">
+          <div class="col-12">
+            <span>
+              <img class="pad-right-min"
+                src="/images/format_icons/icon_format/{{bibSummary.ccvms.icon_format.code}}.png"/>
+              <span>{{bibSummary.ccvms.icon_format.label}}</span>
             </span>
-          </div>
-          <div class="float-left w-50">
-            @ {{orgName(copyCount.org_unit)}}
+            <span style='pl-2'>{{bibSummary.edition}}</span>
+            <span style='pl-2'>{{bibSummary.pubdate}}</span>
           </div>
         </div>
       </div>
-    </div>
-    <div class="col-1">
-      <div class="row">
-        <div class="w-100">
-          TCN: {{bibSummary.tcn_value}}
+      <div class="col-2">
+        <div class="row" [ngClass]="{'pt-2':copyIndex > 0}" 
+          *ngFor="let copyCount of bibSummary.copyCounts; let copyIdx = index">
+          <div class="w-100" *ngIf="copyCount.type == 'staff'">
+            <div class="float-left text-left w-50">
+              <span class="pr-1">
+              {{copyCount.available}} / {{copyCount.count}} items
+              </span>
+            </div>
+            <div class="float-left w-50">
+              @ {{orgName(copyCount.org_unit)}}
+            </div>
+          </div>
         </div>
       </div>
-      <div class="row">
-        <div class="w-100">
-          Holds: {{bibSummary.holdCount}}
+      <div class="col-1">
+        <div class="row">
+          <div class="w-100">
+            TCN: {{bibSummary.tcn_value}}
+          </div>
         </div>
-      </div>
-    </div>
-    <div class="col-3">
-      <div class="row">
-        <div class="col-12">
-          <div class="float-right weak-text-1">
-            Created {{bibSummary.create_date | date:'shortDate'}} by
-            <!-- creator if fleshed after the initial data set is loaded -->
-            <a *ngIf="bibSummary.creator.usrname" target="_self" 
-              href="./staff/circ/patron/{{bibSummary.creator.id()}}/checkout">
-                {{bibSummary.creator.usrname()}}
-            </a>
-            <!-- add a spacer pending data to reduce page shuffle -->
-            <span *ngIf="!bibSummary.creator.usrname"> ... </span>
+        <div class="row">
+          <div class="w-100">
+            Holds: {{bibSummary.holdCount}}
           </div>
         </div>
       </div>
-      <div class="row pt-2">
-        <div class="col-12">
-          <div class="float-right weak-text-1">
-            Edited {{bibSummary.edit_date | date:'shortDate'}} by
-            <a *ngIf="bibSummary.editor.usrname" target="_self" 
-              href="./staff/circ/patron/{{bibSummary.editor.id()}}/checkout">
-                {{bibSummary.editor.usrname()}}
-            </a>
-            <span *ngIf="!bibSummary.editor.usrname"> ... </span>
+      <div class="col-3">
+        <div class="row">
+          <div class="col-12">
+            <div class="float-right small-text-1">
+              Created {{bibSummary.create_date | date:'shortDate'}} by
+              <!-- creator if fleshed after the initial data set is loaded -->
+              <a *ngIf="bibSummary.creator.usrname" target="_self" 
+                href="./staff/circ/patron/{{bibSummary.creator.id()}}/checkout">
+                  {{bibSummary.creator.usrname()}}
+              </a>
+              <!-- add a spacer pending data to reduce page shuffle -->
+              <span *ngIf="!bibSummary.creator.usrname"> ... </span>
+            </div>
           </div>
         </div>
-      </div>
-      <div class="row pt-2">
-        <div class="col-12">
-          <div class="float-right">
-            <span>
-              <button (click)="placeHold()"
-                class="btn btn-sm btn-success with-material-icon weak-text-1">
-                <span class="material-icons">check</span>
-                <span i18n>Place Hold</span>
-              </button>
-            </span>
-            <span>
-              <button (click)="addToList()" 
-                class="btn btn-sm btn-info with-material-icon weak-text-1">
-                <span class="material-icons">playlist_add_check</span>
-                <span i18n>Add to List</span>
-              </button>
-            </span>
+        <div class="row pt-2">
+          <div class="col-12">
+            <div class="float-right small-text-1">
+              Edited {{bibSummary.edit_date | date:'shortDate'}} by
+              <a *ngIf="bibSummary.editor.usrname" target="_self" 
+                href="./staff/circ/patron/{{bibSummary.editor.id()}}/checkout">
+                  {{bibSummary.editor.usrname()}}
+              </a>
+              <span *ngIf="!bibSummary.editor.usrname"> ... </span>
+            </div>
           </div>
         </div>
-      </div>
-    </div><!-- col -->
-  </div><!-- row -->
-</div><!-- col -->
+        <div class="row pt-2">
+          <div class="col-12">
+            <div class="float-right">
+              <span>
+                <button (click)="placeHold()"
+                  class="btn btn-sm btn-success label-with-material-icon small-text-1">
+                  <span class="material-icons">check</span>
+                  <span i18n>Place Hold</span>
+                </button>
+              </span>
+              <span>
+                <button (click)="addToList()" 
+                  class="btn btn-sm btn-info label-with-material-icon small-text-1">
+                  <span class="material-icons">playlist_add_check</span>
+                  <span i18n>Add to List</span>
+                </button>
+              </span>
+            </div>
+          </div>
+        </div>
+      </div><!-- col -->
+    </div><!-- row -->
+  </div><!-- card-body -->
+</div><!-- card -->
 
index b7fc776..beee4cf 100644 (file)
@@ -5,11 +5,10 @@ import {EgCatalogService} from '@eg/share/catalog/catalog.service';
 import {CatalogSearchContext} from '@eg/share/catalog/search-context';
 import {EgNetService} from '@eg/core/net';
 import {EgCatalogUrlService} from '@eg/share/catalog/catalog-url.service';
-import {StaffCatalogService} from '../staff-catalog.service';
+import {StaffCatalogService} from '../app.service';
 
 @Component({
   selector: 'eg-catalog-result-record',
-  styleUrls: ['record.component.css'],
   templateUrl: 'record.component.html'
 })
 export class ResultRecordComponent implements OnInit {
diff --git a/Open-ILS/webby-src/src/app/staff/catalog/result/results.component.css b/Open-ILS/webby-src/src/app/staff/catalog/result/results.component.css
deleted file mode 100644 (file)
index e69de29..0000000
index 6313656..b87a2cd 100644 (file)
@@ -7,12 +7,11 @@ import {EgCatalogUrlService} from '@eg/share/catalog/catalog-url.service';
 import {CatalogSearchContext, CatalogSearchState}
   from '@eg/share/catalog/search-context';
 import {EgPcrudService} from '@eg/core/pcrud';
-import {StaffCatalogService} from '../staff-catalog.service';
+import {StaffCatalogService} from '../app.service';
 import {EgIdlObject} from '@eg/core/idl';
 
 @Component({
   selector: 'eg-catalog-results',
-  styleUrls: ['results.component.css'],
   templateUrl: 'results.component.html'
 })
 export class ResultsComponent implements OnInit {
index f933e03..467db52 100644 (file)
@@ -1,6 +1,6 @@
 import {NgModule} from '@angular/core';
 import {RouterModule, Routes} from '@angular/router';
-import {EgCatalogComponent} from './catalog.component';
+import {EgCatalogComponent} from './app.component';
 import {ResultsComponent} from './result/results.component';
 import {RecordComponent} from './record/record.component';
 import {EgCatalogResolver} from './resolver.service';
index aeb07ba..94ef0bf 100644 (file)
@@ -4,7 +4,7 @@ import {EgOrgService} from '@eg/core/org';
 import {EgCatalogService,} from '@eg/share/catalog/catalog.service';
 import {CatalogSearchContext, CatalogSearchState} 
   from '@eg/share/catalog/search-context';
-import {StaffCatalogService} from './staff-catalog.service';
+import {StaffCatalogService} from './app.service';
 
 @Component({
   selector: 'eg-catalog-search-form',
diff --git a/Open-ILS/webby-src/src/app/staff/catalog/staff-catalog.service.ts b/Open-ILS/webby-src/src/app/staff/catalog/staff-catalog.service.ts
deleted file mode 100644 (file)
index 625206e..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-import {Injectable} from '@angular/core';
-import {Router, ActivatedRoute} from '@angular/router';
-import {EgOrgService} from '@eg/core/org';
-import {EgCatalogService} from '@eg/share/catalog/catalog.service';
-import {EgCatalogUrlService} from '@eg/share/catalog/catalog-url.service';
-import {CatalogSearchContext} from '@eg/share/catalog/search-context';
-
-/**
- * Shared bits needed by the staff version of the catalog.
- */
-
-@Injectable()
-export class StaffCatalogService {
-
-    searchContext: CatalogSearchContext;
-    routeIndex: number = 0;
-
-    constructor(
-        private router: Router,
-        private route: ActivatedRoute,
-        private org: EgOrgService,
-        private cat: EgCatalogService,
-        private catUrl: EgCatalogUrlService
-    ) { }
-
-    createContext(): void {
-        // Initialize the search context from the load-time URL params.
-        // Do this here so the search form and other context data are
-        // applied on every page, not just the search results page.  The
-        // search results pages will handle running the actual search.
-        this.searchContext = 
-            this.catUrl.fromUrlParams(this.route.snapshot.queryParamMap);
-
-        this.searchContext.org = this.org;
-        this.searchContext.isStaff = true;
-
-        // TODO: UI / settings
-        if (!this.searchContext.pager.limit)
-          this.searchContext.pager.limit = 20;
-    }
-
-    /**
-     * Redirect to the search results page while propagating the current
-     * search paramters into the URL.  Let the search results component
-     * execute the actual search.
-     */
-    search(): void {
-        let params = this.catUrl.toUrlParams(this.searchContext);
-
-        // Avoid redirect on empty-query searches
-        if (params.query[0] == '') return;
-        
-        // Force a new search every time this method is called, even if
-        // it's the same as the active search.  Since router navigation
-        // exits early when the route + params is identical, add a
-        // random token to the route params to force a full navigation.
-        // This also resolves a problem where only removing secondary+
-        // versions of a query param fail to cause a route navigation.
-        // (E.g. going from two query= params to one).  Investigation
-        // pending.
-        params.ridx=''+this.routeIndex++;
-
-        this.router.navigate(
-          ['/staff/catalog/search'], {queryParams: params});
-    }
-
-}
-
-
diff --git a/Open-ILS/webby-src/src/app/staff/circ/app.module.ts b/Open-ILS/webby-src/src/app/staff/circ/app.module.ts
new file mode 100644 (file)
index 0000000..b9ea323
--- /dev/null
@@ -0,0 +1,16 @@
+import { CommonModule } from '@angular/common';
+import { NgModule }     from '@angular/core';
+import { EgCircRoutingModule } from './routing.module';
+
+@NgModule({
+  declarations: [
+  ],
+  imports: [
+    EgCircRoutingModule
+  ],
+  providers: []
+})
+
+export class EgCircModule { 
+
+}
diff --git a/Open-ILS/webby-src/src/app/staff/circ/circ.module.ts b/Open-ILS/webby-src/src/app/staff/circ/circ.module.ts
deleted file mode 100644 (file)
index b9ea323..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-import { CommonModule } from '@angular/common';
-import { NgModule }     from '@angular/core';
-import { EgCircRoutingModule } from './routing.module';
-
-@NgModule({
-  declarations: [
-  ],
-  imports: [
-    EgCircRoutingModule
-  ],
-  providers: []
-})
-
-export class EgCircModule { 
-
-}
diff --git a/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/app.component.html b/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/app.component.html
new file mode 100644 (file)
index 0000000..1f55cb1
--- /dev/null
@@ -0,0 +1,8 @@
+<h2 i18n="Barcode Search Header">Search for Patron by Barcode</h2>
+
+<span i18n>Barcode:</span><input type='text' [ngModel]='barcode'/>
+
+<br/>
+<ul>
+    <li *ngFor="let str of strList">{{str}}</li>
+</ul>
diff --git a/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/app.component.ts b/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/app.component.ts
new file mode 100644 (file)
index 0000000..43d36da
--- /dev/null
@@ -0,0 +1,45 @@
+import { Component, OnInit } from '@angular/core';
+import { ActivatedRoute } from '@angular/router';
+import { EgNetService } from '@eg/core/net';
+import { EgAuthService } from '@eg/core/auth';
+
+@Component({
+  templateUrl: 'app.component.html'
+})
+
+export class EgBcSearchComponent implements OnInit {
+
+    barcode: String = '';
+    strList: String[] = [];
+
+    constructor(
+        private route: ActivatedRoute,
+        private net: EgNetService,
+        private auth: EgAuthService
+    ) {}
+
+    ngOnInit() {
+
+        this.barcode = this.route.snapshot.paramMap.get('barcode');
+
+        if (this.barcode) {
+            // Find the user and redirect to the 
+        }
+
+        this.route.data.subscribe((data: { startup : any }) => {
+            console.debug('EgBcSearch ngOnInit complete');
+        });
+
+        this.net.request(
+            'open-ils.actor',
+            'opensrf.system.echo',
+            'hello', 'goodbye', 'in the middle'
+        ).subscribe(res => this.strList.push(res));
+    }
+
+    findUser(): void {
+        // find user by this.barcode;
+    }
+}
+
+
diff --git a/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/app.module.ts b/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/app.module.ts
new file mode 100644 (file)
index 0000000..f119697
--- /dev/null
@@ -0,0 +1,19 @@
+import { CommonModule }            from '@angular/common';
+import { NgModule }                from '@angular/core';
+import { FormsModule }             from '@angular/forms';
+import { EgBcSearchComponent }     from './app.component';
+import { EgBcSearchRoutingModule } from './routing.module';
+
+@NgModule({
+  declarations: [
+    EgBcSearchComponent
+  ],
+  imports: [
+    EgBcSearchRoutingModule,
+    CommonModule,
+    FormsModule
+  ],
+})
+
+export class EgBcSearchModule {}
+
diff --git a/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/bcsearch-routing.module.ts b/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/bcsearch-routing.module.ts
deleted file mode 100644 (file)
index 25d8a57..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-import { NgModule }             from '@angular/core';
-import { RouterModule, Routes } from '@angular/router';
-import { EgBcSearchComponent }  from './bcsearch.component';
-
-const routes: Routes = [
-  { path: '',
-    component: EgBcSearchComponent
-  },
-  { path: ':barcode',
-    component: EgBcSearchComponent
-  },
-];
-
-@NgModule({
-  imports: [ RouterModule.forChild(routes) ],
-  exports: [ RouterModule ]
-})
-
-export class EgBcSearchRoutingModule {}
diff --git a/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/bcsearch.component.html b/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/bcsearch.component.html
deleted file mode 100644 (file)
index 1f55cb1..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<h2 i18n="Barcode Search Header">Search for Patron by Barcode</h2>
-
-<span i18n>Barcode:</span><input type='text' [ngModel]='barcode'/>
-
-<br/>
-<ul>
-    <li *ngFor="let str of strList">{{str}}</li>
-</ul>
diff --git a/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/bcsearch.component.ts b/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/bcsearch.component.ts
deleted file mode 100644 (file)
index cfc2ee2..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-import { ActivatedRoute } from '@angular/router';
-import { EgNetService } from '@eg/core/net';
-import { EgAuthService } from '@eg/core/auth';
-
-@Component({
-  templateUrl: 'bcsearch.component.html'
-})
-
-export class EgBcSearchComponent implements OnInit {
-
-    barcode: String = '';
-    strList: String[] = [];
-
-    constructor(
-        private route: ActivatedRoute,
-        private net: EgNetService,
-        private auth: EgAuthService
-    ) {}
-
-    ngOnInit() {
-
-        this.barcode = this.route.snapshot.paramMap.get('barcode');
-
-        if (this.barcode) {
-            // Find the user and redirect to the 
-        }
-
-        this.route.data.subscribe((data: { startup : any }) => {
-            console.debug('EgBcSearch ngOnInit complete');
-        });
-
-        this.net.request(
-            'open-ils.actor',
-            'opensrf.system.echo',
-            'hello', 'goodbye', 'in the middle'
-        ).subscribe(res => this.strList.push(res));
-    }
-
-    findUser(): void {
-        // find user by this.barcode;
-    }
-}
-
-
diff --git a/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/bcsearch.module.ts b/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/bcsearch.module.ts
deleted file mode 100644 (file)
index be9f6b8..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-import { CommonModule }            from '@angular/common';
-import { NgModule }                from '@angular/core';
-import { FormsModule }             from '@angular/forms';
-import { EgBcSearchComponent }     from './bcsearch.component';
-import { EgBcSearchRoutingModule } from './bcsearch-routing.module';
-
-@NgModule({
-  declarations: [
-    EgBcSearchComponent
-  ],
-  imports: [
-    EgBcSearchRoutingModule,
-    CommonModule,
-    FormsModule
-  ],
-})
-
-export class EgBcSearchModule {}
-
diff --git a/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/routing.module.ts b/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/routing.module.ts
new file mode 100644 (file)
index 0000000..2a685f3
--- /dev/null
@@ -0,0 +1,19 @@
+import { NgModule }             from '@angular/core';
+import { RouterModule, Routes } from '@angular/router';
+import { EgBcSearchComponent }  from './app.component';
+
+const routes: Routes = [
+  { path: '',
+    component: EgBcSearchComponent
+  },
+  { path: ':barcode',
+    component: EgBcSearchComponent
+  },
+];
+
+@NgModule({
+  imports: [ RouterModule.forChild(routes) ],
+  exports: [ RouterModule ]
+})
+
+export class EgBcSearchRoutingModule {}
index 98f2a4e..1b0a0f0 100644 (file)
@@ -7,7 +7,7 @@ const routes: Routes = [{
     path: 'patron',
     children: [{
       path: 'bcsearch',
-      loadChildren: '@eg/staff/circ/patron/bcsearch/bcsearch.module#EgBcSearchModule'
+      loadChildren: '@eg/staff/circ/patron/bcsearch/app.module#EgBcSearchModule'
     }]
   }]
 }];
index 3f33faf..a08b30b 100644 (file)
@@ -1,11 +1,11 @@
-import { Injectable } from '@angular/core';
-import { Location } from '@angular/common';
-import { Observable, Observer } from 'rxjs/Rx';
-import { Router, Resolve, RouterStateSnapshot,
-         ActivatedRouteSnapshot } from '@angular/router';
-import { EgStoreService } from '@eg/core/store';
-import { EgNetService } from '@eg/core/net';
-import { EgAuthService } from '@eg/core/auth';
+import {Injectable} from '@angular/core';
+import {Location} from '@angular/common';
+import {Observable, Observer} from 'rxjs/Rx';
+import {Router, Resolve, RouterStateSnapshot,
+        ActivatedRouteSnapshot} from '@angular/router';
+import {EgStoreService} from '@eg/core/store';
+import {EgNetService} from '@eg/core/net';
+import {EgAuthService} from '@eg/core/auth';
 
 /**
  * Apply configuration, etc. required by all staff components.
index eaeaafd..f2f41ed 100644 (file)
@@ -1,9 +1,9 @@
-import { NgModule } from '@angular/core';
-import { RouterModule, Routes } from '@angular/router';
-import { EgStaffResolver } from './resolver.service';
-import { EgStaffComponent } from './staff.component';
-import { EgStaffLoginComponent } from './login.component';
-import { EgStaffSplashComponent } from './splash.component';
+import {NgModule} from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
+import {EgStaffResolver} from './resolver.service';
+import {EgStaffComponent} from './app.component';
+import {EgStaffLoginComponent} from './login.component';
+import {EgStaffSplashComponent} from './splash.component';
 
 // Not using 'canActivate' because it's called before all resolvers,
 // but the resolvers parse the IDL, etc.
@@ -24,13 +24,13 @@ const routes: Routes = [{
     component: EgStaffSplashComponent
   }, {
     path: 'circ',
-    loadChildren : '@eg/staff/circ/circ.module#EgCircModule'
+    loadChildren : '@eg/staff/circ/app.module#EgCircModule'
   }, {
     path: 'catalog',
-    loadChildren : '@eg/staff/catalog/catalog.module#EgCatalogModule'
+    loadChildren : '@eg/staff/catalog/app.module#EgCatalogModule'
   }, {
     path: 'admin',
-    loadChildren : '@eg/staff/admin/admin.module#EgAdminModule'
+    loadChildren : '@eg/staff/admin/app.module#EgAdminModule'
   }]
 }];
 
diff --git a/Open-ILS/webby-src/src/app/staff/share/bib-summary.component.css b/Open-ILS/webby-src/src/app/staff/share/bib-summary.component.css
deleted file mode 100644 (file)
index bec1012..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-.eg-bib-summary {
-}
-.eg-bib-summary .card-body {
-  padding: .25rem;
-}
-.eg-bib-summary .list-group-item {
-  padding: .25rem;
-}
index 8011524..6626608 100644 (file)
@@ -1,5 +1,5 @@
 
-<div class='eg-bib-summary card w-100' *ngIf="summary">
+<div class='eg-bib-summary card tight-card w-100' *ngIf="summary">
   <div class="card-header d-flex">
     <div class="font-weight-bold">
       Record Summary
index 61f438f..877b18a 100644 (file)
@@ -5,7 +5,6 @@ import {EgCatalogService} from '@eg/share/catalog/catalog.service';
 
 @Component({
   selector: 'eg-bib-summary',
-  styleUrls: ['bib-summary.component.css'],
   templateUrl: 'bib-summary.component.html'
 })
 export class EgBibSummaryComponent implements OnInit {
diff --git a/Open-ILS/webby-src/src/app/staff/splash.component.css b/Open-ILS/webby-src/src/app/staff/splash.component.css
deleted file mode 100644 (file)
index e69de29..0000000
index 04d768c..b8f8a0d 100644 (file)
@@ -1,13 +1,10 @@
-import { Component, OnInit } from '@angular/core';
-import { ActivatedRoute, Router } from '@angular/router';
+import {Component, OnInit} from '@angular/core';
 
 @Component({
-    styleUrls: ['splash.component.css'],
     templateUrl: 'splash.component.html'
 })
 
 export class EgStaffSplashComponent implements OnInit {
-    constructor(private route: ActivatedRoute) {}
 
     ngOnInit() {
     }
diff --git a/Open-ILS/webby-src/src/app/staff/staff.component.css b/Open-ILS/webby-src/src/app/staff/staff.component.css
deleted file mode 100644 (file)
index 508d879..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#staff-content-container {
-  width: 95%;
-  margin-top:56px;
-  padding-right: 10px;
-  padding-left: 10px;
-  margin-right: auto;
-  margin-left: auto;
-}
diff --git a/Open-ILS/webby-src/src/app/staff/staff.component.html b/Open-ILS/webby-src/src/app/staff/staff.component.html
deleted file mode 100644 (file)
index 7bd463a..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- top navigation bar -->
-<eg-staff-nav-bar></eg-staff-nav-bar>
-
-<div id='staff-content-container'>
-  <!-- page content -->
-  <router-outlet></router-outlet>
-</div>
-
diff --git a/Open-ILS/webby-src/src/app/staff/staff.component.ts b/Open-ILS/webby-src/src/app/staff/staff.component.ts
deleted file mode 100644 (file)
index 6b52db0..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-import { Router, ActivatedRoute, NavigationEnd } from '@angular/router';
-import { EgAuthService, EgAuthWsState } from '@eg/core/auth';
-import { EgNetService } from '@eg/core/net';
-
-@Component({
-  templateUrl: 'staff.component.html',
-  styleUrls: ['staff.component.css']
-})
-
-export class EgStaffComponent implements OnInit {
-
-    readonly loginPath = '/staff/login';
-    readonly wsAdminPath = '/staff/admin/workstation/workstations';
-
-    constructor(
-        private router: Router,
-        private route: ActivatedRoute,
-        private net: EgNetService,
-        private auth: EgAuthService
-    ) {}
-
-    ngOnInit() {
-
-        console.debug('EgStaffComponent:ngOnInit()');
-
-        // Fires on all in-app router navigation, but not initial page load.
-        this.router.events.subscribe(routeEvent => {
-            if (routeEvent instanceof NavigationEnd) {
-                //console.debug(`EgStaffComponent routing to ${routeEvent.url}`);
-                this.basicAuthChecks(routeEvent);
-            }
-        });
-
-        // Redirect to the login page on any auth timeout events.
-        this.net.authExpired$.subscribe(uhOh => {
-            console.debug('Auth session has expired. Redirecting to login');
-            this.auth.redirectUrl = this.router.url;
-            this.router.navigate(['/staff/login']);
-        });
-
-        this.route.data.subscribe((data: {staffResolver : any}) => {
-            console.debug('EgStaff ngOnInit complete');
-     
-      });
-    }
-
-    /**
-     * Verifying auth token on every route is overkill, since an expired
-     * token will make itself known with the first API call, but we do
-     * want to prevent navigation from the login or workstation admin
-     * page, since these can be accessed without a valid authtoken or
-     * workstation, respectively, once the initial route resolvers
-     * have done their jobs.
-     */
-    basicAuthChecks(routeEvent: NavigationEnd): void {
-
-        // Access to login page is always granted
-        if (routeEvent.url == this.loginPath) return;
-
-        if (!this.auth.token()) 
-            this.router.navigate([this.loginPath]);
-
-        // Access to workstation admin page is granted regardless
-        // of workstation validity.
-        if (routeEvent.url == this.wsAdminPath) return;
-
-        if (this.auth.workstationState != EgAuthWsState.VALID)
-            this.router.navigate([this.wsAdminPath]);
-    }
-}
-
-
diff --git a/Open-ILS/webby-src/src/app/staff/staff.module.ts b/Open-ILS/webby-src/src/app/staff/staff.module.ts
deleted file mode 100644 (file)
index 526d8c2..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-import {CommonModule} from '@angular/common';
-import {NgModule} from '@angular/core';
-import {FormsModule} from '@angular/forms';
-import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
-import {EgBaseModule} from '@eg/base.module';
-
-import {EgStaffComponent} from './staff.component';
-import {EgStaffRoutingModule} from './routing.module';
-import {EgStaffNavComponent} from './nav.component';
-import {EgStaffLoginComponent} from './login.component';
-import {EgStaffSplashComponent} from './splash.component';
-import {EgOrgSelectComponent} from '@eg/share/org-select.component';
-
-@NgModule({
-  declarations: [
-    EgStaffComponent,
-    EgStaffNavComponent,
-    EgStaffSplashComponent,
-    EgStaffLoginComponent,
-    EgOrgSelectComponent
-  ],
-  imports: [
-    EgStaffRoutingModule,
-    FormsModule,
-    NgbModule
-  ],
-  exports: [
-    // Components available to all staff modules
-    EgOrgSelectComponent,
-    FormsModule,
-    NgbModule
-  ]
-})
-
-export class EgStaffModule { 
-
-}
index 710570e..08b359c 100644 (file)
@@ -1,7 +1,7 @@
 import { enableProdMode } from '@angular/core';
 import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
 
-import { EgBaseModule } from './app/base.module';
+import { EgBaseModule } from './app/app.module';
 import { environment } from './environments/environment';
 
 if (environment.production) {
index 3646a77..2ac5039 100644 (file)
@@ -17,6 +17,8 @@ h3 {font-size: 1.15rem}
 h4 {font-size: 1.05rem}
 h5 {font-size: .95rem}
 
+.small-text-1 {font-size: 85%}
+
 
 /** Ang5 routes on clicks to href's with no values, so we can't have
  * bare href's to force anchor styling.  Use this for anchors w/ no href.
@@ -44,3 +46,17 @@ h5 {font-size: .95rem}
   padding-left: .25rem;
   padding-right: .25rem; /* default .5rem */
 }
+
+/* allow spans/labels to vertically orient with material icons */
+.label-with-material-icon {
+    display: inline-flex;
+    vertical-align: middle;
+    align-items: center;
+}
+
+/* Default .card padding is extreme */
+.tight-card .card-body,
+.tight-card .list-group-item {
+  padding: .25rem;
+}
+