mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 03:40:42 -03:30
Fix for Save button not responding on Job Settings page
Signed-off-by: Vidya Nambiar <vnambiar@redhat.com>
This commit is contained in:
parent
8f6849fc22
commit
68e555824d
@ -141,14 +141,14 @@ function JobsEdit() {
|
||||
<FormColumnLayout>
|
||||
<InputField
|
||||
name="AWX_ISOLATION_BASE_PATH"
|
||||
config={jobs.AWX_ISOLATION_BASE_PATH}
|
||||
isRequired
|
||||
config={jobs.AWX_ISOLATION_BASE_PATH ?? null}
|
||||
isRequired={Boolean(options?.AWX_ISOLATION_BASE_PATH)}
|
||||
/>
|
||||
<InputField
|
||||
name="SCHEDULE_MAX_JOBS"
|
||||
config={jobs.SCHEDULE_MAX_JOBS}
|
||||
type="number"
|
||||
isRequired
|
||||
config={jobs.SCHEDULE_MAX_JOBS ?? null}
|
||||
type={options?.SCHEDULE_MAX_JOBS ? 'number' : undefined}
|
||||
isRequired={Boolean(options?.SCHEDULE_MAX_JOBS)}
|
||||
/>
|
||||
<InputField
|
||||
name="DEFAULT_JOB_TIMEOUT"
|
||||
|
||||
@ -122,4 +122,22 @@ describe('<JobsEdit />', () => {
|
||||
await waitForElement(wrapper, 'ContentLoading', (el) => el.length === 0);
|
||||
expect(wrapper.find('ContentError').length).toBe(1);
|
||||
});
|
||||
|
||||
test('Form input fields that are invisible (due to being set manually via a settings file) should not prevent submitting the form', async () => {
|
||||
const mockOptions = Object.assign({}, mockAllOptions);
|
||||
// If AWX_ISOLATION_BASE_PATH has been set in a settings file it will be absent in the PUT options
|
||||
delete mockOptions['actions']['PUT']['AWX_ISOLATION_BASE_PATH'];
|
||||
await act(async () => {
|
||||
wrapper = mountWithContexts(
|
||||
<SettingsProvider value={mockOptions.actions}>
|
||||
<JobsEdit />
|
||||
</SettingsProvider>
|
||||
);
|
||||
});
|
||||
await waitForElement(wrapper, 'ContentLoading', (el) => el.length === 0);
|
||||
await act(async () => {
|
||||
wrapper.find('Form').invoke('onSubmit')();
|
||||
});
|
||||
expect(SettingsAPI.updateAll).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
@ -397,7 +397,10 @@ const InputField = ({ name, config, type = 'text', isRequired = false }) => {
|
||||
};
|
||||
InputField.propTypes = {
|
||||
name: string.isRequired,
|
||||
config: shape({}).isRequired,
|
||||
config: shape({}),
|
||||
};
|
||||
InputField.defaultProps = {
|
||||
config: null,
|
||||
};
|
||||
|
||||
const TextAreaField = ({ name, config, isRequired = false }) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user