Merge pull request #11171 from nixocio/ui_issue_11169

Fix subform for AAP for inventory source
This commit is contained in:
Sarah Akus 2021-10-01 12:46:02 -04:00 committed by GitHub
commit bf8859f401
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 10 deletions

View File

@ -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'
}

View File

@ -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;

View File

@ -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>
);
});

View File

@ -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';

View File

@ -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`],
],
},
]}