mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 04:59:02 +08:00
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 <palashgdev@gmail.com> Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
This commit is contained in:
parent
0832bce955
commit
6cd341a887
1
frontend/src/container/Version/constant.ts
Normal file
1
frontend/src/container/Version/constant.ts
Normal file
@ -0,0 +1 @@
|
||||
export const githubReleaseURL = 'https://github.com/SigNoz/signoz/releases';
|
@ -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 (
|
||||
<Card>
|
||||
<Title ellipsis level={4}>
|
||||
<Typography.Title ellipsis level={4}>
|
||||
{t('version')}
|
||||
</Title>
|
||||
</Typography.Title>
|
||||
|
||||
<Form
|
||||
wrapperCol={{
|
||||
@ -55,11 +62,7 @@ function Version(): JSX.Element {
|
||||
value={isLatestVersionError ? t('n_a').toString() : latestVersion}
|
||||
placeholder={t('latest_version')}
|
||||
/>
|
||||
<Button
|
||||
href="https://github.com/SigNoz/signoz/releases"
|
||||
target="_blank"
|
||||
type="link"
|
||||
>
|
||||
<Button href={latestVersionUrl} target="_blank" type="link">
|
||||
{t('release_notes')}
|
||||
</Button>
|
||||
</Form.Item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user