From 37b2ace9c519984bcd057f5806e631d9f6037f64 Mon Sep 17 00:00:00 2001 From: Xavier FACQ Date: Wed, 9 Aug 2023 10:29:47 +0200 Subject: [PATCH] Fix/adoptium 769 temurin archive shows one checksum for multiple artefacts (#2068) * [adoptium-769] Temurin archive shows one checksum for multiple artefacts * Set unique "key" prop to each child * Improve css * Adapt tests --- .../TemurinArchiveTable.test.tsx.snap | 61 ++++++++++++++++--- src/components/TemurinArchiveTable/index.tsx | 23 ++++--- 2 files changed, 68 insertions(+), 16 deletions(-) diff --git a/src/components/TemurinArchiveTable/__tests__/__snapshots__/TemurinArchiveTable.test.tsx.snap b/src/components/TemurinArchiveTable/__tests__/__snapshots__/TemurinArchiveTable.test.tsx.snap index b6f0b0b4f..b6c7ea7d4 100644 --- a/src/components/TemurinArchiveTable/__tests__/__snapshots__/TemurinArchiveTable.test.tsx.snap +++ b/src/components/TemurinArchiveTable/__tests__/__snapshots__/TemurinArchiveTable.test.tsx.snap @@ -150,14 +150,25 @@ exports[`TemurinArchiveTable component > renders correctly 1`] = ` > - + OS / Architecture + + Installer + SHA256 + + Binary @@ -171,7 +182,9 @@ exports[`TemurinArchiveTable component > renders correctly 1`] = ` Os_mock architecture_mock - + renders correctly 1`] = ` Not Available - + + renders correctly 1`] = ` > - + OS / Architecture + + Installer + SHA256 + + Binary @@ -344,7 +373,9 @@ exports[`TemurinArchiveTable component > renders correctly 1`] = ` Os_mock architecture_mock - + renders correctly 1`] = ` - + + Text + + + + { results.releases.map( (release, i): string | JSX.Element => release && ( - +
@@ -53,9 +53,10 @@ const TemurinArchiveTable = ({results, updatePage}) => { - - - + + + + {Object.keys(release.platforms).map(function(key) { @@ -63,13 +64,13 @@ const TemurinArchiveTable = ({results, updatePage}) => { release.platforms[key].assets.map( (asset, i): string | JSX.Element => asset && ( - + - - +
InstallerBinaryOS / ArchitectureInstallerSHA256Binary SHA256
{i === 0 && `${capitalize(asset.os)} ${asset.architecture === 'x32' ? 'x86' : asset.architecture}` } + {asset.installer_link ? ( { } + + {asset.installer_link ? ( + Checksum + ): <> + } + + {type} {!installer ? (size + " MB") : ""} )