From 94e70e6b447d5c2e4fc2043f2bb6a64b4855c69f Mon Sep 17 00:00:00 2001 From: Rohan Chaturvedi Date: Fri, 29 Nov 2024 19:21:45 +0530 Subject: [PATCH] fix: cloud version tag display (#400) * fix: display basic version tag on cloud * chore: bump version --- backend/version.txt | 2 +- frontend/components/ReleaseInfo.tsx | 175 ++++++++++++++-------------- 2 files changed, 91 insertions(+), 86 deletions(-) diff --git a/backend/version.txt b/backend/version.txt index 873e6cc6..4275974b 100644 --- a/backend/version.txt +++ b/backend/version.txt @@ -1 +1 @@ -v2.34.0 +v2.34.2 diff --git a/frontend/components/ReleaseInfo.tsx b/frontend/components/ReleaseInfo.tsx index e24a2c91..facb7108 100644 --- a/frontend/components/ReleaseInfo.tsx +++ b/frontend/components/ReleaseInfo.tsx @@ -2,7 +2,7 @@ import { Fragment, useEffect, useState } from 'react' import Link from 'next/link' -import { getHealth } from '@/utils/appConfig' +import { getHealth, isCloudHosted } from '@/utils/appConfig' import clsx from 'clsx' import { relativeTimeFromDates } from '@/utils/time' import { Popover, Transition } from '@headlessui/react' @@ -64,98 +64,103 @@ export const ReleaseInfo = () => { return (
Console version: - - {({ open }) => ( - <> - -
{healthData.version} + ) : ( + + {({ open }) => ( + <> + +
+ {healthData.version} +
+ {isUpdateAvailable && ( + + Update available + )} +
+ - {healthData.version} -
- {isUpdateAvailable && ( - - Update available - - )} -
- - -
- {releases.map((release, index) => ( -
-
-
- +
+ {releases.map((release, index) => ( +
+
- {release.tag_name === healthData.version ? ( - - Current:{' '} - - {release.name} ({release.tag_name}) - - - ) : ( - <> - {index === 0 && Latest:}{' '} - - {release.name} ({release.tag_name}) - - - )} - -

- {relativeTimeFromDates(new Date(release.published_at))} -

+ >
+
+ + {release.tag_name === healthData.version ? ( + + Current:{' '} + + {release.name} ({release.tag_name}) + + + ) : ( + <> + {index === 0 && Latest:}{' '} + + {release.name} ({release.tag_name}) + + + )} + +

+ {relativeTimeFromDates(new Date(release.published_at))} +

+
-
- ))} -
- - - - )} - + ))} +
+ + + + )} + + )}
) }