LP1904036 SMS number / carrier required if SMS enabled
authorBill Erickson <berickxx@gmail.com>
Thu, 16 Sep 2021 15:02:45 +0000 (11:02 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:37 +0000 (20:13 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts

index c46961e..48dc650 100644 (file)
       id="cust-{{args.settingName}}-input"
       [ngModel]="userSettings[args.settingName]"
       (ngModelChange)="userSettingChange(args.settingName, $event)"
+      [required]="settingFieldRequired(args.settingName)"
       [disabled]="args.disabled"
     />
   </div>
           name="cust-opac.default_sms_carrier-input"
           domId="cust-opac.default_sms_carrier-input"
           [selectedId]="userSettings['opac.default_sms_carrier']"
+          [required]="settingFieldRequired('opac.default_sms_carrier')"
           (onChange)="userSettingChange(
             'opac.default_sms_carrier', $event ? $event.id : null)">
         </eg-combobox>
index c95260d..15d29b3 100644 (file)
@@ -1145,6 +1145,16 @@ export class EditComponent implements OnInit, AfterViewInit {
         return this.fieldVisibility[field] === 3;
     }
 
+    settingFieldRequired(name: string): boolean {
+
+        switch (name) {
+            case 'opac.default_sms_notify':
+            case 'opac.default_sms_carrier':
+                return this.holdNotifyTypes.sms;
+        }
+
+        return false;
+    }
 
     fieldPattern(idlClass: string, field: string): RegExp {
         if (!this.fieldPatterns[idlClass][field]) {