From 013b9f77669be1099f4dd6ffdc6f4b7417d1fb6d Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Wed, 21 May 2025 09:22:19 +0100 Subject: [PATCH] Bug 39951: Fix column filter offsets Test plan: 1) Enable ERM module 2) Create an agreement and a license with a vendor 3) The table filters will be out of sync - Agreements - only the vendor filter is incorrect, it sits above the name column instead of the vendor column - Licenses - all dropdown filter options will be left shifted by one 4) Apply patch 5) yarn js:build 6) Hard refresh the browser 7) All the filters should now be above the correct columns --- .../prog/js/vue/components/ERM/AgreementsList.vue | 6 +++--- .../prog/js/vue/components/ERM/LicensesList.vue | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) 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 f57a1abf78c..0f31e17dd2a 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 @@ -121,7 +121,7 @@ export default { table_settings: this.agreement_table_settings, add_filters: true, filters_options: { - 1: () => + 2: () => this.vendors.map(e => { e["_id"] = e["id"]; e["_str"] = e["name"]; @@ -275,11 +275,11 @@ export default { url += "?max_expiration_date=" + this.filters.max_expiration_date; - const vendorId = this.$route.query.vendor_id + const vendorId = this.$route.query.vendor_id; if (vendorId) { url = this.filters.by_expired ? url + "&vendor_id=" + vendorId - : url + "?vendor_id=" + vendorId + : url + "?vendor_id=" + vendorId; } return url; }, diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicensesList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicensesList.vue index e74d4f98852..49b469cd0fa 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicensesList.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicensesList.vue @@ -75,14 +75,14 @@ export default { table_settings: this.license_table_settings, add_filters: true, filters_options: { - 1: () => + 2: () => this.vendors.map(e => { e["_id"] = e["id"]; e["_str"] = e["name"]; return e; }), - 3: () => this.map_av_dt_filter("av_license_types"), - 4: () => this.map_av_dt_filter("av_license_statuses"), + 4: () => this.map_av_dt_filter("av_license_types"), + 5: () => this.map_av_dt_filter("av_license_statuses"), }, actions: { 0: ["show"], @@ -117,11 +117,11 @@ export default { tableURL() { let url = "/api/v1/erm/licenses"; - const vendorId = this.$route.query.vendor_id + const vendorId = this.$route.query.vendor_id; if (vendorId) { - url += "?vendor_id=" + vendorId + url += "?vendor_id=" + vendorId; } - return url + return url; }, async getSearchableAdditionalFields() { const client = APIClient.additional_fields; -- 2.48.1