webpack/src/Extends/Host/PuppetTab/SubTabs/Reports/components/DescriptionCard.js in foreman_puppet-4.0.1 vs webpack/src/Extends/Host/PuppetTab/SubTabs/Reports/components/DescriptionCard.js in foreman_puppet-4.0.2
- old
+ new
@@ -10,61 +10,78 @@
import SkeletonLoader from 'foremanReact/components/common/SkeletonLoader';
import DefaultLoaderEmptyState from 'foremanReact/components/HostDetails/DetailsCard/DefaultLoaderEmptyState';
import { STATUS } from 'foremanReact/constants';
import { translate as __ } from 'foremanReact/common/I18n';
-const DescriptionCard = ({ proxyName, caProxy, env, status }) => (
+const DescriptionCard = ({
+ proxyName,
+ caProxy,
+ proxyId,
+ caProxyId,
+ env,
+ status,
+}) => (
<CardTemplate header={__('Puppet details')} expandable>
<DescriptionList isCompact>
<DescriptionListGroup>
<DescriptionListTerm>{__('Puppet environment')}</DescriptionListTerm>
<DescriptionListDescription>
<SkeletonLoader
emptyState={<DefaultLoaderEmptyState />}
status={status}
>
{env && (
- <a href={`/foreman_puppet/environments/${env}/edit`}>{env}</a>
+ <a href={`/foreman_puppet/environments/?search=name+%3D+${env}`}>
+ {env}
+ </a>
)}
</SkeletonLoader>
</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
- <DescriptionListTerm>{__('Puppet smart proxy')}</DescriptionListTerm>
+ <DescriptionListTerm>{__('Puppet Smart Proxy')}</DescriptionListTerm>
<DescriptionListDescription>
<SkeletonLoader
emptyState={<DefaultLoaderEmptyState />}
status={status}
>
- {proxyName}
+ {proxyName && (
+ <a href={`/smart_proxies/${proxyId}#puppet`}>{proxyName}</a>
+ )}
</SkeletonLoader>
</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
- <DescriptionListTerm>{__('Puppet server CA')}</DescriptionListTerm>
+ <DescriptionListTerm>{__('Puppet CA Smart Proxy')}</DescriptionListTerm>
<DescriptionListDescription>
<SkeletonLoader
emptyState={<DefaultLoaderEmptyState />}
status={status}
>
- {caProxy}
+ {caProxy && (
+ <a href={`/smart_proxies/${caProxyId}#puppet-ca`}>{caProxy}</a>
+ )}
</SkeletonLoader>
</DescriptionListDescription>
</DescriptionListGroup>
</DescriptionList>
</CardTemplate>
);
DescriptionCard.propTypes = {
caProxy: PropTypes.string,
+ caProxyId: PropTypes.number,
env: PropTypes.string,
+ proxyId: PropTypes.number,
proxyName: PropTypes.string,
status: PropTypes.string,
};
DescriptionCard.defaultProps = {
caProxy: undefined,
+ caProxyId: undefined,
env: undefined,
+ proxyId: undefined,
proxyName: undefined,
status: STATUS.PENDING,
};
export default DescriptionCard;