LP1889128 Activation date repair and form reset handling
authorBill Erickson <berickxx@gmail.com>
Tue, 3 Nov 2020 20:04:37 +0000 (15:04 -0500)
committerJane Sandberg <sandbej@linnbenton.edu>
Wed, 6 Jan 2021 00:48:27 +0000 (16:48 -0800)
Fixes an issue where the holds activation date was not correctly
retrieved from the form.  Related, hold suspension and activation date
values are now reset/cleared when a new hold receipt is selected.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.html
Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.ts

index 6a1147d..26ca6f2 100644 (file)
@@ -90,8 +90,8 @@
           </div>
         </div>
         <div class="col-lg-6">
-          <eg-date-select (onChangeAsISO)="activeDateSelected($event)"
-            [disabled]="!suspend">
+          <eg-date-select [(ngModel)]="activeDate" name='active-date'
+            (onChangeAsIso)="activeDateSelected($event)" [disabled]="!suspend">
           </eg-date-select>
         </div>
       </div>
index 59f6a54..02f9a4e 100644 (file)
@@ -63,7 +63,8 @@ export class HoldComponent implements OnInit {
     notifySms: boolean;
     smsValue: string;
     suspend: boolean;
-    activeDate: string;
+    activeDateStr: string;
+    activeDate: Date;
 
     holdContexts: HoldContext[];
     recordSummaries: BibRecordSummary[];
@@ -306,7 +307,7 @@ export class HoldComponent implements OnInit {
     }
 
     activeDateSelected(dateStr: string) {
-        this.activeDate = dateStr;
+        this.activeDateStr = dateStr;
     }
 
     userBarcodeChanged() {
@@ -365,6 +366,9 @@ export class HoldComponent implements OnInit {
         this.currentUserBarcode = null;
         this.multiHoldCount = 1;
         this.smsValue = '';
+        this.activeDate = null;
+        this.activeDateStr = null;
+        this.suspend = false;
         if (this.smsCbox) { this.smsCbox.selectedId = null; }
 
         // Avoid clearing the barcode in cases where the form is
@@ -533,7 +537,7 @@ export class HoldComponent implements OnInit {
             notifyPhone: this.notifyPhone ? this.phoneValue : null,
             notifySms: this.notifySms ? this.smsValue : null,
             smsCarrier: this.smsCbox ? this.smsCbox.selectedId : null,
-            thawDate: this.suspend ? this.activeDate : null,
+            thawDate: this.suspend ? this.activeDateStr : null,
             frozen: this.suspend,
             holdableFormats: selectedFormats