From cf31dafbd64e66c2a1b412ead38c8a624c56eaeb Mon Sep 17 00:00:00 2001 From: Claudio W Date: Mon, 1 Apr 2024 12:58:04 +0200 Subject: [PATCH] fix: properly tag maintenance and flag versions correctly (#6586) --- components/Downloads/Release/VersionDropdown.tsx | 4 ++++ components/withDownloadCategories.tsx | 2 +- next-data/generators/releaseData.mjs | 2 +- pages/en/index.mdx | 2 +- types/releases.ts | 1 + 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/components/Downloads/Release/VersionDropdown.tsx b/components/Downloads/Release/VersionDropdown.tsx index 5333780899822..94e8b29032f6f 100644 --- a/components/Downloads/Release/VersionDropdown.tsx +++ b/components/Downloads/Release/VersionDropdown.tsx @@ -16,6 +16,10 @@ const getDropDownStatus = (version: string, status: string) => { return `${version} (Current)`; } + if (status === 'Maintenance') { + return `${version} (Maintenance)`; + } + return version; }; diff --git a/components/withDownloadCategories.tsx b/components/withDownloadCategories.tsx index f6047ea20bdd9..b35453ad4bb0d 100644 --- a/components/withDownloadCategories.tsx +++ b/components/withDownloadCategories.tsx @@ -17,7 +17,7 @@ const WithDownloadCategories: FC = async ({ children }) => { const { page, category, subCategory } = getDownloadCategory(pathname); const initialRelease: Array = pathname.includes('current') - ? ['Current'] + ? ['Current', 'Maintenance'] : ['Active LTS', 'Maintenance LTS']; return ( diff --git a/next-data/generators/releaseData.mjs b/next-data/generators/releaseData.mjs index cd34ecf3e4ef1..3ba2f69fbea77 100644 --- a/next-data/generators/releaseData.mjs +++ b/next-data/generators/releaseData.mjs @@ -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)) { diff --git a/pages/en/index.mdx b/pages/en/index.mdx index 102d7a64c442f..dea0d0f1da96c 100644 --- a/pages/en/index.mdx +++ b/pages/en/index.mdx @@ -28,7 +28,7 @@ layout: home )} - + {({ release }) => ( Want new features sooner? diff --git a/types/releases.ts b/types/releases.ts index b3ff09379375f..228d21fa0d70d 100644 --- a/types/releases.ts +++ b/types/releases.ts @@ -1,5 +1,6 @@ export type NodeReleaseStatus = | 'Maintenance LTS' + | 'Maintenance' | 'Active LTS' | 'Current' | 'End-of-life'