From: Bill Erickson Date: Tue, 12 Dec 2017 16:26:24 +0000 (-0500) Subject: LP#626157 Ang2 consistent naming; less custom css X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=04f8454276f3370c6723ff48f02669a96983b878;p=working%2FEvergreen.git LP#626157 Ang2 consistent naming; less custom css Signed-off-by: Bill Erickson --- 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 index 0000000000..d049f7a828 --- /dev/null +++ b/Open-ILS/webby-src/src/app/app.component.ts @@ -0,0 +1,11 @@ +import {Component} from '@angular/core'; + +@Component({ + selector: 'eg-root', + template: '' +}) + +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 index 0000000000..d9d06e3b27 --- /dev/null +++ b/Open-ILS/webby-src/src/app/app.module.ts @@ -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 index b72bedb1cc..0000000000 --- a/Open-ILS/webby-src/src/app/base.component.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'eg-root', - template: '' -}) - -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 index f462f84db1..0000000000 --- a/Open-ILS/webby-src/src/app/base.module.ts +++ /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)); - */ - } -} diff --git a/Open-ILS/webby-src/src/app/resolver.service.ts b/Open-ILS/webby-src/src/app/resolver.service.ts index b699fcece5..7ffa74bccb 100644 --- a/Open-ILS/webby-src/src/app/resolver.service.ts +++ b/Open-ILS/webby-src/src/app/resolver.service.ts @@ -19,10 +19,13 @@ export class EgBaseResolver implements Resolve> { 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. } } diff --git a/Open-ILS/webby-src/src/app/routing.module.ts b/Open-ILS/webby-src/src/app/routing.module.ts index 8085267fa9..7d7e70e71f 100644 --- a/Open-ILS/webby-src/src/app/routing.module.ts +++ b/Open-ILS/webby-src/src/app/routing.module.ts @@ -14,7 +14,7 @@ const routes: Routes = [ }, { path: 'staff', resolve : {startup : EgBaseResolver}, - loadChildren: './staff/staff.module#EgStaffModule' + loadChildren: './staff/app.module#EgStaffModule' } ]; diff --git a/Open-ILS/webby-src/src/app/share/unapi.ts b/Open-ILS/webby-src/src/app/share/unapi.ts index 3de344b8a3..28c25896c0 100644 --- a/Open-ILS/webby-src/src/app/share/unapi.ts +++ b/Open-ILS/webby-src/src/app/share/unapi.ts @@ -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 index f66ab52a81..0000000000 --- a/Open-ILS/webby-src/src/app/staff/admin/admin.module.ts +++ /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 index 0000000000..10613316ac --- /dev/null +++ b/Open-ILS/webby-src/src/app/staff/admin/app.module.ts @@ -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 {} diff --git a/Open-ILS/webby-src/src/app/staff/admin/routing.module.ts b/Open-ILS/webby-src/src/app/staff/admin/routing.module.ts index 39de569dcb..53418899fe 100644 --- a/Open-ILS/webby-src/src/app/staff/admin/routing.module.ts +++ b/Open-ILS/webby-src/src/app/staff/admin/routing.module.ts @@ -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 index d6c5b0ee09..0000000000 --- a/Open-ILS/webby-src/src/app/staff/admin/workstation/admin-ws.module.ts +++ /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 index 0000000000..71015dff53 --- /dev/null +++ b/Open-ILS/webby-src/src/app/staff/admin/workstation/app.module.ts @@ -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 {} + diff --git a/Open-ILS/webby-src/src/app/staff/admin/workstation/routing.module.ts b/Open-ILS/webby-src/src/app/staff/admin/workstation/routing.module.ts index ebf7829a76..c65a5e791c 100644 --- a/Open-ILS/webby-src/src/app/staff/admin/workstation/routing.module.ts +++ b/Open-ILS/webby-src/src/app/staff/admin/workstation/routing.module.ts @@ -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 index 0000000000..508d879b9b --- /dev/null +++ b/Open-ILS/webby-src/src/app/staff/app.component.css @@ -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 index 0000000000..7bd463a623 --- /dev/null +++ b/Open-ILS/webby-src/src/app/staff/app.component.html @@ -0,0 +1,8 @@ + + + +
+ + +
+ 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 index 0000000000..48b6a66db6 --- /dev/null +++ b/Open-ILS/webby-src/src/app/staff/app.component.ts @@ -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 index 0000000000..7b53d7fc41 --- /dev/null +++ b/Open-ILS/webby-src/src/app/staff/app.module.ts @@ -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 index 0000000000..1596454ac1 --- /dev/null +++ b/Open-ILS/webby-src/src/app/staff/catalog/app.component.html @@ -0,0 +1,6 @@ + + + + + + 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 index 0000000000..a5ca68f3db --- /dev/null +++ b/Open-ILS/webby-src/src/app/staff/catalog/app.component.ts @@ -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 index 0000000000..b76cc0bcef --- /dev/null +++ b/Open-ILS/webby-src/src/app/staff/catalog/app.module.ts @@ -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 index 0000000000..625206e7f4 --- /dev/null +++ b/Open-ILS/webby-src/src/app/staff/catalog/app.service.ts @@ -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 index 1596454ac1..0000000000 --- a/Open-ILS/webby-src/src/app/staff/catalog/catalog.component.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - 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 index 47ec5e7d64..0000000000 --- a/Open-ILS/webby-src/src/app/staff/catalog/catalog.component.ts +++ /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 index e1833d051d..0000000000 --- a/Open-ILS/webby-src/src/app/staff/catalog/catalog.module.ts +++ /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 index 6c08652de5..0000000000 --- a/Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.css +++ /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} -*/ diff --git a/Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.html b/Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.html index 79984ff636..84e9d8e8a5 100644 --- a/Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.html +++ b/Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.html @@ -1,12 +1,3 @@ -
  • @@ -30,18 +21,18 @@
