From: Bill Erickson Date: Thu, 2 Jul 2020 14:42:15 +0000 (-0400) Subject: LPXXX Angular Volcopy X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7135c262b18c05d97ba4497f7e4422b62371b4d8;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.ts b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts index 241a25fcc1..2097f003d7 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts @@ -372,23 +372,28 @@ export class CopyAttrsComponent implements OnInit, AfterViewInit { } openCopyTags() { - this.copyTagsDialog.mode = 'create'; this.copyTagsDialog.inPlaceMode = true; + this.copyTagsDialog.copyIds = this.context.copyList().map(c => c.id()); + console.log('IDS', this.copyTagsDialog.copyIds); this.copyTagsDialog.open({size: 'lg'}).subscribe(newTags => { if (!newTags || newTags.length === 0) { return; } newTags.forEach(tag => { this.context.copyList().forEach(copy => { - console.log('ADDING TAG ', tag); - /* - const a = this.idl.clone(newTag); - a.isnew(true); - a.copy(copy.id()); - if (!copy.copy_alerts()) { copy.copy_alerts([]); } - copy.copy_alerts().push(a); + + if (copy.tags().filter( + map => map.tag().id() === tag.id()).length > 0) { + return; // map already exists + } + + const map = this.idl.create('acptcm'); + map.isnew(true); + map.copy(copy.id()); + map.tag(tag); + + copy.tags().push(map); copy.ischanged(true); - */ }); }); }); diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.ts index 46d356e408..d16abb3175 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.ts @@ -17,8 +17,12 @@ import {NgbTabset, NgbTabChangeEvent} from '@ng-bootstrap/ng-bootstrap'; const COPY_FLESH = { flesh: 1, flesh_fields: { - acp: ['call_number', 'location', 'parts', - 'creator', 'editor', 'stat_cat_entries'] + acp: [ + 'call_number', 'location', 'parts', 'tags', + 'creator', 'editor', 'stat_cat_entries' + ], + acptcm: ['tag'], + acpt: ['tag_type'] } }; diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.service.ts b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.service.ts index e0c76b11e5..ba20dc96d9 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.service.ts @@ -214,6 +214,7 @@ export class VolCopyService { copy.ref('f'); copy.mint_condition('t'); copy.parts([]); + copy.tags([]); copy.stat_cat_entries([]); return copy; diff --git a/Open-ILS/src/eg2/src/app/staff/share/holdings/copy-tags-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/share/holdings/copy-tags-dialog.component.html index b2c1ffaef5..f1b53d81f9 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holdings/copy-tags-dialog.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/holdings/copy-tags-dialog.component.html @@ -5,10 +5,10 @@