table header cleanup; fix inventory status labels

This commit is contained in:
Keith Grant
2020-12-07 11:34:53 -08:00
parent 6a47899dbb
commit 9da636e294
6 changed files with 12 additions and 7 deletions

View File

@@ -17,7 +17,7 @@ const ActionsGrid = styled.div`
`; `;
export default function ActionsTd({ children }) { export default function ActionsTd({ children }) {
const numActions = children.length; const numActions = children.length || 1;
const width = numActions * 40; const width = numActions * 40;
return ( return (
<Td <Td

View File

@@ -1,12 +1,17 @@
import React from 'react'; import React from 'react';
import { useLocation, useHistory } from 'react-router-dom'; import { useLocation, useHistory } from 'react-router-dom';
import { Thead, Tr, Th } from '@patternfly/react-table'; import { Thead, Tr, Th as PFTh } from '@patternfly/react-table';
import styled from 'styled-components';
import { import {
encodeNonDefaultQueryString, encodeNonDefaultQueryString,
parseQueryString, parseQueryString,
replaceParams, replaceParams,
} from '../../util/qs'; } from '../../util/qs';
const Th = styled(PFTh)`
--pf-c-table--cell--Overflow: initial;
`;
export default function HeaderRow({ qsConfig, defaultSortKey, children }) { export default function HeaderRow({ qsConfig, defaultSortKey, children }) {
const location = useLocation(); const location = useLocation();
const history = useHistory(); const history = useHistory();

View File

@@ -199,6 +199,7 @@ function InventoryList({ i18n }) {
<HeaderCell>{i18n._(t`Groups`)}</HeaderCell> <HeaderCell>{i18n._(t`Groups`)}</HeaderCell>
<HeaderCell>{i18n._(t`Hosts`)}</HeaderCell> <HeaderCell>{i18n._(t`Hosts`)}</HeaderCell>
<HeaderCell>{i18n._(t`Sources`)}</HeaderCell> <HeaderCell>{i18n._(t`Sources`)}</HeaderCell>
<HeaderCell>{i18n._(t`Actions`)}</HeaderCell>
</HeaderRow> </HeaderRow>
} }
renderToolbar={props => ( renderToolbar={props => (

View File

@@ -11,7 +11,7 @@ import { InventoriesAPI } from '../../../api';
import { Inventory } from '../../../types'; import { Inventory } from '../../../types';
import { ActionsTd, ActionItem } from '../../../components/PaginatedTable'; import { ActionsTd, ActionItem } from '../../../components/PaginatedTable';
import CopyButton from '../../../components/CopyButton'; import CopyButton from '../../../components/CopyButton';
import SyncStatusIndicator from '../../../components/SyncStatusIndicator'; import StatusLabel from '../../../components/StatusLabel';
function InventoryListItem({ function InventoryListItem({
inventory, inventory,
@@ -74,9 +74,7 @@ function InventoryListItem({
)} )}
</Td> </Td>
<Td> <Td>
{inventory.kind !== 'smart' && ( {inventory.kind !== 'smart' && <StatusLabel status={syncStatus} />}
<SyncStatusIndicator status={syncStatus} />
)}
</Td> </Td>
<Td> <Td>
{inventory.kind === 'smart' {inventory.kind === 'smart'

View File

@@ -156,6 +156,7 @@ function OrganizationsList({ i18n }) {
<HeaderCell sortKey="name">{i18n._(t`Name`)}</HeaderCell> <HeaderCell sortKey="name">{i18n._(t`Name`)}</HeaderCell>
<HeaderCell>{i18n._(t`Members`)}</HeaderCell> <HeaderCell>{i18n._(t`Members`)}</HeaderCell>
<HeaderCell>{i18n._(t`Teams`)}</HeaderCell> <HeaderCell>{i18n._(t`Teams`)}</HeaderCell>
<HeaderCell>{i18n._(t`Actions`)}</HeaderCell>
</HeaderRow> </HeaderRow>
} }
renderToolbar={props => ( renderToolbar={props => (

View File

@@ -2,7 +2,7 @@ import React from 'react';
import { string, bool, func } from 'prop-types'; import { string, bool, func } from 'prop-types';
import { withI18n } from '@lingui/react'; import { withI18n } from '@lingui/react';
import { t } from '@lingui/macro'; import { t } from '@lingui/macro';
import { Button, Tooltip } from '@patternfly/react-core'; import { Button } from '@patternfly/react-core';
import { Tr, Td } from '@patternfly/react-table'; import { Tr, Td } from '@patternfly/react-table';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { PencilAltIcon } from '@patternfly/react-icons'; import { PencilAltIcon } from '@patternfly/react-icons';