mirror of
https://github.com/ansible/awx.git
synced 2026-05-12 20:07:37 -02:30
Adds tooltip around host filter lookup when an organization is not selected
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
FormGroup,
|
||||
InputGroup,
|
||||
Modal,
|
||||
Tooltip,
|
||||
} from '@patternfly/react-core';
|
||||
import ChipGroup from '../ChipGroup';
|
||||
import Popover from '../Popover';
|
||||
@@ -243,24 +244,7 @@ function HostFilterLookup({
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<FormGroup
|
||||
fieldId="host-filter"
|
||||
helperTextInvalid={helperTextInvalid}
|
||||
isRequired
|
||||
label={i18n._(t`Smart host filter`)}
|
||||
validated={isValid ? 'default' : 'error'}
|
||||
labelIcon={
|
||||
<Popover
|
||||
content={i18n._(
|
||||
t`Populate the hosts for this inventory by using a search
|
||||
filter. Example: ansible_facts.ansible_distribution:"RedHat".
|
||||
Refer to the Ansible Tower documentation for further syntax and
|
||||
examples.`
|
||||
)}
|
||||
/>
|
||||
}
|
||||
>
|
||||
const renderLookup = () => (
|
||||
<InputGroup onBlur={onBlur}>
|
||||
<Button
|
||||
aria-label={i18n._(t`Search`)}
|
||||
@@ -288,6 +272,37 @@ function HostFilterLookup({
|
||||
))}
|
||||
</ChipHolder>
|
||||
</InputGroup>
|
||||
);
|
||||
|
||||
return (
|
||||
<FormGroup
|
||||
fieldId="host-filter"
|
||||
helperTextInvalid={helperTextInvalid}
|
||||
isRequired
|
||||
label={i18n._(t`Smart host filter`)}
|
||||
validated={isValid ? 'default' : 'error'}
|
||||
labelIcon={
|
||||
<Popover
|
||||
content={i18n._(
|
||||
t`Populate the hosts for this inventory by using a search
|
||||
filter. Example: ansible_facts.ansible_distribution:"RedHat".
|
||||
Refer to the Ansible Tower documentation for further syntax and
|
||||
examples.`
|
||||
)}
|
||||
/>
|
||||
}
|
||||
>
|
||||
{isDisabled ? (
|
||||
<Tooltip
|
||||
content={i18n._(
|
||||
t`Please select an organization before editing the host filter`
|
||||
)}
|
||||
>
|
||||
{renderLookup()}
|
||||
</Tooltip>
|
||||
) : (
|
||||
renderLookup()
|
||||
)}
|
||||
<Modal
|
||||
aria-label={i18n._(t`Lookup modal`)}
|
||||
isOpen={isModalOpen}
|
||||
|
||||
Reference in New Issue
Block a user