From: Bill Erickson Date: Wed, 27 May 2020 21:04:24 +0000 (-0400) Subject: VOLCOPY Item attr batch component X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=92c533ef231f932e07e2b1f34238bbf9defeb50f;p=working%2FEvergreen.git VOLCOPY Item attr batch component Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/staff/share/holdings/batch-item-attr.component.html b/Open-ILS/src/eg2/src/app/staff/share/holdings/batch-item-attr.component.html new file mode 100644 index 0000000000..64fd34d251 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/share/holdings/batch-item-attr.component.html @@ -0,0 +1,31 @@ + +
+
{{label}}
+
+
+
+ + Yes + No + + + {{count.key | currency}} + + + {{count.key}} + +
+
{{count.value}} copies
+
+
+ + +
+ + +
+
+
+ diff --git a/Open-ILS/src/eg2/src/app/staff/share/holdings/batch-item-attr.component.ts b/Open-ILS/src/eg2/src/app/staff/share/holdings/batch-item-attr.component.ts new file mode 100644 index 0000000000..dc3be46b29 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/share/holdings/batch-item-attr.component.ts @@ -0,0 +1,56 @@ +import {Component, OnInit, Input, Output, ViewChild, Renderer2, TemplateRef, + EventEmitter} from '@angular/core'; +import {StringComponent} from '@eg/share/string/string.component'; + +/** + * Displays attribute values and associated copy counts for managing + * updates to batches of items. + */ + +@Component({ + selector: 'eg-batch-item-attr', + templateUrl: 'batch-item-attr.component.html' +}) + +export class BatchItemAttrComponent { + + // Main display label, e.g. "Circulation Modifier" + @Input() label: string; + + // Maps display labels to the number of items that have the label. + // e.g. {"Stacks": 4, "Display": 12} + @Input() labelCounts: {[label: string]: number} = {}; + + // Ref to some type of edit widget for modifying the value. + // Note this component simply displays the template, it does not + // interact with the template in any way. + @Input() editTemplate: TemplateRef; + + // In some cases, we can map display labels to something more + // human friendly. + @Input() displayAs: 'bool' | 'currency' = null; + + @Output() changesSaved: EventEmitter = new EventEmitter(); + @Output() changesCanceled: EventEmitter = new EventEmitter(); + + // Is the editTtemplate visible? + editing = false; + + hasChanged = false; + + constructor() {} + + save() { + this.hasChanged = true; + this.editing = false; + this.changesSaved.emit(); + } + + cancel() { + this.editing = false; + this.changesCanceled.emit(); + } +} + + + diff --git a/Open-ILS/src/eg2/src/app/staff/share/holdings/holdings.module.ts b/Open-ILS/src/eg2/src/app/staff/share/holdings/holdings.module.ts index bc93932419..b33863bf4c 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holdings/holdings.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/holdings/holdings.module.ts @@ -9,6 +9,7 @@ import {DeleteHoldingDialogComponent} from './delete-volcopy-dialog.component'; import {ConjoinedItemsDialogComponent} from './conjoined-items-dialog.component'; import {TransferItemsComponent} from './transfer-items.component'; import {TransferHoldingsComponent} from './transfer-holdings.component'; +import {BatchItemAttrComponent} from './batch-item-attr.component'; @NgModule({ declarations: [ @@ -19,7 +20,8 @@ import {TransferHoldingsComponent} from './transfer-holdings.component'; DeleteHoldingDialogComponent, ConjoinedItemsDialogComponent, TransferItemsComponent, - TransferHoldingsComponent + TransferHoldingsComponent, + BatchItemAttrComponent ], imports: [ StaffCommonModule @@ -32,7 +34,8 @@ import {TransferHoldingsComponent} from './transfer-holdings.component'; DeleteHoldingDialogComponent, ConjoinedItemsDialogComponent, TransferItemsComponent, - TransferHoldingsComponent + TransferHoldingsComponent, + BatchItemAttrComponent ], providers: [ HoldingsService