mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
Fix subform for AAP for inventory source
Fix subform for AAP for inventory source See: https://github.com/ansible/awx/issues/11169
This commit is contained in:
@@ -22,7 +22,7 @@ import {
|
|||||||
OpenStackSubForm,
|
OpenStackSubForm,
|
||||||
SCMSubForm,
|
SCMSubForm,
|
||||||
SatelliteSubForm,
|
SatelliteSubForm,
|
||||||
TowerSubForm,
|
ControllerSubForm,
|
||||||
VMwareSubForm,
|
VMwareSubForm,
|
||||||
VirtualizationSubForm,
|
VirtualizationSubForm,
|
||||||
} from './InventorySourceSubForms';
|
} from './InventorySourceSubForms';
|
||||||
@@ -207,8 +207,8 @@ const InventorySourceFormFields = ({
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
tower: (
|
controller: (
|
||||||
<TowerSubForm
|
<ControllerSubForm
|
||||||
autoPopulateCredential={
|
autoPopulateCredential={
|
||||||
!source?.id || source?.source !== 'controller'
|
!source?.id || source?.source !== 'controller'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
SourceVarsField,
|
SourceVarsField,
|
||||||
} from './SharedFields';
|
} from './SharedFields';
|
||||||
|
|
||||||
const TowerSubForm = ({ autoPopulateCredential }) => {
|
const ControllerSubForm = ({ autoPopulateCredential }) => {
|
||||||
const { setFieldValue, setFieldTouched } = useFormikContext();
|
const { setFieldValue, setFieldTouched } = useFormikContext();
|
||||||
const [credentialField, credentialMeta, credentialHelpers] =
|
const [credentialField, credentialMeta, credentialHelpers] =
|
||||||
useField('credential');
|
useField('credential');
|
||||||
@@ -78,4 +78,4 @@ const TowerSubForm = ({ autoPopulateCredential }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default TowerSubForm;
|
export default ControllerSubForm;
|
||||||
@@ -3,7 +3,7 @@ import { act } from 'react-dom/test-utils';
|
|||||||
import { Formik } from 'formik';
|
import { Formik } from 'formik';
|
||||||
import { CredentialsAPI } from 'api';
|
import { CredentialsAPI } from 'api';
|
||||||
import { mountWithContexts } from '../../../../../testUtils/enzymeHelpers';
|
import { mountWithContexts } from '../../../../../testUtils/enzymeHelpers';
|
||||||
import TowerSubForm from './TowerSubForm';
|
import ControllerSubForm from './ControllerSubForm';
|
||||||
|
|
||||||
jest.mock('../../../../api');
|
jest.mock('../../../../api');
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ const initialValues = {
|
|||||||
verbosity: 1,
|
verbosity: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
describe('<TowerSubForm />', () => {
|
describe('<ControllerSubForm />', () => {
|
||||||
let wrapper;
|
let wrapper;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
@@ -31,7 +31,7 @@ describe('<TowerSubForm />', () => {
|
|||||||
await act(async () => {
|
await act(async () => {
|
||||||
wrapper = mountWithContexts(
|
wrapper = mountWithContexts(
|
||||||
<Formik initialValues={initialValues}>
|
<Formik initialValues={initialValues}>
|
||||||
<TowerSubForm />
|
<ControllerSubForm />
|
||||||
</Formik>
|
</Formik>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -5,6 +5,6 @@ export { default as InsightsSubForm } from './InsightsSubForm';
|
|||||||
export { default as OpenStackSubForm } from './OpenStackSubForm';
|
export { default as OpenStackSubForm } from './OpenStackSubForm';
|
||||||
export { default as SCMSubForm } from './SCMSubForm';
|
export { default as SCMSubForm } from './SCMSubForm';
|
||||||
export { default as SatelliteSubForm } from './SatelliteSubForm';
|
export { default as SatelliteSubForm } from './SatelliteSubForm';
|
||||||
export { default as TowerSubForm } from './TowerSubForm';
|
export { default as ControllerSubForm } from './ControllerSubForm';
|
||||||
export { default as VMwareSubForm } from './VMwareSubForm';
|
export { default as VMwareSubForm } from './VMwareSubForm';
|
||||||
export { default as VirtualizationSubForm } from './VirtualizationSubForm';
|
export { default as VirtualizationSubForm } from './VirtualizationSubForm';
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ function InventorySourcesList({ nodeResource, onUpdateNodeResource }) {
|
|||||||
[`satellite6`, t`Red Hat Satellite 6`],
|
[`satellite6`, t`Red Hat Satellite 6`],
|
||||||
[`openstack`, t`OpenStack`],
|
[`openstack`, t`OpenStack`],
|
||||||
[`rhv`, t`Red Hat Virtualization`],
|
[`rhv`, t`Red Hat Virtualization`],
|
||||||
[`tower`, t`Ansible Tower`],
|
[`controller`, t`Red Hat Ansible Automation Platform`],
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
|
|||||||
Reference in New Issue
Block a user