Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(config): add build properties JSON file #547

Merged
merged 2 commits into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/app/About/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
*/

import React from 'react';
import build from '@app/build.json';
import cryostatLogoHorizontal from '@app/assets/logo-cryostat-3-horizontal.svg';
import { BreadcrumbPage } from '@app/BreadcrumbPage/BreadcrumbPage';
import { AboutDescription, CRYOSTAT_TRADEMARK } from './AboutDescription';
Expand All @@ -47,7 +48,7 @@ export const About = () => {
<BreadcrumbPage pageTitle="About">
<Card>
<CardHeader>
<Brand alt="Cryostat" src={cryostatLogoHorizontal} className="cryostat-logo" />
<Brand alt={build.productName} src={cryostatLogoHorizontal} className="cryostat-logo" />
</CardHeader>
<CardBody>
<AboutDescription />
Expand Down
43 changes: 24 additions & 19 deletions src/app/About/AboutDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

import { Text, TextContent, TextList, TextListItem, TextVariants } from '@patternfly/react-core';
import React from 'react';
import build from '@app/build.json';
import { ServiceContext } from '@app/Shared/Services/Services';
import { NotificationsContext } from '@app/Notifications/Notifications';

Expand Down Expand Up @@ -69,55 +70,59 @@ 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="https://cryostat.io">
<Text component={TextVariants.a} target="_blank" href={build.homePageUrl}>
cryostat.io
</Text>
</TextListItem>
<TextListItem component="dt">Bugs</TextListItem>
<TextListItem component="dd">
<Text>
<Text component={TextVariants.a} target="_blank" href="https://github.com/cryostatio/cryostat/issues">
<Text component={TextVariants.a} target="_blank" href={build.knownIssuesUrl}>
Known Issues
</Text>
&nbsp;|&nbsp;
<Text
component={TextVariants.a}
target="_blank"
href={`https://github.com/cryostatio/cryostat/issues/new?labels=user+report,bug&body=Affects+${cryostatVersion}`}
href={build.fileIssueUrl.replace('__REPLACE_VERSION__', cryostatVersion || 'unknown')}
>
File a Report
</Text>
</Text>
</TextListItem>
<TextListItem component="dt">Mailing List</TextListItem>
<TextListItem component="dd">
<Text component={TextVariants.a} target="_blank" href="https://groups.google.com/g/cryostat-development">
Google Groups
<Text component={TextVariants.a} target="_blank" href={build.mailingListUrl}>
{build.mailingListName}
</Text>
</TextListItem>
<TextListItem component="dt">Open Source License</TextListItem>
<TextListItem component="dd">
<Text
component={TextVariants.a}
target="_blank"
href="https://github.com/cryostatio/cryostat/blob/main/LICENSE"
>
<Text component={TextVariants.a} target="_blank" href={build.licenseUrl}>
License
</Text>
</TextListItem>
Expand Down
10 changes: 10 additions & 0 deletions src/app/build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"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__",
"mailingListName": "Google Groups",
"mailingListUrl": "https://groups.google.com/g/cryostat-development",
"licenseUrl": "https://github.com/cryostatio/cryostat/blob/main/LICENSE"
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"**/*.ts",
"**/*.tsx",
"**/*.jsx",
"**/*.js"
"**/*.js",
"**/*.json"
],
"exclude": ["node_modules"]
}