From 192fb3aa50fa99ae5f66c162d30632ef7689a892 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 17 Oct 2024 15:15:53 +0000 Subject: [PATCH] Bug 37301: Fix: URL param needs to match attr_id url param needs to match attr_id usage statistics is non-standard when compared to agreements+licenses etc. using usage_data_provider_id but resource id field is erm_usage_data_provider_id. This patch is fixing that. --- .../ERM/UsageStatisticsDataProvidersCounterLogs.vue | 4 ++-- .../ERM/UsageStatisticsDataProvidersFileImport.vue | 4 ++-- .../ERM/UsageStatisticsDataProvidersFormAdd.vue | 10 +++++----- .../ERM/UsageStatisticsDataProvidersShow.vue | 2 +- .../components/ERM/UsageStatisticsProviderDataList.vue | 4 ++-- koha-tmpl/intranet-tmpl/prog/js/vue/routes/erm.js | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersCounterLogs.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersCounterLogs.vue index 741545d07e..e676ddbe95 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersCounterLogs.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersCounterLogs.vue @@ -66,7 +66,7 @@ export default { await client.counter_files .count({ usage_data_provider_id: - this.$route.params.usage_data_provider_id, + this.$route.params.erm_usage_data_provider_id, }) .then( count => { @@ -77,7 +77,7 @@ export default { ) }, table_url() { - let url = `/api/v1/erm/counter_logs?usage_data_provider_id=${this.$route.params.usage_data_provider_id}` + let url = `/api/v1/erm/counter_logs?usage_data_provider_id=${this.$route.params.erm_usage_data_provider_id}` return url }, download_counter_file(counter_log, dt, event) { diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFileImport.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFileImport.vue index 617af051ba..f0e1903728 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFileImport.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFileImport.vue @@ -74,7 +74,7 @@ export default { loadFile(filename, content) { this.file.filename = filename this.file.file_content = btoa(content) - this.getDataProvider(this.$route.params.usage_data_provider_id) + this.getDataProvider(this.$route.params.erm_usage_data_provider_id) }, addDocument(e) { e.preventDefault() @@ -129,7 +129,7 @@ export default { }, }, mounted() { - this.getDataProvider(this.$route.params.usage_data_provider_id) + this.getDataProvider(this.$route.params.erm_usage_data_provider_id) }, components: { ButtonSubmit, diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFormAdd.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFormAdd.vue index b0c35107f5..973f655331 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFormAdd.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFormAdd.vue @@ -435,12 +435,12 @@ export default { }, beforeRouteEnter(to, from, next) { next(vm => { - if (to.params.usage_data_provider_id) { - vm.getDataProvider(to.params.usage_data_provider_id) + if (to.params.erm_usage_data_provider_id) { + vm.getDataProvider(to.params.erm_usage_data_provider_id) } else { vm.initialized = true } - if (from.params.usage_data_provider_id) { + if (from.params.erm_usage_data_provider_id) { vm.previous_route = "data_provider_show" } else { vm.previous_route = "data_provider_list" @@ -592,7 +592,7 @@ export default { this.$router.push({ name: "UsageStatisticsDataProvidersShow", params: { - usage_data_provider_id: + erm_usage_data_provider_id: erm_usage_data_provider_id, }, }) @@ -608,7 +608,7 @@ export default { this.$router.push({ name: "UsageStatisticsDataProvidersShow", params: { - usage_data_provider_id: + erm_usage_data_provider_id: erm_usage_data_provider_id, }, }) 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 1643dbc91a..47884e46bb 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 @@ -171,7 +171,7 @@ export default { }, beforeRouteEnter(to, from, next) { next(vm => { - vm.getUsageDataProvider(to.params.usage_data_provider_id) + vm.getUsageDataProvider(to.params.erm_usage_data_provider_id) }) }, methods: { diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsProviderDataList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsProviderDataList.vue index f3bdf85f75..df4f0586ac 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsProviderDataList.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsProviderDataList.vue @@ -46,7 +46,7 @@ export default { await client[`usage_${this.data_type}s`] .count({ usage_data_provider_id: - this.$route.params.usage_data_provider_id, + this.$route.params.erm_usage_data_provider_id, }) .then( count => { @@ -59,7 +59,7 @@ export default { table_url() { let url = "/api/v1/erm/usage_%ss?usage_data_provider_id=%s".format( this.data_type, - this.$route.params.usage_data_provider_id + this.$route.params.erm_usage_data_provider_id ) return url }, diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/routes/erm.js b/koha-tmpl/intranet-tmpl/prog/js/vue/routes/erm.js index 46c10babbf..f94d1704fc 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/routes/erm.js +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/routes/erm.js @@ -306,7 +306,7 @@ export const routes = [ ), }, { - path: ":usage_data_provider_id", + path: ":erm_usage_data_provider_id", name: "UsageStatisticsDataProvidersShow", component: markRaw( UsageStatisticsDataProvidersShow @@ -322,7 +322,7 @@ export const routes = [ title: $__("Add data provider"), }, { - path: "edit/:usage_data_provider_id", + path: "edit/:erm_usage_data_provider_id", name: "UsageStatisticsDataProvidersFormAddEdit", component: markRaw( UsageStatisticsDataProvidersFormAdd -- 2.39.5