From 38e0aa865d1559aebac7c12b9ad2e589d7e10297 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 7 Mar 2023 15:42:48 +0100 Subject: [PATCH] Bug 33066: Embed vendor and retrieve vendor name from the request MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Bug 33066: (follow-up) Embed vendor and retrieve vendor name from the request It needs "Bug 32923: Allow to embed user_roles for agreements" Signed-off-by: Pedro Amorim Signed-off-by: Agustín Moyano Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 922ed2d2830dbfe3f8f2b069eb03b314c5d16a5e) Signed-off-by: Martin Renvoize --- api/v1/swagger/paths/erm_agreements.yaml | 1 + .../prog/js/vue/components/ERM/AgreementsList.vue | 9 ++------- .../intranet-tmpl/prog/js/vue/components/KohaTable.vue | 1 + 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/api/v1/swagger/paths/erm_agreements.yaml b/api/v1/swagger/paths/erm_agreements.yaml index 614569c7b2..289bc36a13 100644 --- a/api/v1/swagger/paths/erm_agreements.yaml +++ b/api/v1/swagger/paths/erm_agreements.yaml @@ -68,6 +68,7 @@ type: string enum: - user_roles + - vendor collectionFormat: csv - $ref: "../swagger.yaml#/parameters/match" - $ref: "../swagger.yaml#/parameters/order_by" 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 e7fc10d20e..137bb26c7e 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 @@ -95,6 +95,7 @@ export default { building_table: false, tableOptions: { columns: this.getTableColumns(), + options: { embed: "vendor" }, url: () => this.table_url(), table_settings: this.agreement_table_settings, add_filters: true, @@ -211,10 +212,6 @@ export default { getTableColumns: function () { let get_lib_from_av = this.get_lib_from_av let escape_str = this.escape_str - let vendors_map = this.vendors.reduce((map, e) => { - map[e.id] = e - return map - }, {}) return [ { @@ -238,9 +235,7 @@ export default { searchable: true, orderable: true, render: function (data, type, row, meta) { - return row.vendor_id != undefined - ? row.vendor_id //escape_str(vendors_map[row.vendor_id].name) - : "" + return row.vendor_id != undefined ? row.vendor.name : "" }, }, { diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue index 2e0173e1a2..7c53c9bdf5 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue @@ -46,6 +46,7 @@ export default { }, buttons, default_search: this.$route.query.q, + ...this.options, }, hidden_ids, included_ids, -- 2.39.5