--- /dev/null
+{
+ "name": "eg",
+ "version": "0.0.0",
+ "license": "MIT",
+ "scripts": {
+ "ng": "ng",
+ "start": "ng serve",
+ "build": "ng build",
+ "test": "ng test",
+ "lint": "ng lint",
+ "e2e": "ng e2e"
+ },
+ "private": true,
+ "dependencies": {
+ "@angular/animations": "^5.0.0",
+ "@angular/common": "^5.0.0",
+ "@angular/compiler": "^5.0.0",
+ "@angular/core": "^5.0.0",
+ "@angular/forms": "^5.0.0",
+ "@angular/http": "^5.0.0",
+ "@angular/platform-browser": "^5.0.0",
+ "@angular/platform-browser-dynamic": "^5.0.0",
+ "@angular/router": "^5.0.0",
+ "core-js": "^2.4.1",
+ "jquery": "^3.2.1",
+ "rxjs": "^5.5.2",
+ "zone.js": "^0.8.14"
+ },
+ "devDependencies": {
+ "@angular/cli": "1.5.1",
+ "@angular/compiler-cli": "^5.0.0",
+ "@angular/language-service": "^5.0.0",
+ "@types/jasmine": "~2.5.53",
+ "@types/jasminewd2": "~2.0.2",
+ "@types/jquery": "^3.2.16",
+ "@types/node": "~6.0.60",
+ "codelyzer": "~3.2.0",
+ "jasmine-core": "~2.6.2",
+ "jasmine-spec-reporter": "~4.1.0",
+ "karma": "~1.7.0",
+ "karma-chrome-launcher": "~2.1.1",
+ "karma-cli": "~1.0.1",
+ "karma-coverage-istanbul-reporter": "^1.2.1",
+ "karma-jasmine": "~1.1.0",
+ "karma-jasmine-html-reporter": "^0.2.2",
+ "protractor": "~5.1.2",
+ "ts-node": "~3.2.0",
+ "tslint": "~5.7.0",
+ "typescript": "~2.4.2"
+ }
+}
--- /dev/null
+import { NgModule } from '@angular/core';
+import { RouterModule, Routes } from '@angular/router';
+import { WelcomeComponent } from './welcome.component';
+
+/**
+ * Avoid adding bulk to the base module by lazy-loading sub-modules.
+ * When lazy loading, no module references should be directly imported.
+ * The refs are encoded in the loadChildren attribute of each route.
+ */
+
+const routes: Routes = [
+ { path: '', component: WelcomeComponent },
+ { path: 'staff',
+ loadChildren: './staff/staff.module#EgStaffModule'
+ }
+];
+
+@NgModule({
+ imports: [ RouterModule.forRoot(routes) ],
+ exports: [ RouterModule ]
+})
+
+export class EgBaseRoutingModule {}
--- /dev/null
+import { Component } from '@angular/core';
+
+@Component({
+ selector: 'eg-root',
+ template: '<router-outlet></router-outlet>'
+})
+
+export class EgBaseComponent {
+ title = 'EgBase';
+}
+
+
--- /dev/null
+/**
+ * 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 { EgBaseComponent } from './base.component';
+import { EgBaseRoutingModule } from './base-routing.module';
+import { WelcomeComponent } from './welcome.component';
+
+@NgModule({
+ declarations: [
+ EgBaseComponent,
+ WelcomeComponent
+ ],
+ imports: [
+ EgBaseRoutingModule,
+ BrowserModule
+ ],
+ providers: [],
+ bootstrap: [EgBaseComponent]
+})
+
+export class EgBaseModule {
+ constructor(router: Router) {
+ console.debug('Routes: ',
+ JSON.stringify(router.config, undefined, 2));
+ }
+}
--- /dev/null
+Core types (classes) and Angular services used by all modules.
--- /dev/null
+
+export class EgEvent {
+ code : Number;
+ textcode : String;
+ payload : any;
+ desc : String;
+ debug : String;
+ note : String;
+ servertime : String;
+ ilsperm : String;
+ ilspermloc : Number;
+ success : Boolean = false;
+
+ toString(): String {
+ let s = `Event: ${this.code}:${this.textcode} -> ${this.desc}`;
+ if (this.ilsperm)
+ s += ` ${this.ilsperm}@${this.ilspermloc}`;
+ if (this.note)
+ s += `\n${this.note}`;
+ return s;
+ }
+
+ /**
+ * Returns an EgEvent if 'thing' is an event, null otherwise.
+ */
+ public static parse(thing: any): EgEvent {
+
+ // All events have a textcode
+ if (thing && typeof thing == 'object' && 'textcode' in thing) {
+
+ let evt = new EgEvent();
+
+ ['textcode','payload','desc','note','servertime','ilsperm']
+ .forEach(field => { evt[field] = thing[field]; });
+
+ evt.debug = thing.stacktrace;
+ evt.code = new Number(thing.code);
+ evt.ilspermloc = new Number(thing.ilspermloc);
+ evt.success = thing.textcode == 'SUCCESS';
+
+ return evt;
+ }
+
+ return null;
+ }
+}
+
--- /dev/null
+import { NgModule } from '@angular/core';
+import { RouterModule, Routes } from '@angular/router';
+import { EgCircComponent } from './circ.component';
+
+const routes: Routes = [
+ { path: '',
+ component: EgCircComponent,
+ children : [
+ { path: 'patron/bcsearch',
+ loadChildren: '@eg/staff/circ/patron/bcsearch/bcsearch.module#EgBcSearchModule'
+ }
+ ]
+ },
+];
+
+@NgModule({
+ imports: [ RouterModule.forChild(routes) ],
+ exports: [ RouterModule ]
+})
+
+export class EgCircRoutingModule {}
--- /dev/null
+import { Component } from '@angular/core';
+import { Router } from '@angular/router';
+
+@Component({
+ template: '<router-outlet></router-outlet>'
+})
+
+export class EgCircComponent { }
+
+
--- /dev/null
+import { CommonModule } from '@angular/common';
+import { NgModule } from '@angular/core';
+
+import { EgCircComponent } from './circ.component';
+import { EgCircRoutingModule } from './circ-routing.module';
+
+@NgModule({
+ declarations: [
+ EgCircComponent
+ ],
+ imports: [
+ EgCircRoutingModule
+ ],
+ providers: []
+})
+
+export class EgCircModule {
+
+}
--- /dev/null
+import { NgModule } from '@angular/core';
+import { RouterModule, Routes } from '@angular/router';
+import { EgBcSearchComponent } from './bcsearch.component';
+
+const routes: Routes = [
+ { path: ':barcode',
+ component: EgBcSearchComponent
+ },
+];
+
+@NgModule({
+ imports: [ RouterModule.forChild(routes) ],
+ exports: [ RouterModule ]
+})
+
+export class EgBcSearchRoutingModule {}
--- /dev/null
+<h2 i18n="Barcode Search Header">Search for Patron by Barcode</h2>
+
+<span i18n>Barcode:</span><input type='text' [ngModel]='barcode'/>
--- /dev/null
+import { Component, OnInit } from '@angular/core';
+import { ActivatedRoute } from '@angular/router';
+
+@Component({
+ templateUrl: 'bcsearch.component.html'
+})
+
+export class EgBcSearchComponent implements OnInit {
+ constructor(private route: ActivatedRoute) {}
+
+ barcode: String '';
+
+ 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('EgStaff ngOnInit complete');
+ });
+ }
+
+ findUser(): void {
+ // find user by this.barcode;
+ }
+}
+
+
--- /dev/null
+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,
+ FormsModule
+ ],
+ providers: []
+})
+
+export class EgBcSearchModule {
+
+}
--- /dev/null
+Classes, services, and components shared in the staff app.
--- /dev/null
+import { Injectable } from '@angular/core';
+import { Observable } from 'rxjs/Observable';
+import { Router, Resolve, RouterStateSnapshot,
+ ActivatedRouteSnapshot } from '@angular/router';
+
+/**
+ * TODO: import network, etc. and implement startup routines.
+ */
+
+@Injectable()
+export class EgStaffResolver implements Resolve<any> {
+
+ constructor(private router: Router) {}
+
+ resolve(
+ route: ActivatedRouteSnapshot,
+ state: RouterStateSnapshot): Observable<any> {
+
+ // async placeholder for startup routines
+ return Observable.create(
+ observer => {
+ observer.next(123);
+ console.debug('completing EgStaffRouteResolver');
+ observer.complete();
+ console.debug('completed EgStaffRouteResolver');
+ }
+ );
+ }
+
+}
+
--- /dev/null
+import { NgModule } from '@angular/core';
+import { RouterModule, Routes } from '@angular/router';
+import { EgStaffComponent } from './staff.component';
+import { EgStaffResolver } from './staff-resolver.service';
+
+const routes: Routes = [
+ { path: '',
+ component: EgStaffComponent,
+ // base resolver. Called first and guaranteed to
+ // complete before any child resolvers are started.
+ resolve : {startup : EgStaffResolver},
+ children : [
+ { path : 'circ',
+ loadChildren : '@eg/staff/circ/circ.module#EgCircModule'
+ }
+ ]
+ }
+];
+
+@NgModule({
+ imports: [ RouterModule.forChild(routes) ],
+ exports: [ RouterModule ],
+ providers: [ EgStaffResolver ]
+})
+
+export class EgStaffRoutingModule {}
--- /dev/null
+<h1>Nav Bar Goes Here</h1>
+
+<h2>Staff Module</h2>
+
+<router-outlet></router-outlet>
+
--- /dev/null
+import { Component, OnInit } from '@angular/core';
+import { ActivatedRoute, Router } from '@angular/router';
+
+@Component({
+ templateUrl: 'staff.component.html'
+})
+
+export class EgStaffComponent implements OnInit {
+ title = 'EgStaff';
+
+ constructor(private route: ActivatedRoute) {}
+
+ ngOnInit() {
+
+ this.route.data.subscribe((data: { startup : any }) => {
+ console.debug('EgStaff ngOnInit complete');
+ });
+ }
+}
+
+
--- /dev/null
+import { CommonModule } from '@angular/common';
+import { NgModule } from '@angular/core';
+//import { FormsModule } from '@angular/forms';
+
+import { EgStaffComponent } from './staff.component';
+import { EgStaffRoutingModule } from './staff-routing.module';
+
+@NgModule({
+ declarations: [
+ EgStaffComponent
+ ],
+ imports: [
+ EgStaffRoutingModule,
+ //FormsModule,
+ ],
+ providers: []
+})
+
+export class EgStaffModule {
+
+}
--- /dev/null
+<div style="text-align: center; margin-top: 50px;">
+
+ <h1 i18n="Welcome Message">Welcome to Webby</h1>
+
+ <strong i18n="Welcome Status OK">
+ If you see this page, you're probably in good shape...
+ </strong>
+
+ <p i18n="Welcome Recommendations">
+ But maybe you meant to go to the <a routerLink="/staff">staff page</a>
+ or <a routerLink="/catalog">the catalog.</a>
+ </p>
+</div>
+
--- /dev/null
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ templateUrl : './welcome.component.html'
+})
+
+export class WelcomeComponent implements OnInit {
+
+ ngOnInit() {
+ }
+}
+
+
+
--- /dev/null
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title i18n="Page Title">Eg</title>
+ <base href="/">
+
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <link rel="icon" type="image/x-icon" href="favicon.ico">
+</head>
+<body>
+ <eg-root></eg-root>
+</body>
+</html>
--- /dev/null
+import { enableProdMode } from '@angular/core';
+import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+
+import { EgBaseModule } from './app/base.module';
+import { environment } from './environments/environment';
+
+if (environment.production) {
+ enableProdMode();
+}
+
+platformBrowserDynamic().bootstrapModule(EgBaseModule)
+ .catch(err => console.log(err));
--- /dev/null
+{
+ "compileOnSave": false,
+ "compilerOptions": {
+ "outDir": "./dist/out-tsc",
+ "sourceMap": true,
+ "declaration": false,
+ "moduleResolution": "node",
+ "emitDecoratorMetadata": true,
+ "experimentalDecorators": true,
+ "target": "es5",
+ "baseUrl": "src",
+ "paths": {
+ "@eg/*": ["app/*"],
+ "@env/*": ["environments/*"]
+ },
+ "typeRoots": [
+ "node_modules/@types"
+ ],
+ "lib": [
+ "es2017",
+ "dom"
+ ]
+ }
+}