Bugzilla – Attachment 174618 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.50 KB, created by
Pedro Amorim
on 2024-11-15 16:45:03 UTC
(
hide
)
Description:
Bug 37301: Add goToResourceShow to BaseResource
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-11-15 16:45:03 UTC
Size:
3.50 KB
patch
obsolete
>From ec15250bc799754b5168105c55277062c75f0e9b 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 1c782bc44a..e5ceb80752 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 a05a0f028f..8802518814 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 a7ffea17ff..9fc9b3643d 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 >@@ -45,7 +45,7 @@ > v-bind="tableOptions" > :searchable_additional_fields="searchable_additional_fields" > :searchable_av_options="searchable_av_options" >- @show="doShow" >+ @show="goToResourceShow" > @edit="goToResourceEdit" > @delete="doDelete" > @select="doSelect" >@@ -222,13 +222,6 @@ export default { > }) > }) > }, >- doShow: function ({ agreement_id }, dt, event) { >- event.preventDefault() >- this.$router.push({ >- name: "AgreementsShow", >- params: { agreement_id }, >- }) >- }, > doDelete: function (agreement, dt, event) { > this.setConfirmationDialog( > { >-- >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