From 273aa59abe54a0a6fbd94565c086dbb42370baa3 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 10 Jul 2018 17:24:21 -0400 Subject: [PATCH] LP#1775466 Common catalog mod; marchtml repairs Signed-off-by: Bill Erickson --- .../src/app/share/catalog/catalog-common.module.ts | 28 ++++++++++++++++++++++ .../src/app/share/catalog/marc-html.component.ts | 8 ++++--- .../src/eg2/src/app/share/grid/grid.component.ts | 5 ++++ .../eg2/src/app/staff/catalog/catalog.module.ts | 12 ++-------- Open-ILS/src/eg2/src/app/staff/common.module.ts | 6 ++--- 5 files changed, 43 insertions(+), 16 deletions(-) create mode 100644 Open-ILS/src/eg2/src/app/share/catalog/catalog-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 index 0000000000..c370b300c9 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/share/catalog/catalog-common.module.ts @@ -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 {} diff --git a/Open-ILS/src/eg2/src/app/share/catalog/marc-html.component.ts b/Open-ILS/src/eg2/src/app/share/catalog/marc-html.component.ts index a002e965c6..0f782219b9 100644 --- a/Open-ILS/src/eg2/src/app/share/catalog/marc-html.component.ts +++ b/Open-ILS/src/eg2/src/app/share/catalog/marc-html.component.ts @@ -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) { 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 83d2435499..fb8b92db02 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 @@ -83,6 +83,11 @@ export class GridComponent implements OnInit, AfterViewInit, OnDestroy { } ngOnInit() { + + if (!this.dataSource) { + throw new Error(' requires a [dataSource]'); + } + this.context.idlClass = this.idlClass; this.context.dataSource = this.dataSource; this.context.persistKey = this.persistKey; 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 ca8aa48a46..15faf0bc00 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,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 ] diff --git a/Open-ILS/src/eg2/src/app/staff/common.module.ts b/Open-ILS/src/eg2/src/app/staff/common.module.ts index 02bb078567..ec4ca30fa5 100644 --- a/Open-ILS/src/eg2/src/app/staff/common.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/common.module.ts @@ -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 ] }) -- 2.11.0