Bugzilla – Attachment 177175 Details for
Bug 37301
Further improve how we build Vue components
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37301: Rename 'type' with 'action'
Bug-37301-Rename-type-with-action.patch (text/plain), 3.38 KB, created by
Pedro Amorim
on 2025-01-27 11:22:48 UTC
(
hide
)
Description:
Bug 37301: Rename 'type' with 'action'
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-01-27 11:22:48 UTC
Size:
3.38 KB
patch
obsolete
>From 857dedbdc0da73fbaed29c9871d5823384bda4b1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 10 Jul 2024 14:27:37 +0200 >Subject: [PATCH] Bug 37301: Rename 'type' with 'action' > >'type' is too generic. >Also move to else-if and add a else block to ease debugging in case an >unsupported action is passed >--- > .../prog/js/vue/components/ERM/AgreementsList.vue | 2 +- > .../prog/js/vue/components/ERM/AgreementsShow.vue | 4 ++-- > .../prog/js/vue/components/ToolbarButton.vue | 15 +++++++++++---- > 3 files changed, 14 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue >index acfb010dd56..046d1c7f94f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue >@@ -3,7 +3,7 @@ > <div v-else id="agreements_list"> > <Toolbar v-if="!embedded"> > <ToolbarButton >- type="add" >+ action="add" > @addResource="add_agreement" > :title="$__('New agreement')" > /> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsShow.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsShow.vue >index 70c8c10bdff..26eb7b7ccb7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsShow.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsShow.vue >@@ -2,8 +2,8 @@ > <div v-if="!initialized">{{ $__("Loading") }}</div> > <div v-else id="agreements_show"> > <Toolbar> >- <ToolbarButton type="edit" @editResource="edit_agreement" /> >- <ToolbarButton type="delete" @deleteResource="delete_agreement" /> >+ <ToolbarButton action="edit" @editResource="edit_agreement" /> >+ <ToolbarButton action="delete" @deleteResource="delete_agreement" /> > </Toolbar> > > <h2> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ToolbarButton.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ToolbarButton.vue >index 214d12ef261..f74760d79c3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ToolbarButton.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ToolbarButton.vue >@@ -1,19 +1,26 @@ > <template> >- <a v-if="type === 'add'" @click="$emit('addResource')" class="btn btn-default" >+ <a v-if="action === 'add'" @click="$emit('addResource')" class="btn btn-default" > ><font-awesome-icon icon="plus" /> {{ title }}</a > > >- <a v-if="type === 'delete'" @click="$emit('deleteResource')" class="btn btn-default" >+ <a >+ v-else-if="action === 'delete'" >+ @click="$emit('deleteResource')" >+ class="btn btn-default" > ><font-awesome-icon icon="trash" /> {{ $__("Delete") }}</a > > >- <a v-if="type === 'edit'" @click="$emit('editResource')" class="btn btn-default" >+ <a >+ v-else-if="action === 'edit'" >+ @click="$emit('editResource')" >+ class="btn btn-default" > ><font-awesome-icon icon="pencil" /> {{ $__("Edit") }}</a > > >+ <span v-else>{{ $__("Unknown action %s").format(action) }}</span> > </template> > > <script> > export default { > props: { >- type: { >+ action: { > type: String, > required: true, > }, >-- >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 37301
:
168709
|
168739
|
168740
|
168741
|
168800
|
168827
|
168828
|
168829
|
168836
|
172713
|
172911
|
172912
|
172913
|
172914
|
172915
|
172916
|
172917
|
172918
|
172919
|
172920
|
172921
|
174612
|
174613
|
174614
|
174615
|
174616
|
174617
|
174618
|
174619
|
174620
|
174621
|
174622
|
174623
|
174624
|
174625
|
174626
|
174627
|
174628
|
174629
|
174630
|
174631
|
175450
|
177173
|
177174
| 177175 |
177176
|
177177
|
177178
|
177179
|
177180
|
177181
|
177182
|
177183
|
177184
|
177185
|
177186
|
177187
|
177188
|
177189
|
177190
|
177191
|
177192
|
177193
|
177351