Merge pull request #7101 from keithjgrant/5996-inventory-removable

make Inventory optional if prompt-on-launch is true

Reviewed-by: Daniel Sami
             https://github.com/dsesami
This commit is contained in:
softwarefactory-project-zuul[bot] 2020-05-26 20:01:56 +00:00 committed by GitHub
commit d239c82ff5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -231,7 +231,7 @@ function JobTemplateForm({
</FieldWithPrompt>
<FieldWithPrompt
fieldId="template-inventory"
isRequired
isRequired={!formikValues.ask_inventory_on_launch}
label={i18n._(t`Inventory`)}
promptId="template-ask-inventory-on-launch"
promptName="ask_inventory_on_launch"
@ -242,10 +242,10 @@ function JobTemplateForm({
value={inventory}
onBlur={() => inventoryHelpers.setTouched()}
onChange={value => {
inventoryHelpers.setValue(value.id);
inventoryHelpers.setValue(value ? value.id : null);
setInventory(value);
}}
required
required={!formikValues.ask_inventory_on_launch}
touched={inventoryMeta.touched}
error={inventoryMeta.error}
/>