Bugzilla – Attachment 174625 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: Apply changes to eholdings titles
Bug-37301-Apply-changes-to-eholdings-titles.patch (text/plain), 10.25 KB, created by
Pedro Amorim
on 2024-11-15 16:45:23 UTC
(
hide
)
Description:
Bug 37301: Apply changes to eholdings titles
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-11-15 16:45:23 UTC
Size:
10.25 KB
patch
obsolete
>From 44fc4561ca49590d044013e39b6a83edea8e2f68 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Thu, 17 Oct 2024 12:06:03 +0000 >Subject: [PATCH] Bug 37301: Apply changes to eholdings titles > >--- > .../ERM/EHoldingsLocalTitleResource.vue | 30 +++++++++ > .../ERM/EHoldingsLocalTitlesList.vue | 63 +++---------------- > .../ERM/EHoldingsLocalTitlesShow.vue | 53 +++------------- > 3 files changed, 49 insertions(+), 97 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitleResource.vue > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitleResource.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitleResource.vue >new file mode 100644 >index 0000000000..de1b91eb9c >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitleResource.vue >@@ -0,0 +1,30 @@ >+<script> >+import BaseResource from "../BaseResource.vue" >+import { APIClient } from "../../fetch/api-client.js" >+ >+export default { >+ extends: BaseResource, >+ setup(props) { >+ return { >+ ...BaseResource.setup({ >+ resource_name: "title", >+ name_attr: "publication_title", >+ id_attr: "title_id", >+ show_component: "EHoldingsLocalTitlesShow", >+ list_component: "EHoldingsLocalTitlesList", >+ add_component: "EHoldingsLocalTitlesFormAdd", >+ edit_component: "EHoldingsLocalTitlesFormAddEdit", >+ api_client: APIClient.erm.localTitles, >+ resource_table_url: >+ APIClient.erm._baseURL + "eholdings/local/titles", >+ i18n: { >+ display_name: __("Local title"), >+ }, >+ }), >+ //EHoldingsLocalTitleResource specific setup here >+ } >+ }, >+ methods: {}, >+ name: "EHoldingsLocalTitleResource", >+} >+</script> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesList.vue >index cc4125624e..5e9a4ce9fb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesList.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesList.vue >@@ -4,8 +4,8 @@ > <div v-else id="titles_list"> > <Toolbar> > <ToolbarButton >- :to="{ name: 'EHoldingsLocalTitlesFormAdd' }" >- icon="plus" >+ action="add" >+ @go-to-add-resource="goToResourceAdd" > :title="$__('New title')" > /> > <ToolbarButton >@@ -27,9 +27,9 @@ > <KohaTable > ref="table" > v-bind="tableOptions" >- @show="doShow" >- @edit="doEdit" >- @delete="doDelete" >+ @show="goToResourceShow" >+ @edit="goToResourceEdit" >+ @delete="doResourceDelete" > ></KohaTable> > </div> > <div v-else class="alert alert-info"> >@@ -46,15 +46,15 @@ import { inject, ref, reactive } from "vue" > import { storeToRefs } from "pinia" > import { APIClient } from "../../fetch/api-client.js" > import KohaTable from "../KohaTable.vue" >+import EHoldingsLocalTitleResource from "./EHoldingsLocalTitleResource.vue" > > export default { >+ extends: EHoldingsLocalTitleResource, > setup() { > const AVStore = inject("AVStore") > const { av_title_publication_types } = storeToRefs(AVStore) > const { get_lib_from_av, map_av_dt_filter } = AVStore > >- const { setConfirmationDialog, setMessage } = inject("mainStore") >- > const table = ref() > const filters = reactive({ > publication_title: "", >@@ -62,14 +62,13 @@ export default { > }) > > return { >+ ...EHoldingsLocalTitleResource.setup(), > av_title_publication_types, > get_lib_from_av, > map_av_dt_filter, > escape_str, > table, > filters, >- setConfirmationDialog, >- setMessage, > eholdings_titles_table_settings, > } > }, >@@ -85,7 +84,7 @@ export default { > initialized: false, > tableOptions: { > columns: this.getTableColumns(), >- url: "/api/v1/erm/eholdings/local/titles", >+ url: this.getResourceTableUrl(), > options: { > embed: "resources.package", > searchCols: [ >@@ -124,46 +123,6 @@ export default { > error => {} > ) > }, >- doShow: function ({ title_id }, dt, event) { >- event.preventDefault() >- this.$router.push({ >- name: "EHoldingsLocalTitlesShow", >- params: { title_id }, >- }) >- }, >- doEdit: function ({ title_id }, dt, event) { >- this.$router.push({ >- name: "EHoldingsLocalTitlesFormAddEdit", >- params: { title_id }, >- }) >- }, >- doDelete: function (title, dt, event) { >- this.setConfirmationDialog( >- { >- title: this.$__( >- "Are you sure you want to remove this title?" >- ), >- message: title.publication_title, >- accept_label: this.$__("Yes, delete"), >- cancel_label: this.$__("No, do not delete"), >- }, >- () => { >- const client = APIClient.erm >- client.localTitles.delete(title.title_id).then( >- success => { >- this.setMessage( >- this.$__("Local title %s deleted").format( >- title.publication_title >- ), >- true >- ) >- dt.draw() >- }, >- error => {} >- ) >- } >- ) >- }, > getTableColumns: function () { > let get_lib_from_av = this.get_lib_from_av > let escape_str = this.escape_str >@@ -176,9 +135,7 @@ export default { > orderable: true, > render: function (data, type, row, meta) { > return ( >- '<a href="/cgi-bin/koha/erm/eholdings/local/titles/' + >- row.title_id + >- '" class="show">' + >+ '<a role="button" class="show">' + > escape_str( > `${row.publication_title} (#${row.title_id})` > ) + >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesShow.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesShow.vue >index fbe7ac2752..4f567106e9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesShow.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesShow.vue >@@ -3,19 +3,13 @@ > <div v-else-if="title" id="eholdings_title_show"> > <Toolbar> > <ToolbarButton >- :to="{ >- name: 'EHoldingsLocalTitlesFormAddEdit', >- params: { title_id: title.title_id }, >- }" >- class="btn btn-default" >- icon="pencil" >- :title="$__('Edit')" >+ action="edit" >+ @go-to-edit-resource="goToResourceEdit" >+ /> >+ <ToolbarButton >+ action="delete" >+ @delete-resource="doResourceDelete" > /> >- <a >- @click="delete_title(title.title_id, title.publication_title)" >- class="btn btn-default" >- ><font-awesome-icon icon="trash" /> {{ $__("Delete") }}</a >- > > </Toolbar> > > <h2> >@@ -267,17 +261,17 @@ import EHoldingsTitlePackagesList from "./EHoldingsLocalTitlePackagesList.vue" > import { APIClient } from "../../fetch/api-client.js" > import Toolbar from "../Toolbar.vue" > import ToolbarButton from "../ToolbarButton.vue" >+import EHoldingsLocalTitleResource from "./EHoldingsLocalTitleResource.vue" > > export default { >+ extends: EHoldingsLocalTitleResource, > setup() { > const AVStore = inject("AVStore") > const { get_lib_from_av } = AVStore >- const { setConfirmationDialog, setMessage } = inject("mainStore") > > return { >+ ...EHoldingsLocalTitleResource.setup(), > get_lib_from_av, >- setConfirmationDialog, >- setMessage, > } > }, > data() { >@@ -333,35 +327,6 @@ export default { > error => {} > ) > }, >- delete_title: function (title_id, title_publication_title) { >- this.setConfirmationDialog( >- { >- title: this.$__( >- "Are you sure you want to remove this title?" >- ), >- message: title_publication_title, >- accept_label: this.$__("Yes, delete"), >- cancel_label: this.$__("No, do not delete"), >- }, >- () => { >- const client = APIClient.erm >- client.localTitles.delete(title_id).then( >- success => { >- this.setMessage( >- this.$__("Local title %s deleted").format( >- title_publication_title >- ), >- true >- ) >- this.$router.push({ >- name: "EHoldingsLocalTitlesList", >- }) >- }, >- error => {} >- ) >- } >- ) >- }, > }, > components: { > EHoldingsTitlePackagesList, >-- >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