Skip to content

Commit

Permalink
chore: card-labels for stories feature (#2341)
Browse files Browse the repository at this point in the history
* no card-labels for stories feature

* remove stories section labels; keep on browse pages

* revert hiding card sub-titles for stories/exhibitions
  • Loading branch information
lbiedinger authored Jun 5, 2024
1 parent 9a4458d commit c7e4dfb
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions packages/portal/src/components/content/ContentCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
data() {
return {
cardImageUrl: this.imageUrl,
displayLabelTypes: 'exhibitions|galleries|blog|collections',
displayLabelTypes: 'exhibitions|galleries|blog|collections|stories',
// hit prefix & suffix can be overly long for our display purposes;
// limit to max num of words each
hitTextPrefix: this.hitText?.prefix?.split(/\s/).slice(-HIT_TEXT_AFFIX_MAX_WORDS).join(' '),
Expand Down Expand Up @@ -350,7 +350,7 @@
}
if (this.displayLabelType === 'blog') {
return this.$tc('blog.posts', 1);
return this.$features?.redirectBlogsToStories ? this.$tc('stories.stories', 1) : this.$tc('blog.posts', 1);
}
return this.$tc(`${this.displayLabelType}.${this.displayLabelType}`, 1);
Expand All @@ -361,7 +361,7 @@
},
displayLabelType() {
return this.displayLabelMatch ? this.displayLabelMatch[1] : false;
return this.displayLabelMatch?.[1];
},
displayLabelMatch() {
Expand Down
1 change: 0 additions & 1 deletion packages/portal/src/components/content/ContentHubPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
:image-optimisation-options="{ width: 510 }"
:image-alt="imageAlt(item.primaryImageOfPage)"
:texts="[item.description]"
:show-subtitle="false"
:offset="index"
/>
</b-card-group>
Expand Down
4 changes: 2 additions & 2 deletions packages/portal/src/components/story/StoryPost.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:title="title"
:subtitle="subtitle"
:hero="hero"
:context-label="$t('cardLabels.story')"
:context-label="$tc('stories.stories', 1)"
data-qa="story hero"
/>
<AuthoredHead
Expand All @@ -14,7 +14,7 @@
:subtitle="subtitle"
:description="description"
:hero="hero"
:context-label="$t('cardLabels.story')"
:context-label="$tc('stories.stories', 1)"
data-qa="authored head"
/>
<div
Expand Down
5 changes: 3 additions & 2 deletions packages/portal/src/i18n/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ export default {
"organisation": "Organisation",
"person": "Person",
"place": "Place",
"story": "Story",
"theme": "Theme",
"time": "Century",
"topic": "Topic"
Expand Down Expand Up @@ -1230,8 +1229,10 @@ export default {
"pinned": "Pinned",
"required": "Required"
},
"stories": {
"stories": "Story | Stories"
},
"storiesPage": {
"title": "Stories",
"storiesHaveLoaded": "{0} stories found"
},
"swiper": {
Expand Down
2 changes: 1 addition & 1 deletion packages/portal/src/pages/stories/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
computed: {
pageMeta() {
return {
title: this.$t('storiesPage.title'),
title: this.$tc('stories.stories', 2),
description: this.description,
ogType: 'article',
ogImage: this.socialMediaImage?.url,
Expand Down
2 changes: 1 addition & 1 deletion packages/portal/tests/unit/pages/stories/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe('pages/stories/index', () => {

const pageMeta = wrapper.vm.pageMeta;

expect(pageMeta.title).toBe('storiesPage.title');
expect(pageMeta.title).toBe('stories.stories');
});
});

Expand Down

0 comments on commit c7e4dfb

Please sign in to comment.