Bugzilla – Attachment 168829 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: Add goToResourceShow to BaseResource
Bug-37301-Add-goToResourceShow-to-BaseResource.patch (text/plain), 3.42 KB, created by
Jonathan Druart
on 2024-07-11 14:13:21 UTC
(
hide
)
Description:
Bug 37301: Add goToResourceShow to BaseResource
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-07-11 14:13:21 UTC
Size:
3.42 KB
patch
obsolete
>From d03856bd0bc9369398bc6b65a1a8f3cb1046f313 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 11 Jul 2024 16:12:07 +0200 >Subject: [PATCH] Bug 37301: Add goToResourceShow to BaseResource > >--- > .../prog/js/vue/components/BaseResource.vue | 15 +++++++++++++++ > .../js/vue/components/ERM/AgreementResource.vue | 1 + > .../prog/js/vue/components/ERM/AgreementsList.vue | 9 +-------- > 3 files changed, 17 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/BaseResource.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/BaseResource.vue >index 1c782bc44ab..e5ceb80752c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/BaseResource.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/BaseResource.vue >@@ -9,6 +9,20 @@ export default { > return { ...props, setConfirmationDialog, setMessage, setError } > }, > methods: { >+ /** >+ * Navigates to the show page of the given resource. >+ * >+ * @param {Object} resource - The resource to navigate to >+ * @return {void} >+ */ >+ goToResourceShow: function (resource, dt, event) { >+ event?.preventDefault() >+ this.$router.push({ >+ name: this.show_component, >+ params: { [this.id_attr]: resource[this.id_attr] }, >+ }) >+ }, >+ > /** > * Navigates to the edit page of the given resource. > * >@@ -40,6 +54,7 @@ export default { > props: { > resource_name: String, > id_attr: String, >+ show_component: String, > add_component: String, > edit_component: String, > }, >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue >index a05a0f028f8..88025188146 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue >@@ -8,6 +8,7 @@ export default { > ...BaseResource.setup({ > resource_name: "agreement", > id_attr: "agreement_id", >+ show_component: "AgreementsShow", > add_component: "AgreementsFormAdd", > edit_component: "AgreementsFormAddEdit", > }), >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 d80577111f3..9a731552385 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 >@@ -43,7 +43,7 @@ > <KohaTable > ref="table" > v-bind="tableOptions" >- @show="doShow" >+ @show="goToResourceShow" > @edit="goToResourceEdit" > @delete="doDelete" > @select="doSelect" >@@ -173,13 +173,6 @@ export default { > error => {} > ) > }, >- doShow: function ({ agreement_id }, dt, event) { >- event.preventDefault() >- this.$router.push({ >- name: "AgreementsShow", >- params: { agreement_id }, >- }) >- }, > doDelete: function (agreement, dt, event) { > this.setConfirmationDialog( > { >-- >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