Skip to content

Commit

Permalink
Fix/issues 2668 correct pb with release notes given version (#2708)
Browse files Browse the repository at this point in the history
* [issues-2668] Fix pb with release notes given version

* fix tests

* Use the appropriate mock name
  • Loading branch information
xavierfacq authored Mar 11, 2024
1 parent 261615f commit 477a489
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/__fixtures__/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ export const createRandomTemurinReleases = (installer): TemurinReleases => ({
release_link: new URL('https://release_link_mock'),
source_url: new URL('https://source_url_mock'),
release_notes: true,
release_notes_name: 'release_notes_name_mock',
timestamp: new Date(Date.UTC(2020, 0, 1)),
platforms: {
'platform_mock': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ exports[`TemurinArchiveTable component > renders correctly 1`] = `
<p>
<a
class="link-light"
href="/temurin/release-notes?version=release_name_mock"
href="/temurin/release-notes?version=release_notes_name_mock"
>
<svg
fill="currentColor"
Expand Down Expand Up @@ -310,7 +310,7 @@ exports[`TemurinArchiveTable component > renders correctly 1`] = `
<p>
<a
class="link-light"
href="/temurin/release-notes?version=release_name_mock"
href="/temurin/release-notes?version=release_notes_name_mock"
>
<svg
fill="currentColor"
Expand Down
4 changes: 2 additions & 2 deletions src/components/TemurinArchiveTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const TemurinArchiveTable = ({results, updatePage}) => {
{release.source_url &&
<p><a href={release.source_url} className="link-light"><FaDownload /> <Trans>Source Code Archive</Trans></a></p>
}
{release.release_notes &&
<p><Link to={`/temurin/release-notes?version=${release.release_name}`} className="link-light"><MdNotes /> <Trans>Release Notes</Trans></Link></p>
{release.release_notes &&
<p><Link to={`/temurin/release-notes?version=${release.release_notes_name}`} className="link-light"><MdNotes /> <Trans>Release Notes</Trans></Link></p>
}
</div>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ exports[`getAssetsForVersion > returns valid JSON - with release notes 1`] = `
"release_link": "https://release_link_mock/",
"release_name": "0.0.0",
"release_notes": true,
"release_notes_name": "release_name_mock",
"timestamp": "2020-01-01T00:00:00.000Z",
},
],
Expand Down
2 changes: 2 additions & 0 deletions src/hooks/fetchTemurinArchive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function renderReleases(pkgs: MockTemurinFeatureReleaseAPI[], pagecount: number,
}
if (aRelease.release_notes) {
release.release_notes = true;
release.release_notes_name = aRelease.release_name;
}

if (releaseType === 'ga' && !['INSTALLER', 'JDK', 'JRE'].includes(binary_type)) {
Expand Down Expand Up @@ -126,6 +127,7 @@ export interface TemurinReleases {
};
};
release_notes?: boolean;
release_notes_name?: string;
}

interface ReleaseAsset {
Expand Down

0 comments on commit 477a489

Please sign in to comment.