Skip to content

Commit

Permalink
Fixes #36683 - Add help icons to rpm filters
Browse files Browse the repository at this point in the history
  • Loading branch information
sjha4 committed Sep 13, 2023
1 parent 05b73f7 commit d7d06f6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ import { useSelector, shallowEqual } from 'react-redux';
import PropTypes from 'prop-types';
import { translate as __ } from 'foremanReact/common/I18n';
import {
Modal, ModalVariant,
Modal, ModalVariant, Popover, Button,
} from '@patternfly/react-core';
import {
HelpIcon,
} from '@patternfly/react-icons';
import { TableVariant, Thead, Tbody, Tr, Th, Td } from '@patternfly/react-table';
import { urlBuilder } from 'foremanReact/common/urlHelpers';
import TableWrapper from '../../../../../components/Table/TableWrapper';
Expand All @@ -17,9 +20,9 @@ const columnHeaders = [
__('Summary'),
];

const emptyContentTitle = __('No matching RPM found.');
const emptyContentBody = __("Given criteria doesn't match any RPMs. Try changing your rule.");
const emptySearchTitle = __('Your search returned no matching RPMs.');
const emptyContentTitle = __('No matching non-modular RPM found.');
const emptyContentBody = __("Given criteria doesn't match any non-modular RPMs. Try changing your rule.");
const emptySearchTitle = __('Your search returned no matching non-modular RPMs.');
const emptySearchBody = __('Try changing your search criteria.');

const CVRpmMatchContentModal = ({ filterId, onClose, filterRuleId }) => {
Expand All @@ -41,6 +44,16 @@ const CVRpmMatchContentModal = ({ filterId, onClose, filterRuleId }) => {
isOpen
onClose={onClose}
appendTo={document.body}
help={
<Popover
headerContent={__('Help')}
bodyContent={__("Matching RPMs based on your created filter rule. Remember, RPM filters don't apply to modular RPMs.")}
>
<Button variant="plain" aria-label="Help" ouiaId="matching-content-modal-help">
<HelpIcon />
</Button>
</Popover>
}
>
<TableWrapper
{...{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ import PropTypes from 'prop-types';
import { translate as __ } from 'foremanReact/common/I18n';
import {
Modal, ModalVariant, Form, FormGroup, TextInput,
ActionGroup, Button, FormSelect, FormSelectOption,
ActionGroup, Button, FormSelect, FormSelectOption, Popover,
} from '@patternfly/react-core';
import {
HelpIcon,
} from '@patternfly/react-icons';
import { addCVFilterRule, editCVFilterRule, getCVFilterRules } from '../../../ContentViewDetailActions';
import {
selectCreateFilterRuleStatus,
Expand Down Expand Up @@ -135,6 +138,17 @@ const AddEditPackageRuleModal = ({
isOpen
onClose={onClose}
appendTo={document.body}
help={
<Popover
headerContent={__('Help')}
bodyContent={__('Use filter rules to include or restrict certain content. ' +
"When selecting RPMs, be aware that RPM filters don't apply to modular RPMs.")}
>
<Button variant="plain" aria-label="Help" ouiaId="rpm-filter-rule-modal-help">
<HelpIcon />
</Button>
</Popover>
}
>
<Form onSubmit={(e) => {
e.preventDefault();
Expand Down

0 comments on commit d7d06f6

Please sign in to comment.