-
+
Location
-
Call Number / Copy Notes
-
Barcode
-
Shelving Location
-
Circulation Modifier
-
Age Hold Protection
-
Active/Create Date
-
Holdable?
-
Status
-
Due Date
+
Call Number / Copy Notes
+
Barcode
+
Shelving Location
+
Circulation Modifier
+
Age Hold Protection
+
Active/Create Date
+
Holdable?
+
Status
+
Due Date
    @@ -49,29 +40,29 @@ [ngClass]="{'list-group-item-info': (idx % 2) == 1}">
    {{orgName(copy.circ_lib)}}
    -
    +
    {{copy.call_number_prefix_label}} {{copy.call_number_label}} {{copy.call_number_suffix_label}}
    -
    +
    {{copy.barcode}} View | Edit
    -
    {{copy.copy_location}}
    -
    {{copy.circ_modifier || ''}}
    -
    {{copy.age_protect}}
    -
    +
    {{copy.copy_location}}
    +
    {{copy.circ_modifier || ''}}
    +
    {{copy.age_protect}}
    +
    {{copy.active_date || copy.create_date | date:'shortDate'}}
    -
    +
    Yes No
    -
    {{copy.copy_status}}
    -
    {{copy.due_date | date:'shortDate'}}
    +
    {{copy.copy_status}}
    +
    {{copy.due_date | date:'shortDate'}}
