From 1019f5c76709bd4ec32e762048ab6bf50b3db4e6 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 28 Jul 2020 11:48:33 -0400 Subject: [PATCH] LP1889128 Staffcat hold form reset option Adds a Reset button to the staff catalog holds form so subsequent holds may be placed for the same items but for different patrons. Signed-off-by: Bill Erickson Signed-off-by: Michele Morgan Signed-off-by: Jane Sandberg --- .../src/app/staff/catalog/hold/hold.component.html | 12 +++++----- .../src/app/staff/catalog/hold/hold.component.ts | 26 +++++++++++++++------- 2 files changed, 24 insertions(+), 14 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 48c2bed40d..a708708895 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 @@ -166,16 +166,16 @@ +
  • + + + +
  • -
    -
    - -
    -

    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 95645876fa..74bf9f189b 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 @@ -101,15 +101,10 @@ export class HoldComponent implements OnInit { this.smsCarriers = []; } - ngOnInit() { - - // Respond to changes in hold type. This currently assumes hold - // types only toggle post-init between copy-level types (C,R,F) - // and no other params (e.g. target) change with it. If other - // types require tracking, additional data collection may be needed. - this.route.paramMap.subscribe( - (params: ParamMap) => this.holdType = params.get('type')); + reset() { + this.user = null; + this.userBarcode = null; this.holdType = this.route.snapshot.params['type']; this.holdTargets = this.route.snapshot.queryParams['target']; this.holdFor = this.route.snapshot.queryParams['holdFor'] || 'patron'; @@ -136,11 +131,26 @@ export class HoldComponent implements OnInit { return ctx; }); + this.resetForm(); + if (this.holdFor === 'staff' || this.userBarcode) { this.holdForChanged(); } this.getTargetMeta(); + this.placeHoldsClicked = false; + } + + ngOnInit() { + + // Respond to changes in hold type. This currently assumes hold + // types only toggle post-init between copy-level types (C,R,F) + // and no other params (e.g. target) change with it. If other + // types require tracking, additional data collection may be needed. + this.route.paramMap.subscribe( + (params: ParamMap) => this.holdType = params.get('type')); + + this.reset(); this.org.settings(['sms.enable', 'circ.holds.max_duplicate_holds']) .then(sets => { -- 2.11.0