Skip to content

Commit

Permalink
Rename Reports Details Card components
Browse files Browse the repository at this point in the history
  • Loading branch information
Manisha15 authored and ronlavi2412 committed Aug 3, 2022
1 parent 44ad823 commit ac482bf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
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

0 comments on commit ac482bf

Please sign in to comment.