Merge pull request #7014 from nixocio/ui_update_chip_group

Update usage of new custom `ChipGroup`

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2020-05-14 21:35:37 +00:00 committed by GitHub
commit 30610f1a62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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}