diff --git a/Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.ts b/Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.ts index 94ad3c7fdf..f234eba8df 100644 --- a/Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.ts +++ b/Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.ts @@ -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 index 8b6be46d70..0000000000 --- a/Open-ILS/webby-src/src/app/staff/catalog/record/pagination.component.css +++ /dev/null @@ -1,7 +0,0 @@ - -/* Bootstrap default is 20px */ -/* -.pagination {margin: 0px 0px 0px 0px} -*/ - - diff --git a/Open-ILS/webby-src/src/app/staff/catalog/record/pagination.component.ts b/Open-ILS/webby-src/src/app/staff/catalog/record/pagination.component.ts index 4abdef1528..a7535f6514 100644 --- a/Open-ILS/webby-src/src/app/staff/catalog/record/pagination.component.ts +++ b/Open-ILS/webby-src/src/app/staff/catalog/record/pagination.component.ts @@ -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 index e69de29bb2..0000000000 diff --git a/Open-ILS/webby-src/src/app/staff/catalog/record/record.component.ts b/Open-ILS/webby-src/src/app/staff/catalog/record/record.component.ts index 37ded3b154..78552eb443 100644 --- a/Open-ILS/webby-src/src/app/staff/catalog/record/record.component.ts +++ b/Open-ILS/webby-src/src/app/staff/catalog/record/record.component.ts @@ -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 index e69de29bb2..0000000000 diff --git a/Open-ILS/webby-src/src/app/staff/catalog/result/facets.component.ts b/Open-ILS/webby-src/src/app/staff/catalog/result/facets.component.ts index d6bc2cf91d..8101ceda01 100644 --- a/Open-ILS/webby-src/src/app/staff/catalog/result/facets.component.ts +++ b/Open-ILS/webby-src/src/app/staff/catalog/result/facets.component.ts @@ -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 { diff --git a/Open-ILS/webby-src/src/app/staff/catalog/result/pagination.component.ts b/Open-ILS/webby-src/src/app/staff/catalog/result/pagination.component.ts index 917491dfab..8dbb4d84c9 100644 --- a/Open-ILS/webby-src/src/app/staff/catalog/result/pagination.component.ts +++ b/Open-ILS/webby-src/src/app/staff/catalog/result/pagination.component.ts @@ -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 index ff8aab33f4..0000000000 --- a/Open-ILS/webby-src/src/app/staff/catalog/result/record.component.css +++ /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; -} - diff --git a/Open-ILS/webby-src/src/app/staff/catalog/result/record.component.html b/Open-ILS/webby-src/src/app/staff/catalog/result/record.component.html index a9268bc33f..c9a0cd9b45 100644 --- a/Open-ILS/webby-src/src/app/staff/catalog/result/record.component.html +++ b/Open-ILS/webby-src/src/app/staff/catalog/result/record.component.html @@ -4,124 +4,126 @@ egDateFilter's --> -
-
-
- - - - -
-
-
-
- - - #{{index + 1 + searchContext.pager.offset}} - - - {{bibSummary.title || ' '}} - -
+
+
+
+
+ + + +
-
-
- - - {{bibSummary.author || ' '}} - +
+
+
+ + + #{{index + 1 + searchContext.pager.offset}} + + + {{bibSummary.title || ' '}} + +
-
-
-
- - - {{bibSummary.ccvms.icon_format.label}} - - {{bibSummary.edition}} - {{bibSummary.pubdate}} + -
-
-
-
-
-
- - {{copyCount.available}} / {{copyCount.count}} items +
+
+ + + {{bibSummary.ccvms.icon_format.label}} -
-
- @ {{orgName(copyCount.org_unit)}} + {{bibSummary.edition}} + {{bibSummary.pubdate}}
-
-
-
-
- TCN: {{bibSummary.tcn_value}} +
+
+
+
+ + {{copyCount.available}} / {{copyCount.count}} items + +
+
+ @ {{orgName(copyCount.org_unit)}} +
+
-
-
- Holds: {{bibSummary.holdCount}} +
+
+
+ TCN: {{bibSummary.tcn_value}} +
-
-
-
-
-
-
- Created {{bibSummary.create_date | date:'shortDate'}} by - - - {{bibSummary.creator.usrname()}} - - - ... +
+
+ Holds: {{bibSummary.holdCount}}
-
-
-
- Edited {{bibSummary.edit_date | date:'shortDate'}} by - - {{bibSummary.editor.usrname()}} - - ... +
+
+
+
+ Created {{bibSummary.create_date | date:'shortDate'}} by + + + {{bibSummary.creator.usrname()}} + + + ... +
-
-
-
-
- - - - - - +
+
+
+ Edited {{bibSummary.edit_date | date:'shortDate'}} by + + {{bibSummary.editor.usrname()}} + + ... +
-
-
-
-
+
+
+
+ + + + + + +
+
+
+
+
+
+
diff --git a/Open-ILS/webby-src/src/app/staff/catalog/result/record.component.ts b/Open-ILS/webby-src/src/app/staff/catalog/result/record.component.ts index b7fc776eb2..beee4cfbb0 100644 --- a/Open-ILS/webby-src/src/app/staff/catalog/result/record.component.ts +++ b/Open-ILS/webby-src/src/app/staff/catalog/result/record.component.ts @@ -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 index e69de29bb2..0000000000 diff --git a/Open-ILS/webby-src/src/app/staff/catalog/result/results.component.ts b/Open-ILS/webby-src/src/app/staff/catalog/result/results.component.ts index 63136564aa..b87a2cdd7d 100644 --- a/Open-ILS/webby-src/src/app/staff/catalog/result/results.component.ts +++ b/Open-ILS/webby-src/src/app/staff/catalog/result/results.component.ts @@ -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 { diff --git a/Open-ILS/webby-src/src/app/staff/catalog/routing.module.ts b/Open-ILS/webby-src/src/app/staff/catalog/routing.module.ts index f933e035fc..467db52e2c 100644 --- a/Open-ILS/webby-src/src/app/staff/catalog/routing.module.ts +++ b/Open-ILS/webby-src/src/app/staff/catalog/routing.module.ts @@ -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'; diff --git a/Open-ILS/webby-src/src/app/staff/catalog/search-form.component.ts b/Open-ILS/webby-src/src/app/staff/catalog/search-form.component.ts index aeb07badc3..94ef0bf03f 100644 --- a/Open-ILS/webby-src/src/app/staff/catalog/search-form.component.ts +++ b/Open-ILS/webby-src/src/app/staff/catalog/search-form.component.ts @@ -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 index 625206e7f4..0000000000 --- a/Open-ILS/webby-src/src/app/staff/catalog/staff-catalog.service.ts +++ /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 index 0000000000..b9ea323f2f --- /dev/null +++ b/Open-ILS/webby-src/src/app/staff/circ/app.module.ts @@ -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 index b9ea323f2f..0000000000 --- a/Open-ILS/webby-src/src/app/staff/circ/circ.module.ts +++ /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 index 0000000000..1f55cb1d8b --- /dev/null +++ b/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/app.component.html @@ -0,0 +1,8 @@ +

Search for Patron by Barcode

+ +Barcode: + +
+
    +
  • {{str}}
  • +
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 index 0000000000..43d36daf97 --- /dev/null +++ b/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/app.component.ts @@ -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 index 0000000000..f119697292 --- /dev/null +++ b/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/app.module.ts @@ -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 index 25d8a57670..0000000000 --- a/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/bcsearch-routing.module.ts +++ /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 index 1f55cb1d8b..0000000000 --- a/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/bcsearch.component.html +++ /dev/null @@ -1,8 +0,0 @@ -

Search for Patron by Barcode

- -Barcode: - -
-
    -
  • {{str}}
  • -
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 index cfc2ee2143..0000000000 --- a/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/bcsearch.component.ts +++ /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 index be9f6b8136..0000000000 --- a/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/bcsearch.module.ts +++ /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 index 0000000000..2a685f321e --- /dev/null +++ b/Open-ILS/webby-src/src/app/staff/circ/patron/bcsearch/routing.module.ts @@ -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 {} diff --git a/Open-ILS/webby-src/src/app/staff/circ/routing.module.ts b/Open-ILS/webby-src/src/app/staff/circ/routing.module.ts index 98f2a4ec99..1b0a0f0cbe 100644 --- a/Open-ILS/webby-src/src/app/staff/circ/routing.module.ts +++ b/Open-ILS/webby-src/src/app/staff/circ/routing.module.ts @@ -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' }] }] }]; diff --git a/Open-ILS/webby-src/src/app/staff/resolver.service.ts b/Open-ILS/webby-src/src/app/staff/resolver.service.ts index 3f33fafb40..a08b30bb31 100644 --- a/Open-ILS/webby-src/src/app/staff/resolver.service.ts +++ b/Open-ILS/webby-src/src/app/staff/resolver.service.ts @@ -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. diff --git a/Open-ILS/webby-src/src/app/staff/routing.module.ts b/Open-ILS/webby-src/src/app/staff/routing.module.ts index eaeaafd2a3..f2f41edaa2 100644 --- a/Open-ILS/webby-src/src/app/staff/routing.module.ts +++ b/Open-ILS/webby-src/src/app/staff/routing.module.ts @@ -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 index bec1012f5b..0000000000 --- a/Open-ILS/webby-src/src/app/staff/share/bib-summary.component.css +++ /dev/null @@ -1,8 +0,0 @@ -.eg-bib-summary { -} -.eg-bib-summary .card-body { - padding: .25rem; -} -.eg-bib-summary .list-group-item { - padding: .25rem; -} diff --git a/Open-ILS/webby-src/src/app/staff/share/bib-summary.component.html b/Open-ILS/webby-src/src/app/staff/share/bib-summary.component.html index 8011524479..66266086d8 100644 --- a/Open-ILS/webby-src/src/app/staff/share/bib-summary.component.html +++ b/Open-ILS/webby-src/src/app/staff/share/bib-summary.component.html @@ -1,5 +1,5 @@ -
+
Record Summary diff --git a/Open-ILS/webby-src/src/app/staff/share/bib-summary.component.ts b/Open-ILS/webby-src/src/app/staff/share/bib-summary.component.ts index 61f438f892..877b18a4f5 100644 --- a/Open-ILS/webby-src/src/app/staff/share/bib-summary.component.ts +++ b/Open-ILS/webby-src/src/app/staff/share/bib-summary.component.ts @@ -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 index e69de29bb2..0000000000 diff --git a/Open-ILS/webby-src/src/app/staff/splash.component.ts b/Open-ILS/webby-src/src/app/staff/splash.component.ts index 04d768cb98..b8f8a0d8ae 100644 --- a/Open-ILS/webby-src/src/app/staff/splash.component.ts +++ b/Open-ILS/webby-src/src/app/staff/splash.component.ts @@ -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 index 508d879b9b..0000000000 --- a/Open-ILS/webby-src/src/app/staff/staff.component.css +++ /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 index 7bd463a623..0000000000 --- a/Open-ILS/webby-src/src/app/staff/staff.component.html +++ /dev/null @@ -1,8 +0,0 @@ - - - -
- - -
- 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 index 6b52db0e35..0000000000 --- a/Open-ILS/webby-src/src/app/staff/staff.component.ts +++ /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 index 526d8c2fd6..0000000000 --- a/Open-ILS/webby-src/src/app/staff/staff.module.ts +++ /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 { - -} diff --git a/Open-ILS/webby-src/src/main.ts b/Open-ILS/webby-src/src/main.ts index 710570e226..08b359c3b7 100644 --- a/Open-ILS/webby-src/src/main.ts +++ b/Open-ILS/webby-src/src/main.ts @@ -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) { diff --git a/Open-ILS/webby-src/src/styles.css b/Open-ILS/webby-src/src/styles.css index 3646a77f84..2ac5039365 100644 --- a/Open-ILS/webby-src/src/styles.css +++ b/Open-ILS/webby-src/src/styles.css @@ -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; +} +