From: Bill Erickson Date: Tue, 23 Jun 2020 16:27:47 +0000 (-0400) Subject: LPXXX Angular Volcopy X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0d4581aa3d7eb1f4163e01b717d3eda8561c876d;p=working%2FEvergreen.git LPXXX Angular Volcopy Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.html b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.html index 7d1c57920c..4ea94abcb6 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.html @@ -12,6 +12,21 @@ + + + + +
@@ -93,28 +108,22 @@ domId='location-input' [required]="true" permFilter="UPDATE_COPY"> - - + +
- - + +
@@ -125,12 +134,9 @@ [limitPerms]="['UPDATE_COPY']"> - - + +
@@ -138,15 +144,10 @@ - - + +
- @@ -159,13 +160,9 @@ - - + +
@@ -173,49 +170,39 @@ - - + +
- + + + + - - + +
- + + + + - - + +
@@ -231,13 +218,9 @@ - - + +
@@ -253,29 +236,24 @@ - - + +
- + + + + - - + +
@@ -286,12 +264,9 @@ value="{{mod.code()}}">{{mod.name()}} - - + +
@@ -333,13 +308,9 @@ - - + +
@@ -347,13 +318,9 @@ - - + +
@@ -361,13 +328,9 @@ - - + +
@@ -375,13 +338,9 @@ - - + +
@@ -389,13 +348,9 @@ - - + +
@@ -403,14 +358,9 @@ - - + +
@@ -424,13 +374,9 @@ - - + +
@@ -452,9 +398,9 @@ -
+
- ; + constructor( private router: Router, private route: ActivatedRoute, - private renderer: Renderer2, private evt: EventService, private idl: IdlService, private org: OrgService, @@ -77,9 +81,9 @@ export class CopyAttrsComponent implements OnInit, AfterViewInit { private auth: AuthService, private pcrud: PcrudService, private holdings: HoldingsService, - private volcopy: VolCopyService, private format: FormatService, - private store: StoreService + private store: StoreService, + public volcopy: VolCopyService ) { } ngOnInit() { @@ -221,7 +225,13 @@ export class CopyAttrsComponent implements OnInit, AfterViewInit { } applyCopyValue(field: string, value?: any) { - if (value === undefined) { value = this.values[field]; } + if (value === undefined) { + value = this.values[field]; + } else { + this.values[field] = value; + } + + // TODO: handle circ_lib, owning_lib changes specially console.debug('APPLYING', field, value); @@ -233,18 +243,6 @@ export class CopyAttrsComponent implements OnInit, AfterViewInit { }); } - circLibChanged() { - // TODO other stuff happens here? - this.applyCopyValue('circ_lib'); - } - - owningLibChanged() { - // TODO - // copies.ischanged(true); - console.log('OWNING LIB ', this.values['owning_lib']); - } - - // Create or modify a stat cat entry for each copy that does not // already match the new value. statCatChanged(catId: number) { @@ -312,9 +310,20 @@ export class CopyAttrsComponent implements OnInit, AfterViewInit { }); } + saveTemplate() { + this.batchAttrs.forEach(comp => { + console.log(comp.editInputDomId); + }); + } + displayAttr(field: string): boolean { return this.volcopy.defaults.hidden[field] !== true; } + + copyFieldLabel(field: string): string { + const def = this.idl.classes.acp.field_map[field]; + return def ? def.label : ''; + } } 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 index e8f00a2dc0..f364cd5b50 100644 --- 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 @@ -36,6 +36,7 @@
+
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 index 408ebf9284..a72545454f 100644 --- 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 @@ -21,6 +21,10 @@ export class BatchItemAttrComponent { // Main display label, e.g. "Circulation Modifier" @Input() label: string; + // Optional. Useful for exracting information (i.e. hasChanges) + // on a specific field from a set of batch attr components. + @Input() name: string; + // Maps display labels to the number of items that have the label. // e.g. {"Stacks": 4, "Display": 12} @Input() labelCounts: {[label: string]: number} = {}; @@ -44,6 +48,7 @@ export class BatchItemAttrComponent { @Output() changesSaved: EventEmitter = new EventEmitter(); @Output() changesCanceled: EventEmitter = new EventEmitter(); + @Output() valueCleared: EventEmitter = new EventEmitter(); // Is the editTtemplate visible? editing = false; @@ -63,6 +68,13 @@ export class BatchItemAttrComponent { this.changesCanceled.emit(); } + clear() { + this.hasChanged = true; + this.editing = false; + this.valueCleared.emit(); + } + + toggleEditMode() { if (this.readOnly) { return; }