From 4f722d9c4f0a4fa8ae4ec0d5827b2f65e2fcbdd4 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 17 Oct 2024 15:16:50 +0000 Subject: [PATCH] Bug 37301: Apply changes to usage statistics data providers This is also removing UsageStatissticsDataProvidersToolbar as that is not required, and updating the UsageStatisticsDataProvidersSummary button to a ToolbarButton instead of a router-link --- .../UsageStatisticsDataProviderResource.vue | 30 +++++ .../ERM/UsageStatisticsDataProvidersList.vue | 106 ++++-------------- .../ERM/UsageStatisticsDataProvidersShow.vue | 63 ++--------- .../UsageStatisticsDataProvidersSummary.vue | 3 +- .../UsageStatisticsDataProvidersToolbar.vue | 16 --- 5 files changed, 64 insertions(+), 154 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProviderResource.vue delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersToolbar.vue diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProviderResource.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProviderResource.vue new file mode 100644 index 0000000000..bf87841b63 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProviderResource.vue @@ -0,0 +1,30 @@ + diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersList.vue index b0421f8cf7..7d383400d5 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersList.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersList.vue @@ -2,28 +2,27 @@
{{ $__("Loading") }}
@@ -35,27 +34,25 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersShow.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersShow.vue index 47884e46bb..73d7215843 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersShow.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersShow.vue @@ -3,27 +3,13 @@
+ - {{ $__("Delete") }}

@@ -126,8 +112,10 @@ import UsageStatisticsDataProvidersFileImport from "./UsageStatisticsDataProvide import UsageStatisticsDataProvidersCounterLogs from "./UsageStatisticsDataProvidersCounterLogs.vue" import UsageStatisticsDataProviderDetails from "./UsageStatisticsDataProviderDetails.vue" import UsageStatisticsProviderDataList from "./UsageStatisticsProviderDataList.vue" +import UsageStatisticsDataProviderResource from "./UsageStatisticsDataProviderResource.vue" export default { + extends: UsageStatisticsDataProviderResource, setup() { const AVStore = inject("AVStore") const { get_lib_from_av } = AVStore @@ -135,6 +123,7 @@ export default { const { setConfirmationDialog, setMessage } = inject("mainStore") return { + ...UsageStatisticsDataProviderResource.setup(), get_lib_from_av, setConfirmationDialog, setMessage, @@ -188,40 +177,6 @@ export default { change_tab_content(e) { this.tab_content = e.target.getAttribute("data-content") }, - delete_usage_data_provider: function ( - usage_data_provider_id, - usage_data_provider_name - ) { - this.setConfirmationDialog( - { - title: this.$__( - "Are you sure you want to remove this data provider?" - ), - message: usage_data_provider_name, - accept_label: this.$__("Yes, delete"), - cancel_label: this.$__("No, do not delete"), - }, - () => { - const client = APIClient.erm - client.usage_data_providers - .delete(usage_data_provider_id) - .then( - success => { - this.setMessage( - this.$__( - "Usage data provider %s deleted" - ).format(usage_data_provider_name), - true - ) - this.$router.push({ - name: "UsageStatisticsDataProvidersList", - }) - }, - error => {} - ) - } - ) - }, }, name: "UsageStatisticsDataProvidersShow", components: { diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersSummary.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersSummary.vue index 6db374a523..c79c148824 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersSummary.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersSummary.vue @@ -24,7 +24,6 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersToolbar.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersToolbar.vue deleted file mode 100644 index 2ff264578e..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersToolbar.vue +++ /dev/null @@ -1,16 +0,0 @@ - - - -- 2.39.5