From: Bill Erickson Date: Sun, 1 Jul 2018 19:36:12 +0000 (-0400) Subject: LP#1779158 Angular vandelay more import form X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a504365305d17579bf99ba23df3451ff0ad9aab1;p=working%2FEvergreen.git LP#1779158 Angular vandelay more import form Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.html b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.html index e380b6a61d..f7bbaac7ff 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.html @@ -41,6 +41,13 @@ +
+ +
+
+ +
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.ts index 725c0fdf2d..ed640b14a7 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.ts @@ -13,18 +13,8 @@ export class ImportComponent implements OnInit, AfterViewInit { recordType: string; newQueueName: string; - allQueues: {[qtype: string]: IdlObject[]}; - activeQueues: {[qtype: string]: IdlObject[]}; attrDefs: {[atype: string]: IdlObject[]}; - bibSources: IdlObject[]; - bibBuckets: IdlObject[]; - itemImportAttrDefs: IdlObject[]; - matchSets: {[stype: string]: IdlObject[]}; defaultMatchSet: string; - mergeProfiles: IdlObject[]; - - matchSetEntries: TypeaheadEntry[]; - importItemDefEntries: TypeaheadEntry[]; importNonMatching: boolean; mergeOnExact: boolean; @@ -41,8 +31,6 @@ export class ImportComponent implements OnInit, AfterViewInit { ) { this.recordType = 'bib'; this.attrDefs = {}; - this.matchSets = {}; - this.activeQueues = {}; this.minQualityRatio = 0; } @@ -65,22 +53,14 @@ export class ImportComponent implements OnInit, AfterViewInit { .then(defs => this.attrDefs.bib = defs), this.vandelay.getAttrDefs('auth') .then(defs => this.attrDefs.auth = defs), - this.vandelay.getMergeProfiles() - .then(profiles => this.mergeProfiles = profiles), - this.vandelay.getActiveQueues('bib') - .then(queues => this.activeQueues.bib = queues), - this.vandelay.getActiveQueues('auth') - .then(queues => this.activeQueues.auth = queues), - this.vandelay.getMatchSets('bib') - .then(sets => this.matchSets.bib = sets), - this.vandelay.getMatchSets('auth') - .then(sets => this.matchSets.auth= sets), - this.vandelay.getBibBuckets() - .then(bkts => this.bibBuckets = bkts), - this.vandelay.getBibSources() - .then(srcs => this.bibSources = srcs), - this.vandelay.getItemImportDefs() - .then(defs => this.itemImportAttrDefs = defs), + this.vandelay.getMergeProfiles(), + this.vandelay.getActiveQueues('bib'), + this.vandelay.getActiveQueues('auth'), + this.vandelay.getMatchSets('bib'), + this.vandelay.getMatchSets('auth'), + this.vandelay.getBibBuckets(), + this.vandelay.getBibSources(), + this.vandelay.getItemImportDefs(), this.org.settings(['vandelay.default_match_set']).then( s => this.defaultMatchSet = s['vandelay.default_match_set']) ]; @@ -91,33 +71,37 @@ export class ImportComponent implements OnInit, AfterViewInit { // Format typeahead data sets formatEntries(etype: string): TypeaheadEntry[] { const rtype = this.recordType; + let list; switch (etype) { case 'bibSources': - return (this.bibSources || []).map(s => { - return {id: s.id(), label: s.source()}; - }); + return (this.vandelay.bibSources || []).map( + s => { return {id: s.id(), label: s.source()}; }); + + case 'bibBuckets': + list = this.vandelay.bibBuckets; + break; case 'activeQueues': - return (this.activeQueues[rtype] || []).map(q => { - return {id: q.id(), label: q.name()}; - }); + list = this.vandelay.activeQueues[rtype]; + break; case 'matchSets': - return (this.matchSets[rtype] || []).map(s => { - return {id: s.id(), label: s.name()}; - }); + list = this.vandelay.matchSets[rtype]; + break; case 'importItemDefs': - return (this.itemImportAttrDefs || []).map(d => { - return {id: d.id(), label: d.name()}; - }); + list = this.vandelay.importItemAttrDefs; + break; case 'mergeProfiles': - return (this.mergeProfiles || []).map(d => { - return {id: d.id(), label: d.name()}; - }); + list = this.vandelay.mergeProfiles; + break; } + + return (list || []).map(item => { + return {id: item.id(), label: item.name()}; + }); } } diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.service.ts b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.service.ts index 46bfd09f9c..caa7ca3256 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.service.ts @@ -145,7 +145,11 @@ export class VandelayService { 'open-ils.actor', 'open-ils.actor.container.retrieve_by_class', this.auth.token(), this.auth.user().id(), 'biblio', 'staff_client' - ).pipe(tap(bkt => bkts.push(bkt))).toPromise().then(() => bkts); + //).pipe(tap(bkt => bkts.push(bkt))).toPromise().then(() => bkts); + ).toPromise().then(bkts => { + this.bibBuckets = bkts; + return bkts; + }); } getCopyStatuses(): Promise {