From d83a9dd28c9ed095ea0fdb550310a466e5161b3d Mon Sep 17 00:00:00 2001 From: pghorpade Date: Thu, 24 Aug 2023 11:56:18 -0700 Subject: [PATCH 1/2] fix: buttonurl is not required if the program URL behaviour is external --- pages/about/programs/index.vue | 57 +++++++++++++++------------------- 1 file changed, 25 insertions(+), 32 deletions(-) diff --git a/pages/about/programs/index.vue b/pages/about/programs/index.vue index e37300974..e59ddecfa 100644 --- a/pages/about/programs/index.vue +++ b/pages/about/programs/index.vue @@ -23,12 +23,11 @@ @search-ready="getSearchData" /> @@ -39,12 +38,11 @@ @@ -53,7 +51,6 @@ :title="parsedBannerHeader.title" :category="parsedBannerHeader.category" breadcrumb="Featured" - :byline="parsedByline" :description="parsedBannerHeader.text" :to="parsedBannerHeader.to" :align-right="true" @@ -61,9 +58,7 @@ class="banner section-featured-banner" /> - + 0 && + hits.length == 0 && + !noResultsFound " section-title="All Programs & Initiatives" > @@ -121,21 +115,19 @@ We can’t find the term you are looking for on this page, but we're here to help.
Try searching the whole site from - UCLA Library Home, or try one of the these regularly visited links: + UCLA Library Home, or try one of the these regularly visited + links:

@@ -220,7 +212,7 @@ export default { "sectionHandle:program", (this.$route.query.filters && JSON.parse(this.$route.query.filters)) || - {}, + {}, config.programsList.sortField, config.programsList.orderBy, config.programsList.resultFields, @@ -299,11 +291,13 @@ export default { }, parsedProgramsList() { return this.programs.map((obj) => { + if( obj.programUrlBehavior === "externalSite") + console.log(obj.programUrlBehavior,obj) return { ...obj, to: obj.programUrlBehavior === "externalSite" - ? obj.buttonUrl[0].buttonUrl + ? obj.buttonUrl && obj.buttonUrl.length > 0 && obj.buttonUrl[0].buttonUrl ? obj.buttonUrl[0].buttonUrl : null : `/${obj.uri}`, image: _get(obj, "heroImage[0].image[0]", null), staffName: `${obj.fullName}`, @@ -386,6 +380,5 @@ export default { From f0bfc540829a4209f3dd66f24d052f47a0a1c027 Mon Sep 17 00:00:00 2001 From: pghorpade Date: Thu, 24 Aug 2023 12:59:39 -0700 Subject: [PATCH 2/2] fix: add buttonUrl check for search results too --- pages/about/programs/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/about/programs/index.vue b/pages/about/programs/index.vue index e59ddecfa..b6feff36f 100644 --- a/pages/about/programs/index.vue +++ b/pages/about/programs/index.vue @@ -349,7 +349,7 @@ export default { description: obj["_source"].text, to: obj["_source"].programUrlBehavior === "externalSite" - ? obj["_source"].buttonUrl[0].buttonUrl + ? obj["_source"].buttonUrl && obj["_source"].buttonUrl.length > 0 && obj["_source"].buttonUrl[0].buttonUrl ? obj["_source"].buttonUrl[0].buttonUrl : null : `/${obj["_source"].uri}`, image: _get(obj["_source"], "heroImage[0].image[0]", null), category: _get(