From bcf335bd2ea8863eaa5f047a90e1b4963eedf66d Mon Sep 17 00:00:00 2001 From: Dan Briem Date: Fri, 30 Jul 2021 22:34:26 -0400 Subject: [PATCH] LP#1933381 Notify by SMS requires SMS fields when placing holds When placing a hold, if the notification method is set to SMS and no carrier is selected, the hold fails with a generic error. This disables the Place Hold(s) button if notify by SMS is selected and the SMS phone number or carrier fields are not set. Signed-off-by: Dan Briem Signed-off-by: Erica Rohlfs Signed-off-by: Galen Charlton --- .../src/eg2/src/app/staff/catalog/hold/hold.component.html | 7 ++++--- .../src/eg2/src/app/staff/catalog/hold/hold.component.ts | 12 ++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.html b/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.html index 0e764ff9d6..cdc864ddcb 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.html +++ b/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.html @@ -172,7 +172,8 @@ + id="smsValue" name="smsValue" [(ngModel)]="smsValue" + [required]="notifySms"/> @@ -182,7 +183,7 @@
@@ -190,7 +191,7 @@
  • + [disabled]="!readyToPlaceHolds()" i18n>Place Hold(s)
  • diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.ts index ef10228109..5399cd389e 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.ts @@ -475,6 +475,18 @@ export class HoldComponent implements OnInit { } } + readyToPlaceHolds(): boolean { + if (!this.user || this.placeHoldsClicked) { + return false; + } + if (this.notifySms) { + if (!this.smsValue.length || !this.smsCbox?.selectedId) { + return false; + } + } + return true; + } + // Attempt hold placement on all targets placeHolds(idx?: number) { if (!idx) { -- 2.11.0