From cdb9c7d6992f23a28700483c5c8a1e0f68de1b60 Mon Sep 17 00:00:00 2001 From: Padmaja Date: Tue, 5 Nov 2024 16:54:23 +0530 Subject: [PATCH 1/2] Fix thumbail url for archived items in news (#2639) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🐛 Fix archive url #2631 * Simplify * ✅ pass test * Pass test * 🐛 Fix thumbnail #2631 --- search/IndexArchivedNews/mapper.test.ts | 4 +--- search/IndexArchivedNews/mapper.ts | 2 +- .../newsroom/NewsSections/NewsHeadliner.tsx | 19 ++++++++----------- .../newsroom/NewsSections/NewsItem.tsx | 19 ++++++++----------- 4 files changed, 18 insertions(+), 26 deletions(-) diff --git a/search/IndexArchivedNews/mapper.test.ts b/search/IndexArchivedNews/mapper.test.ts index 1d6076e07..ca23d9be5 100644 --- a/search/IndexArchivedNews/mapper.test.ts +++ b/search/IndexArchivedNews/mapper.test.ts @@ -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') }) }) diff --git a/search/IndexArchivedNews/mapper.ts b/search/IndexArchivedNews/mapper.ts index b852ab3a3..e5773aa06 100644 --- a/search/IndexArchivedNews/mapper.ts +++ b/search/IndexArchivedNews/mapper.ts @@ -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 } diff --git a/web/templates/newsroom/NewsSections/NewsHeadliner.tsx b/web/templates/newsroom/NewsSections/NewsHeadliner.tsx index fe0f18eba..2eaf4805d 100644 --- a/web/templates/newsroom/NewsSections/NewsHeadliner.tsx +++ b/web/templates/newsroom/NewsSections/NewsHeadliner.tsx @@ -1,6 +1,5 @@ import { FormattedDate } from '@components/FormattedDateTime' import { forwardRef, HTMLAttributes } from 'react' -import Img from 'next/image' import { BaseLink } from '@core/Link' import { Typography } from '@core/Typography' import Image, { Ratios } from '../../../pageComponents/shared/SanityImage' @@ -26,16 +25,14 @@ const NewsHeadliner = forwardRef(function New {(heroImage?.image?.asset || fallbackImage || thumbnailUrl) && (
{thumbnailUrl ? ( -
- -
+ ) : ( (heroImage?.image?.asset || fallbackImage) && ( (function NewsItem( {(heroImage?.image?.asset || fallbackImage || thumbnailUrl) && ( <> {thumbnailUrl ? ( -
- -
+ ) : ( (heroImage?.image?.asset || fallbackImage) && ( Date: Tue, 5 Nov 2024 17:35:19 +0530 Subject: [PATCH 2/2] :bug: Fix thumbnail image size #2640 (#2641) --- web/templates/newsroom/NewsSections/NewsHeadliner.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/templates/newsroom/NewsSections/NewsHeadliner.tsx b/web/templates/newsroom/NewsSections/NewsHeadliner.tsx index 2eaf4805d..6a1ae6c83 100644 --- a/web/templates/newsroom/NewsSections/NewsHeadliner.tsx +++ b/web/templates/newsroom/NewsSections/NewsHeadliner.tsx @@ -26,7 +26,7 @@ const NewsHeadliner = forwardRef(function New
{thumbnailUrl ? (