mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 16:51:11 +03:00
fix ProjectLookup re-renders
This commit is contained in:
parent
9de165a676
commit
3409d39150
@ -79,6 +79,7 @@ class JobTemplateForm extends Component {
|
||||
};
|
||||
this.handleProjectValidation = this.handleProjectValidation.bind(this);
|
||||
this.loadRelatedInstanceGroups = this.loadRelatedInstanceGroups.bind(this);
|
||||
this.handleProjectUpdate = this.handleProjectUpdate.bind(this);
|
||||
this.setContentError = this.setContentError.bind(this);
|
||||
}
|
||||
|
||||
@ -120,6 +121,12 @@ class JobTemplateForm extends Component {
|
||||
};
|
||||
}
|
||||
|
||||
handleProjectUpdate(project) {
|
||||
const { setFieldValue } = this.props;
|
||||
setFieldValue('project', project.id);
|
||||
this.setState({ project });
|
||||
}
|
||||
|
||||
setContentError(contentError) {
|
||||
this.setState({ contentError });
|
||||
}
|
||||
@ -257,10 +264,7 @@ class JobTemplateForm extends Component {
|
||||
you want this job to execute.`)}
|
||||
isValid={!form.touched.project || !form.errors.project}
|
||||
helperTextInvalid={form.errors.project}
|
||||
onChange={value => {
|
||||
form.setFieldValue('project', value.id);
|
||||
this.setState({ project: value });
|
||||
}}
|
||||
onChange={this.handleProjectUpdate}
|
||||
required
|
||||
/>
|
||||
)}
|
||||
|
Loading…
Reference in New Issue
Block a user