Merge pull request #6219 from dsesami/host-detail-labels

Host detail labels

Reviewed-by: Daniel Sami
             https://github.com/dsesami
This commit is contained in:
softwarefactory-project-zuul[bot] 2020-03-09 13:37:50 +00:00 committed by GitHub
commit 9a394a5726
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -6,12 +6,13 @@ import { formatDateString } from '@util/dates';
import Detail from './Detail';
import { SummaryFieldUser } from '../../types';
function UserDateDetail({ label, date, user }) {
function UserDateDetail({ label, date, user, dataCy = null }) {
const dateStr = formatDateString(date);
const username = user ? user.username : '';
return (
<Detail
label={label}
dataCy={dataCy}
value={
user ? (
<Trans>

View File

@ -66,7 +66,7 @@ function HostDetail({ i18n, host }) {
<CardBody>
<HostToggle host={host} css="padding-bottom: 40px" />
<DetailList gutter="sm">
<Detail label={i18n._(t`Name`)} value={name} />
<Detail label={i18n._(t`Name`)} value={name} dataCy="host-name" />
<Detail
label={i18n._(t`Activity`)}
value={<Sparkline jobs={recentPlaybookJobs} />}
@ -74,6 +74,7 @@ function HostDetail({ i18n, host }) {
<Detail label={i18n._(t`Description`)} value={description} />
<Detail
label={i18n._(t`Inventory`)}
dataCy="host-inventory"
value={
<Link to={`/inventories/inventory/${inventory.id}/details`}>
{inventory.name}
@ -84,11 +85,13 @@ function HostDetail({ i18n, host }) {
date={created}
label={i18n._(t`Created`)}
user={created_by}
dataCy="host-created-by"
/>
<UserDateDetail
date={modified}
label={i18n._(t`Last Modified`)}
user={modified_by}
dataCy="host-last-modified-by"
/>
<VariablesDetail
label={i18n._(t`Variables`)}