Wizard: Deprecate Chip and ChipGroup components
`Chip` and `ChipGroup` components will be deprecated in PF6. This replaces them with recommended `Label` and `LabelGroup`.
This commit is contained in:
parent
9dc66ec1d0
commit
223a6a6780
5 changed files with 30 additions and 26 deletions
|
|
@ -2,10 +2,10 @@ import React, { useState } from 'react';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Chip,
|
|
||||||
ChipGroup,
|
|
||||||
HelperText,
|
HelperText,
|
||||||
HelperTextItem,
|
HelperTextItem,
|
||||||
|
Label,
|
||||||
|
LabelGroup,
|
||||||
TextInputGroup,
|
TextInputGroup,
|
||||||
TextInputGroupMain,
|
TextInputGroupMain,
|
||||||
TextInputGroupUtilities,
|
TextInputGroupUtilities,
|
||||||
|
|
@ -126,25 +126,29 @@ const ChippingInput = ({
|
||||||
</HelperText>
|
</HelperText>
|
||||||
)}
|
)}
|
||||||
{requiredList && requiredList.length > 0 && (
|
{requiredList && requiredList.length > 0 && (
|
||||||
<ChipGroup
|
<LabelGroup
|
||||||
categoryName="Required by OpenSCAP"
|
categoryName="Required by OpenSCAP"
|
||||||
numChips={20}
|
numLabels={20}
|
||||||
className="pf-v5-u-mt-sm pf-v5-u-w-100"
|
className="pf-v5-u-mt-sm pf-v5-u-w-100"
|
||||||
>
|
>
|
||||||
{requiredList.map((item) => (
|
{requiredList.map((item) => (
|
||||||
<Chip key={item} isReadOnly>
|
<Label key={item} isCompact>
|
||||||
{item}
|
{item}
|
||||||
</Chip>
|
</Label>
|
||||||
))}
|
))}
|
||||||
</ChipGroup>
|
</LabelGroup>
|
||||||
)}
|
)}
|
||||||
<ChipGroup numChips={20} className="pf-v5-u-mt-sm pf-v5-u-w-100">
|
<LabelGroup numLabels={20} className="pf-v5-u-mt-sm pf-v5-u-w-100">
|
||||||
{list?.map((item) => (
|
{list?.map((item) => (
|
||||||
<Chip key={item} onClick={(e) => handleRemoveItem(e, item)}>
|
<Label
|
||||||
|
key={item}
|
||||||
|
isCompact
|
||||||
|
onClose={(e) => handleRemoveItem(e, item)}
|
||||||
|
>
|
||||||
{item}
|
{item}
|
||||||
</Chip>
|
</Label>
|
||||||
))}
|
))}
|
||||||
</ChipGroup>
|
</LabelGroup>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@ import React, { useEffect, useState } from 'react';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Chip,
|
|
||||||
ChipGroup,
|
|
||||||
FormGroup,
|
FormGroup,
|
||||||
HelperText,
|
HelperText,
|
||||||
HelperTextItem,
|
HelperTextItem,
|
||||||
|
Label,
|
||||||
|
LabelGroup,
|
||||||
MenuToggle,
|
MenuToggle,
|
||||||
MenuToggleElement,
|
MenuToggleElement,
|
||||||
Select,
|
Select,
|
||||||
|
|
@ -174,13 +174,13 @@ const LanguagesDropDown = () => {
|
||||||
)}`}</HelperTextItem>
|
)}`}</HelperTextItem>
|
||||||
</HelperText>
|
</HelperText>
|
||||||
)}
|
)}
|
||||||
<ChipGroup numChips={5} className="pf-v5-u-mt-sm pf-v5-u-w-100">
|
<LabelGroup numLabels={5} className="pf-v5-u-mt-sm pf-v5-u-w-100">
|
||||||
{languages?.map((lang) => (
|
{languages?.map((lang) => (
|
||||||
<Chip key={lang} onClick={(e) => handleRemoveLang(e, lang)}>
|
<Label key={lang} onClose={(e) => handleRemoveLang(e, lang)}>
|
||||||
{lang}
|
{lang}
|
||||||
</Chip>
|
</Label>
|
||||||
))}
|
))}
|
||||||
</ChipGroup>
|
</LabelGroup>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ import {
|
||||||
HelperText,
|
HelperText,
|
||||||
HelperTextItem,
|
HelperTextItem,
|
||||||
FormHelperText,
|
FormHelperText,
|
||||||
|
Label,
|
||||||
|
LabelGroup,
|
||||||
Popover,
|
Popover,
|
||||||
Select,
|
Select,
|
||||||
SelectOption,
|
SelectOption,
|
||||||
|
|
@ -17,8 +19,6 @@ import {
|
||||||
TextInputGroup,
|
TextInputGroup,
|
||||||
TextInputGroupMain,
|
TextInputGroupMain,
|
||||||
TextInputGroupUtilities,
|
TextInputGroupUtilities,
|
||||||
ChipGroup,
|
|
||||||
Chip,
|
|
||||||
} from '@patternfly/react-core';
|
} from '@patternfly/react-core';
|
||||||
import { MenuToggleElement } from '@patternfly/react-core/dist/esm/components/MenuToggle/MenuToggle';
|
import { MenuToggleElement } from '@patternfly/react-core/dist/esm/components/MenuToggle/MenuToggle';
|
||||||
import {
|
import {
|
||||||
|
|
@ -168,19 +168,19 @@ const RegionsSelect = ({ composeId, handleClose }: RegionsSelectPropTypes) => {
|
||||||
placeholder="Select region"
|
placeholder="Select region"
|
||||||
isExpanded={isOpen}
|
isExpanded={isOpen}
|
||||||
>
|
>
|
||||||
<ChipGroup aria-label="Selected regions">
|
<LabelGroup aria-label="Selected regions">
|
||||||
{selected.map((selection, index) => (
|
{selected.map((selection, index) => (
|
||||||
<Chip
|
<Label
|
||||||
key={index}
|
key={index}
|
||||||
onClick={(ev) => {
|
onClose={(ev) => {
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
onSelect(selection);
|
onSelect(selection);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{selection}
|
{selection}
|
||||||
</Chip>
|
</Label>
|
||||||
))}
|
))}
|
||||||
</ChipGroup>
|
</LabelGroup>
|
||||||
</TextInputGroupMain>
|
</TextInputGroupMain>
|
||||||
<TextInputGroupUtilities>
|
<TextInputGroupUtilities>
|
||||||
{selected.length > 0 && (
|
{selected.length > 0 && (
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ const removeKernelArg = async (kernelArg: string) => {
|
||||||
const user = userEvent.setup();
|
const user = userEvent.setup();
|
||||||
|
|
||||||
const removeNosmtArgButton = await screen.findByRole('button', {
|
const removeNosmtArgButton = await screen.findByRole('button', {
|
||||||
name: `close ${kernelArg}`,
|
name: `Close ${kernelArg}`,
|
||||||
});
|
});
|
||||||
await waitFor(() => user.click(removeNosmtArgButton));
|
await waitFor(() => user.click(removeNosmtArgButton));
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ const addEnabledService = async (service: string) => {
|
||||||
const removeService = async (service: string) => {
|
const removeService = async (service: string) => {
|
||||||
const user = userEvent.setup();
|
const user = userEvent.setup();
|
||||||
const removeServiceButton = await screen.findByRole('button', {
|
const removeServiceButton = await screen.findByRole('button', {
|
||||||
name: `close ${service}`,
|
name: `Close ${service}`,
|
||||||
});
|
});
|
||||||
await waitFor(() => user.click(removeServiceButton));
|
await waitFor(() => user.click(removeServiceButton));
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue