Bugzilla – Attachment 149527 Details for
Bug 33483
Cannot link EBSCO's package with local agreement
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33483: Make KohaTable accept customizable actions button
Bug-33483-Make-KohaTable-accept-customizable-actio.patch (text/plain), 3.06 KB, created by
Jonathan Druart
on 2023-04-12 11:41:20 UTC
(
hide
)
Description:
Bug 33483: Make KohaTable accept customizable actions button
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-04-12 11:41:20 UTC
Size:
3.06 KB
patch
obsolete
>From 82a348136348012cc2357207a4287ca2d282c670 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 11 Apr 2023 21:11:48 +0200 >Subject: [PATCH] Bug 33483: Make KohaTable accept customizable actions button > >We have hardcoded some buttons: edit, delete >But we could need specific buttons. > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../prog/js/vue/components/KohaTable.vue | 19 ++++++++++++++----- > 1 file changed, 14 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue >index 3e5d809ed06..54b3043098a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue >@@ -85,14 +85,19 @@ export default { > searchable: false, > render: (data, type, row) => { > let content = [] >- this.actions["-1"].forEach(a => { >- if (a == "edit") { >+ this.actions["-1"].forEach(action => { >+ if (typeof action === "object") { >+ let action_name = Object.keys(action)[0] >+ content.push( >+ `<a class="${action_name} btn btn-default btn-xs" role="button"><i class="${action[action_name].icon}"></i>${action[action_name].text}</a>` >+ ) >+ } else if (action == "edit") { > content.push( > '<a class="edit btn btn-default btn-xs" role="button"><i class="fa fa-pencil"></i>' + > this.$__("Edit") + > "</a>" > ) >- } else if (a == "delete") { >+ } else if (action == "delete") { > content.push( > '<a class="delete btn btn-default btn-xs" role="button"><i class="fa fa-trash"></i>' + > this.$__("Delete") + >@@ -157,8 +162,12 @@ export default { > .each(function (idx) { > const data = dataSet[idx] > actions.forEach(action => { >- $("." + action, this).on("click", e => { >- self.$emit(action, data, dt, e) >+ let action_name = >+ typeof action === "object" >+ ? Object.keys(action)[0] >+ : action >+ $("." + action_name, this).on("click", e => { >+ self.$emit(action_name, data, dt, e) > }) > }) > }) >-- >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 33483
:
149437
|
149452
|
149455
|
149456
|
149470
|
149471
|
149472
|
149473
|
149527
|
149528
|
149529
|
149555
|
149564
|
149565
|
149566
|
149567
|
149568
|
149569
|
149847
|
149848
|
149849
|
149850
|
149851
|
149852