mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03: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:
parent
7eefa897b3
commit
003bf29dce
@ -22,7 +22,7 @@ import {
|
||||
OpenStackSubForm,
|
||||
SCMSubForm,
|
||||
SatelliteSubForm,
|
||||
TowerSubForm,
|
||||
ControllerSubForm,
|
||||
VMwareSubForm,
|
||||
VirtualizationSubForm,
|
||||
} from './InventorySourceSubForms';
|
||||
@ -207,8 +207,8 @@ const InventorySourceFormFields = ({
|
||||
}
|
||||
/>
|
||||
),
|
||||
tower: (
|
||||
<TowerSubForm
|
||||
controller: (
|
||||
<ControllerSubForm
|
||||
autoPopulateCredential={
|
||||
!source?.id || source?.source !== 'controller'
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ import {
|
||||
SourceVarsField,
|
||||
} from './SharedFields';
|
||||
|
||||
const TowerSubForm = ({ autoPopulateCredential }) => {
|
||||
const ControllerSubForm = ({ autoPopulateCredential }) => {
|
||||
const { setFieldValue, setFieldTouched } = useFormikContext();
|
||||
const [credentialField, credentialMeta, credentialHelpers] =
|
||||
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 { CredentialsAPI } from 'api';
|
||||
import { mountWithContexts } from '../../../../../testUtils/enzymeHelpers';
|
||||
import TowerSubForm from './TowerSubForm';
|
||||
import ControllerSubForm from './ControllerSubForm';
|
||||
|
||||
jest.mock('../../../../api');
|
||||
|
||||
@ -21,7 +21,7 @@ const initialValues = {
|
||||
verbosity: 1,
|
||||
};
|
||||
|
||||
describe('<TowerSubForm />', () => {
|
||||
describe('<ControllerSubForm />', () => {
|
||||
let wrapper;
|
||||
|
||||
beforeEach(async () => {
|
||||
@ -31,7 +31,7 @@ describe('<TowerSubForm />', () => {
|
||||
await act(async () => {
|
||||
wrapper = mountWithContexts(
|
||||
<Formik initialValues={initialValues}>
|
||||
<TowerSubForm />
|
||||
<ControllerSubForm />
|
||||
</Formik>
|
||||
);
|
||||
});
|
||||
@ -5,6 +5,6 @@ export { default as InsightsSubForm } from './InsightsSubForm';
|
||||
export { default as OpenStackSubForm } from './OpenStackSubForm';
|
||||
export { default as SCMSubForm } from './SCMSubForm';
|
||||
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 VirtualizationSubForm } from './VirtualizationSubForm';
|
||||
|
||||
@ -102,7 +102,7 @@ function InventorySourcesList({ nodeResource, onUpdateNodeResource }) {
|
||||
[`satellite6`, t`Red Hat Satellite 6`],
|
||||
[`openstack`, t`OpenStack`],
|
||||
[`rhv`, t`Red Hat Virtualization`],
|
||||
[`tower`, t`Ansible Tower`],
|
||||
[`controller`, t`Red Hat Ansible Automation Platform`],
|
||||
],
|
||||
},
|
||||
]}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user