LP1904036 Merge repairs; penalty display; autorenew
authorBill Erickson <berickxx@gmail.com>
Wed, 13 Jul 2022 20:36:35 +0000 (16:36 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:42 +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/share/patron/summary.component.html
Open-ILS/src/eg2/src/app/staff/share/patron/summary.component.ts

index f8870d6..75fcc9e 100644 (file)
     </div>
   </ng-container>
 
-  <ng-container *ngTemplateOutlet="userSettingsCheckboxRow;
-    context: {args: {settingName: 'circ.autorenew.opt_in'}}">
-  </ng-container>
   <ng-container *ngFor="let set of optInSettingTypes | keyvalue">
     <ng-container *ngTemplateOutlet="userSettingsCheckboxRow;
       context: {args: {settingName: set.key}}">
index 4fed347..11f1646 100644 (file)
     </div>
   </div>
 
-  <div class="row mb-1 alert alert-danger p-0" 
+  <div class="row mb-1 alert alert-anger p-0" 
     *ngFor="let pen of summary.alerts.alertPenalties">
     <div class="col-lg-9"
       title="{{pen.standing_penalty().name()}}">
-      {{pen.usr_message() || pen.standing_penalty().label()}}
+      {{penaltyLabel(pen)}}
     </div>
     <div class="col-lg-3">{{pen.set_date() | date:'shortDate'}}</div>
   </div>
index 87888e2..749b430 100644 (file)
@@ -58,6 +58,16 @@ export class PatronSummaryComponent implements OnInit {
         }
     }
 
+    penaltyLabel(pen: IdlObject): string {
+        if (pen.usr_message()) {
+            // They don't often have titles, but defaulting to
+            // title, assuming it will be shorter and therefore more
+            // appropriate for summary display.
+            return pen.usr_message().title() || pen.usr_message().message();
+        }
+        return pen.standing_penalty().label();
+    }
+
     printAddress(addr: IdlObject) {
         this.printer.print({
             templateName: 'patron_address',