Bug 10190: (QA follow-up): fix: keyboard delay delete behaviour

If the 'Delay' input field value is deleted using backspace or other,
block form submission. The same behaviour apply if the delete button
is used, as both clear out the value.

As triggers with no delay are not processed and would also cause
higher triggers to then also not be processed, we do not allow the
creation of triggers without a set delay.

Triggers when edited individually do not check for impact on any overrides
they might have. It is therefore safest not to allow submission of a trigger
where the user explicitly unset the value.

An explicit 'reset to fallback' feature is possible and would constitute a follow up enhancement.

Test plan (based on comment 872):

A) 'Administration' > 'Circulation triggers' > 'Add new trigger' for any library/category. Set a Delay, a Notice, and a transport type.
B) Select the Delay field's value and clear it via the 'X' clear button.
C) Notice 'Submit' is disabled.
D) Select the Delay field's value and clear it via the keyboard (Backspace/Delete). Click 'Submit'.
E) Notice 'Submit' is disabled.

Assisted-by: Claude Opus 5 (Anthropic)
Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Chloé Zermatten 2026-09-03 11:09:53 +00:00 committed by Pedro Amorim
parent e40291cb2c
commit b38d6d5201
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 9 additions and 0 deletions

View File

@ -550,6 +550,15 @@ export default {
this.setAllowSubmission();
},
setAllowSubmission() {
// the number input yields "" when cleared from the keyboard and null when
// cleared with the button; a trigger with no delay is never processed
const delay =
this.ruleSetToSubmit?.[`overdue_${this.triggerNumber}_delay`];
if (delay === "" || delay == null) {
this.allowSubmission = false;
return;
}
// if notice is set to "", this translates to 'No letter', for which submission is allowed, and mtt is redundant
const noticeAllowSubmissionAndBypassMtt =
this.ruleSetToSubmit?.[