Skip to content

Commit

Permalink
updated keys to be more unique, also updaed DS VByline key to be more…
Browse files Browse the repository at this point in the history
… unique (#174)
  • Loading branch information
bonomite authored Oct 17, 2022
1 parent 417bb34 commit cb709da
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 28 deletions.
6 changes: 1 addition & 5 deletions components/Byline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,7 @@ const sponsor = ref(props.article?.sponsors ? props.article?.sponsors[0] : null)
:class="isMultipleAuthors ? 'multiple-authors' : 'one-author'"
>
<div class="author-images flex">
<div
v-for="author of authors"
:key="author.photoID"
class="author-image"
>
<div v-for="author of authors" :key="author.id" class="author-image">
<v-flexible-link :to="author.url" raw>
<v-simple-responsive-image
v-if="author.photoID"
Expand Down
4 changes: 2 additions & 2 deletions components/GothamistFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import VShareTools from '@nypublicradio/nypr-design-system-vue3/v2/src/components/VShareTools.vue'
import VShareToolsItem from '@nypublicradio/nypr-design-system-vue3/v2/src/components/VShareToolsItem.vue'
import VFlexibleLink from '@nypublicradio/nypr-design-system-vue3/v2/src/components/VFlexibleLink.vue'
import Navigation from '~~/composables/types/Navigation.js';
import Navigation from '~~/composables/types/Navigation.js'
const props = defineProps<{
navigation: Navigation
Expand Down Expand Up @@ -56,7 +56,7 @@ const copyrightYear = ref(props.navigation.copyrightYear)
<v-flexible-link
v-for="(item, index) in legalLinks"
:to="item.value.url"
:key="`legalLinks-${index}`"
:key="`legalLinks-${item.value.title}-${index}`"
>
{{ item.value.title }}
</v-flexible-link>
Expand Down
2 changes: 1 addition & 1 deletion components/MenuList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const emit = defineEmits(['menu-list-click'])
<v-flexible-link
v-for="(item, index) in navLinks"
:to="item.value.url"
:key="`primaryFooterLinks-${index}`"
:key="`primaryFooterLinks-${item.value.title}-${index}`"
@click="emit('menu-list-click', item.value.title)"
>
{{ item.value.title }}
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"typescript": "^4.5.4"
},
"dependencies": {
"@nypublicradio/nypr-design-system-vue3": "^0.4.26",
"@nypublicradio/nypr-design-system-vue3": "^0.4.27",
"@sentry/tracing": "^6.18.2",
"@sentry/vue": "^6.18.2",
"@vitejs/plugin-vue": "^2.3.2",
Expand Down
4 changes: 2 additions & 2 deletions pages/[sectionSlug]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ const newsletterSubmitEvent = () => {
<div class="col">
<div
v-for="(article, index) in articles.slice(0, articlesToShow)"
:key="index"
>
:key="`${article.id}-${index}`"
>
<v-card
class="mod-horizontal mb-5"
:image="useImageUrl(article.listingImage)"
Expand Down
2 changes: 1 addition & 1 deletion pages/[sectionSlug]/photos/[gallerySlug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ onUnmounted(() => {
v-for="(slide, index) in gallery.slides"
class="col-12"
:class="{ 'xl:col-6': index % 3 !== 0 }"
:key="index"
:key="`${slide.image.id}-${index}`"
>
<template v-if="index === 3 || (index > 0 && index % 6 === 0)">
<HtlAd
Expand Down
15 changes: 7 additions & 8 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@ const homePageCollectionsPromise = findPage('/').then(({ data }) => {
})
})
const [articles, homePageCollections] = await Promise.all(
[articlesPromise, homePageCollectionsPromise]
)
const [articles, homePageCollections] = await Promise.all([
articlesPromise,
homePageCollectionsPromise,
])
// the latest 4 articles
const latestArticles = articles.slice(0,4)
const latestArticles = articles.slice(0, 4)
// the home page featured article should display only the first story in the home page content collection
const featuredArticle = normalizeArticlePage(
homePageCollections?.[0].data?.[0]
)
const featuredArticle = normalizeArticlePage(homePageCollections?.[0].data?.[0])
const riverStoryCount = ref(6)
const riverAdOffset = ref(2)
Expand Down Expand Up @@ -77,7 +76,7 @@ const nativoSectionLoaded = (name) => {
<template v-if="homePageCollections && homePageCollections.length > 0">
<template
v-for="(collection, index) in homePageCollections"
:key="collection.id"
:key="`${collection.id}-${collection.data[0].id}`"
>
<single-story-feature
v-if="collection.layout === 'single-story-feature'"
Expand Down
2 changes: 1 addition & 1 deletion pages/tags/[tagSlug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const newsletterSubmitEvent = () => {
<div class="col">
<div
v-for="(article, index) in articles.slice(0, articlesToShow)"
:key="index"
:key="`${article.id}-${index}`"
>
<v-card
class="mod-horizontal mb-5"
Expand Down

0 comments on commit cb709da

Please sign in to comment.