From: Galen Charlton Date: Wed, 8 Dec 2021 22:40:07 +0000 (-0500) Subject: LP#1942220: teach the acq MARC import component new tricks X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=edd318fd0efa3897a73156d3d3dd0c7306d723be;p=working%2FEvergreen.git LP#1942220: teach the acq MARC import component new tricks Specifically, how to acted in a mode that gathers record import parameters to drive PO and LI asset creation Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.html b/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.html index d2f4c15d73..ce76ccd89c 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.html +++ b/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.html @@ -1,7 +1,7 @@ - + -
+ @@ -13,7 +13,8 @@
- + +
-
+
@@ -38,6 +39,7 @@
+

Purchase Order

@@ -114,9 +116,9 @@
+
- -

Upload Settings

+

Upload Settings

@@ -214,6 +216,7 @@
+
@@ -222,9 +225,10 @@ id="load-items" [(ngModel)]="loadItems">
+
-

This Upload

+

This Upload

@@ -239,7 +243,7 @@
-
+
@@ -264,13 +268,20 @@
-
+
+
+
+ +
+
diff --git a/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.ts index 22ae79d69a..47b990c44f 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.ts @@ -58,10 +58,21 @@ const ORG_SETTINGS = [ @Component({ + selector: 'eg-acq-upload', templateUrl: './upload.component.html' }) export class UploadComponent implements OnInit, AfterViewInit, OnDestroy { + // mode can be one of + // upload: actually upload and process a MARC order file + // getImportParams: gather import parameters to use when creating + // assets for a purchase order; the invoker + // would do the actual asset creation + @Input() mode = 'upload'; + + @Input() customAction: (args: any) => void; + customActionProcessing = false; + settings: Object = {}; recordType: string; selectedQueue: ComboboxEntry; @@ -333,6 +344,9 @@ export class UploadComponent implements OnInit, AfterViewInit, OnDestroy { } hasNeededData(): boolean { + if (this.mode === 'getImportParams') { + return this.selectedQueue ? true : false; + } return this.selectedQueue && Boolean(this.selectedFile) && Boolean(this.selectedFiscalYear) && @@ -371,6 +385,35 @@ export class UploadComponent implements OnInit, AfterViewInit, OnDestroy { ); } + performCustomAction() { + + const vandelayOptions = { + import_no_match: this.importNonMatching, + auto_overlay_exact: this.mergeOnExact, + auto_overlay_best_match: this.mergeOnBestMatch, + auto_overlay_1match: this.mergeOnSingleMatch, + merge_profile: this.selectedMergeProfile, + fall_through_merge_profile: this.selectedFallThruMergeProfile, + match_quality_ratio: this.minQualityRatio, + bib_source: this.selectedBibSource, + create_assets: this.loadItems, + queue_name: this.selectedQueue.label + }; + + const args = { + provider: this.selectedProvider, + ordering_agency: this.orderingAgency, + create_po: this.createPurchaseOrder, + activate_po: this.activatePurchaseOrder, + fiscal_year: this.selectedFiscalYear, + picklist: this.activeSelectionListId, + vandelay: vandelayOptions + }; + + this.customActionProcessing = true; + this.customAction(args); + } + resetProgressBars() { this.uploadProgress.update({value: 0, max: 1}); }