From d6f596c51453cb23f7d9357c326823e0b100e81c Mon Sep 17 00:00:00 2001 From: Chloe Zermatten Date: Mon, 11 May 2026 11:55:35 +0000 Subject: [PATCH] Bug 10190: (QA follow-up) UI/UX improvements and fixes - phase three Trigger deletion and rule set reset - warn the user that resetting or deleting a given set will break sets using it as fallback. - indicate which sets will be affected. - display a preview of the post reset state of each affected rule set. - preparation: allow TriggerTable to take a title parameter. - refactor to remove 'has_rules' from the store's rule suffixes list so those match the DB. - DRY: refactor to implement TriggerTable rather than use custom templates. - select context stage handles narrower viewports - prevent crash on missing rule set TriggersTable: refactor: the elements used as buttons are now button elements - this is so they may be marked as disabled. Main page - trigger actions (delete button display) - disable the trigger deletion button. - if the context has been narrowed down ('delete' deletes all explicit rule set per trigger per library). - if the trigger belongs to default library AND one or more libraries have a trigger of a number bigger than the selected one. This is to protect trigger sequentiality from being broken for the relevant libraries. We also include an on hover message to explain the disabled button. Add/ Edit trigger form - clarify letters 'undo' button behaviour: - swap the native vue select X for a fa-undo icon. - display 'undo override and reset to fallback' on hover. - only display the add/edit button at the selectOrAdd step. - restore selected trigger yellow highlight (regression fix). - display any temporarily saved data from prior step in a green 'success' container. - only messages and data pulled from the DB for informative purposes display in blue containers. Other - redirect to correct URL (admin home) if store load fails - mtt fallbacks display as such consistently (bold italics) - is a bugfix. - catch errors on store initialisation - remove whitespace duplicate - ensure that mtt, if set, always display Assisted-by: Claude Opus 4.7 (Anthropic) AI used to help trace back potential bug sources, flag potential regressions, and draft enhancements. Changes were reviewed, tweaked, and commited manually and gradually (with a pre-submission commit squash). Sponsored-by: Glasgow Colleges Library Group Signed-off-by: Nick Clemens Signed-off-by: Pedro Amorim --- .../CirculationTriggersForm.vue | 4 +- .../CirculationTriggersFormAdd.vue | 31 +- .../CirculationTriggersFormConfirmReset.vue | 353 ++++------------ ...lationTriggersFormConfirmTriggerDelete.vue | 111 +++-- .../CirculationTriggersList.vue | 73 +++- .../CirculationTriggers/ConfirmContext.vue | 8 +- .../Admin/CirculationTriggers/EditActions.vue | 3 +- .../Admin/CirculationTriggers/EditNotice.vue | 23 ++ .../Admin/CirculationTriggers/Main.vue | 2 +- .../CirculationTriggers/TriggersTable.vue | 172 ++++---- .../vue/modules/admin/circulation_triggers.ts | 4 +- .../prog/js/vue/stores/circulation-rules.js | 387 +++++++++++++----- 12 files changed, 658 insertions(+), 513 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersForm.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersForm.vue index 25c0ba0298..2aa6b69f56 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersForm.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersForm.vue @@ -20,7 +20,7 @@ -
+
{{ $__("Loading rule set information...") }}

diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormConfirmReset.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormConfirmReset.vue index 3b74058848..eb195f21a9 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormConfirmReset.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormConfirmReset.vue @@ -2,271 +2,45 @@ -
-
-

- {{ - $__( - "Resetting this rule set for the chosen context will have an impact on all the contexts that used to fall back on this rule set." - ) - }} -

-

- {{ - $__( - "To better understand which contexts will be affected, use 'Display: all applied rules.' on the circulations triggers page." - ) - }} -

-
- {{ $__("Trigger context") }} -
    -
  1. -

    - {{ $__("Library") }}: -

    -

    - {{ handleContext(library_id, libraries, "library_id") }} -

    -
  2. -
  3. -

    - {{ $__("Patron category") }}: -

    -

    - {{ - handleContext( - patron_category_id, - patronCategories, - "patron_category_id" - ) - }} -

    -
  4. -
  5. -

    - {{ $__("Item type") }}: -

    -

    - {{ - handleContext( - item_type_id, - itemTypes, - "item_type_id", - "description" - ) - }} -

    -
  6. -
-
-

{{ $__("Loading circulation context...") }}

-
-
- -
- - {{ $__("Rules (overrides) which will be deleted") }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ - $__("Loading circulation rule set...") - }} - - -
- {{ $__("Delay") }} - - {{ $__("Notice") }} - - {{ $__("Email") }} - - {{ $__("Print") }} - - {{ $__("SMS") }} - - {{ $__("Restricts checkouts") }} -
- - {{ - effectiveRuleSet[ - `overdue_${triggerNumber}_delay` - ].value - }} - - - - {{ - handleNotice( - effectiveRuleSet[ - `overdue_${triggerNumber}_notice` - ].value - ) - }} - - - - {{ - handleTransport( - effectiveRuleSet[ - `overdue_${triggerNumber}_mtt` - ].value, - "email", - !effectiveRuleSet[ - `overdue_${modal ? i + 1 : triggerNumber}_notice` - ].value - ) - }} - - - - {{ - handleTransport( - effectiveRuleSet[ - `overdue_${triggerNumber}_mtt` - ].value, - "print", - !effectiveRuleSet[ - `overdue_${modal ? i + 1 : triggerNumber}_notice` - ].value - ) - }} - - - - {{ - handleTransport( - effectiveRuleSet[ - `overdue_${triggerNumber}_mtt` - ].value, - !effectiveRuleSet[ - `overdue_${modal ? i + 1 : triggerNumber}_notice` - ].value - ) - }} - - - - {{ - handleRestrictions( - effectiveRuleSet[ - `overdue_${triggerNumber}_restrict` - ].value - ) - }} - -
-
+
{{ alertMessage }}
+
+
+ +
+
@@ -377,11 +170,15 @@ export default { max-height: 90vh; } -form li { +form ol li { display: flex; align-items: center; } +.page-section ul li { + float: none; +} + .numeric-input-wrapper { position: relative; display: inline-block; diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormConfirmTriggerDelete.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormConfirmTriggerDelete.vue index ae672fb0a9..9ff6cf0fcc 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormConfirmTriggerDelete.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormConfirmTriggerDelete.vue @@ -1,26 +1,21 @@