From 3477a013a110d97eb49673220fe6eeac32941e52 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 4 Jun 2018 10:58:22 -0400 Subject: [PATCH] LP#1775466 Strip Eg prefix from most classes Avoid prefixing shared classed with Eg consistent with Angular style. Prefixing is not necessary since shared code has to be explicitly imported. Signed-off-by: Bill Erickson --- Open-ILS/src/eg2/src/app/app.component.ts | 2 +- Open-ILS/src/eg2/src/app/app.module.ts | 14 ++-- Open-ILS/src/eg2/src/app/common.module.ts | 50 ++++++------ Open-ILS/src/eg2/src/app/core/auth.service.ts | 58 ++++++------- Open-ILS/src/eg2/src/app/core/event.service.ts | 4 +- Open-ILS/src/eg2/src/app/core/event.spec.ts | 8 +- Open-ILS/src/eg2/src/app/core/idl.service.ts | 16 ++-- Open-ILS/src/eg2/src/app/core/idl.spec.ts | 8 +- Open-ILS/src/eg2/src/app/core/net.service.ts | 42 +++++----- Open-ILS/src/eg2/src/app/core/org.service.ts | 42 +++++----- Open-ILS/src/eg2/src/app/core/org.spec.ts | 44 +++++----- Open-ILS/src/eg2/src/app/core/pcrud.service.ts | 94 +++++++++++----------- Open-ILS/src/eg2/src/app/core/perm.service.ts | 14 ++-- Open-ILS/src/eg2/src/app/core/store.service.ts | 2 +- Open-ILS/src/eg2/src/app/core/store.spec.ts | 8 +- Open-ILS/src/eg2/src/app/resolver.service.ts | 10 +-- Open-ILS/src/eg2/src/app/routing.module.ts | 10 +-- Open-ILS/src/eg2/src/app/share/README | 2 +- .../share/accesskey/accesskey-info.component.ts | 8 +- .../src/app/share/accesskey/accesskey.directive.ts | 8 +- .../src/app/share/accesskey/accesskey.service.ts | 10 +-- .../src/app/share/catalog/catalog-url.service.ts | 6 +- .../eg2/src/app/share/catalog/catalog.service.ts | 28 +++---- .../eg2/src/app/share/catalog/search-context.ts | 8 +- .../src/eg2/src/app/share/catalog/unapi.service.ts | 12 +-- .../app/share/date-select/date-select.component.ts | 2 +- .../eg2/src/app/share/dialog/confirm.component.ts | 4 +- .../eg2/src/app/share/dialog/dialog.component.ts | 4 +- .../eg2/src/app/share/dialog/progress.component.ts | 6 +- .../eg2/src/app/share/dialog/prompt.component.ts | 4 +- .../src/app/share/fm-editor/fm-editor.component.ts | 30 +++---- .../app/share/grid/grid-column-config.component.ts | 8 +- .../app/share/grid/grid-column-width.component.ts | 14 ++-- .../src/app/share/grid/grid-column.component.ts | 14 ++-- .../src/app/share/grid/grid-header.component.ts | 16 ++-- .../share/grid/grid-toolbar-action.component.ts | 14 ++-- .../share/grid/grid-toolbar-button.component.ts | 14 ++-- .../src/app/share/grid/grid-toolbar.component.ts | 14 ++-- .../src/eg2/src/app/share/grid/grid.component.ts | 26 +++--- Open-ILS/src/eg2/src/app/share/grid/grid.module.ts | 42 +++++----- Open-ILS/src/eg2/src/app/share/grid/grid.ts | 82 +++++++++---------- .../app/share/org-select/org-select.component.ts | 26 +++--- .../src/eg2/src/app/share/print/print.component.ts | 8 +- .../src/eg2/src/app/share/print/print.service.ts | 10 +-- .../eg2/src/app/share/string/string.component.ts | 12 +-- .../src/eg2/src/app/share/string/string.service.ts | 8 +- .../src/eg2/src/app/share/toast/toast.component.ts | 12 +-- .../src/eg2/src/app/share/toast/toast.service.ts | 10 +-- .../src/eg2/src/app/share/util/audio.service.ts | 6 +- .../src/eg2/src/app/share/util/format.service.ts | 14 ++-- .../app/staff/admin/basic-admin-page.component.ts | 6 +- .../src/eg2/src/app/staff/admin/common.module.ts | 36 ++++----- .../src/eg2/src/app/staff/admin/routing.module.ts | 6 +- .../app/staff/admin/server/admin-server.module.ts | 12 +-- .../src/app/staff/admin/server/routing.module.ts | 6 +- .../app/staff/admin/workstation/routing.module.ts | 2 +- .../workstations/workstations.component.ts | 34 ++++---- .../workstations/workstations.module.ts | 4 +- .../eg2/src/app/staff/catalog/catalog.component.ts | 2 +- .../eg2/src/app/staff/catalog/catalog.module.ts | 30 +++---- .../eg2/src/app/staff/catalog/catalog.service.ts | 18 ++--- .../app/staff/catalog/record/copies.component.ts | 8 +- .../staff/catalog/record/marc-view.component.ts | 12 +-- .../staff/catalog/record/pagination.component.ts | 8 +- .../app/staff/catalog/record/record.component.ts | 16 ++-- .../eg2/src/app/staff/catalog/resolver.service.ts | 26 +++--- .../app/staff/catalog/result/facets.component.ts | 4 +- .../staff/catalog/result/pagination.component.ts | 4 +- .../app/staff/catalog/result/record.component.ts | 16 ++-- .../app/staff/catalog/result/results.component.ts | 16 ++-- .../eg2/src/app/staff/catalog/routing.module.ts | 12 +-- .../src/app/staff/catalog/search-form.component.ts | 16 ++-- .../circ/patron/bcsearch/bcsearch.component.ts | 10 +-- .../staff/circ/patron/bcsearch/bcsearch.module.ts | 14 ++-- .../staff/circ/patron/bcsearch/routing.module.ts | 8 +- .../src/app/staff/circ/patron/routing.module.ts | 4 +- .../src/eg2/src/app/staff/circ/routing.module.ts | 4 +- Open-ILS/src/eg2/src/app/staff/common.module.ts | 88 ++++++++++---------- Open-ILS/src/eg2/src/app/staff/login.component.ts | 12 +-- Open-ILS/src/eg2/src/app/staff/nav.component.ts | 6 +- Open-ILS/src/eg2/src/app/staff/resolver.service.ts | 28 +++---- Open-ILS/src/eg2/src/app/staff/routing.module.ts | 28 +++---- .../eg2/src/app/staff/sandbox/routing.module.ts | 6 +- .../eg2/src/app/staff/sandbox/sandbox.component.ts | 38 ++++----- .../eg2/src/app/staff/sandbox/sandbox.module.ts | 18 ++--- .../staff/share/admin-page/admin-page.component.ts | 48 +++++------ .../share/bib-summary/bib-summary.component.ts | 14 ++-- .../staff/share/link-table/link-table.component.ts | 6 +- .../staff/share/op-change/op-change.component.ts | 14 ++-- .../src/app/staff/share/staff-banner.component.ts | 2 +- Open-ILS/src/eg2/src/app/staff/splash.component.ts | 2 +- Open-ILS/src/eg2/src/app/staff/staff.component.ts | 24 +++--- Open-ILS/src/eg2/src/app/staff/staff.module.ts | 26 +++--- Open-ILS/src/eg2/src/main.ts | 4 +- 94 files changed, 803 insertions(+), 803 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/app.component.ts b/Open-ILS/src/eg2/src/app/app.component.ts index 4a36d04493..3f95092c5a 100644 --- a/Open-ILS/src/eg2/src/app/app.component.ts +++ b/Open-ILS/src/eg2/src/app/app.component.ts @@ -5,7 +5,7 @@ import {Component} from '@angular/core'; template: '' }) -export class EgBaseComponent { +export class BaseComponent { } diff --git a/Open-ILS/src/eg2/src/app/app.module.ts b/Open-ILS/src/eg2/src/app/app.module.ts index b45230589a..1f22babfe5 100644 --- a/Open-ILS/src/eg2/src/app/app.module.ts +++ b/Open-ILS/src/eg2/src/app/app.module.ts @@ -1,5 +1,5 @@ /** - * EgBaseModule is the shared starting point for all apps. It provides + * BaseModule is the shared starting point for all apps. It provides * the root route and core services, and a simple welcome page for users * that end up here accidentally. */ @@ -9,26 +9,26 @@ import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; // ng-bootstrap import {CookieModule} from 'ngx-cookie'; // import CookieMonster import {EgCommonModule} from './common.module'; -import {EgBaseComponent} from './app.component'; -import {EgBaseRoutingModule} from './routing.module'; +import {BaseComponent} from './app.component'; +import {BaseRoutingModule} from './routing.module'; import {WelcomeComponent} from './welcome.component'; // Import and 'provide' globally required services. @NgModule({ declarations: [ - EgBaseComponent, + BaseComponent, WelcomeComponent ], imports: [ EgCommonModule.forRoot(), - EgBaseRoutingModule, + BaseRoutingModule, BrowserModule, NgbModule.forRoot(), CookieModule.forRoot() ], exports: [], - bootstrap: [EgBaseComponent] + bootstrap: [BaseComponent] }) -export class EgBaseModule {} +export class BaseModule {} diff --git a/Open-ILS/src/eg2/src/app/common.module.ts b/Open-ILS/src/eg2/src/app/common.module.ts index c999a22d4c..b728240aa6 100644 --- a/Open-ILS/src/eg2/src/app/common.module.ts +++ b/Open-ILS/src/eg2/src/app/common.module.ts @@ -7,22 +7,22 @@ import {RouterModule} from '@angular/router'; import {FormsModule} from '@angular/forms'; import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; -import {EgEventService} from '@eg/core/event.service'; -import {EgStoreService} from '@eg/core/store.service'; -import {EgIdlService} from '@eg/core/idl.service'; -import {EgNetService} from '@eg/core/net.service'; -import {EgAuthService} from '@eg/core/auth.service'; -import {EgPermService} from '@eg/core/perm.service'; -import {EgPcrudService} from '@eg/core/pcrud.service'; -import {EgOrgService} from '@eg/core/org.service'; -import {EgAudioService} from '@eg/share/util/audio.service'; -import {EgFormatService} from '@eg/share/util/format.service'; -import {EgPrintService} from '@eg/share/print/print.service'; -import {EgPrintComponent} from '@eg/share/print/print.component'; +import {EventService} from '@eg/core/event.service'; +import {StoreService} from '@eg/core/store.service'; +import {IdlService} from '@eg/core/idl.service'; +import {NetService} from '@eg/core/net.service'; +import {AuthService} from '@eg/core/auth.service'; +import {PermService} from '@eg/core/perm.service'; +import {PcrudService} from '@eg/core/pcrud.service'; +import {OrgService} from '@eg/core/org.service'; +import {AudioService} from '@eg/share/util/audio.service'; +import {FormatService} from '@eg/share/util/format.service'; +import {PrintService} from '@eg/share/print/print.service'; +import {PrintComponent} from '@eg/share/print/print.component'; @NgModule({ declarations: [ - EgPrintComponent + PrintComponent ], imports: [ CommonModule, @@ -35,7 +35,7 @@ import {EgPrintComponent} from '@eg/share/print/print.component'; RouterModule, NgbModule, FormsModule, - EgPrintComponent + PrintComponent ] }) @@ -48,17 +48,17 @@ export class EgCommonModule { providers: [ DatePipe, CurrencyPipe, - EgEventService, - EgStoreService, - EgIdlService, - EgNetService, - EgAuthService, - EgPermService, - EgPcrudService, - EgOrgService, - EgPrintService, - EgAudioService, - EgFormatService + EventService, + StoreService, + IdlService, + NetService, + AuthService, + PermService, + PcrudService, + OrgService, + PrintService, + AudioService, + FormatService ] }; } diff --git a/Open-ILS/src/eg2/src/app/core/auth.service.ts b/Open-ILS/src/eg2/src/app/core/auth.service.ts index b6608567af..3176bf80e9 100644 --- a/Open-ILS/src/eg2/src/app/core/auth.service.ts +++ b/Open-ILS/src/eg2/src/app/core/auth.service.ts @@ -1,15 +1,15 @@ import {Injectable, EventEmitter} from '@angular/core'; -import {EgNetService} from './net.service'; -import {EgEventService, EgEvent} from './event.service'; -import {EgIdlService, EgIdlObject} from './idl.service'; -import {EgStoreService} from './store.service'; +import {NetService} from './net.service'; +import {EventService, EgEvent} from './event.service'; +import {IdlService, IdlObject} from './idl.service'; +import {StoreService} from './store.service'; // Not universally available. declare var BroadcastChannel; // Models a login instance. -class EgAuthUser { - user: EgIdlObject; // actor.usr (au) object +class AuthUser { + user: IdlObject; // actor.usr (au) object workstation: string; // workstation name token: string; authtime: number; @@ -22,14 +22,14 @@ class EgAuthUser { } // Params required for calling the login() method. -interface EgAuthLoginArgs { +interface AuthLoginArgs { username: string; password: string; type: string; workstation?: string; } -export enum EgAuthWsState { +export enum AuthWsState { PENDING, NOT_USED, NOT_FOUND_SERVER, @@ -38,13 +38,13 @@ export enum EgAuthWsState { } @Injectable() -export class EgAuthService { +export class AuthService { private authChannel: any; - private activeUser: EgAuthUser = null; + private activeUser: AuthUser = null; - workstationState: EgAuthWsState = EgAuthWsState.PENDING; + workstationState: AuthWsState = AuthWsState.PENDING; // Used by auth-checking resolvers redirectUrl: string; @@ -53,9 +53,9 @@ export class EgAuthService { pollTimeout: any; constructor( - private egEvt: EgEventService, - private net: EgNetService, - private store: EgStoreService + private egEvt: EventService, + private net: NetService, + private store: StoreService ) { // BroadcastChannel is not yet defined in PhantomJS and elsewhere @@ -70,7 +70,7 @@ export class EgAuthService { // - Accessor functions always refer to the active user. - user(): EgIdlObject { + user(): IdlObject { return this.activeUser ? this.activeUser.user : null; } @@ -87,14 +87,14 @@ export class EgAuthService { return this.activeUser ? this.activeUser.authtime : 0; } - // NOTE: EgNetService emits an event if the auth session has expired. + // NOTE: NetService emits an event if the auth session has expired. // This only rejects when no authtoken is found. testAuthToken(): Promise { if (!this.activeUser) { // Only necessary on new page loads. During op-change, // for example, we already have an activeUser. - this.activeUser = new EgAuthUser( + this.activeUser = new AuthUser( this.store.getLoginSessionItem('eg.auth.token'), this.store.getLoginSessionItem('eg.auth.time') ); @@ -108,7 +108,7 @@ export class EgAuthService { 'open-ils.auth', 'open-ils.auth.session.retrieve', this.token()).toPromise() .then(user => { - // EgNetService interceps NO_SESSION events. + // NetService interceps NO_SESSION events. // We can only get here if the session is valid. this.activeUser.user = user; this.listenForLogout(); @@ -116,7 +116,7 @@ export class EgAuthService { }); } - login(args: EgAuthLoginArgs, isOpChange?: boolean): Promise { + login(args: AuthLoginArgs, isOpChange?: boolean): Promise { return this.net.request('open-ils.auth', 'open-ils.auth.login', args) .toPromise().then(res => { return this.handleLoginResponse( @@ -125,7 +125,7 @@ export class EgAuthService { } handleLoginResponse( - args: EgAuthLoginArgs, evt: EgEvent, isOpChange: boolean): Promise { + args: AuthLoginArgs, evt: EgEvent, isOpChange: boolean): Promise { switch (evt.textcode) { case 'SUCCESS': @@ -133,7 +133,7 @@ export class EgAuthService { case 'WORKSTATION_NOT_FOUND': console.error(`No such workstation "${args.workstation}"`); - this.workstationState = EgAuthWsState.NOT_FOUND_SERVER; + this.workstationState = AuthWsState.NOT_FOUND_SERVER; delete args.workstation; return this.login(args, isOpChange); @@ -144,14 +144,14 @@ export class EgAuthService { } // Stash the login data - handleLoginOk(args: EgAuthLoginArgs, evt: EgEvent, isOpChange: boolean): Promise { + handleLoginOk(args: AuthLoginArgs, evt: EgEvent, isOpChange: boolean): Promise { if (isOpChange) { this.store.setLoginSessionItem('eg.auth.token.oc', this.token()); this.store.setLoginSessionItem('eg.auth.time.oc', this.authtime()); } - this.activeUser = new EgAuthUser( + this.activeUser = new AuthUser( evt.payload.authtoken, evt.payload.authtime, args.workstation @@ -166,7 +166,7 @@ export class EgAuthService { undoOpChange(): Promise { if (this.opChangeIsActive()) { this.deleteSession(); - this.activeUser = new EgAuthUser( + this.activeUser = new AuthUser( this.store.getLoginSessionItem('eg.auth.token.oc'), this.store.getLoginSessionItem('eg.auth.time.oc'), this.activeUser.workstation @@ -233,7 +233,7 @@ export class EgAuthService { 0, // return extra auth details, unneeded here. 1 // avoid extending the auth timeout - // EgNetService intercepts NO_SESSION events. + // NetService intercepts NO_SESSION events. // If the promise resolves, the session is valid. ).subscribe( user => this.sessionPoll(), @@ -250,12 +250,12 @@ export class EgAuthService { verifyWorkstation(): Promise { if (!this.user()) { - this.workstationState = EgAuthWsState.PENDING; + this.workstationState = AuthWsState.PENDING; return Promise.reject('Cannot verify workstation without user'); } if (!this.user().wsid()) { - this.workstationState = EgAuthWsState.NOT_USED; + this.workstationState = AuthWsState.NOT_USED; return Promise.reject('User has no workstation ID to verify'); } @@ -269,12 +269,12 @@ export class EgAuthService { if (ws) { this.activeUser.workstation = ws.name; - this.workstationState = EgAuthWsState.VALID; + this.workstationState = AuthWsState.VALID; return resolve(); } } - this.workstationState = EgAuthWsState.NOT_FOUND_LOCAL; + this.workstationState = AuthWsState.NOT_FOUND_LOCAL; reject(); }); }); diff --git a/Open-ILS/src/eg2/src/app/core/event.service.ts b/Open-ILS/src/eg2/src/app/core/event.service.ts index 07b8c20fc1..638ba96376 100644 --- a/Open-ILS/src/eg2/src/app/core/event.service.ts +++ b/Open-ILS/src/eg2/src/app/core/event.service.ts @@ -25,10 +25,10 @@ export class EgEvent { } @Injectable() -export class EgEventService { +export class EventService { /** - * Returns an EgEvent if 'thing' is an event, null otherwise. + * Returns an Event if 'thing' is an event, null otherwise. */ parse(thing: any): EgEvent { diff --git a/Open-ILS/src/eg2/src/app/core/event.spec.ts b/Open-ILS/src/eg2/src/app/core/event.spec.ts index 631a9619c7..3dfdab2fbb 100644 --- a/Open-ILS/src/eg2/src/app/core/event.spec.ts +++ b/Open-ILS/src/eg2/src/app/core/event.spec.ts @@ -1,9 +1,9 @@ -import {EgEventService} from './event.service'; +import {EventService} from './event.service'; -describe('EgEventService', () => { - let service: EgEventService; +describe('EventService', () => { + let service: EventService; beforeEach(() => { - service = new EgEventService(); + service = new EventService(); }); const evt = { diff --git a/Open-ILS/src/eg2/src/app/core/idl.service.ts b/Open-ILS/src/eg2/src/app/core/idl.service.ts index 82f0ab73de..9ec6c6e7f6 100644 --- a/Open-ILS/src/eg2/src/app/core/idl.service.ts +++ b/Open-ILS/src/eg2/src/app/core/idl.service.ts @@ -6,7 +6,7 @@ declare var _preload_fieldmapper_IDL: Object; /** * Every IDL object class implements this interface. */ -export interface EgIdlObject { +export interface IdlObject { a: any[]; classname: string; _isfieldmapper: boolean; @@ -15,7 +15,7 @@ export interface EgIdlObject { } @Injectable() -export class EgIdlService { +export class IdlService { classes = {}; // IDL class metadata constructors = {}; // IDL instance generators @@ -23,7 +23,7 @@ export class EgIdlService { /** * Create a new IDL object instance. */ - create(cls: string, seed?: any[]): EgIdlObject { + create(cls: string, seed?: any[]): IdlObject { if (this.constructors[cls]) { return new this.constructors[cls](seed); } @@ -47,9 +47,9 @@ export class EgIdlService { this.classes[cls].classname = cls; // This dance lets us encode each IDL object with the - // EgIdlObject interface. Useful for adding type restrictions + // IdlObject interface. Useful for adding type restrictions // where desired for functions, etc. - const generator: any = ((): EgIdlObject => { + const generator: any = ((): IdlObject => { const x: any = function(seed) { this.a = seed || []; @@ -86,10 +86,10 @@ export class EgIdlService { }); } - // Makes a deep copy of an EgIdlObject's / structures containing - // EgIdlObject's. Note we don't use JSON cross-walk because our + // Makes a deep copy of an IdlObject's / structures containing + // IdlObject's. Note we don't use JSON cross-walk because our // JSON lib does not handle circular references. - // @depth specifies the maximum number of steps through EgIdlObject' + // @depth specifies the maximum number of steps through IdlObject' // we will traverse. clone(source: any, depth?: number): any { if (depth === undefined) { diff --git a/Open-ILS/src/eg2/src/app/core/idl.spec.ts b/Open-ILS/src/eg2/src/app/core/idl.spec.ts index c5e8a6ea6b..8138bf453c 100644 --- a/Open-ILS/src/eg2/src/app/core/idl.spec.ts +++ b/Open-ILS/src/eg2/src/app/core/idl.spec.ts @@ -1,9 +1,9 @@ -import {EgIdlService} from './idl.service'; +import {IdlService} from './idl.service'; -describe('EgIdlService', () => { - let service: EgIdlService; +describe('IdlService', () => { + let service: IdlService; beforeEach(() => { - service = new EgIdlService(); + service = new IdlService(); }); it('should parse the IDL', () => { diff --git a/Open-ILS/src/eg2/src/app/core/net.service.ts b/Open-ILS/src/eg2/src/app/core/net.service.ts index 660201a726..df3cb3e6e9 100644 --- a/Open-ILS/src/eg2/src/app/core/net.service.ts +++ b/Open-ILS/src/eg2/src/app/core/net.service.ts @@ -1,6 +1,6 @@ /** * - * constructor(private net : EgNetService) { + * constructor(private net : NetService) { * ... * this.net.request(service, method, param1 [, param2, ...]) * .subscribe( @@ -23,13 +23,13 @@ import {Injectable, EventEmitter} from '@angular/core'; import {Observable} from 'rxjs/Observable'; import {Observer} from 'rxjs/Observer'; -import {EgEventService, EgEvent} from './event.service'; +import {EventService, EgEvent} from './event.service'; // Global vars from opensrf.js // These are availavble at runtime, but are not exported. declare var OpenSRF, OSRF_TRANSPORT_TYPE_WS; -export class EgNetRequest { +export class NetRequest { service: string; method: string; params: any[]; @@ -40,8 +40,8 @@ export class EgNetRequest { // True if we're using a single-use local session localSession = true; - // Last EgEvent encountered by this request. - // Most callers will not need to import EgEvent since the parsed + // Last Event encountered by this request. + // Most callers will not need to import Event since the parsed // event will be available here. evt: EgEvent; @@ -58,10 +58,10 @@ export class EgNetRequest { } } -export interface EgAuthExpiredEvent { +export interface AuthExpiredEvent { // request is set when the auth expiration was determined as a // by-product of making an API call. - request?: EgNetRequest; + request?: NetRequest; // True if this environment (e.g. browser tab) was notified of the // expired auth token from an external source (e.g. another browser tab). @@ -69,20 +69,20 @@ export interface EgAuthExpiredEvent { } @Injectable() -export class EgNetService { +export class NetService { - permFailed$: EventEmitter; - authExpired$: EventEmitter; + permFailed$: EventEmitter; + authExpired$: EventEmitter; // If true, permission failures are emitted via permFailed$ // and the active request is marked as superseded. permFailedHasHandler: Boolean = false; constructor( - private egEvt: EgEventService + private egEvt: EventService ) { - this.permFailed$ = new EventEmitter(); - this.authExpired$ = new EventEmitter(); + this.permFailed$ = new EventEmitter(); + this.authExpired$ = new EventEmitter(); } // Standard request call -- Variadic params version @@ -94,11 +94,11 @@ export class EgNetService { requestWithParamList(service: string, method: string, params: any[]): Observable { return this.requestCompiled( - new EgNetRequest(service, method, params)); + new NetRequest(service, method, params)); } - // Request with pre-compiled EgNetRequest - requestCompiled(request: EgNetRequest): Observable { + // Request with pre-compiled NetRequest + requestCompiled(request: NetRequest): Observable { return Observable.create( observer => { request.observer = observer; @@ -108,9 +108,9 @@ export class EgNetService { } // Send the compiled request to the server via WebSockets - sendCompiledRequest(request: EgNetRequest): void { + sendCompiledRequest(request: NetRequest): void { OpenSRF.Session.transport = OSRF_TRANSPORT_TYPE_WS; - console.debug(`EgNet: request ${request.method}`); + console.debug(`Net: request ${request.method}`); request.session.request({ async : true, // WS only operates in async mode @@ -119,7 +119,7 @@ export class EgNetService { oncomplete : () => { // TODO: teach opensrf.js to call cleanup() inside - // disconnect() and teach EgPcrud to call cleanup() + // disconnect() and teach Pcrud to call cleanup() // as needed to avoid long-lived session data bloat. if (request.localSession) { request.session.cleanup(); @@ -166,14 +166,14 @@ export class EgNetService { switch (request.evt.textcode) { case 'NO_SESSION': - console.debug(`EgNet emitting event: ${request.evt}`); + console.debug(`Net emitting event: ${request.evt}`); request.observer.error(request.evt.toString()); this.authExpired$.emit({request: request}); return; case 'PERM_FAILURE': if (this.permFailedHasHandler) { - console.debug(`EgNet emitting event: ${request.evt}`); + console.debug(`Net emitting event: ${request.evt}`); request.superseded = true; this.permFailed$.emit(request); return; diff --git a/Open-ILS/src/eg2/src/app/core/org.service.ts b/Open-ILS/src/eg2/src/app/core/org.service.ts index 958d8214bf..57cbf6f26d 100644 --- a/Open-ILS/src/eg2/src/app/core/org.service.ts +++ b/Open-ILS/src/eg2/src/app/core/org.service.ts @@ -1,11 +1,11 @@ import {Injectable} from '@angular/core'; import {Observable} from 'rxjs/Observable'; -import {EgIdlObject, EgIdlService} from './idl.service'; -import {EgNetService} from './net.service'; -import {EgAuthService} from './auth.service'; -import {EgPcrudService} from './pcrud.service'; +import {IdlObject, IdlService} from './idl.service'; +import {NetService} from './net.service'; +import {AuthService} from './auth.service'; +import {PcrudService} from './pcrud.service'; -type EgOrgNodeOrId = number | EgIdlObject; +type OrgNodeOrId = number | IdlObject; interface OrgFilter { canHaveUsers?: boolean; @@ -20,27 +20,27 @@ interface OrgSettingsBatch { } @Injectable() -export class EgOrgService { +export class OrgService { - private orgList: EgIdlObject[] = []; - private orgTree: EgIdlObject; // root node + children - private orgMap: {[id: number]: EgIdlObject} = {}; + private orgList: IdlObject[] = []; + private orgTree: IdlObject; // root node + children + private orgMap: {[id: number]: IdlObject} = {}; private settingsCache: OrgSettingsBatch = {}; constructor( - private net: EgNetService, - private auth: EgAuthService, - private pcrud: EgPcrudService + private net: NetService, + private auth: AuthService, + private pcrud: PcrudService ) {} - get(nodeOrId: EgOrgNodeOrId): EgIdlObject { + get(nodeOrId: OrgNodeOrId): IdlObject { if (typeof nodeOrId === 'object') { return nodeOrId; } return this.orgMap[nodeOrId]; } - list(): EgIdlObject[] { + list(): IdlObject[] { return this.orgList; } @@ -80,17 +80,17 @@ export class EgOrgService { return list; } - tree(): EgIdlObject { + tree(): IdlObject { return this.orgTree; } // get the root OU - root(): EgIdlObject { + root(): IdlObject { return this.orgList[0]; } // list of org_unit objects or IDs for ancestors + me - ancestors(nodeOrId: EgOrgNodeOrId, asId?: boolean): any[] { + ancestors(nodeOrId: OrgNodeOrId, asId?: boolean): any[] { let node = this.get(nodeOrId); if (!node) { return []; } const nodes = [node]; @@ -121,7 +121,7 @@ export class EgOrgService { } // list of org_unit objects or IDs for me + descendants - descendants(nodeOrId: EgOrgNodeOrId, asId?: boolean): any[] { + descendants(nodeOrId: OrgNodeOrId, asId?: boolean): any[] { const node = this.get(nodeOrId); if (!node) { return []; } const nodes = []; @@ -137,7 +137,7 @@ export class EgOrgService { } // list of org_unit objects or IDs for ancestors + me + descendants - fullPath(nodeOrId: EgOrgNodeOrId, asId?: boolean): any[] { + fullPath(nodeOrId: OrgNodeOrId, asId?: boolean): any[] { const list = this.ancestors(nodeOrId, false).concat( this.descendants(nodeOrId, false).slice(1)); if (asId) { @@ -146,7 +146,7 @@ export class EgOrgService { return list; } - sortTree(sortField?: string, node?: EgIdlObject): void { + sortTree(sortField?: string, node?: IdlObject): void { if (!sortField) { sortField = 'shortname'; } if (!node) { node = this.orgTree; } node.children( @@ -157,7 +157,7 @@ export class EgOrgService { node.children.forEach(n => this.sortTree(n)); } - absorbTree(node?: EgIdlObject): void { + absorbTree(node?: IdlObject): void { if (!node) { node = this.orgTree; this.orgMap = {}; diff --git a/Open-ILS/src/eg2/src/app/core/org.spec.ts b/Open-ILS/src/eg2/src/app/core/org.spec.ts index 2b2fad6229..78c2f26657 100644 --- a/Open-ILS/src/eg2/src/app/core/org.spec.ts +++ b/Open-ILS/src/eg2/src/app/core/org.spec.ts @@ -1,28 +1,28 @@ -import {EgIdlService} from './idl.service'; -import {EgEventService} from './event.service'; -import {EgNetService} from './net.service'; -import {EgAuthService} from './auth.service'; -import {EgPcrudService} from './pcrud.service'; -import {EgStoreService} from './store.service'; -import {EgOrgService} from './org.service'; +import {IdlService} from './idl.service'; +import {EventService} from './event.service'; +import {NetService} from './net.service'; +import {AuthService} from './auth.service'; +import {PcrudService} from './pcrud.service'; +import {StoreService} from './store.service'; +import {OrgService} from './org.service'; -describe('EgOrgService', () => { - let idlService: EgIdlService; - let netService: EgNetService; - let authService: EgAuthService; - let pcrudService: EgPcrudService; - let orgService: EgOrgService; - let evtService: EgEventService; - let storeService: EgStoreService; +describe('OrgService', () => { + let idlService: IdlService; + let netService: NetService; + let authService: AuthService; + let pcrudService: PcrudService; + let orgService: OrgService; + let evtService: EventService; + let storeService: StoreService; beforeEach(() => { - idlService = new EgIdlService(); - evtService = new EgEventService(); - storeService = new EgStoreService(null /* CookieService */); - netService = new EgNetService(evtService); - authService = new EgAuthService(evtService, netService, storeService); - pcrudService = new EgPcrudService(idlService, netService, authService); - orgService = new EgOrgService(netService, authService, pcrudService); + idlService = new IdlService(); + evtService = new EventService(); + storeService = new StoreService(null /* CookieService */); + netService = new NetService(evtService); + authService = new AuthService(evtService, netService, storeService); + pcrudService = new PcrudService(idlService, netService, authService); + orgService = new OrgService(netService, authService, pcrudService); }); const initTestData = () => { diff --git a/Open-ILS/src/eg2/src/app/core/pcrud.service.ts b/Open-ILS/src/eg2/src/app/core/pcrud.service.ts index 759d81ee30..ea1dabc551 100644 --- a/Open-ILS/src/eg2/src/app/core/pcrud.service.ts +++ b/Open-ILS/src/eg2/src/app/core/pcrud.service.ts @@ -1,15 +1,15 @@ import {Injectable} from '@angular/core'; import {Observable} from 'rxjs/Observable'; import {Observer} from 'rxjs/Observer'; -import {EgIdlService, EgIdlObject} from './idl.service'; -import {EgNetService, EgNetRequest} from './net.service'; -import {EgAuthService} from './auth.service'; +import {IdlService, IdlObject} from './idl.service'; +import {NetService, NetRequest} from './net.service'; +import {AuthService} from './auth.service'; // Externally defined. Used here for debugging. declare var js2JSON: (jsThing: any) => string; declare var OpenSRF: any; // creating sessions -interface EgPcrudReqOps { +interface PcrudReqOps { authoritative?: boolean; anonymous?: boolean; idlist?: boolean; @@ -17,9 +17,9 @@ interface EgPcrudReqOps { } // For for documentation purposes. -type EgPcrudResponse = any; +type PcrudResponse = any; -export class EgPcrudContext { +export class PcrudContext { static verboseLogging = true; // static identGenerator = 0; // for debug logging @@ -29,28 +29,28 @@ export class EgPcrudContext { private xactCloseMode: string; private cudIdx: number; private cudAction: string; - private cudLast: EgPcrudResponse; - private cudList: EgIdlObject[]; + private cudLast: PcrudResponse; + private cudList: IdlObject[]; - private idl: EgIdlService; - private net: EgNetService; - private auth: EgAuthService; + private idl: IdlService; + private net: NetService; + private auth: AuthService; // Tracks nested CUD actions - cudObserver: Observer; + cudObserver: Observer; session: any; // OpenSRF.ClientSession constructor( // passed in by parent service -- not injected - egIdl: EgIdlService, - egNet: EgNetService, - egAuth: EgAuthService + egIdl: IdlService, + egNet: NetService, + egAuth: AuthService ) { this.idl = egIdl; this.net = egNet; this.auth = egAuth; this.xactCloseMode = 'rollback'; - this.ident = EgPcrudContext.identGenerator++; + this.ident = PcrudContext.identGenerator++; this.session = new OpenSRF.ClientSession('open-ils.pcrud'); } @@ -59,7 +59,7 @@ export class EgPcrudContext { } log(msg: string): void { - if (EgPcrudContext.verboseLogging) { + if (PcrudContext.verboseLogging) { console.debug(this + ': ' + msg); } } @@ -68,12 +68,12 @@ export class EgPcrudContext { console.error(this + ': ' + msg); } - token(reqOps?: EgPcrudReqOps): string { + token(reqOps?: PcrudReqOps): string { return (reqOps && reqOps.anonymous) ? 'ANONYMOUS' : this.auth.token(); } - connect(): Promise { + connect(): Promise { this.log('connect'); return new Promise( (resolve, reject) => { this.session.connect({ @@ -88,7 +88,7 @@ export class EgPcrudContext { } retrieve(fmClass: string, pkey: Number | string, - pcrudOps?: any, reqOps?: EgPcrudReqOps): Observable { + pcrudOps?: any, reqOps?: PcrudReqOps): Observable { reqOps = reqOps || {}; this.authoritative = reqOps.authoritative || false; return this.dispatch( @@ -97,14 +97,14 @@ export class EgPcrudContext { } retrieveAll(fmClass: string, pcrudOps?: any, - reqOps?: EgPcrudReqOps): Observable { + reqOps?: PcrudReqOps): Observable { const search = {}; search[this.idl.classes[fmClass].pkey] = {'!=' : null}; return this.search(fmClass, search, pcrudOps, reqOps); } search(fmClass: string, search: any, - pcrudOps?: any, reqOps?: EgPcrudReqOps): Observable { + pcrudOps?: any, reqOps?: PcrudReqOps): Observable { reqOps = reqOps || {}; this.authoritative = reqOps.authoritative || false; @@ -116,33 +116,33 @@ export class EgPcrudContext { return this.dispatch(method, [this.token(reqOps), search, pcrudOps]); } - create(list: EgIdlObject | EgIdlObject[]): Observable { + create(list: IdlObject | IdlObject[]): Observable { return this.cud('create', list); } - update(list: EgIdlObject | EgIdlObject[]): Observable { + update(list: IdlObject | IdlObject[]): Observable { return this.cud('update', list); } - remove(list: EgIdlObject | EgIdlObject[]): Observable { + remove(list: IdlObject | IdlObject[]): Observable { return this.cud('delete', list); } - autoApply(list: EgIdlObject | EgIdlObject[]): Observable { // RENAMED + autoApply(list: IdlObject | IdlObject[]): Observable { // RENAMED return this.cud('auto', list); } - xactClose(): Observable { + xactClose(): Observable { return this.sendRequest( 'open-ils.pcrud.transaction.' + this.xactCloseMode, [this.token()] ); } - xactBegin(): Observable { + xactBegin(): Observable { return this.sendRequest( 'open-ils.pcrud.transaction.begin', [this.token()] ); } - private dispatch(method: string, params: any[]): Observable { + private dispatch(method: string, params: any[]): Observable { if (this.authoritative) { return this.wrapXact(() => { return this.sendRequest(method, params); @@ -158,7 +158,7 @@ export class EgPcrudContext { // => action // => xact_close(commit/rollback) // => disconnect - wrapXact(mainFunc: () => Observable): Observable { + wrapXact(mainFunc: () => Observable): Observable { return Observable.create(observer => { // 1. connect @@ -187,18 +187,18 @@ export class EgPcrudContext { } private sendRequest(method: string, - params: any[]): Observable { + params: any[]): Observable { // this.log(`sendRequest(${method})`); return this.net.requestCompiled( - new EgNetRequest( + new NetRequest( 'open-ils.pcrud', method, params, this.session) ); } private cud(action: string, - list: EgIdlObject | EgIdlObject[]): Observable { + list: IdlObject | IdlObject[]): Observable { this.cudList = [].concat(list); // value or array this.log(`CUD(): ${action}`); @@ -252,52 +252,52 @@ export class EgPcrudContext { } @Injectable() -export class EgPcrudService { +export class PcrudService { constructor( - private idl: EgIdlService, - private net: EgNetService, - private auth: EgAuthService + private idl: IdlService, + private net: NetService, + private auth: AuthService ) {} // Pass-thru functions for one-off PCRUD calls - connect(): Promise { + connect(): Promise { return this.newContext().connect(); } - newContext(): EgPcrudContext { - return new EgPcrudContext(this.idl, this.net, this.auth); + newContext(): PcrudContext { + return new PcrudContext(this.idl, this.net, this.auth); } retrieve(fmClass: string, pkey: Number | string, - pcrudOps?: any, reqOps?: EgPcrudReqOps): Observable { + pcrudOps?: any, reqOps?: PcrudReqOps): Observable { return this.newContext().retrieve(fmClass, pkey, pcrudOps, reqOps); } retrieveAll(fmClass: string, pcrudOps?: any, - reqOps?: EgPcrudReqOps): Observable { + reqOps?: PcrudReqOps): Observable { return this.newContext().retrieveAll(fmClass, pcrudOps, reqOps); } search(fmClass: string, search: any, - pcrudOps?: any, reqOps?: EgPcrudReqOps): Observable { + pcrudOps?: any, reqOps?: PcrudReqOps): Observable { return this.newContext().search(fmClass, search, pcrudOps, reqOps); } - create(list: EgIdlObject | EgIdlObject[]): Observable { + create(list: IdlObject | IdlObject[]): Observable { return this.newContext().create(list); } - update(list: EgIdlObject | EgIdlObject[]): Observable { + update(list: IdlObject | IdlObject[]): Observable { return this.newContext().update(list); } - remove(list: EgIdlObject | EgIdlObject[]): Observable { + remove(list: IdlObject | IdlObject[]): Observable { return this.newContext().remove(list); } - autoApply(list: EgIdlObject | EgIdlObject[]): Observable { + autoApply(list: IdlObject | IdlObject[]): Observable { return this.newContext().autoApply(list); } } diff --git a/Open-ILS/src/eg2/src/app/core/perm.service.ts b/Open-ILS/src/eg2/src/app/core/perm.service.ts index 3ed9f13b3c..774c045f33 100644 --- a/Open-ILS/src/eg2/src/app/core/perm.service.ts +++ b/Open-ILS/src/eg2/src/app/core/perm.service.ts @@ -1,7 +1,7 @@ import {Injectable} from '@angular/core'; -import {EgNetService} from './net.service'; -import {EgOrgService} from './org.service'; -import {EgAuthService} from './auth.service'; +import {NetService} from './net.service'; +import {OrgService} from './org.service'; +import {AuthService} from './auth.service'; interface HasPermAtResult { [permName: string]: any[]; // org IDs or org unit objects @@ -12,12 +12,12 @@ interface HasPermHereResult { } @Injectable() -export class EgPermService { +export class PermService { constructor( - private net: EgNetService, - private org: EgOrgService, - private auth: EgAuthService, + private net: NetService, + private org: OrgService, + private auth: AuthService, ) {} // workstation not required. diff --git a/Open-ILS/src/eg2/src/app/core/store.service.ts b/Open-ILS/src/eg2/src/app/core/store.service.ts index 2062eca6d5..0a20ca82db 100644 --- a/Open-ILS/src/eg2/src/app/core/store.service.ts +++ b/Open-ILS/src/eg2/src/app/core/store.service.ts @@ -5,7 +5,7 @@ import {Injectable} from '@angular/core'; import {CookieService} from 'ngx-cookie'; @Injectable() -export class EgStoreService { +export class StoreService { // Base path for cookie-based storage. // Useful for limiting cookies to subsections of the application. diff --git a/Open-ILS/src/eg2/src/app/core/store.spec.ts b/Open-ILS/src/eg2/src/app/core/store.spec.ts index 0c30fdc7db..ae6c27fbf5 100644 --- a/Open-ILS/src/eg2/src/app/core/store.spec.ts +++ b/Open-ILS/src/eg2/src/app/core/store.spec.ts @@ -1,9 +1,9 @@ -import {EgStoreService} from './store.service'; +import {StoreService} from './store.service'; -describe('EgStoreService', () => { - let service: EgStoreService; +describe('StoreService', () => { + let service: StoreService; beforeEach(() => { - service = new EgStoreService(null /* CookieService */); + service = new StoreService(null /* CookieService */); }); it('should set/get a localStorage value', () => { diff --git a/Open-ILS/src/eg2/src/app/resolver.service.ts b/Open-ILS/src/eg2/src/app/resolver.service.ts index 8e1fc2a074..ac5c381d5d 100644 --- a/Open-ILS/src/eg2/src/app/resolver.service.ts +++ b/Open-ILS/src/eg2/src/app/resolver.service.ts @@ -1,16 +1,16 @@ import {Injectable} from '@angular/core'; import {Router, Resolve, RouterStateSnapshot, ActivatedRouteSnapshot} from '@angular/router'; -import {EgIdlService} from '@eg/core/idl.service'; -import {EgOrgService} from '@eg/core/org.service'; +import {IdlService} from '@eg/core/idl.service'; +import {OrgService} from '@eg/core/org.service'; @Injectable() -export class EgBaseResolver implements Resolve> { +export class BaseResolver implements Resolve> { constructor( private router: Router, - private idl: EgIdlService, - private org: EgOrgService, + private idl: IdlService, + private org: OrgService, ) {} /** diff --git a/Open-ILS/src/eg2/src/app/routing.module.ts b/Open-ILS/src/eg2/src/app/routing.module.ts index c60df919e4..db3ee19dce 100644 --- a/Open-ILS/src/eg2/src/app/routing.module.ts +++ b/Open-ILS/src/eg2/src/app/routing.module.ts @@ -1,6 +1,6 @@ import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; -import {EgBaseResolver} from './resolver.service'; +import {BaseResolver} from './resolver.service'; import {WelcomeComponent} from './welcome.component'; /** @@ -15,15 +15,15 @@ const routes: Routes = [ component: WelcomeComponent }, { path: 'staff', - resolve : {startup : EgBaseResolver}, - loadChildren: './staff/staff.module#EgStaffModule' + resolve : {startup : BaseResolver}, + loadChildren: './staff/staff.module#StaffModule' } ]; @NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule], - providers: [EgBaseResolver] + providers: [BaseResolver] }) -export class EgBaseRoutingModule {} +export class BaseRoutingModule {} diff --git a/Open-ILS/src/eg2/src/app/share/README b/Open-ILS/src/eg2/src/app/share/README index 8bd93d7a56..f428f79e42 100644 --- a/Open-ILS/src/eg2/src/app/share/README +++ b/Open-ILS/src/eg2/src/app/share/README @@ -1,6 +1,6 @@ Shared Angular services, components, directives, and associated classes. These items are NOT automatically imported to the base module, though some -may already be imported by intermediate modules (e.g. EgStaffCommonModule). +may already be imported by intermediate modules (e.g. StaffCommonModule). Import as needed. diff --git a/Open-ILS/src/eg2/src/app/share/accesskey/accesskey-info.component.ts b/Open-ILS/src/eg2/src/app/share/accesskey/accesskey-info.component.ts index 4cce4073b2..d713ee60b6 100644 --- a/Open-ILS/src/eg2/src/app/share/accesskey/accesskey-info.component.ts +++ b/Open-ILS/src/eg2/src/app/share/accesskey/accesskey-info.component.ts @@ -1,19 +1,19 @@ /** */ import {Component, Input, OnInit} from '@angular/core'; -import {EgAccessKeyService} from '@eg/share/accesskey/accesskey.service'; -import {EgDialogComponent} from '@eg/share/dialog/dialog.component'; +import {AccessKeyService} from '@eg/share/accesskey/accesskey.service'; +import {DialogComponent} from '@eg/share/dialog/dialog.component'; import {NgbModal} from '@ng-bootstrap/ng-bootstrap'; @Component({ selector: 'eg-accesskey-info', templateUrl: './accesskey-info.component.html' }) -export class EgAccessKeyInfoComponent extends EgDialogComponent { +export class AccessKeyInfoComponent extends DialogComponent { constructor( private modal: NgbModal, // required for passing to parent - private keyService: EgAccessKeyService) { + private keyService: AccessKeyService) { super(modal); } diff --git a/Open-ILS/src/eg2/src/app/share/accesskey/accesskey.directive.ts b/Open-ILS/src/eg2/src/app/share/accesskey/accesskey.directive.ts index 989f29e233..dfc835d9bd 100644 --- a/Open-ILS/src/eg2/src/app/share/accesskey/accesskey.directive.ts +++ b/Open-ILS/src/eg2/src/app/share/accesskey/accesskey.directive.ts @@ -12,12 +12,12 @@ * > */ import {Directive, ElementRef, Input, OnInit} from '@angular/core'; -import {EgAccessKeyService} from '@eg/share/accesskey/accesskey.service'; +import {AccessKeyService} from '@eg/share/accesskey/accesskey.service'; @Directive({ selector: '[egAccessKey]' }) -export class EgAccessKeyDirective implements OnInit { +export class AccessKeyDirective implements OnInit { // Space-separated list of key combinations // E.g. "ctrl+h", "alt+h ctrl+y" @@ -32,13 +32,13 @@ export class EgAccessKeyDirective implements OnInit { constructor( private elm: ElementRef, - private keyService: EgAccessKeyService + private keyService: AccessKeyService ) { } ngOnInit() { if (!this.keySpec) { - console.warn('EgAccessKey no keySpec provided'); + console.warn('AccessKey no keySpec provided'); return; } diff --git a/Open-ILS/src/eg2/src/app/share/accesskey/accesskey.service.ts b/Open-ILS/src/eg2/src/app/share/accesskey/accesskey.service.ts index 0ca0645703..323bdea1a3 100644 --- a/Open-ILS/src/eg2/src/app/share/accesskey/accesskey.service.ts +++ b/Open-ILS/src/eg2/src/app/share/accesskey/accesskey.service.ts @@ -1,6 +1,6 @@ import {Injectable, EventEmitter, HostListener} from '@angular/core'; -export interface EgAccessKeyAssignment { +export interface AccessKeyAssignment { key: string; // keyboard command desc: string; // human-friendly description ctx: string; // template context @@ -8,15 +8,15 @@ export interface EgAccessKeyAssignment { } @Injectable() -export class EgAccessKeyService { +export class AccessKeyService { // Assignments stored as an array with most recently assigned // items toward the front. Most recent items have precedence. - assignments: EgAccessKeyAssignment[] = []; + assignments: AccessKeyAssignment[] = []; constructor() {} - assign(assn: EgAccessKeyAssignment): void { + assign(assn: AccessKeyAssignment): void { this.assignments.unshift(assn); } @@ -42,7 +42,7 @@ export class EgAccessKeyService { for (const i in this.assignments) { // for-loop to exit early if (keySpec === this.assignments[i].key) { const assign = this.assignments[i]; - console.debug(`EgAccessKey assignment found for ${assign.key}`); + console.debug(`AccessKey assignment found for ${assign.key}`); // Allow the current digest cycle to complete before // firing the access key action. setTimeout(assign.action, 0); diff --git a/Open-ILS/src/eg2/src/app/share/catalog/catalog-url.service.ts b/Open-ILS/src/eg2/src/app/share/catalog/catalog-url.service.ts index a4cdff4ca5..b39f3cad95 100644 --- a/Open-ILS/src/eg2/src/app/share/catalog/catalog-url.service.ts +++ b/Open-ILS/src/eg2/src/app/share/catalog/catalog-url.service.ts @@ -1,15 +1,15 @@ import {Injectable} from '@angular/core'; import {ParamMap} from '@angular/router'; -import {EgOrgService} from '@eg/core/org.service'; +import {OrgService} from '@eg/core/org.service'; import {CatalogSearchContext, FacetFilter} from './search-context'; import {CATALOG_CCVM_FILTERS} from './catalog.service'; @Injectable() -export class EgCatalogUrlService { +export class CatalogUrlService { // consider supporting a param name prefix/namespace - constructor(private org: EgOrgService) { } + constructor(private org: OrgService) { } /** * Returns a URL query structure suitable for using with diff --git a/Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts b/Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts index 352fd6a4c2..6c1c6b9858 100644 --- a/Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts +++ b/Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts @@ -1,9 +1,9 @@ import {Injectable} from '@angular/core'; -import {EgOrgService} from '@eg/core/org.service'; -import {EgUnapiService} from '@eg/share/catalog/unapi.service'; -import {EgIdlObject} from '@eg/core/idl.service'; -import {EgNetService} from '@eg/core/net.service'; -import {EgPcrudService} from '@eg/core/pcrud.service'; +import {OrgService} from '@eg/core/org.service'; +import {UnapiService} from '@eg/share/catalog/unapi.service'; +import {IdlObject} from '@eg/core/idl.service'; +import {NetService} from '@eg/core/net.service'; +import {PcrudService} from '@eg/core/pcrud.service'; import {CatalogSearchContext, CatalogSearchState} from './search-context'; export const CATALOG_CCVM_FILTERS = [ @@ -40,10 +40,10 @@ const NAMESPACE_MAPS = { }; @Injectable() -export class EgCatalogService { +export class CatalogService { - ccvmMap: {[ccvm: string]: EgIdlObject[]} = {}; - cmfMap: {[cmf: string]: EgIdlObject} = {}; + ccvmMap: {[ccvm: string]: IdlObject[]} = {}; + cmfMap: {[cmf: string]: IdlObject} = {}; // Keep a reference to the most recently retrieved facet data, // since facet data is consistent across a given search. @@ -52,10 +52,10 @@ export class EgCatalogService { lastFacetKey: string; constructor( - private net: EgNetService, - private org: EgOrgService, - private unapi: EgUnapiService, - private pcrud: EgPcrudService + private net: NetService, + private org: OrgService, + private unapi: UnapiService, + private pcrud: PcrudService ) {} search(ctx: CatalogSearchContext): Promise { @@ -113,7 +113,7 @@ export class EgCatalogService { summary => { if (ctx.result.records) { // May be reset when quickly navigating results. - ctx.result.records[idx] = summary + ctx.result.records[idx] = summary; } } ) @@ -189,7 +189,7 @@ export class EgCatalogService { }); } - compileCcvms(ccvms: EgIdlObject[]): void { + compileCcvms(ccvms: IdlObject[]): void { ccvms.forEach(ccvm => { if (!this.ccvmMap[ccvm.ctype()]) { this.ccvmMap[ccvm.ctype()] = []; diff --git a/Open-ILS/src/eg2/src/app/share/catalog/search-context.ts b/Open-ILS/src/eg2/src/app/share/catalog/search-context.ts index ab702cb83e..7b8908c8f0 100644 --- a/Open-ILS/src/eg2/src/app/share/catalog/search-context.ts +++ b/Open-ILS/src/eg2/src/app/share/catalog/search-context.ts @@ -1,5 +1,5 @@ -import {EgOrgService} from '@eg/core/org.service'; -import {EgIdlObject} from '@eg/core/idl.service'; +import {OrgService} from '@eg/core/org.service'; +import {IdlObject} from '@eg/core/idl.service'; import {Pager} from '@eg/share/util/pager'; import {Params} from '@angular/router'; @@ -42,7 +42,7 @@ export class CatalogSearchContext { joinOp: string[]; matchOp: string[]; format: string; - searchOrg: EgIdlObject; + searchOrg: IdlObject; ccvmFilters: {[ccvmCode: string]: string[]}; facetFilters: FacetFilter[]; isStaff: boolean; @@ -56,7 +56,7 @@ export class CatalogSearchContext { // Utility stuff pager: Pager; - org: EgOrgService; + org: OrgService; constructor() { this.pager = new Pager(); diff --git a/Open-ILS/src/eg2/src/app/share/catalog/unapi.service.ts b/Open-ILS/src/eg2/src/app/share/catalog/unapi.service.ts index 7a1bad03ca..e285a89c4c 100644 --- a/Open-ILS/src/eg2/src/app/share/catalog/unapi.service.ts +++ b/Open-ILS/src/eg2/src/app/share/catalog/unapi.service.ts @@ -1,5 +1,5 @@ import {Injectable, EventEmitter} from '@angular/core'; -import {EgOrgService} from '@eg/core/org.service'; +import {OrgService} from '@eg/core/org.service'; /* TODO: Add Display Fields to UNAPI @@ -8,7 +8,7 @@ https://library.biz/opac/extras/unapi?id=tag::U2@bre/1{bre.extern,holdings_xml,m const UNAPI_PATH = '/opac/extras/unapi?id=tag::U2@'; -interface EgUnapiParams { +interface UnapiParams { target: string; // bre, ... id: number | string; // 1 | 1,2,3,4,5 extras: string; // {holdings_xml,mra,...} @@ -18,11 +18,11 @@ interface EgUnapiParams { } @Injectable() -export class EgUnapiService { +export class UnapiService { - constructor(private org: EgOrgService) {} + constructor(private org: OrgService) {} - createUrl(params: EgUnapiParams): string { + createUrl(params: UnapiParams): string { const depth = params.depth || 0; const org = params.orgId ? this.org.get(params.orgId) : this.org.root(); @@ -30,7 +30,7 @@ export class EgUnapiService { `${org.shortname()}/${depth}&format=${params.format}`; } - getAsXmlDocument(params: EgUnapiParams): Promise { + getAsXmlDocument(params: UnapiParams): Promise { // XReq creates an XML document for us. Seems like the right // tool for the job. const url = this.createUrl(params); diff --git a/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.ts b/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.ts index e670414d7b..ae3a729a3c 100644 --- a/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.ts +++ b/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.ts @@ -11,7 +11,7 @@ import {NgbDateStruct} from '@ng-bootstrap/ng-bootstrap'; selector: 'eg-date-select', templateUrl: './date-select.component.html' }) -export class EgDateSelectComponent implements OnInit { +export class DateSelectComponent implements OnInit { @Input() initialIso: string; // ISO string @Input() initialYmd: string; // YYYY-MM-DD (uses local time zone) diff --git a/Open-ILS/src/eg2/src/app/share/dialog/confirm.component.ts b/Open-ILS/src/eg2/src/app/share/dialog/confirm.component.ts index e00731b233..efcbdeb54e 100644 --- a/Open-ILS/src/eg2/src/app/share/dialog/confirm.component.ts +++ b/Open-ILS/src/eg2/src/app/share/dialog/confirm.component.ts @@ -1,5 +1,5 @@ import {Component, Input, ViewChild, TemplateRef} from '@angular/core'; -import {EgDialogComponent} from '@eg/share/dialog/dialog.component'; +import {DialogComponent} from '@eg/share/dialog/dialog.component'; @Component({ selector: 'eg-confirm-dialog', @@ -9,7 +9,7 @@ import {EgDialogComponent} from '@eg/share/dialog/dialog.component'; /** * Confirmation dialog that asks a yes/no question. */ -export class EgConfirmDialogComponent extends EgDialogComponent { +export class ConfirmDialogComponent extends DialogComponent { // What question are we asking? @Input() public dialogBody: string; } diff --git a/Open-ILS/src/eg2/src/app/share/dialog/dialog.component.ts b/Open-ILS/src/eg2/src/app/share/dialog/dialog.component.ts index 19374a9d3b..8a93ea6e01 100644 --- a/Open-ILS/src/eg2/src/app/share/dialog/dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/share/dialog/dialog.component.ts @@ -4,14 +4,14 @@ import {NgbModal, NgbModalRef, NgbModalOptions} from '@ng-bootstrap/ng-bootstrap /** * Dialog base class. Handles the ngbModal logic. * Sub-classed component templates must have a #dialogContent selector - * at the root of the template (see EgConfirmDialogComponent). + * at the root of the template (see ConfirmDialogComponent). */ @Component({ selector: 'eg-dialog', template: '' }) -export class EgDialogComponent implements OnInit { +export class DialogComponent implements OnInit { // Assume all dialogs support a title attribute. @Input() public dialogTitle: string; diff --git a/Open-ILS/src/eg2/src/app/share/dialog/progress.component.ts b/Open-ILS/src/eg2/src/app/share/dialog/progress.component.ts index e0aead3cc6..180ed500ae 100644 --- a/Open-ILS/src/eg2/src/app/share/dialog/progress.component.ts +++ b/Open-ILS/src/eg2/src/app/share/dialog/progress.component.ts @@ -1,5 +1,5 @@ import {Component, Input, ViewChild, TemplateRef} from '@angular/core'; -import {EgDialogComponent} from '@eg/share/dialog/dialog.component'; +import {DialogComponent} from '@eg/share/dialog/dialog.component'; @Component({ selector: 'eg-progress-dialog', @@ -12,7 +12,7 @@ import {EgDialogComponent} from '@eg/share/dialog/dialog.component'; * * // assuming a template reference... * @ViewChild('progressDialog') - * private dialog: EgProgressDialogComponent; + * private dialog: ProgressDialogComponent; * * dialog.open(); * dialog.update({value : 0, max : 123}); @@ -41,7 +41,7 @@ import {EgDialogComponent} from '@eg/share/dialog/dialog.component'; * indeterminate: shows a generic value-less with no * clear indication of progress. */ -export class EgProgressDialogComponent extends EgDialogComponent { +export class ProgressDialogComponent extends DialogComponent { max: number; value: number; diff --git a/Open-ILS/src/eg2/src/app/share/dialog/prompt.component.ts b/Open-ILS/src/eg2/src/app/share/dialog/prompt.component.ts index 179efeb6bc..ab7f77ea0c 100644 --- a/Open-ILS/src/eg2/src/app/share/dialog/prompt.component.ts +++ b/Open-ILS/src/eg2/src/app/share/dialog/prompt.component.ts @@ -1,5 +1,5 @@ import {Component, Input, ViewChild, TemplateRef} from '@angular/core'; -import {EgDialogComponent} from '@eg/share/dialog/dialog.component'; +import {DialogComponent} from '@eg/share/dialog/dialog.component'; @Component({ selector: 'eg-prompt-dialog', @@ -9,7 +9,7 @@ import {EgDialogComponent} from '@eg/share/dialog/dialog.component'; /** * Promptation dialog that requests user input. */ -export class EgPromptDialogComponent extends EgDialogComponent { +export class PromptDialogComponent extends DialogComponent { // What question are we asking? @Input() public dialogBody: string; // Value to return to the caller diff --git a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts index 84a347ba8e..ade0852d88 100644 --- a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts +++ b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts @@ -1,9 +1,9 @@ import {Component, OnInit, Input, Output, EventEmitter, TemplateRef} from '@angular/core'; -import {EgIdlService, EgIdlObject} from '@eg/core/idl.service'; -import {EgAuthService} from '@eg/core/auth.service'; -import {EgPcrudService} from '@eg/core/pcrud.service'; -import {EgDialogComponent} from '@eg/share/dialog/dialog.component'; +import {IdlService, IdlObject} from '@eg/core/idl.service'; +import {AuthService} from '@eg/core/auth.service'; +import {PcrudService} from '@eg/core/pcrud.service'; +import {DialogComponent} from '@eg/share/dialog/dialog.component'; import {NgbModal, NgbModalOptions} from '@ng-bootstrap/ng-bootstrap'; interface CustomFieldTemplate { @@ -17,7 +17,7 @@ interface CustomFieldTemplate { interface CustomFieldContext { // Current create/edit/view record - record: EgIdlObject; + record: IdlObject; // IDL field definition blob field: any; @@ -33,7 +33,7 @@ interface CustomFieldContext { styles: ['input[type="checkbox"] {margin-left: 0px}'] }) export class FmRecordEditorComponent - extends EgDialogComponent implements OnInit { + extends DialogComponent implements OnInit { // IDL class hint (e.g. "aou") @Input() idlClass: string; @@ -45,7 +45,7 @@ export class FmRecordEditorComponent recId: any; // IDL record we are editing // TODO: allow this to be update in real time by the caller? - record: EgIdlObject; + record: IdlObject; @Input() customFieldTemplates: {[fieldName: string]: CustomFieldTemplate} = {}; @@ -74,16 +74,16 @@ export class FmRecordEditorComponent // supports cases where whether a field is required or not depends // on the current value of another field. @Input() isRequiredOverride: - {[field: string]: (field: string, record: EgIdlObject) => boolean}; + {[field: string]: (field: string, record: IdlObject) => boolean}; // IDL record display label. Defaults to the IDL label. @Input() recordLabel: string; // Emit the modified object when the save action completes. - @Output() onSave$ = new EventEmitter(); + @Output() onSave$ = new EventEmitter(); // Emit the original object when the save action is canceled. - @Output() onCancel$ = new EventEmitter(); + @Output() onCancel$ = new EventEmitter(); // Emit an error message when the save action fails. @Output() onError$ = new EventEmitter(); @@ -110,9 +110,9 @@ export class FmRecordEditorComponent constructor( private modal: NgbModal, // required for passing to parent - private idl: EgIdlService, - private auth: EgAuthService, - private pcrud: EgPcrudService) { + private idl: IdlService, + private auth: AuthService, + private pcrud: PcrudService) { super(modal); } @@ -188,7 +188,7 @@ export class FmRecordEditorComponent // Modifies the provided FM record in place, replacing JS values // with IDL-compatible values. - convertDatatypesToIdl(rec: EgIdlObject) { + convertDatatypesToIdl(rec: IdlObject) { const fields = this.idlDef.fields; fields.forEach(field => { if (field.datatype === 'bool') { @@ -208,7 +208,7 @@ export class FmRecordEditorComponent } - private flattenLinkedValues(cls: string, list: EgIdlObject[]): any[] { + private flattenLinkedValues(cls: string, list: IdlObject[]): any[] { const idField = this.idl.classes[cls].pkey; const selector = this.idl.classes[cls].field_map[idField].selector || idField; diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-column-config.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid-column-config.component.ts index f1ce757e11..10ad606f2b 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-column-config.component.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-column-config.component.ts @@ -1,6 +1,6 @@ import {Component, Input, OnInit} from '@angular/core'; -import {EgDialogComponent} from '@eg/share/dialog/dialog.component'; -import {EgGridColumnSet} from './grid'; +import {DialogComponent} from '@eg/share/dialog/dialog.component'; +import {GridColumnSet} from './grid'; @Component({ selector: 'eg-grid-column-config', @@ -9,8 +9,8 @@ import {EgGridColumnSet} from './grid'; /** */ -export class EgGridColumnConfigComponent extends EgDialogComponent implements OnInit { - @Input() columnSet: EgGridColumnSet; +export class GridColumnConfigComponent extends DialogComponent implements OnInit { + @Input() columnSet: GridColumnSet; } diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-column-width.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid-column-width.component.ts index 2ff482f259..f9bacf4dad 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-column-width.component.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-column-width.component.ts @@ -1,16 +1,16 @@ import {Component, Input, OnInit, Host} from '@angular/core'; -import {EgGridContext, EgGridColumn, EgGridColumnSet, - EgGridDataSource} from './grid'; +import {GridContext, GridColumn, GridColumnSet, + GridDataSource} from './grid'; @Component({ selector: 'eg-grid-column-width', templateUrl: './grid-column-width.component.html' }) -export class EgGridColumnWidthComponent implements OnInit { +export class GridColumnWidthComponent implements OnInit { - @Input() gridContext: EgGridContext; - columnSet: EgGridColumnSet; + @Input() gridContext: GridContext; + columnSet: GridColumnSet; isVisible: boolean; constructor() {} @@ -20,11 +20,11 @@ export class EgGridColumnWidthComponent implements OnInit { this.columnSet = this.gridContext.columnSet; } - expandColumn(col: EgGridColumn) { + expandColumn(col: GridColumn) { col.flex++; } - shrinkColumn(col: EgGridColumn) { + shrinkColumn(col: GridColumn) { if (col.flex > 1) { col.flex--; } } diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-column.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid-column.component.ts index c9993c3ba1..34548a9e4c 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-column.component.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-column.component.ts @@ -1,15 +1,15 @@ import {Component, Input, OnInit, Host, TemplateRef} from '@angular/core'; -import {EgGridColumn, EgGridColumnSet} from './grid'; -import {EgGridComponent} from './grid.component'; +import {GridColumn, GridColumnSet} from './grid'; +import {GridComponent} from './grid.component'; @Component({ selector: 'eg-grid-column', template: '' }) -export class EgGridColumnComponent implements OnInit { +export class GridColumnComponent implements OnInit { - // Note most input fields should match class fields for EgGridColumn + // Note most input fields should match class fields for GridColumn @Input() name: string; @Input() path: string; @Input() label: string; @@ -27,16 +27,16 @@ export class EgGridColumnComponent implements OnInit { @Input() cellTemplate: TemplateRef; // get a reference to our container grid. - constructor(@Host() private grid: EgGridComponent) {} + constructor(@Host() private grid: GridComponent) {} ngOnInit() { if (!this.grid) { - console.warn('EgGridColumnComponent needs an '); + console.warn('GridColumnComponent needs an '); return; } - const col = new EgGridColumn(); + const col = new GridColumn(); col.name = this.name; col.path = this.path; col.label = this.label; diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-header.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid-header.component.ts index 7340633f05..8f2dab330e 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-header.component.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-header.component.ts @@ -1,16 +1,16 @@ import {Component, Input, OnInit} from '@angular/core'; -import {EgGridContext, EgGridColumn, EgGridRowSelector, - EgGridColumnSet, EgGridDataSource} from './grid'; +import {GridContext, GridColumn, GridRowSelector, + GridColumnSet, GridDataSource} from './grid'; @Component({ selector: 'eg-grid-header', templateUrl: './grid-header.component.html' }) -export class EgGridHeaderComponent implements OnInit { +export class GridHeaderComponent implements OnInit { - @Input() gridContext: EgGridContext; - dragColumn: EgGridColumn; + @Input() gridContext: GridContext; + dragColumn: GridColumn; constructor() {} @@ -28,12 +28,12 @@ export class EgGridHeaderComponent implements OnInit { $event.preventDefault(); } - onColumnDrop(col: EgGridColumn) { + onColumnDrop(col: GridColumn) { this.gridContext.columnSet.insertBefore(this.dragColumn, col); this.gridContext.columnSet.columns.forEach(c => c.isDragTarget = false); } - sortOneColumn(col: EgGridColumn) { + sortOneColumn(col: GridColumn) { let dir = 'ASC'; const sort = this.gridContext.dataSource.sort; @@ -47,7 +47,7 @@ export class EgGridHeaderComponent implements OnInit { // Returns true if the provided column is sorting in the // specified direction. - isColumnSorting(col: EgGridColumn, dir: string): boolean { + isColumnSorting(col: GridColumn, dir: string): boolean { const sort = this.gridContext.dataSource.sort.filter(c => c.name === col.name)[0]; return sort && sort.dir === dir; } diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-action.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-action.component.ts index c9ba49675d..593530a7f9 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-action.component.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-action.component.ts @@ -1,29 +1,29 @@ import {Component, Input, OnInit, Host, TemplateRef} from '@angular/core'; -import {EgGridToolbarAction} from './grid'; -import {EgGridComponent} from './grid.component'; +import {GridToolbarAction} from './grid'; +import {GridComponent} from './grid.component'; @Component({ selector: 'eg-grid-toolbar-action', template: '' }) -export class EgGridToolbarActionComponent implements OnInit { +export class GridToolbarActionComponent implements OnInit { - // Note most input fields should match class fields for EgGridColumn + // Note most input fields should match class fields for GridColumn @Input() label: string; @Input() action: (rows: any[]) => any; // get a reference to our container grid. - constructor(@Host() private grid: EgGridComponent) {} + constructor(@Host() private grid: GridComponent) {} ngOnInit() { if (!this.grid) { - console.warn('EgGridToolbarActionComponent needs a [grid]'); + console.warn('GridToolbarActionComponent needs a [grid]'); return; } - const action = new EgGridToolbarAction(); + const action = new GridToolbarAction(); action.label = this.label; action.action = this.action; diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-button.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-button.component.ts index 7c37d45d69..ae71b18b64 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-button.component.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-button.component.ts @@ -1,29 +1,29 @@ import {Component, Input, OnInit, Host, TemplateRef} from '@angular/core'; -import {EgGridToolbarButton} from './grid'; -import {EgGridComponent} from './grid.component'; +import {GridToolbarButton} from './grid'; +import {GridComponent} from './grid.component'; @Component({ selector: 'eg-grid-toolbar-button', template: '' }) -export class EgGridToolbarButtonComponent implements OnInit { +export class GridToolbarButtonComponent implements OnInit { - // Note most input fields should match class fields for EgGridColumn + // Note most input fields should match class fields for GridColumn @Input() label: string; @Input() action: () => any; // get a reference to our container grid. - constructor(@Host() private grid: EgGridComponent) {} + constructor(@Host() private grid: GridComponent) {} ngOnInit() { if (!this.grid) { - console.warn('EgGridToolbarButtonComponent needs a [grid]'); + console.warn('GridToolbarButtonComponent needs a [grid]'); return; } - const btn = new EgGridToolbarButton(); + const btn = new GridToolbarButton(); btn.label = this.label; btn.action = this.action; diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.ts index 690c14cf0e..43d3aec9d8 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.ts @@ -1,19 +1,19 @@ import {Component, Input, OnInit, Host} from '@angular/core'; import {DomSanitizer, SafeUrl} from '@angular/platform-browser'; import {Pager} from '@eg/share/util/pager'; -import {EgGridColumn, EgGridColumnSet, EgGridToolbarButton, - EgGridToolbarAction, EgGridContext, EgGridDataSource} from '@eg/share/grid/grid'; -import {EgGridColumnWidthComponent} from './grid-column-width.component'; +import {GridColumn, GridColumnSet, GridToolbarButton, + GridToolbarAction, GridContext, GridDataSource} from '@eg/share/grid/grid'; +import {GridColumnWidthComponent} from './grid-column-width.component'; @Component({ selector: 'eg-grid-toolbar', templateUrl: 'grid-toolbar.component.html' }) -export class EgGridToolbarComponent implements OnInit { +export class GridToolbarComponent implements OnInit { - @Input() gridContext: EgGridContext; - @Input() colWidthConfig: EgGridColumnWidthComponent; + @Input() gridContext: GridContext; + @Input() colWidthConfig: GridColumnWidthComponent; csvExportInProgress: boolean; csvExportUrl: SafeUrl; @@ -35,7 +35,7 @@ export class EgGridToolbarComponent implements OnInit { ); } - performAction(action: EgGridToolbarAction) { + performAction(action: GridToolbarAction) { action.action(this.gridContext.getSelectedRows()); } diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid.component.ts index 29d5863703..5f9368263c 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid.component.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid.component.ts @@ -1,11 +1,11 @@ import {Component, Input, OnInit, AfterViewInit, EventEmitter, OnDestroy, HostListener, ViewEncapsulation} from '@angular/core'; import {Subscription} from 'rxjs/Subscription'; -import {EgIdlService} from '@eg/core/idl.service'; -import {EgOrgService} from '@eg/core/org.service'; -import {EgStoreService} from '@eg/core/store.service'; -import {EgFormatService} from '@eg/share/util/format.service'; -import {EgGridContext, EgGridColumn, EgGridDataSource} from './grid'; +import {IdlService} from '@eg/core/idl.service'; +import {OrgService} from '@eg/core/org.service'; +import {StoreService} from '@eg/core/store.service'; +import {FormatService} from '@eg/share/util/format.service'; +import {GridContext, GridColumn, GridDataSource} from './grid'; @Component({ selector: 'eg-grid', @@ -15,28 +15,28 @@ import {EgGridContext, EgGridColumn, EgGridDataSource} from './grid'; encapsulation: ViewEncapsulation.None }) -export class EgGridComponent implements OnInit, AfterViewInit, OnDestroy { +export class GridComponent implements OnInit, AfterViewInit, OnDestroy { @Input() mainLabel: string; - @Input() dataSource: EgGridDataSource; + @Input() dataSource: GridDataSource; @Input() idlClass: string; @Input() isSortable: boolean; @Input() isMultiSortable: boolean; @Input() persistKey: string; @Input() disableMultiSelect: boolean; - context: EgGridContext; + context: GridContext; onRowActivate$: EventEmitter; onRowClick$: EventEmitter; constructor( - private idl: EgIdlService, - private org: EgOrgService, - private store: EgStoreService, - private format: EgFormatService + private idl: IdlService, + private org: OrgService, + private store: StoreService, + private format: FormatService ) { this.context = - new EgGridContext(this.idl, this.org, this.store, this.format); + new GridContext(this.idl, this.org, this.store, this.format); this.onRowActivate$ = new EventEmitter(); this.onRowClick$ = new EventEmitter(); } diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid.module.ts b/Open-ILS/src/eg2/src/app/share/grid/grid.module.ts index 076f43dc8e..07a7eede20 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid.module.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid.module.ts @@ -1,41 +1,41 @@ import {NgModule} from '@angular/core'; import {EgCommonModule} from '@eg/common.module'; -import {EgGridComponent} from './grid.component'; -import {EgGridColumnComponent} from './grid-column.component'; -import {EgGridHeaderComponent} from './grid-header.component'; -import {EgGridToolbarComponent} from './grid-toolbar.component'; -import {EgGridToolbarButtonComponent} from './grid-toolbar-button.component'; -import {EgGridToolbarActionComponent} from './grid-toolbar-action.component'; -import {EgGridColumnConfigComponent} from './grid-column-config.component'; -import {EgGridColumnWidthComponent} from './grid-column-width.component'; +import {GridComponent} from './grid.component'; +import {GridColumnComponent} from './grid-column.component'; +import {GridHeaderComponent} from './grid-header.component'; +import {GridToolbarComponent} from './grid-toolbar.component'; +import {GridToolbarButtonComponent} from './grid-toolbar-button.component'; +import {GridToolbarActionComponent} from './grid-toolbar-action.component'; +import {GridColumnConfigComponent} from './grid-column-config.component'; +import {GridColumnWidthComponent} from './grid-column-width.component'; @NgModule({ declarations: [ // public + internal components - EgGridComponent, - EgGridColumnComponent, - EgGridHeaderComponent, - EgGridToolbarComponent, - EgGridToolbarButtonComponent, - EgGridToolbarActionComponent, - EgGridColumnConfigComponent, - EgGridColumnWidthComponent + GridComponent, + GridColumnComponent, + GridHeaderComponent, + GridToolbarComponent, + GridToolbarButtonComponent, + GridToolbarActionComponent, + GridColumnConfigComponent, + GridColumnWidthComponent ], imports: [ EgCommonModule ], exports: [ // public components - EgGridComponent, - EgGridColumnComponent, - EgGridToolbarButtonComponent, - EgGridToolbarActionComponent + GridComponent, + GridColumnComponent, + GridToolbarButtonComponent, + GridToolbarActionComponent ], providers: [ ] }) -export class EgGridModule { +export class GridModule { } diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid.ts b/Open-ILS/src/eg2/src/app/share/grid/grid.ts index 805c5db675..2c7de9def8 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid.ts @@ -4,15 +4,15 @@ import {TemplateRef} from '@angular/core'; import {Observable} from 'rxjs/Observable'; import {Subscription} from 'rxjs/Subscription'; -import {EgIdlService, EgIdlObject} from '@eg/core/idl.service'; -import {EgOrgService} from '@eg/core/org.service'; -import {EgStoreService} from '@eg/core/store.service'; -import {EgFormatService} from '@eg/share/util/format.service'; +import {IdlService, IdlObject} from '@eg/core/idl.service'; +import {OrgService} from '@eg/core/org.service'; +import {StoreService} from '@eg/core/store.service'; +import {FormatService} from '@eg/share/util/format.service'; import {Pager} from '@eg/share/util/pager'; const MAX_ALL_ROW_COUNT = 10000; -export class EgGridColumn { +export class GridColumn { name: string; path: string; label: string; @@ -40,10 +40,10 @@ export class EgGridColumn { } } -export class EgGridColumnSet { - columns: EgGridColumn[]; +export class GridColumnSet { + columns: GridColumn[]; idlClass: string; - indexColumn: EgGridColumn; + indexColumn: GridColumn; isSortable: boolean; isMultiSortable: boolean; stockVisible: string[]; @@ -54,7 +54,7 @@ export class EgGridColumnSet { this.idlClass = idlClass; } - add(col: EgGridColumn) { + add(col: GridColumn) { // avoid dupes if (this.getColByName(col.name)) { return; } @@ -76,7 +76,7 @@ export class EgGridColumnSet { this.columns.push(col); } - getColByName(name: string): EgGridColumn { + getColByName(name: string): GridColumn { return this.columns.filter(c => c.name === name)[0]; } @@ -89,7 +89,7 @@ export class EgGridColumnSet { }); } - applyColumnSortability(col: EgGridColumn) { + applyColumnSortability(col: GridColumn) { // column sortability defaults to the sortability of the column set. if (col.isSortable === undefined && this.isSortable) { col.isSortable = true; @@ -104,11 +104,11 @@ export class EgGridColumnSet { } } - displayColumns(): EgGridColumn[] { + displayColumns(): GridColumn[] { return this.columns.filter(c => c.visible); } - insertBefore(source: EgGridColumn, target: EgGridColumn) { + insertBefore(source: GridColumn, target: GridColumn) { let targetIdx = -1; let sourceIdx = -1; this.columns.forEach((col, idx) => { @@ -132,7 +132,7 @@ export class EgGridColumnSet { this.columns = newCols; } - moveColumn(col: EgGridColumn, diff: number) { + moveColumn(col: GridColumn, diff: number) { let srcIdx, targetIdx; this.columns.forEach((c, i) => { @@ -162,13 +162,13 @@ export class EgGridColumnSet { this.columns.splice(targetIdx, 0, col); } - compileSaveObject(): EgGridColumnPersistConf[] { + compileSaveObject(): GridColumnPersistConf[] { // only store information about visible columns. const conf = this.displayColumns(); // scrunch the data down to just the needed info return conf.map(col => { - const c: EgGridColumnPersistConf = {name : col.name}; + const c: GridColumnPersistConf = {name : col.name}; if (col.align !== 'left') { c.align = col.align; } if (col.flex !== 2) { c.flex = Number(col.flex); } if (Number(col.sort)) { c.sort = Number(c.sort); } @@ -176,7 +176,7 @@ export class EgGridColumnSet { }); } - applyColumnSettings(conf: EgGridColumnPersistConf[]) { + applyColumnSettings(conf: GridColumnPersistConf[]) { if (!conf || conf.length === 0) { return; } const newCols = []; @@ -211,7 +211,7 @@ export class EgGridColumnSet { } -export class EgGridRowSelector { +export class GridRowSelector { indexes: {[string: string]: boolean}; constructor() { @@ -258,7 +258,7 @@ export class EgGridRowSelector { -export class EgGridContext { +export class GridContext { pager: Pager; idlClass: string; @@ -266,24 +266,24 @@ export class EgGridContext { isMultiSortable: boolean; persistKey: string; disableMultiSelect: boolean; - dataSource: EgGridDataSource; - columnSet: EgGridColumnSet; - rowSelector: EgGridRowSelector; - toolbarButtons: EgGridToolbarButton[]; - toolbarActions: EgGridToolbarAction[]; + dataSource: GridDataSource; + columnSet: GridColumnSet; + rowSelector: GridRowSelector; + toolbarButtons: GridToolbarButton[]; + toolbarActions: GridToolbarAction[]; lastSelectedIndex: any; pageChanges: Subscription; mainLabel: string; // Services injected by our grid component - idl: EgIdlService; - org: EgOrgService; - store: EgStoreService; - format: EgFormatService; + idl: IdlService; + org: OrgService; + store: StoreService; + format: FormatService; constructor( - idl: EgIdlService, org: EgOrgService, - store: EgStoreService, format: EgFormatService) { + idl: IdlService, org: OrgService, + store: StoreService, format: FormatService) { this.idl = idl; this.org = org; @@ -291,13 +291,13 @@ export class EgGridContext { this.format = format; this.pager = new Pager(); this.pager.limit = 10; // TODO config - this.rowSelector = new EgGridRowSelector(); + this.rowSelector = new GridRowSelector(); this.toolbarButtons = []; this.toolbarActions = []; } init() { - this.columnSet = new EgGridColumnSet(this.idlClass); + this.columnSet = new GridColumnSet(this.idlClass); this.columnSet.isSortable = this.isSortable === true; this.columnSet.isMultiSortable = this.isMultiSortable === true; this.generateColumns(); @@ -380,7 +380,7 @@ export class EgGridContext { return selected; } - getRowColumnValue(row: any, col: EgGridColumn): string { + getRowColumnValue(row: any, col: GridColumn): string { let val; if (typeof row[col.name] === 'function') { val = row[col.name](); @@ -390,7 +390,7 @@ export class EgGridContext { return this.format.transform({value: val, datatype: col.datatype}); } - getColumnTextContent(row: any, col: EgGridColumn): string { + getColumnTextContent(row: any, col: GridColumn): string { if (col.cellTemplate) { // TODO } else { @@ -549,7 +549,7 @@ export class EgGridContext { if (this.columnSet.idlClass) { this.idl.classes[this.columnSet.idlClass].fields.forEach(field => { if (field.virtual) { return; } - const col = new EgGridColumn(); + const col = new GridColumn(); col.name = field.name; col.label = field.label || field.name; col.idlFieldDef = field; @@ -568,7 +568,7 @@ export class EgGridContext { if (!this.persistKey) { throw new Error('Grid persistKey required to save columns'); } - const compiled: EgGridColumnPersistConf[] = + const compiled: GridColumnPersistConf[] = this.columnSet.compileSaveObject(); return this.store.setItem('eg.grid.' + this.persistKey, compiled); } @@ -576,14 +576,14 @@ export class EgGridContext { // TODO: saveColumnsAsOrgSetting(...) - getColumnsConfig(persistKey: string): Promise { + getColumnsConfig(persistKey: string): Promise { if (!persistKey) { return Promise.resolve([]); } return this.store.getItem('eg.grid.' + persistKey); } } -export class EgGridColumnPersistConf { +export class GridColumnPersistConf { name: string; flex?: number; sort?: number; @@ -592,18 +592,18 @@ export class EgGridColumnPersistConf { // Actions apply to specific rows -export class EgGridToolbarAction { +export class GridToolbarAction { label: string; action: (rows: any[]) => any; } // Buttons are global actions -export class EgGridToolbarButton { +export class GridToolbarButton { label: string; action: () => any; } -export class EgGridDataSource { +export class GridDataSource { data: any[]; sort: any[]; diff --git a/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts b/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts index e996a51b0e..ec906b97bf 100644 --- a/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts +++ b/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts @@ -6,10 +6,10 @@ import {distinctUntilChanged} from 'rxjs/operators/distinctUntilChanged'; import {merge} from 'rxjs/operators/merge'; import {filter} from 'rxjs/operators/filter'; import {Subject} from 'rxjs/Subject'; -import {EgAuthService} from '@eg/core/auth.service'; -import {EgStoreService} from '@eg/core/store.service'; -import {EgOrgService} from '@eg/core/org.service'; -import {EgIdlObject} from '@eg/core/idl.service'; +import {AuthService} from '@eg/core/auth.service'; +import {StoreService} from '@eg/core/store.service'; +import {OrgService} from '@eg/core/org.service'; +import {IdlObject} from '@eg/core/idl.service'; import {NgbTypeahead, NgbTypeaheadSelectItemEvent} from '@ng-bootstrap/ng-bootstrap'; // Use a unicode char for spacing instead of ASCII=32 so the browser @@ -26,13 +26,13 @@ interface OrgDisplay { selector: 'eg-org-select', templateUrl: './org-select.component.html' }) -export class EgOrgSelectComponent implements OnInit { +export class OrgSelectComponent implements OnInit { selected: OrgDisplay; hidden: number[] = []; disabled: number[] = []; click$ = new Subject(); - startOrg: EgIdlObject; + startOrg: IdlObject; @ViewChild('instance') instance: NgbTypeahead; @@ -60,7 +60,7 @@ export class EgOrgSelectComponent implements OnInit { // Apply an org unit value at load time. // This will NOT result in an onChange event. - @Input() set initialOrg(org: EgIdlObject) { + @Input() set initialOrg(org: IdlObject) { if (org) { this.startOrg = org; } } @@ -72,7 +72,7 @@ export class EgOrgSelectComponent implements OnInit { // Modify the selected org unit via data binding. // This WILL result in an onChange event firing. - @Input() set applyOrg(org: EgIdlObject) { + @Input() set applyOrg(org: IdlObject) { if (org) { this.selected = this.formatForDisplay(org); } @@ -88,12 +88,12 @@ export class EgOrgSelectComponent implements OnInit { // Emitted when the org unit value is changed via the selector. // Does not fire on initialOrg - @Output() onChange = new EventEmitter(); + @Output() onChange = new EventEmitter(); constructor( - private auth: EgAuthService, - private store: EgStoreService, - private org: EgOrgService + private auth: AuthService, + private store: StoreService, + private org: OrgService ) {} ngOnInit() { @@ -117,7 +117,7 @@ export class EgOrgSelectComponent implements OnInit { } // Format for display in the selector drop-down and input. - formatForDisplay(org: EgIdlObject): OrgDisplay { + formatForDisplay(org: IdlObject): OrgDisplay { return { id : org.id(), label : PAD_SPACE.repeat(org.ou_type().depth()) diff --git a/Open-ILS/src/eg2/src/app/share/print/print.component.ts b/Open-ILS/src/eg2/src/app/share/print/print.component.ts index ff36bd9abf..b715bc6d32 100644 --- a/Open-ILS/src/eg2/src/app/share/print/print.component.ts +++ b/Open-ILS/src/eg2/src/app/share/print/print.component.ts @@ -1,19 +1,19 @@ import {Component, OnInit, TemplateRef, ElementRef} from '@angular/core'; -import {EgPrintService, EgPrintRequest} from './print.service'; +import {PrintService, PrintRequest} from './print.service'; @Component({ selector: 'eg-print', templateUrl: './print.component.html' }) -export class EgPrintComponent implements OnInit { +export class PrintComponent implements OnInit { template: TemplateRef; context: any; constructor( private elm: ElementRef, - private printer: EgPrintService + private printer: PrintService ) {} ngOnInit() { @@ -21,7 +21,7 @@ export class EgPrintComponent implements OnInit { printReq => this.handlePrintRequest(printReq)); } - handlePrintRequest(printReq: EgPrintRequest) { + handlePrintRequest(printReq: PrintRequest) { this.template = printReq.template; this.context = printReq.contextData; diff --git a/Open-ILS/src/eg2/src/app/share/print/print.service.ts b/Open-ILS/src/eg2/src/app/share/print/print.service.ts index 3b18692f76..4c9914f99a 100644 --- a/Open-ILS/src/eg2/src/app/share/print/print.service.ts +++ b/Open-ILS/src/eg2/src/app/share/print/print.service.ts @@ -1,21 +1,21 @@ import {Injectable, EventEmitter, TemplateRef} from '@angular/core'; -export interface EgPrintRequest { +export interface PrintRequest { template: TemplateRef; contextData: any; printContext: string; } @Injectable() -export class EgPrintService { +export class PrintService { - onPrintRequest$: EventEmitter; + onPrintRequest$: EventEmitter; constructor() { - this.onPrintRequest$ = new EventEmitter(); + this.onPrintRequest$ = new EventEmitter(); } - print(printReq: EgPrintRequest) { + print(printReq: PrintRequest) { this.onPrintRequest$.emit(printReq); } } diff --git a/Open-ILS/src/eg2/src/app/share/string/string.component.ts b/Open-ILS/src/eg2/src/app/share/string/string.component.ts index b4cfe5a5e8..7ba9a409a8 100644 --- a/Open-ILS/src/eg2/src/app/share/string/string.component.ts +++ b/Open-ILS/src/eg2/src/app/share/string/string.component.ts @@ -1,14 +1,14 @@ /*j * * - * import {EgStringComponent} from '@eg/share/string.component'; - * @ViewChild('helloStr') private helloStr: EgStringComponent; + * import {StringComponent} from '@eg/share/string.component'; + * @ViewChild('helloStr') private helloStr: StringComponent; * ... * this.helloStr.currrent().then(s => console.log(s)); * */ import {Component, Input, OnInit, ElementRef, TemplateRef} from '@angular/core'; -import {EgStringService} from '@eg/share/string/string.service'; +import {StringService} from '@eg/share/string/string.service'; @Component({ selector: 'eg-string', @@ -19,13 +19,13 @@ import {EgStringService} from '@eg/share/string/string.service'; ` }) -export class EgStringComponent implements OnInit { +export class StringComponent implements OnInit { @Input() key: string; @Input() ctx: any; @Input() template: TemplateRef; - constructor(private elm: ElementRef, private strings: EgStringService) { + constructor(private elm: ElementRef, private strings: StringService) { this.elm = elm; this.strings = strings; } @@ -45,7 +45,7 @@ export class EgStringComponent implements OnInit { // Apply the new context if provided, give our container a // chance to update, then resolve with the current string. // NOTE: talking to the native DOM element is not so great, but - // hopefully we can retire the EgString* code entirely once + // hopefully we can retire the String* code entirely once // in-code translations are supported (Ang6?) current(ctx?: any): Promise { if (ctx) { this.ctx = ctx; } diff --git a/Open-ILS/src/eg2/src/app/share/string/string.service.ts b/Open-ILS/src/eg2/src/app/share/string/string.service.ts index 5c120e84ac..37a07d913d 100644 --- a/Open-ILS/src/eg2/src/app/share/string/string.service.ts +++ b/Open-ILS/src/eg2/src/app/share/string/string.service.ts @@ -1,18 +1,18 @@ import {Injectable} from '@angular/core'; -interface EgStringAssignment { +interface StringAssignment { key: string; // keyboard command resolver: (ctx: any) => Promise; } @Injectable() -export class EgStringService { +export class StringService { - strings: {[key: string]: EgStringAssignment} = {}; + strings: {[key: string]: StringAssignment} = {}; constructor() {} - register(assn: EgStringAssignment) { + register(assn: StringAssignment) { this.strings[assn.key] = assn; } diff --git a/Open-ILS/src/eg2/src/app/share/toast/toast.component.ts b/Open-ILS/src/eg2/src/app/share/toast/toast.component.ts index 8744c0ccea..9503ffd824 100644 --- a/Open-ILS/src/eg2/src/app/share/toast/toast.component.ts +++ b/Open-ILS/src/eg2/src/app/share/toast/toast.component.ts @@ -1,5 +1,5 @@ import {Component, Input, OnInit, ViewChild} from '@angular/core'; -import {EgToastService, EgToastMessage} from '@eg/share/toast/toast.service'; +import {ToastService, ToastMessage} from '@eg/share/toast/toast.service'; const EG_TOAST_TIMEOUT = 3000; @@ -8,21 +8,21 @@ const EG_TOAST_TIMEOUT = 3000; templateUrl: './toast.component.html', styleUrls: ['./toast.component.css'] }) -export class EgToastComponent implements OnInit { +export class ToastComponent implements OnInit { - message: EgToastMessage; + message: ToastMessage; // track the most recent timeout event timeout: any; - constructor(private toast: EgToastService) { + constructor(private toast: ToastService) { } ngOnInit() { this.toast.messages$.subscribe(msg => this.show(msg)); } - show(msg: EgToastMessage) { + show(msg: ToastMessage) { this.dismiss(this.message); this.message = msg; this.timeout = setTimeout( @@ -31,7 +31,7 @@ export class EgToastComponent implements OnInit { ); } - dismiss(msg: EgToastMessage) { + dismiss(msg: ToastMessage) { this.message = null; if (this.timeout) { clearTimeout(this.timeout); diff --git a/Open-ILS/src/eg2/src/app/share/toast/toast.service.ts b/Open-ILS/src/eg2/src/app/share/toast/toast.service.ts index 92a1725714..58065922ba 100644 --- a/Open-ILS/src/eg2/src/app/share/toast/toast.service.ts +++ b/Open-ILS/src/eg2/src/app/share/toast/toast.service.ts @@ -1,20 +1,20 @@ import {Injectable, EventEmitter} from '@angular/core'; -export interface EgToastMessage { +export interface ToastMessage { text: string; style: string; } @Injectable() -export class EgToastService { +export class ToastService { - messages$: EventEmitter; + messages$: EventEmitter; constructor() { - this.messages$ = new EventEmitter(); + this.messages$ = new EventEmitter(); } - sendMessage(msg: EgToastMessage) { + sendMessage(msg: ToastMessage) { this.messages$.emit(msg); } diff --git a/Open-ILS/src/eg2/src/app/share/util/audio.service.ts b/Open-ILS/src/eg2/src/app/share/util/audio.service.ts index 85dae6945e..9e5b9a9d49 100644 --- a/Open-ILS/src/eg2/src/app/share/util/audio.service.ts +++ b/Open-ILS/src/eg2/src/app/share/util/audio.service.ts @@ -17,16 +17,16 @@ * workstation settings. */ import {Injectable, EventEmitter} from '@angular/core'; -import {EgStoreService} from '@eg/core/store.service'; +import {StoreService} from '@eg/core/store.service'; const AUDIO_BASE_URL = '/audio/notifications/'; @Injectable() -export class EgAudioService { +export class AudioService { // map of requested audio path to resolved path private urlCache: {[path: string]: string} = {}; - constructor(private store: EgStoreService) {} + constructor(private store: StoreService) {} play(path: string): void { if (path) { diff --git a/Open-ILS/src/eg2/src/app/share/util/format.service.ts b/Open-ILS/src/eg2/src/app/share/util/format.service.ts index ee9b8fc89a..33d3253370 100644 --- a/Open-ILS/src/eg2/src/app/share/util/format.service.ts +++ b/Open-ILS/src/eg2/src/app/share/util/format.service.ts @@ -1,7 +1,7 @@ import {Injectable} from '@angular/core'; import {DatePipe, CurrencyPipe} from '@angular/common'; -import {EgIdlService, EgIdlObject} from '@eg/core/idl.service'; -import {EgOrgService} from '@eg/core/org.service'; +import {IdlService, IdlObject} from '@eg/core/idl.service'; +import {OrgService} from '@eg/core/org.service'; /** * Format IDL vield values for display. @@ -9,7 +9,7 @@ import {EgOrgService} from '@eg/core/org.service'; declare var OpenSRF; -export interface EgFormatParams { +export interface FormatParams { value: any; idlClass?: string; idlField?: string; @@ -19,7 +19,7 @@ export interface EgFormatParams { } @Injectable() -export class EgFormatService { +export class FormatService { dateFormat = 'shortDate'; dateTimeFormat = 'short'; @@ -28,14 +28,14 @@ export class EgFormatService { constructor( private datePipe: DatePipe, private currencyPipe: CurrencyPipe, - private idl: EgIdlService, - private org: EgOrgService + private idl: IdlService, + private org: OrgService ) {} /** * Create a human-friendly display version of any field type. */ - transform(params: EgFormatParams): string { + transform(params: FormatParams): string { const value = params.value; if ( value === undefined diff --git a/Open-ILS/src/eg2/src/app/staff/admin/basic-admin-page.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/basic-admin-page.component.ts index 5e23ded3c4..e2a64f5b15 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/basic-admin-page.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/basic-admin-page.component.ts @@ -1,6 +1,6 @@ import {Component, OnInit} from '@angular/core'; import {ActivatedRoute} from '@angular/router'; -import {EgIdlService} from '@eg/core/idl.service'; +import {IdlService} from '@eg/core/idl.service'; /** * Generic IDL class editor page. @@ -14,13 +14,13 @@ import {EgIdlService} from '@eg/core/idl.service'; ` }) -export class EgBasicAdminPageComponent implements OnInit { +export class BasicAdminPageComponent implements OnInit { idlClass: string; classLabel: string; constructor( private route: ActivatedRoute, - private idl: EgIdlService + private idl: IdlService ) { } diff --git a/Open-ILS/src/eg2/src/app/staff/admin/common.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/common.module.ts index 38e2adc7a8..48a63d14c4 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/common.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/common.module.ts @@ -1,34 +1,34 @@ import {NgModule} from '@angular/core'; -import {EgStaffCommonModule} from '@eg/staff/common.module'; -import {EgLinkTableComponent, EgLinkTableLinkComponent} from '@eg/staff/share/link-table/link-table.component'; -import {EgGridModule} from '@eg/share/grid/grid.module'; -import {EgAdminPageComponent} from '@eg/staff/share/admin-page/admin-page.component'; -import {EgBasicAdminPageComponent} from '@eg/staff/admin/basic-admin-page.component'; +import {StaffCommonModule} from '@eg/staff/common.module'; +import {LinkTableComponent, LinkTableLinkComponent} from '@eg/staff/share/link-table/link-table.component'; +import {GridModule} from '@eg/share/grid/grid.module'; +import {AdminPageComponent} from '@eg/staff/share/admin-page/admin-page.component'; +import {BasicAdminPageComponent} from '@eg/staff/admin/basic-admin-page.component'; @NgModule({ declarations: [ - EgLinkTableComponent, - EgLinkTableLinkComponent, - EgAdminPageComponent, - EgBasicAdminPageComponent + LinkTableComponent, + LinkTableLinkComponent, + AdminPageComponent, + BasicAdminPageComponent ], imports: [ - EgStaffCommonModule, - EgGridModule + StaffCommonModule, + GridModule ], exports: [ - EgStaffCommonModule, - EgLinkTableComponent, - EgLinkTableLinkComponent, - EgAdminPageComponent, - EgBasicAdminPageComponent, - EgGridModule + StaffCommonModule, + LinkTableComponent, + LinkTableLinkComponent, + AdminPageComponent, + BasicAdminPageComponent, + GridModule ], providers: [ ] }) -export class EgAdminCommonModule { +export class AdminCommonModule { } diff --git a/Open-ILS/src/eg2/src/app/staff/admin/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/routing.module.ts index a73f4f30d1..77b2d8a1fa 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/routing.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/routing.module.ts @@ -5,10 +5,10 @@ const routes: Routes = [{ path: '', children : [ { path: 'workstation', - loadChildren: '@eg/staff/admin/workstation/routing.module#EgAdminWsRoutingModule' + loadChildren: '@eg/staff/admin/workstation/routing.module#AdminWsRoutingModule' }, { path: 'server', - loadChildren: '@eg/staff/admin/server/admin-server.module#EgAdminServerModule' + loadChildren: '@eg/staff/admin/server/admin-server.module#AdminServerModule' }] }]; @@ -17,4 +17,4 @@ const routes: Routes = [{ exports: [RouterModule] }) -export class EgAdminRoutingModule {} +export class AdminRoutingModule {} diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/admin-server.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/admin-server.module.ts index 7af41948ef..1f00a8a0af 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/admin-server.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/admin-server.module.ts @@ -1,7 +1,7 @@ import {NgModule} from '@angular/core'; -import {EgStaffCommonModule} from '@eg/staff/common.module'; -import {EgAdminServerRoutingModule} from './routing.module'; -import {EgAdminCommonModule} from '@eg/staff/admin/common.module'; +import {StaffCommonModule} from '@eg/staff/common.module'; +import {AdminServerRoutingModule} from './routing.module'; +import {AdminCommonModule} from '@eg/staff/admin/common.module'; import {AdminServerSplashComponent} from './admin-server-splash.component'; @NgModule({ @@ -9,8 +9,8 @@ import {AdminServerSplashComponent} from './admin-server-splash.component'; AdminServerSplashComponent ], imports: [ - EgAdminCommonModule, - EgAdminServerRoutingModule + AdminCommonModule, + AdminServerRoutingModule ], exports: [ ], @@ -18,7 +18,7 @@ import {AdminServerSplashComponent} from './admin-server-splash.component'; ] }) -export class EgAdminServerModule { +export class AdminServerModule { } diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/routing.module.ts index b3d648729d..ceb60f27f4 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/routing.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/routing.module.ts @@ -1,14 +1,14 @@ import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; import {AdminServerSplashComponent} from './admin-server-splash.component'; -import {EgBasicAdminPageComponent} from '@eg/staff/admin/basic-admin-page.component'; +import {BasicAdminPageComponent} from '@eg/staff/admin/basic-admin-page.component'; const routes: Routes = [{ path: 'splash', component: AdminServerSplashComponent }, { path: ':schema/:table', - component: EgBasicAdminPageComponent + component: BasicAdminPageComponent }]; @NgModule({ @@ -16,4 +16,4 @@ const routes: Routes = [{ exports: [RouterModule] }) -export class EgAdminServerRoutingModule {} +export class AdminServerRoutingModule {} diff --git a/Open-ILS/src/eg2/src/app/staff/admin/workstation/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/workstation/routing.module.ts index 9599000852..acdb9a1752 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/workstation/routing.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/workstation/routing.module.ts @@ -11,4 +11,4 @@ const routes: Routes = [{ exports: [RouterModule] }) -export class EgAdminWsRoutingModule {} +export class AdminWsRoutingModule {} diff --git a/Open-ILS/src/eg2/src/app/staff/admin/workstation/workstations/workstations.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/workstation/workstations/workstations.component.ts index 0b1f36e075..2c204e59e1 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/workstation/workstations/workstations.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/workstation/workstations/workstations.component.ts @@ -1,13 +1,13 @@ import {Component, OnInit, ViewChild} from '@angular/core'; import {Router, ActivatedRoute} from '@angular/router'; -import {EgStoreService} from '@eg/core/store.service'; -import {EgIdlObject} from '@eg/core/idl.service'; -import {EgNetService} from '@eg/core/net.service'; -import {EgPermService} from '@eg/core/perm.service'; -import {EgAuthService} from '@eg/core/auth.service'; -import {EgOrgService} from '@eg/core/org.service'; -import {EgEventService} from '@eg/core/event.service'; -import {EgConfirmDialogComponent} from '@eg/share/dialog/confirm.component'; +import {StoreService} from '@eg/core/store.service'; +import {IdlObject} from '@eg/core/idl.service'; +import {NetService} from '@eg/core/net.service'; +import {PermService} from '@eg/core/perm.service'; +import {AuthService} from '@eg/core/auth.service'; +import {OrgService} from '@eg/core/org.service'; +import {EventService} from '@eg/core/event.service'; +import {ConfirmDialogComponent} from '@eg/share/dialog/confirm.component'; // Slim version of the WS that's stored in the cache. interface Workstation { @@ -24,29 +24,29 @@ export class WorkstationsComponent implements OnInit { selectedName: string; workstations: Workstation[] = []; removeWorkstation: string; - newOwner: EgIdlObject; + newOwner: IdlObject; newName: string; defaultName: string; @ViewChild('workstationExistsDialog') - private wsExistsDialog: EgConfirmDialogComponent; + private wsExistsDialog: ConfirmDialogComponent; // Org selector options. hideOrgs: number[]; disableOrgs: number[]; - orgOnChange = (org: EgIdlObject): void => { + orgOnChange = (org: IdlObject): void => { this.newOwner = org; } constructor( private router: Router, private route: ActivatedRoute, - private evt: EgEventService, - private net: EgNetService, - private store: EgStoreService, - private auth: EgAuthService, - private org: EgOrgService, - private perm: EgPermService + private evt: EventService, + private net: NetService, + private store: StoreService, + private auth: AuthService, + private org: OrgService, + private perm: PermService ) {} ngOnInit() { diff --git a/Open-ILS/src/eg2/src/app/staff/admin/workstation/workstations/workstations.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/workstation/workstations/workstations.module.ts index 064b24dd45..cbd8dd6128 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/workstation/workstations/workstations.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/workstation/workstations/workstations.module.ts @@ -1,5 +1,5 @@ import {NgModule} from '@angular/core'; -import {EgStaffCommonModule} from '@eg/staff/common.module'; +import {StaffCommonModule} from '@eg/staff/common.module'; import {WorkstationsRoutingModule} from './routing.module'; import {WorkstationsComponent} from './workstations.component'; @@ -8,7 +8,7 @@ import {WorkstationsComponent} from './workstations.component'; WorkstationsComponent, ], imports: [ - EgStaffCommonModule, + StaffCommonModule, WorkstationsRoutingModule ] }) diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/catalog.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/catalog.component.ts index 0324ed406b..8b2206c2f5 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/catalog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/catalog.component.ts @@ -4,7 +4,7 @@ import {StaffCatalogService} from './catalog.service'; @Component({ templateUrl: 'catalog.component.html' }) -export class EgCatalogComponent implements OnInit { +export class CatalogComponent implements OnInit { constructor(private staffCat: StaffCatalogService) {} diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/catalog.module.ts b/Open-ILS/src/eg2/src/app/staff/catalog/catalog.module.ts index a4b4f614d3..e9870e9e78 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/catalog.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/catalog.module.ts @@ -1,15 +1,15 @@ import {NgModule} from '@angular/core'; -import {EgStaffCommonModule} from '@eg/staff/common.module'; -import {EgUnapiService} from '@eg/share/catalog/unapi.service'; -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 {StaffCommonModule} from '@eg/staff/common.module'; +import {UnapiService} from '@eg/share/catalog/unapi.service'; +import {CatalogRoutingModule} from './routing.module'; +import {CatalogService} from '@eg/share/catalog/catalog.service'; +import {CatalogUrlService} from '@eg/share/catalog/catalog-url.service'; +import {CatalogComponent} 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 '@eg/staff/share/bib-summary/bib-summary.component'; +import {BibSummaryComponent} from '@eg/staff/share/bib-summary/bib-summary.component'; import {ResultPaginationComponent} from './result/pagination.component'; import {ResultFacetsComponent} from './result/facets.component'; import {ResultRecordComponent} from './result/record.component'; @@ -19,11 +19,11 @@ import {MarcViewComponent} from './record/marc-view.component'; @NgModule({ declarations: [ - EgCatalogComponent, + CatalogComponent, ResultsComponent, RecordComponent, CopiesComponent, - EgBibSummaryComponent, + BibSummaryComponent, SearchFormComponent, ResultRecordComponent, ResultFacetsComponent, @@ -32,17 +32,17 @@ import {MarcViewComponent} from './record/marc-view.component'; MarcViewComponent ], imports: [ - EgStaffCommonModule, - EgCatalogRoutingModule + StaffCommonModule, + CatalogRoutingModule ], providers: [ - EgUnapiService, - EgCatalogService, - EgCatalogUrlService, + UnapiService, + CatalogService, + CatalogUrlService, StaffCatalogService ] }) -export class EgCatalogModule { +export class CatalogModule { } diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/catalog.service.ts b/Open-ILS/src/eg2/src/app/staff/catalog/catalog.service.ts index fb8eace456..1e50d9ba88 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/catalog.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/catalog.service.ts @@ -1,9 +1,9 @@ import {Injectable} from '@angular/core'; import {Router, ActivatedRoute} from '@angular/router'; -import {EgIdlObject} from '@eg/core/idl.service'; -import {EgOrgService} from '@eg/core/org.service'; -import {EgCatalogService} from '@eg/share/catalog/catalog.service'; -import {EgCatalogUrlService} from '@eg/share/catalog/catalog-url.service'; +import {IdlObject} from '@eg/core/idl.service'; +import {OrgService} from '@eg/core/org.service'; +import {CatalogService} from '@eg/share/catalog/catalog.service'; +import {CatalogUrlService} from '@eg/share/catalog/catalog-url.service'; import {CatalogSearchContext} from '@eg/share/catalog/search-context'; /** @@ -15,11 +15,11 @@ export class StaffCatalogService { searchContext: CatalogSearchContext; routeIndex = 0; - defaultSearchOrg: EgIdlObject; + defaultSearchOrg: IdlObject; defaultSearchLimit: number; // TODO: does unapi support pref-lib for result-page copy counts? - prefOrg: EgIdlObject; + prefOrg: IdlObject; // Cache the currently selected detail record (i.g. catalog/record/123) // summary so the record detail component can avoid duplicate fetches @@ -29,9 +29,9 @@ export class StaffCatalogService { constructor( private router: Router, private route: ActivatedRoute, - private org: EgOrgService, - private cat: EgCatalogService, - private catUrl: EgCatalogUrlService + private org: OrgService, + private cat: CatalogService, + private catUrl: CatalogUrlService ) { } createContext(): void { diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.ts index 7b8c9a8088..86ac3e3bee 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.ts @@ -1,8 +1,8 @@ import {Component, OnInit, Input} from '@angular/core'; -import {EgNetService} from '@eg/core/net.service'; +import {NetService} from '@eg/core/net.service'; import {StaffCatalogService} from '../catalog.service'; import {Pager} from '@eg/share/util/pager'; -import {EgOrgService} from '@eg/core/org.service'; +import {OrgService} from '@eg/core/org.service'; @Component({ selector: 'eg-catalog-copies', @@ -25,8 +25,8 @@ export class CopiesComponent implements OnInit { } constructor( - private net: EgNetService, - private org: EgOrgService, + private net: NetService, + private org: OrgService, private staffCat: StaffCatalogService, ) {} diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/record/marc-view.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/record/marc-view.component.ts index aa8677e54b..ca6e4157ab 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/record/marc-view.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/record/marc-view.component.ts @@ -1,7 +1,7 @@ import {Component, OnInit, Input, ElementRef} from '@angular/core'; -import {EgNetService} from '@eg/core/net.service'; +import {NetService} from '@eg/core/net.service'; import {StaffCatalogService} from '../catalog.service'; -import {EgOrgService} from '@eg/core/org.service'; +import {OrgService} from '@eg/core/org.service'; @Component({ selector: 'eg-catalog-marc-view', @@ -24,7 +24,7 @@ export class MarcViewComponent implements OnInit { constructor( private elm: ElementRef, - private net: EgNetService, + private net: NetService, private staffCat: StaffCatalogService ) {} @@ -50,11 +50,11 @@ export class MarcViewComponent implements OnInit { // Note: for printing, use the browser print page // option. The end result is the same. html = html.replace( - /