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 committed Jul 13, 2022
1 parent 44ad823 commit 48e399f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
1 change: 1 addition & 0 deletions webpack/src/Extends/Host/PuppetTab/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const SecondaryTabRoutes = ({ hostName, hostInfo, status }) => (
<Switch>
<Route path={route('reports')}>
<Reports hostName={hostName} hostInfo={hostInfo} status={status} />
console.log(hostInfo);
</Route>
<Route path={route('assigned')}>
<EmptyPage
Expand Down
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 48e399f

Please sign in to comment.