Mark Host Config Key as a required field

Mark `Host Config Key` as a required field

See:https://github.com/ansible/awx/issues/4968
This commit is contained in:
nixocio
2020-11-03 17:58:32 -05:00
parent bf6064db21
commit 4268f1aeeb
3 changed files with 7 additions and 1 deletions

View File

@@ -36,7 +36,7 @@ const mockJobTemplate = {
diff_mode: false, diff_mode: false,
extra_vars: '---', extra_vars: '---',
forks: 0, forks: 0,
host_config_key: '', host_config_key: '1234',
id: 1, id: 1,
inventory: 2, inventory: 2,
job_slice_count: 1, job_slice_count: 1,
@@ -225,6 +225,10 @@ describe('<JobTemplateEdit />', () => {
); );
}); });
await waitForElement(wrapper, 'EmptyStateBody', el => el.length === 0); await waitForElement(wrapper, 'EmptyStateBody', el => el.length === 0);
expect(wrapper.find('FormGroup[label="Host Config Key"]').length).toBe(1);
expect(
wrapper.find('FormGroup[label="Host Config Key"]').prop('isRequired')
).toBe(true);
}); });
test('handleSubmit should call api update', async () => { test('handleSubmit should call api update', async () => {

View File

@@ -589,6 +589,7 @@ function JobTemplateForm({
validate={ validate={
allowCallbacks ? required(null, i18n) : null allowCallbacks ? required(null, i18n) : null
} }
isRequired={allowCallbacks}
/> />
</FormColumnLayout> </FormColumnLayout>
</> </>

View File

@@ -56,6 +56,7 @@ describe('<JobTemplateForm />', () => {
webhook_key: 'webhook key', webhook_key: 'webhook key',
webhook_service: 'github', webhook_service: 'github',
webhook_credential: 7, webhook_credential: 7,
host_config_key: '',
}; };
const mockInstanceGroups = [ const mockInstanceGroups = [
{ {