From: Bill Erickson Date: Thu, 21 May 2020 16:06:38 +0000 (-0400) Subject: LPXXX MARC Batch update Angular port X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1e4ffcf9194b42aa02346fe32976a6f655a5674f;p=working%2FEvergreen.git LPXXX MARC Batch update Angular port Signed-off-by: Bill Erickson --- 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 new file mode 100644 index 0000000000..c36cd68969 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/cat/marcbatch/marcbatch.component.html @@ -0,0 +1,82 @@ + + +
+
+
+
+
+
Record Source:
+
+ +
+
+
+ +
Bucket named:
+
+ + +
+
+ +
Record ID:
+
+ +
+
+ +
+
+
Column:
+
+ + of +
+
+ +
+
+
+
+ Columns are numbered starting at 0. For instance, when looking + at a CSV file in Excel, the column labeled A is the same as + column 0, and the column labeled B is the same as column 1. +
+
+
+
+
+
+
+
+ + +
+
+
+
+
+ By default, all records are processed within a single database + transaction. However, processing large batches of records + within a single transaction can negatively impact a running + system because it may conflict with other cataloging activities. + Use Per-Record transactions to mitigate these conflicts. +
+
+
+
+ +
+
+
+
+
+
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 new file mode 100644 index 0000000000..0d7863d026 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/cat/marcbatch/marcbatch.component.ts @@ -0,0 +1,71 @@ +import {Component, OnInit, AfterViewInit, ViewChild, Renderer2} from '@angular/core'; +import {Router, ActivatedRoute, ParamMap} from '@angular/router'; +import {tap} from 'rxjs/operators'; +import {NetService} from '@eg/core/net.service'; +import {AuthService} from '@eg/core/auth.service'; +import {PcrudService} from '@eg/core/pcrud.service'; +import {ComboboxEntry} from '@eg/share/combobox/combobox.component'; + +@Component({ + templateUrl: 'marcbatch.component.html' +}) +export class MarcBatchComponent implements OnInit, AfterViewInit { + + session: string; + source: 'bucket' | 'csv' | 'id' = 'bucket'; + buckets: ComboboxEntry[]; + bucket: number; + recordId: number; + csvColumn = 0; + selectedFile: File; + xactPerRecord = false; + + constructor( + private router: Router, + private route: ActivatedRoute, + private renderer: Renderer2, + private net: NetService, + private pcrud: PcrudService, + private auth: AuthService + ) {} + + ngOnInit() { + this.route.paramMap.subscribe((params: ParamMap) => { + this.session = this.route.snapshot.paramMap.get('session'); + }); + + this.load(); + } + + load() { + this.getBuckets(); + } + + getBuckets(): Promise { + if (this.buckets) { return Promise.resolve(); } + + return this.net.request( + 'open-ils.actor', + 'open-ils.actor.container.retrieve_by_class', + this.auth.token(), this.auth.user().id(), + 'biblio', ['staff_client','vandelay_queue'] + + ).pipe(tap(buckets => { + this.buckets = buckets + .sort((b1, b2) => b1.name() < b2.name() ? -1 : 1) + .map(b => ({id: b.id(), label: b.name()})) + + })).toPromise(); + } + + bucketChanged(entry: ComboboxEntry) { + this.bucket = entry ? entry.id : null; + } + + fileSelected($event) { + this.selectedFile = $event.target.files[0]; + } + + ngAfterViewInit() {} +} + diff --git a/Open-ILS/src/eg2/src/app/staff/cat/marcbatch/marcbatch.module.ts b/Open-ILS/src/eg2/src/app/staff/cat/marcbatch/marcbatch.module.ts new file mode 100644 index 0000000000..c16eb6a973 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/cat/marcbatch/marcbatch.module.ts @@ -0,0 +1,21 @@ +import {NgModule} from '@angular/core'; +import {StaffCommonModule} from '@eg/staff/common.module'; +import {CommonWidgetsModule} from '@eg/share/common-widgets.module'; +import {MarcBatchRoutingModule} from './routing.module'; +import {MarcBatchComponent} from './marcbatch.component'; + +@NgModule({ + declarations: [ + MarcBatchComponent + ], + imports: [ + StaffCommonModule, + CommonWidgetsModule, + MarcBatchRoutingModule + ], + providers: [ + ] +}) + +export class MarcBatchModule { +} diff --git a/Open-ILS/src/eg2/src/app/staff/cat/marcbatch/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/cat/marcbatch/routing.module.ts new file mode 100644 index 0000000000..0c9ad4b8d8 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/cat/marcbatch/routing.module.ts @@ -0,0 +1,20 @@ +import {NgModule} from '@angular/core'; +import {RouterModule, Routes} from '@angular/router'; +import {MarcBatchComponent} from './marcbatch.component'; + +const routes: Routes = [{ + path: '', + component: MarcBatchComponent + }, { + path: ':session', + component: MarcBatchComponent +}]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], + providers: [] +}) + +export class MarcBatchRoutingModule {} + diff --git a/Open-ILS/src/eg2/src/app/staff/cat/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/cat/routing.module.ts index 67fb59b56c..60d87b555e 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/routing.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/routing.module.ts @@ -7,6 +7,9 @@ const routes: Routes = [ }, { path: 'authority', loadChildren: '@eg/staff/cat/authority/authority.module#AuthorityModule' + }, { + path: 'marcbatch', + loadChildren: '@eg/staff/cat/marcbatch/marcbatch.module#MarcBatchModule' } ];