Skip to content

Commit

Permalink
Fixes #36683 - Add help icons to rpm filters (#10698)
Browse files Browse the repository at this point in the history
(cherry picked from commit 7bf5ec6)
  • Loading branch information
sjha4 authored and damoore044 committed Sep 20, 2023
1 parent cb9a2dc commit d5146c4
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,27 @@ 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';
import { getRPMPackages } from '../../ContentViewDetailActions';
import { selectRPMPackages, selectRPMPackagesStatus } from '../../ContentViewDetailSelectors';
import './matchContentModal.scss';


const columnHeaders = [
__('RPM name'),
__('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 +45,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
@@ -0,0 +1,3 @@
.pf-c-empty-state {
margin-top: 0;
}
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 d5146c4

Please sign in to comment.