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
4 changed files with 9 additions and 11 deletions

View File

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

View File

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

View File

@@ -195,9 +195,6 @@ function InventoryList({ i18n }) {
<HeaderCell>{i18n._(t`Status`)}</HeaderCell> <HeaderCell>{i18n._(t`Status`)}</HeaderCell>
<HeaderCell>{i18n._(t`Type`)}</HeaderCell> <HeaderCell>{i18n._(t`Type`)}</HeaderCell>
<HeaderCell>{i18n._(t`Organization`)}</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> <HeaderCell>{i18n._(t`Actions`)}</HeaderCell>
</HeaderRow> </HeaderRow>
} }

View File

@@ -89,11 +89,6 @@ function InventoryListItem({
{inventory?.summary_fields?.organization?.name} {inventory?.summary_fields?.organization?.name}
</Link> </Link>
</Td> </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 ? ( {inventory.pending_deletion ? (
<Td dataLabel={i18n._(t`Groups`)}> <Td dataLabel={i18n._(t`Groups`)}>
<Label color="red">{i18n._(t`Pending delete`)}</Label> <Label color="red">{i18n._(t`Pending delete`)}</Label>