mirror of
https://github.com/ansible/awx.git
synced 2026-05-09 18:37:36 -02:30
make Inventory optional if prompt-on-launch is true
This commit is contained in:
@@ -233,7 +233,7 @@ function JobTemplateForm({
|
|||||||
</FieldWithPrompt>
|
</FieldWithPrompt>
|
||||||
<FieldWithPrompt
|
<FieldWithPrompt
|
||||||
fieldId="template-inventory"
|
fieldId="template-inventory"
|
||||||
isRequired
|
isRequired={!formikValues.ask_inventory_on_launch}
|
||||||
label={i18n._(t`Inventory`)}
|
label={i18n._(t`Inventory`)}
|
||||||
promptId="template-ask-inventory-on-launch"
|
promptId="template-ask-inventory-on-launch"
|
||||||
promptName="ask_inventory_on_launch"
|
promptName="ask_inventory_on_launch"
|
||||||
@@ -244,10 +244,10 @@ function JobTemplateForm({
|
|||||||
value={inventory}
|
value={inventory}
|
||||||
onBlur={() => inventoryHelpers.setTouched()}
|
onBlur={() => inventoryHelpers.setTouched()}
|
||||||
onChange={value => {
|
onChange={value => {
|
||||||
inventoryHelpers.setValue(value.id);
|
inventoryHelpers.setValue(value ? value.id : null);
|
||||||
setInventory(value);
|
setInventory(value);
|
||||||
}}
|
}}
|
||||||
required
|
required={!formikValues.ask_inventory_on_launch}
|
||||||
touched={inventoryMeta.touched}
|
touched={inventoryMeta.touched}
|
||||||
error={inventoryMeta.error}
|
error={inventoryMeta.error}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user