Skip to content

Commit

Permalink
fix: properly tag maintenance and flag versions correctly (#6586)
Browse files Browse the repository at this point in the history
  • Loading branch information
ovflowd authored Apr 1, 2024
1 parent 327356b commit cf31daf
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions components/Downloads/Release/VersionDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ const getDropDownStatus = (version: string, status: string) => {
return `${version} (Current)`;
}

if (status === 'Maintenance') {
return `${version} (Maintenance)`;
}

return version;
};

Expand Down
2 changes: 1 addition & 1 deletion components/withDownloadCategories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const WithDownloadCategories: FC<PropsWithChildren> = async ({ children }) => {
const { page, category, subCategory } = getDownloadCategory(pathname);

const initialRelease: Array<NodeReleaseStatus> = pathname.includes('current')
? ['Current']
? ['Current', 'Maintenance']
: ['Active LTS', 'Maintenance LTS'];

return (
Expand Down
2 changes: 1 addition & 1 deletion next-data/generators/releaseData.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const getNodeReleaseStatus = (now, support) => {
}

if (maintenanceStart && now > new Date(maintenanceStart)) {
return 'Maintenance LTS';
return ltsStart ? 'Maintenance LTS' : 'Maintenance';
}

if (ltsStart && now > new Date(ltsStart)) {
Expand Down
2 changes: 1 addition & 1 deletion pages/en/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ layout: home
</>
)}
</WithNodeRelease>
<WithNodeRelease status={"Current"}>
<WithNodeRelease status={["Current", "Maintenance"]}>
{({ release }) => (
<small>
Want new features sooner?
Expand Down
1 change: 1 addition & 0 deletions types/releases.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export type NodeReleaseStatus =
| 'Maintenance LTS'
| 'Maintenance'
| 'Active LTS'
| 'Current'
| 'End-of-life'
Expand Down

0 comments on commit cf31daf

Please sign in to comment.