Bugzilla – Attachment 190085 Details for
Bug 41355
No 'show' view for record sources
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41355: Handle vue resources with no Show component
Bug-41355-Handle-vue-resources-with-no-Show-compon.patch (text/plain), 4.55 KB, created by
Matt Blenkinsop
on 2025-12-02 14:21:15 UTC
(
hide
)
Description:
Bug 41355: Handle vue resources with no Show component
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2025-12-02 14:21:15 UTC
Size:
4.55 KB
patch
obsolete
>From 1240bc811497e88aa14c1c557628cc755da06be5 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> >Date: Tue, 2 Dec 2025 14:17:24 +0000 >Subject: [PATCH] Bug 41355: Handle vue resources with no Show component > >Test plan: >1) Navigate to record sources and create a record source >2) In the table there will be a hyperlink on the record source name which shouldn't be there >3) Apply patch and rebuild javascript >4) Hard refresh and then observe that the table should no longer have a hyperlink >--- > .../RecordSources/RecordSourcesResource.vue | 7 +--- > .../prog/js/vue/components/ResourceList.vue | 35 +++++++++---------- > 2 files changed, 17 insertions(+), 25 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 eeb0e560f7d..55c928b0fc0 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 >@@ -45,12 +45,7 @@ export default { > name: "record_source_id", > required: true, > type: "text", >- label: $__("Id"), >- tableColumnDefinition: { >- title: $__("ID"), >- data: "record_source_id", >- searchable: true, >- }, >+ label: $__("ID"), > hideIn: ["Form"], > }, > { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ResourceList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ResourceList.vue >index 636857763df..9cd2017d207 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ResourceList.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ResourceList.vue >@@ -22,7 +22,7 @@ > > <script> > import Toolbar from "./Toolbar.vue"; >-import { ref, inject, onBeforeMount, computed } from "vue"; >+import { ref, onBeforeMount, computed } from "vue"; > import { APIClient } from "../fetch/api-client.js"; > import KohaTable from "./KohaTable.vue"; > import { $__ } from "@koha-vue/i18n"; >@@ -89,7 +89,20 @@ export default { > }); > }); > }; >+ const handleShowField = (row, attr, thisResource) => { >+ if (!props.instancedResource.components.show) { >+ return row[attr.name]; >+ } >+ return ( >+ '<a href="' + >+ thisResource.getResourceShowURL(row[thisResource.idAttr]) + >+ '" class="show">' + >+ escape_str(row[attr.name]) + >+ "</a>" >+ ); >+ }; > const assignShowEvent = (columnActions, i) => { >+ if (!props.instancedResource.components.show) return; > if (!columnActions[i]) { > columnActions[i] = ["show"]; > } >@@ -123,15 +136,7 @@ export default { > searchable: true, > orderable: true, > render: function (data, type, row, meta) { >- return ( >- '<a href="' + >- thisResource.getResourceShowURL( >- row[thisResource.idAttr] >- ) + >- '" class="show">' + >- escape_str(row[thisResource.idAttr]) + >- "</a>" >- ); >+ return handleShowField(row, attr, thisResource); > }, > }); > return acc; >@@ -146,15 +151,7 @@ export default { > searchable: true, > orderable: true, > render: function (data, type, row, meta) { >- return ( >- '<a href="' + >- thisResource.getResourceShowURL( >- row[thisResource.idAttr] >- ) + >- '" class="show">' + >- escape_str(row[attr.name]) + >- "</a>" >- ); >+ return handleShowField(row, attr, thisResource); > }, > }); > return acc; >-- >2.39.5
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 41355
:
190082
|
190085
|
190094
|
190106