https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383

--- Comment #73 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 209624
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209624&action=edit
Bug 42383: (QA follow-up) Restore hold group handling in the hold modal

When DisplayAddHoldGroups is enabled and the hold found on check-in is
part of a hold group, the legacy check-in page:

- displayed 'Part of a hold group:' with a 'View patron's holds' link
  to the patron's holds, in the hold found modals
- offered, for waiting holds, a 'Cancel all holds in hold group (X)'
  button calling POST /api/v1/patrons/{patron_id}/hold_groups/
  {hold_group_id}/cancel with the selected cancellation reason, and
  labelled the single hold cancellation button 'Cancel this hold (X)'
  instead of 'Cancel hold (X)'

The Vue page only had a TODO for it. This patch (QA comment point 19)
ports that behaviour:

- The hold group id comes from the embedded hold (hold.hold_group_id),
  already requested by the check-in client, and the
  display_hold_groups module policy flag (DisplayAddHoldGroups). No
  back-end change is needed.
- A hold_groups.cancel() method is added to PatronAPIClient.
- 'Cancel all holds in hold group' opens the existing cancellation
  pop-up, which asks for confirmation and the cancellation reason,
  and calls the new cancelHoldGroup() store action. On success the
  row is marked as checked in; on failure the error is displayed and
  the hold modal stays pending.

Test plan:
1. Enable DisplayAddHoldGroups
2. Place a hold group for a patron on two records (staff interface,
   Place hold, search the patron, select 2 records and check 'Treat as
   hold group')
3. Check in an item of the first record
=> SUCCESS: The 'Hold found' modal is displayed
=> FAIL: There is no mention of the hold group
4. Confirm the hold, then check the item in again
=> FAIL: The 'Hold found (item is already waiting)' modal only offers
   'Cancel hold (X)'
5. Apply this patch and rebuild:
   $ ktd --shell
  k$ yarn js:build
  k$ restart_all
6. Repeat step 4
=> SUCCESS: The modal shows 'Part of a hold group:' and a 'View
   patron's holds' link opening the patron's holds in a new tab
=> SUCCESS: The buttons read 'Cancel all holds in hold group (X)'
   and 'Cancel this hold (X)'
7. Click 'Cancel all holds in hold group (X)', pick a reason and
   confirm
=> SUCCESS: The row is marked as checked in, and the patron's holds
   page shows both holds of the group as cancelled
8. Repeat steps 2 to 4 with DisplayAddHoldGroups disabled
=> SUCCESS: No hold group information is shown, and the button reads
   'Cancel hold (X)'
9. Sign off :-D

Assisted-by: Opus 5.5 (Anthropic)

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to