Bugzilla – Attachment 172621 Details for
Bug 10190
Overdue notice triggers based on item type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10190: Clarify workflow
Bug-10190-Clarify-workflow.patch (text/plain), 8.10 KB, created by
Martin Renvoize (ashimema)
on 2024-10-10 14:40:50 UTC
(
hide
)
Description:
Bug 10190: Clarify workflow
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-10-10 14:40:50 UTC
Size:
8.10 KB
patch
obsolete
>From 8dd2afa73b0591726c0a4d838f4e353d431df48e Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 18 Sep 2024 04:33:27 +0100 >Subject: [PATCH] Bug 10190: Clarify workflow > >This patch re-arranges the edit/add modal form to clarify the >need to select context, then decide on editing an existing trigger or >adding a new one and then, and only then, exposes the actual rule inputs >--- > .../CirculationTriggersFormAdd.vue | 53 ++++++++++++------- > .../CirculationTriggers/TriggersTable.vue | 46 ++++++++++++++-- > 2 files changed, 77 insertions(+), 22 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormAdd.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormAdd.vue >index 0ae22737919..998d3dcd8dd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormAdd.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormAdd.vue >@@ -5,30 +5,21 @@ > <div v-if="initialized" class="modal-content"> > <form @submit="addCircRule($event)"> > <div class="modal-header"> >- <h1 v-if="!editMode">{{ $__("Add circulation trigger") }}</h1> >- <h1 v-else>{{ $__("Edit circulation trigger") }}</h1> >+ <h1 class="modal-title" v-if="!editMode"> >+ {{ $__("Circulation triggers") }} >+ </h1> >+ <h1 class="modal-title" v-else> >+ {{ $__("Edit circulation trigger") }} >+ </h1> > </div> > <div class="modal-body"> > <div class="page-section bg-info" v-if="circRules.length"> >- <h2>{{ $__("Trigger context") }}</h2> >+ <h2>{{ $__("Circulation context") }}</h2> > <TriggerContext :ruleInfo="ruleInfo" /> >- <h2 v-if="ruleInfo.numberOfTriggers > 0"> >- {{ $__("Existing rules") }} >- </h2> >- <p v-if="ruleInfo.numberOfTriggers > 0"> >- {{ $__("Notice") }} {{ " " + newTriggerNumber - 1 }} >- </p> >- <TriggersTable >- v-if="ruleInfo.numberOfTriggers > 0" >- :circRules="circRules" >- :triggerNumber="newTriggerNumber - 1" >- :modal="true" >- :ruleBeingEdited="ruleBeingEdited" >- :triggerBeingEdited="triggerBeingEdited" >- :letters="letters" >- /> > </div> >+ > <fieldset class="rows"> >+ <legend>{{ $__("Select trigger context") }}</legend> > <ol> > <li> > <label for="library_id" class="required" >@@ -102,6 +93,32 @@ > </v-select> > <span class="required">{{ $__("Required") }}</span> > </li> >+ </ol> >+ >+ <div >+ class="page-section bg-warning-subtle" >+ v-if="circRules.length" >+ > >+ <TriggersTable >+ :circRules="circRules" >+ :triggerNumber="newTriggerNumber - 1" >+ :modal="true" >+ :ruleBeingEdited="ruleBeingEdited" >+ :triggerBeingEdited="triggerBeingEdited" >+ :letters="letters" >+ /> >+ </div> >+ </fieldset> >+ >+ <fieldset class="rows" v-if="editMode"> >+ <legend v-if="ruleInfo.numberOfTriggers < newTriggerNumber"> >+ {{ $__("Add new trigger") }} >+ {{ " " + newTriggerNumber }} >+ </legend> >+ <legend v-else> >+ {{ $__("Edit trigger") }} {{ " " + newTriggerNumber }} >+ </legend> >+ <ol> > <li> > <label for="overdue_delay" > >{{ $__("Delay") }}: >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/TriggersTable.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/TriggersTable.vue >index 06d540e93b9..1e208c2ab1d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/TriggersTable.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/TriggersTable.vue >@@ -1,6 +1,12 @@ > <template> > <div class="page-section"> >- <div class="page-section bg-info">{{ $__("Bolid italic values denote fallback values where an override has not been set for the context.") }}</div> >+ <div class="page-section bg-info" v-if="!modal"> >+ {{ >+ $__( >+ "Bolid italic values denote fallback values where an override has not been set for the context." >+ ) >+ }} >+ </div> > <table> > <thead> > <th v-if="!modal"> >@@ -10,7 +16,7 @@ > {{ $__("Item type") }} > </th> > <th v-if="modal"> >- {{ $__("Rule") }} >+ {{ $__("Trigger") }} > </th> > <th> > {{ $__("Delay") }} >@@ -260,6 +266,28 @@ > > > </td> > </tr> >+ <tr v-if="modal"> >+ <td colspan="7"></td> >+ <td class="actions"> >+ <router-link >+ :to="{ >+ name: 'CirculationTriggersFormEdit', >+ query: { >+ library_id: >+ ruleBeingEdited.context.library_id, >+ item_type_id: >+ ruleBeingEdited.context.item_type_id, >+ patron_category_id: >+ ruleBeingEdited.context >+ .patron_category_id, >+ triggerNumber: numberOfTriggers + 1, >+ }, >+ }" >+ class="btn btn-default btn-xs" >+ ><i class="fa-solid fa-pencil"></i> Add</router-link >+ > >+ </td> >+ </tr> > </tbody> > </table> > </div> >@@ -277,6 +305,11 @@ export default { > "itemTypes", > "letters", > ], >+ data() { >+ return { >+ numberOfTriggers: 0, >+ } >+ }, > methods: { > handleContext(value, data, type, displayProperty = "name") { > const item = data.find(item => item[type] === value) >@@ -304,12 +337,17 @@ export default { > > // Calculate the number of 'overdue_X_' triggers in the effectiveRule > const regex = /overdue_(\d+)_delay/g >- const numberOfTriggers = Object.keys(effectiveRule).filter( >+ this.numberOfTriggers = Object.keys(effectiveRule).filter( > key => regex.test(key) && effectiveRule[key] !== null > ).length > >+ // Shortcut for the case where no triggers exist yet >+ if (this.numberOfTriggers === 0) { >+ return undefined >+ } >+ > // Ensure there is one contextRule per 'X' from 1 to numberOfTriggers >- for (let i = 1; i <= numberOfTriggers; i++) { >+ for (let i = 1; i <= this.numberOfTriggers; i++) { > // Check if there's already a rule for overdue_X_ in contextRules > const matchingRule = contextRules.find( > rule => rule[`overdue_${i}_delay`] !== undefined >-- >2.47.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10190
:
170357
|
170358
|
170359
|
170360
|
170361
|
170362
|
170363
|
170364
|
170365
|
170366
|
170367
|
170368
|
170369
|
170370
|
170371
|
170372
|
170373
|
170374
|
170375
|
170376
|
170380
|
170449
|
171727
|
171728
|
171729
|
171730
|
171731
|
171732
|
171733
|
171734
|
171735
|
171736
|
171737
|
171738
|
171739
|
171740
|
171741
|
171742
|
171743
|
171744
|
171745
|
171746
|
171747
|
171748
|
171749
|
171750
|
171751
|
171752
|
171753
|
171754
|
171755
|
172588
|
172589
|
172590
|
172591
|
172592
|
172593
|
172594
|
172595
|
172596
|
172597
|
172598
|
172599
|
172600
|
172601
|
172602
|
172603
|
172604
|
172605
|
172606
|
172607
|
172608
|
172609
|
172612
|
172614
|
172617
|
172619
|
172621
|
172622
|
172623
|
172624
|
172625
|
172626
|
172630
|
172631
|
172632
|
172633
|
172634
|
172635
|
172636
|
172637
|
172638
|
172639
|
172640
|
172641
|
172642
|
172643
|
172644
|
172645
|
172646
|
172647
|
172648
|
172649
|
172650
|
172651
|
172652
|
172653
|
172654
|
172655
|
172656
|
172657
|
172658
|
172659
|
172660
|
172661
|
172662
|
172663