From 0c0aa3b8fa894348967e47988567f9d90b669a8f Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Sat, 30 Jun 2018 15:47:56 -0400 Subject: [PATCH] LP#1779158 Angular vandelay more import form Signed-off-by: Bill Erickson --- .../app/staff/cat/vandelay/import.component.css | 26 +++++++++++ .../app/staff/cat/vandelay/import.component.html | 51 +++++++++++++++++++++- .../src/app/staff/cat/vandelay/import.component.ts | 15 +++++++ .../src/app/staff/cat/vandelay/vandelay.service.ts | 15 +++++++ 4 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.css diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.css b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.css new file mode 100644 index 0000000000..310131c2e1 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.css @@ -0,0 +1,26 @@ + + +.import-form { + margin-right: 10px; + margin-left: 10px; + font-size: 95%; +} + +.import-form .row { + margin: 5px; + padding: 3px; +} + +.import-form .row:nth-child(even) { + background-color: rgba(0,0,0,.03); + border-bottom: 1px solid rgba(0,0,0,.125); +} + +.import-form label { + font-weight: bold; +} + +.import-form input[type="checkbox"] { + /* BS adds a negative left margin */ + margin-left: 0px; +} 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 40bf0d51ca..e380b6a61d 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 @@ -62,7 +62,56 @@ - +
+
+ +
+
+ + +
+
+
+
+
+ +
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+ + +
+
+ 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 0d125a7957..725c0fdf2d 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 @@ -21,10 +21,17 @@ export class ImportComponent implements OnInit, AfterViewInit { itemImportAttrDefs: IdlObject[]; matchSets: {[stype: string]: IdlObject[]}; defaultMatchSet: string; + mergeProfiles: IdlObject[]; matchSetEntries: TypeaheadEntry[]; importItemDefEntries: TypeaheadEntry[]; + importNonMatching: boolean; + mergeOnExact: boolean; + mergeOnSingleMatch: boolean; + mergeOnBestMatch: boolean; + minQualityRatio: number; + @ViewChild('progressDialog') private progressDialog: ProgressDialogComponent; @@ -36,6 +43,7 @@ export class ImportComponent implements OnInit, AfterViewInit { this.attrDefs = {}; this.matchSets = {}; this.activeQueues = {}; + this.minQualityRatio = 0; } ngOnInit() {} @@ -57,6 +65,8 @@ 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') @@ -102,6 +112,11 @@ export class ImportComponent implements OnInit, AfterViewInit { return (this.itemImportAttrDefs || []).map(d => { return {id: d.id(), label: d.name()}; }); + + case 'mergeProfiles': + return (this.mergeProfiles || []).map(d => { + return {id: d.id(), label: d.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 e8d3e5fcd2..46bfd09f9c 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 @@ -22,6 +22,7 @@ export class VandelayService { matchSets: {[stype: string]: IdlObject[]}; importItemAttrDefs: IdlObject[]; bibTrashGroups: IdlObject[]; + mergeProfiles: IdlObject[]; constructor( private idl: IdlService, @@ -53,6 +54,20 @@ export class VandelayService { }); } + getMergeProfiles(): Promise { + if (this.mergeProfiles) { + return Promise.resolve(this.mergeProfiles); + } + + const owners = this.org.ancestors(this.auth.user().ws_ou(), true); + return this.pcrud.search('vmp', + {owner: owners}, {order_by: {vmp: ['name']}}, {atomic: true}) + .toPromise().then(profiles => { + this.mergeProfiles = profiles; + return profiles; + }); + } + // Returns a promise resolved with the list of queues. // Also emits the onQueueListUpdate event so listeners // can detect queue content changes. -- 2.11.0