From dd3bd481f98371ecbaf15d6667057b12f62f7d69 Mon Sep 17 00:00:00 2001 From: Padmaja <52911293+padms@users.noreply.github.com> Date: Mon, 4 Nov 2024 18:47:49 +0530 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=90=9B=20Fix=20archive=20url=20#2631?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- search/IndexArchivedNews/mapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 } From 4e3edf8429eb2aa19efbd43fdf4131a009a073c0 Mon Sep 17 00:00:00 2001 From: Padmaja <52911293+padms@users.noreply.github.com> Date: Mon, 4 Nov 2024 18:48:56 +0530 Subject: [PATCH 2/5] Simplify --- search/IndexArchivedNews/mapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/search/IndexArchivedNews/mapper.ts b/search/IndexArchivedNews/mapper.ts index e5773aa06..5e02ed7aa 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 ? thumbnailURL : null, + thumbnailUrl: thumbnailURL, } as NewsIndex } From 6ec53fc35910eb8fb48d9ca24d2d94d2ca3a916c Mon Sep 17 00:00:00 2001 From: Padmaja <52911293+padms@users.noreply.github.com> Date: Mon, 4 Nov 2024 18:53:19 +0530 Subject: [PATCH 3/5] =?UTF-8?q?=E2=9C=85=20pass=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- search/IndexArchivedNews/mapper.test.ts | 4 +--- 1 file changed, 1 insertion(+), 3 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') }) }) From f5fdf604c4c7513fb29edd2b335de5c1260f9373 Mon Sep 17 00:00:00 2001 From: Padmaja <52911293+padms@users.noreply.github.com> Date: Mon, 4 Nov 2024 18:54:00 +0530 Subject: [PATCH 4/5] Pass test --- search/IndexArchivedNews/mapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/search/IndexArchivedNews/mapper.ts b/search/IndexArchivedNews/mapper.ts index 5e02ed7aa..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, + thumbnailUrl: thumbnailURL ? thumbnailURL : null, } as NewsIndex } From 9347ff13f7d2abe15304000fb60b8581957b6294 Mon Sep 17 00:00:00 2001 From: Padmaja <52911293+padms@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:35:02 +0530 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=90=9B=20Fix=20thumbnail=20#2631?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newsroom/NewsSections/NewsHeadliner.tsx | 33 +++++++++++------ .../newsroom/NewsSections/NewsItem.tsx | 35 +++++++++++++------ 2 files changed, 48 insertions(+), 20 deletions(-) diff --git a/web/templates/newsroom/NewsSections/NewsHeadliner.tsx b/web/templates/newsroom/NewsSections/NewsHeadliner.tsx index b740b26dc..241532053 100644 --- a/web/templates/newsroom/NewsSections/NewsHeadliner.tsx +++ b/web/templates/newsroom/NewsSections/NewsHeadliner.tsx @@ -24,16 +24,29 @@ const NewsHeadliner = forwardRef(function New {(heroImage?.image?.asset || fallbackImage) && (
- + {thumbnailUrl ? ( + + ) : ( + (heroImage?.image?.asset || fallbackImage) && ( + + ) + )}
)} {publishDateTime && ( diff --git a/web/templates/newsroom/NewsSections/NewsItem.tsx b/web/templates/newsroom/NewsSections/NewsItem.tsx index 104d9b0d5..594faefae 100644 --- a/web/templates/newsroom/NewsSections/NewsItem.tsx +++ b/web/templates/newsroom/NewsSections/NewsItem.tsx @@ -33,16 +33,31 @@ const NewsItem = forwardRef(function NewsItem( )}
- {(heroImage?.image?.asset || fallbackImage) && ( - + {(heroImage?.image?.asset || fallbackImage || thumbnailUrl) && ( + <> + {thumbnailUrl ? ( + + ) : ( + (heroImage?.image?.asset || fallbackImage) && ( + + ) + )} + )}