Merge pull request #9057 from keithjgrant/9049-inventory-table-responsiveness

Fix inventory list responsive behavior

Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
             https://github.com/tiagodread
This commit is contained in:
softwarefactory-project-zuul[bot] 2021-01-29 19:14:37 +00:00 committed by GitHub
commit 5ab0b91a0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 11 deletions

View File

@ -71,6 +71,7 @@ export function HeaderCell({
sortBy,
columnIndex,
idPrefix,
className,
children,
}) {
const sort = sortKey
@ -81,7 +82,11 @@ export function HeaderCell({
}
: null;
return (
<Th sort={sort} id={sortKey ? `${idPrefix}-${sortKey}` : null}>
<Th
id={sortKey ? `${idPrefix}-${sortKey}` : null}
className={className}
sort={sort}
>
{children}
</Th>
);

View File

@ -1,3 +1,4 @@
import 'styled-components/macro';
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { TableComposable, Tbody } from '@patternfly/react-table';
@ -88,13 +89,13 @@ function PaginatedTable({
);
} else {
Content = (
<>
<div css="overflow: scroll">
{hasContentLoading && <LoadingSpinner />}
<TableComposable aria-label={dataListLabel}>
{headerRow}
<Tbody>{items.map(renderRow)}</Tbody>
</TableComposable>
</>
</div>
);
}

View File

@ -195,9 +195,6 @@ function InventoryList({ i18n }) {
<HeaderCell>{i18n._(t`Status`)}</HeaderCell>
<HeaderCell>{i18n._(t`Type`)}</HeaderCell>
<HeaderCell>{i18n._(t`Organization`)}</HeaderCell>
<HeaderCell>{i18n._(t`Groups`)}</HeaderCell>
<HeaderCell>{i18n._(t`Hosts`)}</HeaderCell>
<HeaderCell>{i18n._(t`Sources`)}</HeaderCell>
<HeaderCell>{i18n._(t`Actions`)}</HeaderCell>
</HeaderRow>
}

View File

@ -89,11 +89,6 @@ function InventoryListItem({
{inventory?.summary_fields?.organization?.name}
</Link>
</Td>
<Td dataLabel={i18n._(t`Groups`)}>{inventory.total_groups}</Td>
<Td dataLabel={i18n._(t`Hosts`)}>{inventory.total_hosts}</Td>
<Td dataLabel={i18n._(t`Sources`)}>
{inventory.total_inventory_sources}
</Td>
{inventory.pending_deletion ? (
<Td dataLabel={i18n._(t`Groups`)}>
<Label color="red">{i18n._(t`Pending delete`)}</Label>