Bugzilla – Attachment 188776 Details for
Bug 40191
Design pattern: Redirect user to a view of the record after saving instead of list
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40191: Handle resources without detail view in navigation options
Bug-40191-Handle-resources-without-detail-view-in-.patch (text/plain), 4.18 KB, created by
Martin Renvoize (ashimema)
on 2025-10-31 08:59:47 UTC
(
hide
)
Description:
Bug 40191: Handle resources without detail view in navigation options
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-10-31 08:59:47 UTC
Size:
4.18 KB
patch
obsolete
>From 23f82a0709809e78b03f643cd7eded7cf8031b1d Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> >Date: Tue, 21 Oct 2025 10:20:13 +0100 >Subject: [PATCH] Bug 40191: Handle resources without detail view in navigation > options > >Fixes an edge case where resources without a dedicated show/detail component >(like Record Sources) would show invalid navigation options. > >- ResourceFormSave: Filter out "show" option when no_show is true >- RecordSourcesResource: Set no_show flag to hide inappropriate options > >Ensures the split button menu only shows valid navigation targets. > >Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> >--- > .../components/Admin/RecordSources/RecordSourcesResource.vue | 5 +++-- > .../prog/js/vue/components/ResourceFormSave.vue | 4 ++++ > 2 files changed, 7 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/RecordSources/RecordSourcesResource.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/RecordSources/RecordSourcesResource.vue >index 9967023aa48..87378202f67 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/RecordSources/RecordSourcesResource.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/RecordSources/RecordSourcesResource.vue >@@ -40,6 +40,7 @@ export default { > newLabel: $__("New record source"), > }, > props, >+ navigationOnFormSave: "RecordSourcesList", > resourceAttrs: [ > { > name: "record_source_id", >@@ -101,7 +102,7 @@ export default { > baseResource.setMessage( > $__("Record source updated!") > ); >- return recordResource >+ return recordResource; > }, > error => {} > ); >@@ -109,7 +110,7 @@ export default { > return baseResource.apiClient.create(recordSource).then( > recordResource => { > baseResource.setMessage($__("Record source created!")); >- return recordResource >+ return recordResource; > }, > error => {} > ); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ResourceFormSave.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ResourceFormSave.vue >index c8eb6ab3de7..e1fc2215c89 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ResourceFormSave.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ResourceFormSave.vue >@@ -214,6 +214,7 @@ export default { > callback: () => { > saveOptionSelected.value = components.list; > if ( >+ props.instancedResource.stickyToolbar && > props.instancedResource.stickyToolbar.includes( > "Form" > ) >@@ -229,6 +230,7 @@ export default { > callback: () => { > saveOptionSelected.value = components.show; > if ( >+ props.instancedResource.stickyToolbar && > props.instancedResource.stickyToolbar.includes( > "Form" > ) >@@ -244,6 +246,7 @@ export default { > callback: () => { > saveOptionSelected.value = components.edit; > if ( >+ props.instancedResource.stickyToolbar && > props.instancedResource.stickyToolbar.includes( > "Form" > ) >@@ -254,6 +257,7 @@ export default { > }, > }; > return Object.keys(buttonOptions).reduce((acc, key) => { >+ if (!components[key]) return acc; > if (key === "show" && !navigationOnFormSave) return acc; > if (components[key] === navigationOnFormSave) return acc; > return [buttonOptions[key], ...acc]; >-- >2.51.1
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 40191
:
188107
|
188108
|
188109
|
188137
|
188138
|
188139
|
188164
|
188165
|
188167
|
188193
|
188194
|
188195
|
188196
|
188197
|
188198
|
188201
|
188202
|
188203
|
188768
|
188769
|
188770
|
188771
|
188772
|
188773
|
188774
|
188775
| 188776