Skip to content

Commit

Permalink
commit hash URL can be overridden, is not a link if the URL string is…
Browse files Browse the repository at this point in the history
… empty
  • Loading branch information
andrewazores committed Oct 11, 2022
1 parent e5c2709 commit 94ff4e8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/app/About/AboutDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,28 @@ export const AboutDescription = () => {
return result.groups?.describe || 'main';
}, [cryostatVersion, notificationsContext]);

const versionComponent = React.useMemo(() => {
if (build.commitHashUrl) {
return (
<Text
component={TextVariants.a}
target="_blank"
href={build.commitHashUrl.replace('__REPLACE_HASH__', cryostatCommitHash || '')}
>
{cryostatVersion}
</Text>
);
} else {
return <Text component={TextVariants.p}>{cryostatVersion}</Text>;
}
}, [build.commitHashUrl, cryostatCommitHash]);

return (
<>
<TextContent>
<TextList component="dl">
<TextListItem component="dt">Version</TextListItem>
<TextListItem component="dd">
<Text
component={TextVariants.a}
target="_blank"
href={`https://github.com/cryostatio/cryostat/commits/${cryostatCommitHash}`}
>
{cryostatVersion}
</Text>
</TextListItem>
<TextListItem component="dd">{versionComponent}</TextListItem>
<TextListItem component="dt">Homepage</TextListItem>
<TextListItem component="dd">
<Text component={TextVariants.a} target="_blank" href={build.homePageUrl}>
Expand Down
1 change: 1 addition & 0 deletions src/app/build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"productName": "Cryostat",
"commitHashUrl": "https://github.com/cryostatio/cryostat/commits/__REPLACE_HASH__",
"homePageUrl": "https://cryostat.io",
"knownIssuesUrl": "https://github.com/cryostatio/cryostat/issues",
"fileIssueUrl": "https://github.com/cryostatio/cryostat/issues/new?labels=user+report,bug&body=Affects+__REPLACE_VERSION__",
Expand Down

0 comments on commit 94ff4e8

Please sign in to comment.