From 6f642cbb02c51801b062783619331570deaed446 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 3 Oct 2023 10:22:46 +0200 Subject: [PATCH] Bug 32474: Pass label and identifier This is a try to fix the last remaining Cypress failure. The problem is that the label of the existing license does not display, only its id. To recreate: Create a license Create an agreement and select the license Edit the agreement => The display shows "License: {id}", not its name This patch is removing the code from created() because I thought it was the problem originally, and it didn't seem correct to let InfiniteScrollSelect deal with the "id" and "label" for the different dataType. But the problem is somewhere else: we have not fetched any licenses yet from the AgreementLicenses. However we do have the selected license that we could pass to InfiniteScrollSelect, but that's yet another param to pass. It feels like there is something better to do here. --- .../vue/components/ERM/AgreementLicenses.vue | 2 ++ .../vue/components/InfiniteScrollSelect.vue | 32 +++---------------- 2 files changed, 7 insertions(+), 27 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementLicenses.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementLicenses.vue index cab8cb1927a..27664975ff2 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementLicenses.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementLicenses.vue @@ -22,6 +22,8 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/InfiniteScrollSelect.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/InfiniteScrollSelect.vue index f92726b3a02..f7d408b481b 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/InfiniteScrollSelect.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/InfiniteScrollSelect.vue @@ -2,7 +2,7 @@ - item[this.queryProperty].includes(this.search) + item[this.label].includes(this.search) ) }, paginated() { @@ -124,7 +102,7 @@ export default { this.data = [] this.search = e const client = APIClient.erm - const attribute = "me." + this.queryProperty + const attribute = "me." + this.label const q = {} q[attribute] = { like: `%${e}%` } await client[this.dataType] -- 2.34.1