From be9ef9b5c24b75839e1755898a1db74b83be6e88 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 11 Dec 2017 10:35:59 -0500 Subject: [PATCH] LP#626157 Ang2 experiments Signed-off-by: Bill Erickson --- Open-ILS/webby-src/src/app/core/idl.ts | 19 ++++++++++++------- .../webby-src/src/app/share/catalog/search-context.ts | 5 ++++- .../app/{staff => }/share/org-select.component.html | 0 .../src/app/{staff => }/share/org-select.component.ts | 0 Open-ILS/webby-src/src/app/staff/nav.component.html | 19 +++++++++++++++++-- .../webby-src/src/app/staff/splash.component.html | 3 --- Open-ILS/webby-src/src/app/staff/staff.module.ts | 2 +- 7 files changed, 34 insertions(+), 14 deletions(-) rename Open-ILS/webby-src/src/app/{staff => }/share/org-select.component.html (100%) rename Open-ILS/webby-src/src/app/{staff => }/share/org-select.component.ts (100%) diff --git a/Open-ILS/webby-src/src/app/core/idl.ts b/Open-ILS/webby-src/src/app/core/idl.ts index e503ba74a4..8f46933954 100644 --- a/Open-ILS/webby-src/src/app/core/idl.ts +++ b/Open-ILS/webby-src/src/app/core/idl.ts @@ -36,15 +36,20 @@ export class EgIdlService { } parseIdl(): void { - let this_ = this; - this_.classes = _preload_fieldmapper_IDL; + + try { + this.classes = _preload_fieldmapper_IDL; + } catch (E) { + console.error('IDL (IDL2js) not found. Is the system running?'); + return; + } /** * Creates the class constructor and getter/setter * methods for each IDL class. */ let mkclass = (cls, fields) => { - this_.classes[cls].classname = cls; + this.classes[cls].classname = cls; // This dance lets us encode each IDL object with the // EgIdlObject interface. Useful for adding type restrictions @@ -67,16 +72,16 @@ export class EgIdlService { return x; }); - this_.constructors[cls] = generator(); + this.constructors[cls] = generator(); // global class constructors required for JSON_v1.js // TODO: polluting the window namespace w/ every IDL class // is less than ideal. - window[cls] = this_.constructors[cls]; + window[cls] = this.constructors[cls]; } - for (var cls in this_.classes) - mkclass(cls, this_.classes[cls].fields); + for (var cls in this.classes) + mkclass(cls, this.classes[cls].fields); }; } diff --git a/Open-ILS/webby-src/src/app/share/catalog/search-context.ts b/Open-ILS/webby-src/src/app/share/catalog/search-context.ts index 5503580e81..4b1914e851 100644 --- a/Open-ILS/webby-src/src/app/share/catalog/search-context.ts +++ b/Open-ILS/webby-src/src/app/share/catalog/search-context.ts @@ -70,7 +70,10 @@ export class CatalogSearchContext { let ids = []; for ( let idx = this.pager.offset; - idx < this.pager.offset + this.pager.limit; + idx < Math.min( + this.pager.offset + this.pager.limit, + this.pager.resultCount + ); idx++ ) {ids.push(this.resultIds[idx])} return ids; diff --git a/Open-ILS/webby-src/src/app/staff/share/org-select.component.html b/Open-ILS/webby-src/src/app/share/org-select.component.html similarity index 100% rename from Open-ILS/webby-src/src/app/staff/share/org-select.component.html rename to Open-ILS/webby-src/src/app/share/org-select.component.html diff --git a/Open-ILS/webby-src/src/app/staff/share/org-select.component.ts b/Open-ILS/webby-src/src/app/share/org-select.component.ts similarity index 100% rename from Open-ILS/webby-src/src/app/staff/share/org-select.component.ts rename to Open-ILS/webby-src/src/app/share/org-select.component.ts diff --git a/Open-ILS/webby-src/src/app/staff/nav.component.html b/Open-ILS/webby-src/src/app/staff/nav.component.html index 4206cd448f..7b1a05298f 100644 --- a/Open-ILS/webby-src/src/app/staff/nav.component.html +++ b/Open-ILS/webby-src/src/app/staff/nav.component.html @@ -14,11 +14,11 @@ + +