1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Prevent project lookup from firing requests on every render

This commit is contained in:
Marliana Lara 2020-04-06 16:50:10 -04:00
parent 735d44816b
commit c2ba495824
No known key found for this signature in database
GPG Key ID: 38C73B40DFA809EE

View File

@ -103,6 +103,7 @@ function JobTemplateForm({
} }
}, [template, validateField]) }, [template, validateField])
); );
const { const {
request: loadRelatedInstanceGroups, request: loadRelatedInstanceGroups,
error: instanceGroupError, error: instanceGroupError,
@ -143,7 +144,7 @@ function JobTemplateForm({
playbookHelpers.setValue(0); playbookHelpers.setValue(0);
scmHelpers.setValue(''); scmHelpers.setValue('');
}, },
[setProject, projectHelpers, playbookHelpers, scmHelpers] [] // eslint-disable-line react-hooks/exhaustive-deps
); );
const jobTypeOptions = [ const jobTypeOptions = [
@ -289,7 +290,7 @@ function JobTemplateForm({
/> />
<PlaybookSelect <PlaybookSelect
projectId={project?.id || projectField.value?.id} projectId={project?.id || projectField.value?.id}
isValid={!(playbookMeta.touched || playbookMeta.error)} isValid={!playbookMeta.touched || !playbookMeta.error}
field={playbookField} field={playbookField}
onBlur={() => playbookHelpers.setTouched()} onBlur={() => playbookHelpers.setTouched()}
onError={setContentError} onError={setContentError}