diff --git a/helm-frontend/public/config.js b/helm-frontend/public/config.js index 0d0df029cb..bee793a085 100644 --- a/helm-frontend/public/config.js +++ b/helm-frontend/public/config.js @@ -1,4 +1,4 @@ -window.RELEASE = "v1.0.0"; +window.RELEASE = "v1.9.0"; window.BENCHMARK_OUTPUT_BASE_URL = "https://storage.googleapis.com/crfm-helm-public/lite/benchmark_output/"; window.PROJECT_ID = "lite"; diff --git a/helm-frontend/src/components/ReleaseDropdown.tsx b/helm-frontend/src/components/ReleaseDropdown.tsx index 7e648b56ea..223edce526 100644 --- a/helm-frontend/src/components/ReleaseDropdown.tsx +++ b/helm-frontend/src/components/ReleaseDropdown.tsx @@ -1,3 +1,4 @@ +import { Badge } from "@tremor/react"; import { useEffect, useState } from "react"; import getReleaseSummary from "@/services/getReleaseSummary"; import ReleaseSummary from "@/types/ReleaseSummary"; @@ -40,13 +41,6 @@ function ReleaseDropdown() { }); }, []); - function getReleases(): string[] { - return currProjectMetadata !== undefined && - currProjectMetadata.releases !== undefined - ? currProjectMetadata.releases - : ["v1.0.0"]; - } - useEffect(() => { const controller = new AbortController(); async function fetchData() { @@ -58,20 +52,31 @@ function ReleaseDropdown() { return () => controller.abort(); }, []); - const releases = getReleases(); + const releases = + currProjectMetadata !== undefined && + currProjectMetadata.releases !== undefined + ? currProjectMetadata.releases + : ["v1.0.0"]; - if (!summary.release && !summary.suite) { + const currentVersion = summary.release || summary.suite || null; + + if (!currentVersion) { return null; } - const releaseInfo = `Release ${summary.release || summary.suite} (${ - summary.date - })`; + const releaseInfo = `Release ${currentVersion} (${summary.date})`; if (releases.length <= 1) { return
{releaseInfo}
; } + const badge = + releases.length > 0 && currentVersion != releases[0] ? ( + stale + ) : ( + latest + ); + return (
- {releaseInfo}  + {releaseInfo} {badge} 
    {releases.map((release) => (