LP#1775466 Common catalog mod; marchtml repairs
authorBill Erickson <berickxx@gmail.com>
Tue, 10 Jul 2018 21:24:21 +0000 (17:24 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 11 Jul 2018 14:18:30 +0000 (10:18 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/share/catalog/catalog-common.module.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/share/catalog/marc-html.component.ts
Open-ILS/src/eg2/src/app/share/grid/grid.component.ts
Open-ILS/src/eg2/src/app/staff/catalog/catalog.module.ts
Open-ILS/src/eg2/src/app/staff/common.module.ts

diff --git a/Open-ILS/src/eg2/src/app/share/catalog/catalog-common.module.ts b/Open-ILS/src/eg2/src/app/share/catalog/catalog-common.module.ts
new file mode 100644 (file)
index 0000000..c370b30
--- /dev/null
@@ -0,0 +1,28 @@
+import {NgModule} from '@angular/core';
+import {EgCommonModule} from '@eg/common.module';
+import {CatalogService} from './catalog.service';
+import {CatalogUrlService} from './catalog-url.service';
+import {BibRecordService} from './bib-record.service';
+import {UnapiService} from './unapi.service';
+import {MarcHtmlComponent} from './marc-html.component';
+
+
+@NgModule({
+    declarations: [
+        MarcHtmlComponent
+    ],
+    imports: [
+        EgCommonModule
+    ],
+    exports: [
+        MarcHtmlComponent
+    ],
+    providers: [
+        CatalogService,
+        CatalogUrlService,
+        UnapiService,
+        BibRecordService
+    ]
+})
+
+export class CatalogCommonModule {}
index a002e96..0f78221 100644 (file)
@@ -43,6 +43,7 @@ export class MarcHtmlComponent implements OnInit {
 
         let service = 'open-ils.search';
         let method = 'open-ils.search.biblio.record.html';
+        let params: any[] = [this.recId];
 
         switch (this.recType) {
 
@@ -51,19 +52,20 @@ export class MarcHtmlComponent implements OnInit {
                 break;
 
             case 'vandelay-authority':
+                params.unshift(this.auth.token());
                 service = 'open-ils.vandelay';
                 method = 'open-ils.vandelay.queued_authority_record.html';
                 break;
 
             case 'vandelay-bib':
+                params.unshift(this.auth.token());
                 service = 'open-ils.vandelay';
                 method = 'open-ils.vandelay.queued_bib_record.html';
                 break;
         }
 
-        this.net.request(
-            service, method, this.auth.token(), this.recId
-        ).toPromise().then(html => this.injectHtml(html));
+        this.net.requestWithParamList(service, method, params)
+        .toPromise().then(html => this.injectHtml(html));
     }
 
     injectHtml(html: string) {
index 83d2435..fb8b92d 100644 (file)
@@ -83,6 +83,11 @@ export class GridComponent implements OnInit, AfterViewInit, OnDestroy {
     }
 
     ngOnInit() {
+
+        if (!this.dataSource) {
+            throw new Error('<eg-grid/> requires a [dataSource]');
+        }
+
         this.context.idlClass = this.idlClass;
         this.context.dataSource = this.dataSource;
         this.context.persistKey = this.persistKey;
index ca8aa48..15faf0b 100644 (file)
@@ -1,17 +1,13 @@
 import {NgModule} from '@angular/core';
 import {StaffCommonModule} from '@eg/staff/common.module';
 import {GridModule} from '@eg/share/grid/grid.module';
-import {UnapiService} from '@eg/share/catalog/unapi.service';
+import {CatalogCommonModule} from '@eg/share/catalog/catalog-common.module';
 import {CatalogRoutingModule} from './routing.module';
-import {BibRecordService} from '@eg/share/catalog/bib-record.service';
-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 {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';
@@ -26,7 +22,6 @@ import {HoldingsService} from '@eg/staff/share/holdings.service';
     ResultsComponent,
     RecordComponent,
     CopiesComponent,
-    BibSummaryComponent,
     SearchFormComponent,
     ResultRecordComponent,
     ResultFacetsComponent,
@@ -37,13 +32,10 @@ import {HoldingsService} from '@eg/staff/share/holdings.service';
   imports: [
     StaffCommonModule,
     GridModule,
+    CatalogCommonModule,
     CatalogRoutingModule
   ],
   providers: [
-    UnapiService,
-    BibRecordService,
-    CatalogService,
-    CatalogUrlService,
     StaffCatalogService,
     HoldingsService
   ]
index 02bb078..ec4ca30 100644 (file)
@@ -16,7 +16,7 @@ import {StringService} from '@eg/share/string/string.service';
 import {FmRecordEditorComponent} from '@eg/share/fm-editor/fm-editor.component';
 import {DateSelectComponent} from '@eg/share/date-select/date-select.component';
 import {RecordBucketDialogComponent} from '@eg/staff/share/buckets/record-bucket-dialog.component';
-import {MarcHtmlComponent} from '@eg/share/catalog/marc-html.component';
+import {BibSummaryComponent} from '@eg/staff/share/bib-summary/bib-summary.component';
 
 /**
  * Imports the EG common modules and adds modules common to all staff UI's.
@@ -36,7 +36,7 @@ import {MarcHtmlComponent} from '@eg/share/catalog/marc-html.component';
     FmRecordEditorComponent,
     DateSelectComponent,
     RecordBucketDialogComponent,
-    MarcHtmlComponent
+    BibSummaryComponent
   ],
   imports: [
     EgCommonModule
@@ -55,7 +55,7 @@ import {MarcHtmlComponent} from '@eg/share/catalog/marc-html.component';
     FmRecordEditorComponent,
     DateSelectComponent,
     RecordBucketDialogComponent,
-    MarcHtmlComponent
+    BibSummaryComponent
   ]
 })