From: Dan Briem Date: Sat, 31 Jul 2021 02:34:26 +0000 (-0400) Subject: LP#1933381 Notify by SMS requires SMS fields when placing holds X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bcf335bd2ea8863eaa5f047a90e1b4963eedf66d;p=evergreen%2Ftadl.git 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 --- 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) {