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

--- Comment #11 from ChloĆ© Zermatten <[email protected]> ---
Created attachment 208167
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208167&action=edit
Bug 39756: feat(config): reset rules to fallback

Add the reset to fallback button to the newly introduced
rules, and improve functionality.

- Extract and use a ResetToFallback component
- Update the logic so that if used it truly sets the
  value to the closest fallback, rather than only undoing
  the user's current changes. This means deleting the
  override.
- Collapse the methods involved in said resets, that could
  benefit from it
- Ensure field value datatypes are consistent
- use setAllowSubmission consistently so that any change,
  including resets to fallback, can be picked up on and
  allow for submission.
- for radio buttons, ensure that (Yes)/(No) hints
  reflect the projected fallback value

Test plan:

1. Apply the patch and run yarn js:build.
2. Go to Administration > Circulation triggers. For the default
   context, add trigger 1 with:
   - delay 7, notice ODUE, transport email
   - lost value 'Lost', restrict checkouts 'Yes'
3. Select a library L and edit trigger 1. Change the delay to 10,
   the lost value to 'Missing', the notice to another letter and the
   transport to SMS. Notice an undo icon ('Undo override and reset
   to fallback') appears next to each changed field.
4. Click the undo icon next to the lost value, and notice:
   - the field goes back to 'Lost'
   - the icon disappears
   - Save is enabled
   Do the same for the delay, notice and transport.
5. Notice the restrict checkouts radio shows 'Fallback to default
   (Yes)'. In another tab, set the default's restrict to 'No', reload
   L's edit form, and notice the hint now reads '(No)'.
6. On notice 1 from library L, set the lost value to 'Missing'
   and save. Then edit again, click undo on the lost value,
7. Notice that 'Set lost value' for notice 1 for library L now
   shows in bold italics, indicating no value is saved in the DB for
   this, as we are simply falling back to the default rule.
8. Change the default's lost value to 'Missing', select L, and notice
   that L now shows 'Missing' in bold italics. It follows the default
   because no override is left.
9. On trigger 1 for library L, set the notice to 'No letter', and save.
   Notice that no transports are assigned to that rule set anymore.

Sponsored-by: Black Hills Library Consortium- http://www.rcgov.org/Library/
Assisted-by: Claude Opus 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