From 6cd341a8873f3a69d90f12166829ae506d214a8e Mon Sep 17 00:00:00 2001 From: Yash Joshi Date: Fri, 3 Feb 2023 21:51:18 +0530 Subject: [PATCH] fix: redirect to latest tag release notes (#1970) * fix: redirect to latest tag release notes * chore: some refactoring is updated --------- Co-authored-by: Palash Gupta Co-authored-by: Srikanth Chekuri --- frontend/src/container/Version/constant.ts | 1 + frontend/src/container/Version/index.tsx | 23 ++++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 frontend/src/container/Version/constant.ts diff --git a/frontend/src/container/Version/constant.ts b/frontend/src/container/Version/constant.ts new file mode 100644 index 0000000000..de3016c4e2 --- /dev/null +++ b/frontend/src/container/Version/constant.ts @@ -0,0 +1 @@ +export const githubReleaseURL = 'https://github.com/SigNoz/signoz/releases'; diff --git a/frontend/src/container/Version/index.tsx b/frontend/src/container/Version/index.tsx index cad08351e3..8c7cab37e4 100644 --- a/frontend/src/container/Version/index.tsx +++ b/frontend/src/container/Version/index.tsx @@ -1,15 +1,14 @@ import { WarningFilled } from '@ant-design/icons'; import { Button, Card, Form, Space, Typography } from 'antd'; -import React from 'react'; +import React, { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; import { AppState } from 'store/reducers'; import AppReducer from 'types/reducer/app'; +import { githubReleaseURL } from './constant'; import { InputComponent } from './styles'; -const { Title } = Typography; - function Version(): JSX.Element { const [form] = Form.useForm(); const { t } = useTranslation(); @@ -24,11 +23,19 @@ function Version(): JSX.Element { const isLatestVersion = currentVersion === latestVersion; const isError = isCurrentVersionError || isLatestVersionError; + const latestVersionUrl = useMemo( + () => + isLatestVersionError + ? githubReleaseURL + : `${githubReleaseURL}/tag/${latestVersion}`, + [isLatestVersionError, latestVersion], + ); + return ( - + <Typography.Title ellipsis level={4}> {t('version')} - +
-