Skip to content

Commit 023e8e3

Browse files
David-DB88Haarolean
authored andcommitted
FE: Fix version display with a tag (#3827)
(cherry picked from commit ab9d0e2)
1 parent fdd9ad9 commit 023e8e3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

kafka-ui-react-app/src/components/Version/Version.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@ import * as S from './Version.styled';
88

99
const Version: React.FC = () => {
1010
const { data: latestVersionInfo = {} } = useLatestVersion();
11-
const { buildTime, commitId, isLatestRelease } = latestVersionInfo.build;
11+
const { buildTime, commitId, isLatestRelease, version } =
12+
latestVersionInfo.build;
1213
const { versionTag } = latestVersionInfo?.latestRelease || '';
1314

15+
const currentVersion =
16+
isLatestRelease && version?.match(versionTag)
17+
? versionTag
18+
: formatTimestamp(buildTime);
19+
1420
return (
1521
<S.Wrapper>
1622
{!isLatestRelease && (
@@ -32,7 +38,7 @@ const Version: React.FC = () => {
3238
</S.CurrentCommitLink>
3339
</div>
3440
)}
35-
<S.CurrentVersion>{formatTimestamp(buildTime)}</S.CurrentVersion>
41+
<S.CurrentVersion>{currentVersion}</S.CurrentVersion>
3642
</S.Wrapper>
3743
);
3844
};

0 commit comments

Comments
 (0)