Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: APPS-2403 buttonurl is not required if the program URL behaviour is external #731

Merged
merged 2 commits into from
Aug 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 26 additions & 33 deletions pages/about/programs/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@
@search-ready="getSearchData"
/>
<section-wrapper
v-show="
page &&
page.featuredPrograms &&
page.featuredPrograms.length &&
hits.length == 0 &&
!noResultsFound
v-show="page &&
page.featuredPrograms &&
page.featuredPrograms.length &&
hits.length == 0 &&
!noResultsFound
"
theme="divider"
>
Expand All @@ -39,12 +38,11 @@
</section-wrapper>

<section-wrapper
v-show="
page &&
page.featuredPrograms &&
page.featuredPrograms.length &&
hits.length == 0 &&
!noResultsFound
v-show="page &&
page.featuredPrograms &&
page.featuredPrograms.length &&
hits.length == 0 &&
!noResultsFound
"
class="section-no-top-margin"
>
Expand All @@ -53,17 +51,14 @@
:title="parsedBannerHeader.title"
:category="parsedBannerHeader.category"
breadcrumb="Featured"
:byline="parsedByline"
:description="parsedBannerHeader.text"
:to="parsedBannerHeader.to"
:align-right="true"
prompt="View Program"
class="banner section-featured-banner"
/>

<divider-general
v-if="parsedSectionHighlight && parsedSectionHighlight.length"
/>
<divider-general v-if="parsedSectionHighlight && parsedSectionHighlight.length" />

<section-teaser-highlight
v-if="parsedSectionHighlight && parsedSectionHighlight.length"
Expand All @@ -77,11 +72,10 @@
</section-wrapper>

<section-wrapper
v-show="
parsedProgramsList &&
parsedProgramsList.length > 0 &&
hits.length == 0 &&
!noResultsFound
v-show="parsedProgramsList &&
parsedProgramsList.length > 0 &&
hits.length == 0 &&
!noResultsFound
"
section-title="All Programs & Initiatives"
>
Expand Down Expand Up @@ -121,21 +115,19 @@
We can’t find the term you are looking for on this page,
but we're here to help. <br>
Try searching the whole site from
<a href="https://library.ucla.edu">UCLA Library Home</a>, or try one of the these regularly visited links:
<a href="https://library.ucla.edu">UCLA Library Home</a>, or try one of the these regularly visited
links:
</p>
<ul>
<li>
<a
href="https://www.library.ucla.edu/research-teaching-support/research-help"
>Research Help</a>
<a href="https://www.library.ucla.edu/research-teaching-support/research-help">Research Help</a>
</li>
<li>
<a href="/help/services-resources/ask-us">Ask Us</a>
</li>
<li>
<a
href="https://www.library.ucla.edu/use/access-privileges/disability-resources"
>Accessibility Resources</a>
<a href="https://www.library.ucla.edu/use/access-privileges/disability-resources">Accessibility
Resources</a>
</li>
</ul>
</rich-text>
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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}`,
Expand Down Expand Up @@ -355,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(
Expand Down Expand Up @@ -386,6 +380,5 @@ export default {
</script>

<style lang="scss" scoped>
.page-programs {
}
.page-programs {}
</style>
Loading