Bugzilla – Attachment 147925 Details for
Bug 33066
We need a KohaTable Vue component
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33066: Use KohaTable for EHoldingsLocalTitlePackagesList
Bug-33066-Use-KohaTable-for-EHoldingsLocalTitlePac.patch (text/plain), 5.56 KB, created by
Jonathan Druart
on 2023-03-08 13:32:36 UTC
(
hide
)
Description:
Bug 33066: Use KohaTable for EHoldingsLocalTitlePackagesList
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-03-08 13:32:36 UTC
Size:
5.56 KB
patch
obsolete
>From 3777668aeb744c22577d955abcc9152e4e2b5d7a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 8 Mar 2023 14:32:11 +0100 >Subject: [PATCH] Bug 33066: Use KohaTable for EHoldingsLocalTitlePackagesList > >--- > .../ERM/EHoldingsLocalTitlePackagesList.vue | 104 +++++++----------- > 1 file changed, 41 insertions(+), 63 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlePackagesList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlePackagesList.vue >index 85646aa2a45..387e0af924a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlePackagesList.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlePackagesList.vue >@@ -1,98 +1,76 @@ > <template> > <div id="package_list_result"> >- <table :id="table_id"></table> >+ <KohaTable ref="table" v-bind="tableOptions" @show="doShow"></KohaTable> > </div> > </template> > > <script> >-import { createVNode, render } from "vue" >+import { ref } from "vue" > import { useDataTable } from "../../composables/datatables" >+import KohaTable from "../KohaTable.vue" > > export default { > setup() { >- const table_id = "package_list" >- useDataTable(table_id) >+ const table = ref() > > return { >- table_id, >+ table, > } > }, > data() { >- return {} >+ return { >+ package_count: [], >+ initialized: false, >+ tableOptions: { >+ columns: this.getTableColumns(), >+ data: this.resources, >+ options: { embed: "package.name" }, >+ actions: { >+ 0: ["show"], >+ }, >+ }, >+ } > }, > methods: { >- show_resource: function (resource_id) { >+ doShow: function (resource, dt, event) { > this.$router.push( >- "/cgi-bin/koha/erm/eholdings/local/resources/" + resource_id >+ "/cgi-bin/koha/erm/eholdings/local/resources/" + >+ resource.resource_id > ) > }, >- build_datatable: function () { >- let show_resource = this.show_resource >- let resources = this.resources >- let table_id = this.table_id >- >- $("#" + table_id).dataTable( >- $.extend(true, {}, dataTablesDefaults, { >- data: resources, >- embed: ["package.name"], >- order: [[0, "asc"]], >- autoWidth: false, >- columns: [ >- { >- title: __("Name"), >- data: "package.name", >- searchable: true, >- orderable: true, >- render: function (data, type, row, meta) { >- // Rendering done in drawCallback >- return "" >- }, >- width: "100%", >- }, >- ], >- drawCallback: function (settings) { >- var api = new $.fn.dataTable.Api(settings) >- >- $.each( >- $(this).find("tbody tr td:first-child"), >- function (index, e) { >- let tr = $(this).parent() >- let row = api.row(tr).data() >- if (!row) return // Happen if the table is empty >- let n = createVNode( >- "a", >- { >- role: "button", >- href: >- "/cgi-bin/koha/erm/eholdings/local/resources/" + >- row.resource_id, >- onClick: e => { >- e.preventDefault() >- show_resource(row.resource_id) >- }, >- }, >- `${row.package.name}` >- ) >- render(n, e) >- } >+ getTableColumns: function () { >+ let get_lib_from_av = this.get_lib_from_av >+ let escape_str = this.escape_str >+ return [ >+ { >+ title: __("Name"), >+ data: "package.name", >+ searchable: true, >+ orderable: true, >+ render: function (data, type, row, meta) { >+ return ( >+ '<a href="/cgi-bin/koha/erm/eholdings/local/resources/' + >+ row.resource_id + >+ '" class="show">' + >+ escape_str(row.package.name) + >+ "</a>" > ) > }, >- }) >- ) >+ width: "100%", >+ }, >+ ] > }, > }, >- mounted() { >- this.build_datatable() >- }, > props: { > resources: Array, > }, >+ components: { KohaTable }, > name: "EHoldingsLocalTitlePackagesList", > } > </script> > > <style scoped> >-#package_list { >+table { > display: table; > } > </style> >-- >2.25.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 33066
:
147352
|
147353
|
147354
|
147692
|
147693
|
147694
|
147713
|
147846
|
147847
|
147848
|
147849
|
147850
|
147851
|
147852
|
147853
|
147855
|
147856
|
147857
|
147858
|
147862
|
147865
|
147902
|
147903
|
147904
|
147905
|
147906
|
147907
|
147908
|
147909
|
147910
|
147911
|
147912
|
147913
|
147914
|
147915
|
147916
|
147917
|
147918
|
147921
|
147922
|
147923
|
147925
|
147926
|
147928
|
147957
|
147960
|
147971
|
147972
|
148718
|
149158
|
149159
|
149160
|
149161
|
149162
|
149163
|
149164
|
149165
|
149166
|
149167
|
149168
|
149169
|
149170
|
149171
|
149172
|
149173
|
149174
|
149175
|
149176
|
149177
|
149178
|
149179
|
149180
|
149181
|
149182
|
149183