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

Rename Reports Details Card components #301

Merged
merged 1 commit into from
Aug 3, 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
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ import DefaultLoaderEmptyState from 'foremanReact/components/HostDetails/Details
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>
Expand All @@ -31,24 +38,28 @@ const DescriptionCard = ({ proxyName, caProxy, env, status }) => (
</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>
Expand All @@ -58,14 +69,18 @@ const DescriptionCard = ({ proxyName, caProxy, env, status }) => (

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,
};
Expand Down
4 changes: 4 additions & 0 deletions webpack/src/Extends/Host/PuppetTab/SubTabs/Reports/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const Reports = ({
puppet_proxy_name: proxyName,
puppet_ca_proxy_name: caProxy,
environment_name: env,
puppet_proxy_id: proxyId,
puppet_ca_proxy_id: caProxyId,
},
}) => (
<div className="report-tab">
Expand All @@ -20,6 +22,8 @@ const Reports = ({
<DescriptionCard
proxyName={proxyName}
caProxy={caProxy}
proxyId={proxyId}
caProxyId={caProxyId}
env={env}
status={status}
/>
Expand Down