From 4e6ad92cd8eb75297005721fda95500f50c47333 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 29 Jun 2020 18:11:41 -0400 Subject: [PATCH] LPXXX Angular Volcopy Signed-off-by: Bill Erickson --- .../eg2/src/app/staff/cat/volcopy/vol-edit.component.html | 2 +- .../eg2/src/app/staff/cat/volcopy/vol-edit.component.ts | 11 ++--------- .../eg2/src/app/staff/cat/volcopy/volcopy.component.ts | 15 ++++++++++----- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.html b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.html index 8aa5debafd..97895ae2ae 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.html @@ -2,7 +2,7 @@ #confirmDelVol i18n-dialogTitle i18n-dialogBody dialogTitle="Delete Call Number?" - dialogBody="Delete {{deleteVolCount}} Call Number(s) and {{deleteCopyCount}} Associated Item(s)?"> + dialogBody="Delete {{deleteVolCount}} Call Number(s) and All Associated Item(s)?"> { - const copy = copyNode.target; - if (copy.isnew()) { - // New copies can simply be discarded. - } else { - copy.isdeleted(true); - this.context.copiesToDelete.push(copy); - } - }); + // When deleting vols, no need to delete the linked + // copies. They'll be force deleted via the API. } if (deleteVolIdx !== null) { break; } 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 d4aaf7f501..46d356e408 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 @@ -331,8 +331,7 @@ export class VolCopyComponent implements OnInit { this.context.volsToDelete.forEach(vol => { const cloneVol = this.idl.clone(vol); - // If a deleted volume also has deleted copies, they will - // be appended below. + // No need to flesh copies -- they'll be force deleted. cloneVol.copies([]); volumes.push(cloneVol); }); @@ -345,6 +344,7 @@ export class VolCopyComponent implements OnInit { let vol = volumes.filter(v => v.id() === copyVol.id())[0]; if (vol) { + console.log('Adding deleted copy to vol deleted=' + vol.isdeleted()); vol.copies().push(cloneCopy); } else { vol = this.idl.clone(copyVol); @@ -377,10 +377,15 @@ export class VolCopyComponent implements OnInit { let method = 'open-ils.cat.asset.volume.fleshed.batch.update'; if (override) { method += '.override'; } - this.net.request('open-ils.cat', method, this.auth.token(), volumes, true, - {auto_merge_vols: true, create_parts: true, return_copy_ids: true}) + this.net.request('open-ils.cat', + method, this.auth.token(), volumes, true, + { auto_merge_vols: true, + create_parts: true, + return_copy_ids: true, + force_delete_copies: true + } - .toPromise().then(copyIds => { + ).toPromise().then(copyIds => { const evt = this.evt.parse(copyIds); -- 2.11.0