Bugzilla – Attachment 168740 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.32 KB, created by
Jonathan Druart
on 2024-07-10 13:33:15 UTC
(
hide
)
Description:
Bug 37301: Rename 'type' with 'action'
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-07-10 13:33:15 UTC
Size:
3.32 KB
patch
obsolete
>From 635dab1d36ee4e2e7b675e76555156f6fe2d1b1a 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 a79e0c973cf..07d3e5c7ba8 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 a7bc5f23046..75b8cd72306 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 c226ed98f52..d6c535284fc 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="class" >+ <a v-if="action === 'add'" @click="$emit('addResource')" :class="class" > ><font-awesome-icon icon="plus" /> {{ title }}</a > > >- <a v-if="type === 'delete'" @click="$emit('deleteResource')" :class="class" >+ <a >+ v-else-if="action === 'delete'" >+ @click="$emit('deleteResource')" >+ :class="class" > ><font-awesome-icon icon="trash" /> {{ $__("Delete") }}</a > > >- <a v-if="type === 'edit'" @click="$emit('editResource')" :class="class" >+ <a >+ v-else-if="action === 'edit'" >+ @click="$emit('editResource')" >+ :class="class" > ><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.34.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 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