Skip to content

Commit

Permalink
Merge branch 'main' into card-meta_APPS-3011_fix-about-author_APPS-29…
Browse files Browse the repository at this point in the history
…76_link-category-in-event-detail
  • Loading branch information
jendiamond authored Oct 18, 2024
2 parents c9e593f + becb78d commit 00f75f4
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [3.29.5](https://github.com/UCLALibrary/ucla-library-website-components/compare/v3.29.4...v3.29.5) (2024-10-18)


### Bug Fixes

* Apps-2922 remove time stamp on homepage ([#637](https://github.com/UCLALibrary/ucla-library-website-components/issues/637)) ([f1c6e49](https://github.com/UCLALibrary/ucla-library-website-components/commit/f1c6e49df1b72162ff07cfb05c63ebee9133f707))

## [3.29.4](https://github.com/UCLALibrary/ucla-library-website-components/compare/v3.29.3...v3.29.4) (2024-10-18)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ucla-library-website-components",
"type": "module",
"private": false,
"version": "3.29.4",
"version": "3.29.5",
"main": "./dist/ucla-library-website-components.umd.cjs",
"module": "./dist/ucla-library-website-components.js",
"style": "./dist/style.css",
Expand Down
4 changes: 2 additions & 2 deletions src/lib-components/CardMeta.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ const parsedTime = computed(() => {
if (props.startDate && props.sectionHandle === 'event')
return formatTimes(props.startDate, props.endDate)
// legacy behavior returns nothing when sectionHandle is not 'event',
// so check theme is set AND we are not showing ftvaEventSeries data to avoid returning nothing
else if (props.startDate && (props.sectionHandle !== 'ftvaEventSeries' && theme?.value !== undefined))
// so check theme is set to ftva AND we are not showing ftvaEventSeries data to avoid returning nothing
else if (props.startDate && (props.sectionHandle !== 'ftvaEventSeries' && theme?.value === 'ftva'))
return props.endDate ? formatTimes(props.startDate, props.endDate) : formatTimes(props.startDate, props.startDate)
// in all other cases incl. if it is ftvaEventSeries, return nothing
else if (props.startDate && (props.sectionHandle === 'ftvaEventSeries'))
Expand Down
6 changes: 5 additions & 1 deletion src/lib-components/SectionTeaserCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ const theme = useTheme()
const classes = computed(() => {
return ['section-teaser-card', theme?.value || '']
})
const currentTheme = computed(() => {
return theme?.value || ''
})
</script>
<template>
Expand All @@ -50,7 +54,7 @@ const classes = computed(() => {
:byline-two="item.bylineTwo"
:section-handle="item.sectionHandle"
:ongoing="item.ongoing"
:date-created="item.postDate"
:date-created="currentTheme === 'ftva' ? item.postDate : ''"
class="card"
/>
</ul>
Expand Down
54 changes: 54 additions & 0 deletions src/stories/SectionWrapper.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,60 @@ export function Default() {
}
}

// Mocks UCLA Library Home page News section data
const mockDefaultHome = [{
sectionHandle: 'news',
title: 'La Bpo',
text: '<p>La Niña is an oceanic and atmospheric phenomenon that is the colder counterpart of El Niño, as part of the broader El Niño–Southern Oscillation climate pattern.</p>',
to: 'https://www.library.ucla.edu',
ongoing: false,
externalResourceUrl: null,
category: 'Featured, Collections',
startDate: '2023-02-07T15:54:00-08:00',
endDate: '2023-02-07T15:54:00-08:00',
postDate: '2023-02-07T15:54:00-08:00',
}, {
sectionHandle: 'news',
title: 'La Bpo',
text: '<p>La Niña is an oceanic and atmospheric phenomenon that is the colder counterpart of El Niño, as part of the broader El Niño–Southern Oscillation climate pattern.</p>',
to: 'https://www.library.ucla.edu',
ongoing: false,
externalResourceUrl: null,
category: 'Featured, Collections',
startDate: '2023-02-07T15:54:00-08:00',
endDate: '2023-02-07T15:54:00-08:00',
postDate: '2023-02-07T15:54:00-08:00',
}, {
sectionHandle: 'news',
title: 'La Bpo',
text: '<p>La Niña is an oceanic and atmospheric phenomenon that is the colder counterpart of El Niño, as part of the broader El Niño–Southern Oscillation climate pattern.</p>',
to: 'https://www.library.ucla.edu',
ongoing: false,
startDate: '2023-02-07T15:54:00-08:00',
endDate: '2023-02-07T15:54:00-08:00',
postDate: '2022-06-21T12:39:00-07:00'
}]
export function DefaultHome() {
return {
data() {
return {
mockDefaultHome
}
},
provide() {
return {
theme: computed(() => ''), // default theme
}
},
components: { SectionWrapper, SectionTeaserCard },
template: `
<section-wrapper>
<section-teaser-card :items="mockDefaultHome" />
</section-wrapper>
`,
}
}

export function NoMeta() {
return {
data() {
Expand Down

0 comments on commit 00f75f4

Please sign in to comment.