From ae5d83ddd926d2a4cd065346171afe2ab5dce839 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Wed, 14 Aug 2024 15:08:31 +0000 Subject: [PATCH] Bug 10190: Set tab based on trigger edited/created Sponsored-by: Glasgow Colleges Library Group Signed-off-by: George Harkins --- .../CirculationTriggersFormAdd.vue | 5 ++++- .../CirculationTriggersList.vue | 19 +++++++++---------- 2 files changed, 13 insertions(+), 11 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 fac7b534fc3..45849640e9c 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 @@ -306,7 +306,10 @@ export default { await client.circRules.update(circRule).then( () => { this.$router - .push({ name: "CirculationTriggersList" }) + .push({ + name: "CirculationTriggersList", + query: { trigger: this.newTriggerNumber }, + }) .then(() => this.$router.go(0)) }, error => {} diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersList.vue index 27c0511c8a5..ac339cfe939 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersList.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersList.vue @@ -141,17 +141,16 @@ export default { beforeRouteEnter(to, from, next) { next(vm => { vm.getLibraries().then(() => - vm - .getCategories() - .then(() => - vm - .getItemTypes() - .then(() => - vm - .getCircRules({}, true) - .then(() => (vm.initialized = true)) - ) + vm.getCategories().then(() => + vm.getItemTypes().then(() => + vm.getCircRules({}, true).then(() => { + vm.tabSelected = to.query.trigger + ? `Notice ${to.query.trigger}` + : "Notice 1" + vm.initialized = true + }) ) + ) ) }) }, -- 2.47.0