mirror of
https://github.com/ansible/awx.git
synced 2026-03-27 05:45:02 -02:30
add error messages for InventorySelect
This commit is contained in:
@@ -12,13 +12,23 @@ const getInventories = async params => InventoriesAPI.read(params);
|
|||||||
|
|
||||||
class InventoryLookup extends React.Component {
|
class InventoryLookup extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
const { value, tooltip, onChange, required, i18n } = this.props;
|
const {
|
||||||
|
value,
|
||||||
|
tooltip,
|
||||||
|
onChange,
|
||||||
|
required,
|
||||||
|
isValid,
|
||||||
|
helperTextInvalid,
|
||||||
|
i18n,
|
||||||
|
} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormGroup
|
<FormGroup
|
||||||
label={i18n._(t`Inventory`)}
|
label={i18n._(t`Inventory`)}
|
||||||
isRequired={required}
|
isRequired={required}
|
||||||
fieldId="inventory-lookup"
|
fieldId="inventory-lookup"
|
||||||
|
isValid={isValid}
|
||||||
|
helperTextInvalid={helperTextInvalid}
|
||||||
>
|
>
|
||||||
{tooltip && <FieldTooltip content={tooltip} />}
|
{tooltip && <FieldTooltip content={tooltip} />}
|
||||||
<Lookup
|
<Lookup
|
||||||
|
|||||||
@@ -240,6 +240,8 @@ class JobTemplateForm extends Component {
|
|||||||
form.setFieldValue('organizationId', value.organization);
|
form.setFieldValue('organizationId', value.organization);
|
||||||
this.setState({ inventory: value });
|
this.setState({ inventory: value });
|
||||||
}}
|
}}
|
||||||
|
isValid={!form.errors.inventory}
|
||||||
|
helperTextInvalid={form.errors.inventory}
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user