From 5015d6a2a965296dca93197139f8ddad5418d666 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 9 Jun 2020 14:55:03 -0400 Subject: [PATCH] LPXXX Angular Volcopy Signed-off-by: Bill Erickson --- .../app/staff/cat/volcopy/vol-edit.component.html | 32 ++++++++++++---------- .../app/staff/cat/volcopy/vol-edit.component.ts | 15 +++++++++- .../app/staff/cat/volcopy/volcopy.component.html | 13 +++++++++ .../src/eg2/src/app/staff/cat/volcopy/volcopy.ts | 8 +++++- 4 files changed, 51 insertions(+), 17 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 a606b5d76f..b1406ad4b8 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 @@ -4,6 +4,7 @@ dialogTitle="Delete Call Number?" dialogBody="Delete {{deleteVolCount}} Call Number(s) and {{deleteCopyCount}} Associated Item(s)?"> +
- +
- +
- +
@@ -44,7 +45,7 @@
- +
- +
- +
- +
@@ -126,7 +127,7 @@ {{orgNode.target.shortname()}} @@ -199,24 +200,25 @@
-
- Duplicate Barcode
+
+
+ Duplicate Barcode
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.ts index f25da3c9f2..4566fc2ffd 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.ts @@ -317,7 +317,6 @@ export class VolEditComponent implements OnInit { batchVolApply() { this.context.volNodes().forEach(volNode => { const vol = volNode.target; - console.log('batch vol class', this.batchVolClass.id); if (this.batchVolClass) { this.applyVolValue(vol, 'label_class', this.batchVolClass.id); } @@ -431,6 +430,13 @@ export class VolEditComponent implements OnInit { } deleteCopy(copyNode: HoldingsTreeNode) { + + if (copyNode.target.isnew()) { + // Confirmation not required when deleting brand new copies. + this.deleteOneCopy(copyNode); + return; + } + this.deleteCopyCount = 1; this.confirmDelCopy.open().toPromise().then(confirmed => { if (confirmed) { this.deleteOneCopy(copyNode); } @@ -472,6 +478,13 @@ export class VolEditComponent implements OnInit { deleteVol(volNode: HoldingsTreeNode) { + + if (volNode.target.isnew()) { + // Confirmation not required when deleting brand new vols. + this.deleteOneVol(volNode); + return; + } + this.deleteVolCount = 1; this.deleteCopyCount = volNode.children.length; diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.html b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.html index 274eb68b6f..1c62cca96e 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.html @@ -16,4 +16,17 @@
+ +
+
+
+ + +
+
+ + diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.ts b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.ts index 6a515d89e5..716fac7be4 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.ts @@ -115,7 +115,6 @@ export class VolCopyContext { return node; } - sortHoldings() { this.orgNodes().forEach(orgNode => { @@ -137,4 +136,11 @@ export class VolCopyContext { o1.target.shortname() < o2.target.shortname() ? -1 : 1); } + dataIsSaveable(): boolean { + const dupeBc = this.copyList().filter(c => c._dupe_barcode).length; + + if (dupeBc) { return false; } + + return true; + } } -- 2.11.0