Skip to content

Commit

Permalink
Merge branch 'padms/2631' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
padms committed Nov 5, 2024
2 parents 0861454 + 9347ff1 commit a686530
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 24 deletions.
4 changes: 1 addition & 3 deletions search/IndexArchivedNews/mapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ describe('fileStorage', () => {
expect(res.topicTags).toEqual(['tag1', 'tag2', 'General news'])
expect(res.countryTags).toEqual(['Norway'])
expect(res.text).toEqual('A lot of \n content')
expect(res.thumbnailUrl).toEqual(
'https://envisstoragedev.blob.core.windows.net/equinor-archive-content/link/to/url/of/image.png',
)
expect(res.thumbnailUrl).toEqual('/link/to/url/of/image.png')
})
})

Expand Down
2 changes: 1 addition & 1 deletion search/IndexArchivedNews/mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ export const mapData: MapDataType = (article) => {
],
countryTags: [country.trim()].filter(identity),
year,
thumbnailUrl: thumbnailURL ? `https://envisstoragedev.blob.core.windows.net/equinor-archive-content${thumbnailURL}` : null,
thumbnailUrl: thumbnailURL ? thumbnailURL : null,
} as NewsIndex
}
18 changes: 8 additions & 10 deletions web/templates/newsroom/NewsSections/NewsHeadliner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,14 @@ const NewsHeadliner = forwardRef<HTMLLIElement, NewsHeadlinerProps>(function New
{(heroImage?.image?.asset || fallbackImage || thumbnailUrl) && (
<div className="aspect-video relative max-h-[324px] mb-2">
{thumbnailUrl ? (
<div className="relative rounded-xs">
<Img
src={thumbnailUrl}
alt=""
style={{ objectFit: 'cover' }}
fill
sizes="(max-width: 800px) 100vw, 800px"
role={'presentation'}
/>
</div>
<img
className="relative rounded-xs"
src={thumbnailUrl}
alt=""
style={{ objectFit: 'cover' }}
sizes="(max-width: 800px) 100vw, 800px"
role={'presentation'}
/>
) : (
(heroImage?.image?.asset || fallbackImage) && (
<Image
Expand Down
18 changes: 8 additions & 10 deletions web/templates/newsroom/NewsSections/NewsItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,14 @@ const NewsItem = forwardRef<HTMLLIElement, NewsListItemProps>(function NewsItem(
{(heroImage?.image?.asset || fallbackImage || thumbnailUrl) && (
<>
{thumbnailUrl ? (
<div className="relative rounded-xs">
<Img
src={thumbnailUrl}
alt=""
style={{ objectFit: 'cover' }}
fill
sizes="(max-width: 800px) 100vw, 800px"
role={'presentation'}
/>
</div>
<img
className="relative rounded-xs"
src={thumbnailUrl}
alt=""
style={{ objectFit: 'cover' }}
sizes="(max-width: 800px) 100vw, 800px"
role={'presentation'}
/>
) : (
(heroImage?.image?.asset || fallbackImage) && (
<Image
Expand Down

0 comments on commit a686530

Please sign in to comment.