Update usage of new custom ChipGroup

Update usage of new custom `ChipGroup`.

See: https://github.com/ansible/awx/pull/6935/fies

Also: https://www.patternfly.org/v4/documentation/react/components/chipgroup
This commit is contained in:
nixocio 2020-05-13 15:23:46 -04:00
parent 23a20b9db0
commit ce7ea1fbcb

View File

@ -3,15 +3,10 @@ import { Link, useHistory } from 'react-router-dom';
import { withI18n } from '@lingui/react';
import { t } from '@lingui/macro';
import {
Button,
Chip,
ChipGroup,
List,
ListItem,
} from '@patternfly/react-core';
import { Button, Chip, List, ListItem } from '@patternfly/react-core';
import AlertModal from '../../../components/AlertModal';
import { CardBody, CardActionsRow } from '../../../components/Card';
import ChipGroup from '../../../components/ChipGroup';
import { VariablesDetail } from '../../../components/CodeMirrorInput';
import CredentialChip from '../../../components/CredentialChip';
import DeleteButton from '../../../components/DeleteButton';
@ -161,7 +156,10 @@ function InventorySourceDetail({ inventorySource, i18n }) {
fullWidth
label={i18n._(t`Regions`)}
value={
<ChipGroup numChips={5}>
<ChipGroup
numChips={5}
totalChips={source_regions.split(',').length}
>
{source_regions.split(',').map(region => (
<Chip key={region} isReadOnly>
{region}
@ -176,7 +174,10 @@ function InventorySourceDetail({ inventorySource, i18n }) {
fullWidth
label={i18n._(t`Instance filters`)}
value={
<ChipGroup numChips={5}>
<ChipGroup
numChips={5}
totalChips={instance_filters.split(',').length}
>
{instance_filters.split(',').map(filter => (
<Chip key={filter} isReadOnly>
{filter}
@ -191,7 +192,7 @@ function InventorySourceDetail({ inventorySource, i18n }) {
fullWidth
label={i18n._(t`Only group by`)}
value={
<ChipGroup numChips={5}>
<ChipGroup numChips={5} totalChips={group_by.split(',').length}>
{group_by.split(',').map(group => (
<Chip key={group} isReadOnly>
{group}