From f071f273e09031385053708442f8759807171b2f Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 21 May 2020 15:43:32 -0400 Subject: [PATCH] LPXXX MARC Batch update Angular port Signed-off-by: Bill Erickson --- .../staff/cat/marcbatch/marcbatch.component.html | 41 ++++++++++++---------- .../app/staff/cat/marcbatch/marcbatch.component.ts | 27 +++++++++++--- 2 files changed, 46 insertions(+), 22 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/cat/marcbatch/marcbatch.component.html b/Open-ILS/src/eg2/src/app/staff/cat/marcbatch/marcbatch.component.html index 82a91f9481..1ea34b0045 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/marcbatch/marcbatch.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/marcbatch/marcbatch.component.html @@ -6,12 +6,12 @@
Rule Setup
-
Data
-
Help
+
Data
+
Help
Action (Rule Type)
-
+
-
How to change the existing record.
+
How to change the existing record.
MARC Tag
-
- +
-
+
Three characters, no spaces, no indicators, etc. eg: 245
Subfields (optional)
-
+
-
No spaces, no delimiters, eg: abcnp
+
No spaces, no delimiters, eg: abcnp
MARC Data
-
+
-
+
MARC-Breaker formatted data with indicators and subfield delimiters, eg: 245 04$aThe End
@@ -59,23 +59,24 @@
Subfield
-
+
-
+
A single subfield code, no delimiters, eg: a
Expression
-
+
-
+
See the - + Perl documentation for an explanation of Regular Expressions.
@@ -103,7 +104,7 @@
-
Update Template Preview
+
Template Preview
@@ -182,7 +183,11 @@
-
+
+
+ + +
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/marcbatch/marcbatch.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/marcbatch/marcbatch.component.ts index 44e132cf98..1b37b70290 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/marcbatch/marcbatch.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/marcbatch/marcbatch.component.ts @@ -1,4 +1,4 @@ -import {Component, OnInit, AfterViewInit, ViewChild, Renderer2} from '@angular/core'; +import {Component, OnInit, ViewChild, Renderer2} from '@angular/core'; import {Router, ActivatedRoute, ParamMap} from '@angular/router'; import {tap} from 'rxjs/operators'; import {NetService} from '@eg/core/net.service'; @@ -19,7 +19,7 @@ interface TemplateRule { @Component({ templateUrl: 'marcbatch.component.html' }) -export class MarcBatchComponent implements OnInit, AfterViewInit { +export class MarcBatchComponent implements OnInit { session: string; source: 'bucket' | 'csv' | 'id' = 'bucket'; @@ -32,6 +32,10 @@ export class MarcBatchComponent implements OnInit, AfterViewInit { templateRules: TemplateRule[] = []; record: MarcRecord; + processing = false; + progressMax: number = null; + progressValue: number = null; + constructor( private router: Router, private route: ActivatedRoute, @@ -61,7 +65,8 @@ export class MarcBatchComponent implements OnInit, AfterViewInit { let ruleText = rule.marcTag + (rule.marcSubfields || ''); if (rule.advSubfield) { - ruleText += `[${rule.advSubfield} ~ ${rule.advRegex}]`; + ruleText += + `[${rule.advSubfield || ''} ~ ${rule.advRegex || ''}]`; } // Merge behavior is encoded in the 905 field. @@ -158,6 +163,20 @@ export class MarcBatchComponent implements OnInit, AfterViewInit { this.selectedFile = $event.target.files[0]; } - ngAfterViewInit() {} + + process() { + this.processing = true; + this.postForm() + .then(_ => this.pollProgress()) + .then(_ => this.processing = false); + } + + postForm(): Promise { + return Promise.resolve(); + } + + pollProgress(): Promise { + return Promise.resolve(); + } } -- 2.11.0