diff --git a/awx/ui_next/src/screens/Inventory/InventorySourceDetail/InventorySourceDetail.jsx b/awx/ui_next/src/screens/Inventory/InventorySourceDetail/InventorySourceDetail.jsx index 42fad28421..badd28fb26 100644 --- a/awx/ui_next/src/screens/Inventory/InventorySourceDetail/InventorySourceDetail.jsx +++ b/awx/ui_next/src/screens/Inventory/InventorySourceDetail/InventorySourceDetail.jsx @@ -3,10 +3,9 @@ import { Link, useHistory } from 'react-router-dom'; import { withI18n } from '@lingui/react'; import { t } from '@lingui/macro'; -import { Button, Chip, List, ListItem } from '@patternfly/react-core'; +import { Button, List, ListItem } from '@patternfly/react-core'; import AlertModal from '../../../components/AlertModal'; import { CardBody, CardActionsRow } from '../../../components/Card'; -import ChipGroup from '../../../components/ChipGroup'; import { VariablesDetail } from '../../../components/CodeMirrorInput'; import ContentError from '../../../components/ContentError'; import ContentLoading from '../../../components/ContentLoading'; @@ -28,16 +27,13 @@ function InventorySourceDetail({ inventorySource, i18n }) { created, custom_virtualenv, description, - group_by, id, - instance_filters, modified, name, overwrite, overwrite_vars, source, source_path, - source_regions, source_vars, update_cache_timeout, update_on_launch, @@ -233,57 +229,6 @@ function InventorySourceDetail({ inventorySource, i18n }) { ))} /> )} - {source_regions && ( - - {source_regions.split(',').map(region => ( - - {region} - - ))} - - } - /> - )} - {instance_filters && ( - - {instance_filters.split(',').map(filter => ( - - {filter} - - ))} - - } - /> - )} - {group_by && ( - - {group_by.split(',').map(group => ( - - {group} - - ))} - - } - /> - )} {optionsList && ( )} diff --git a/awx/ui_next/src/screens/Inventory/InventorySourceDetail/InventorySourceDetail.test.jsx b/awx/ui_next/src/screens/Inventory/InventorySourceDetail/InventorySourceDetail.test.jsx index c8905143ee..0d7f9a9b79 100644 --- a/awx/ui_next/src/screens/Inventory/InventorySourceDetail/InventorySourceDetail.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventorySourceDetail/InventorySourceDetail.test.jsx @@ -64,32 +64,6 @@ describe('InventorySourceDetail', () => { assertDetail(wrapper, 'Inventory file', 'foo'); assertDetail(wrapper, 'Verbosity', '2 (Debug)'); assertDetail(wrapper, 'Cache timeout', '2 seconds'); - expect( - wrapper - .find('Detail[label="Regions"]') - .containsAllMatchingElements([ - us-east-1, - us-east-2, - ]) - ).toEqual(true); - expect( - wrapper - .find('Detail[label="Instance filters"]') - .containsAllMatchingElements([ - filter1, - filter2, - filter3, - ]) - ).toEqual(true); - expect( - wrapper - .find('Detail[label="Only group by"]') - .containsAllMatchingElements([ - group1, - group2, - group3, - ]) - ).toEqual(true); expect(wrapper.find('CredentialChip').text()).toBe('Cloud: mock cred'); expect(wrapper.find('VariablesDetail').prop('value')).toEqual( '---\nfoo: bar' diff --git a/awx/ui_next/src/screens/Inventory/shared/InventorySourceForm.jsx b/awx/ui_next/src/screens/Inventory/shared/InventorySourceForm.jsx index a694d15243..08b32f1f1a 100644 --- a/awx/ui_next/src/screens/Inventory/shared/InventorySourceForm.jsx +++ b/awx/ui_next/src/screens/Inventory/shared/InventorySourceForm.jsx @@ -75,14 +75,11 @@ const InventorySourceFormFields = ({ sourceOptions, i18n }) => { } else { const defaults = { credential: null, - group_by: '', - instance_filters: '', overwrite: false, overwrite_vars: false, source: sourceType, source_path: '', source_project: null, - source_regions: '', source_script: null, source_vars: '---\n', update_cache_timeout: 0, @@ -200,15 +197,12 @@ const InventorySourceForm = ({ credential: source?.summary_fields?.credential || null, custom_virtualenv: source?.custom_virtualenv || '', description: source?.description || '', - group_by: source?.group_by || '', - instance_filters: source?.instance_filters || '', name: source?.name || '', overwrite: source?.overwrite || false, overwrite_vars: source?.overwrite_vars || false, source: source?.source || '', source_path: source?.source_path === '' ? '/ (project root)' : '', source_project: source?.summary_fields?.source_project || null, - source_regions: source?.source_regions || '', source_script: source?.summary_fields?.source_script || null, source_vars: source?.source_vars || '---\n', update_cache_timeout: source?.update_cache_timeout || 0, diff --git a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/AzureSubForm.jsx b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/AzureSubForm.jsx index 7bc6b49975..99b83ca6b5 100644 --- a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/AzureSubForm.jsx +++ b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/AzureSubForm.jsx @@ -3,14 +3,9 @@ import { useField } from 'formik'; import { withI18n } from '@lingui/react'; import { t } from '@lingui/macro'; import CredentialLookup from '../../../../components/Lookup/CredentialLookup'; -import { - OptionsField, - RegionsField, - SourceVarsField, - VerbosityField, -} from './SharedFields'; +import { OptionsField, SourceVarsField, VerbosityField } from './SharedFields'; -const AzureSubForm = ({ i18n, sourceOptions }) => { +const AzureSubForm = ({ i18n }) => { const [credentialField, credentialMeta, credentialHelpers] = useField( 'credential' ); @@ -29,11 +24,6 @@ const AzureSubForm = ({ i18n, sourceOptions }) => { value={credentialField.value} required /> - diff --git a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/AzureSubForm.test.jsx b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/AzureSubForm.test.jsx index a7dae124fd..b363f7f42b 100644 --- a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/AzureSubForm.test.jsx +++ b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/AzureSubForm.test.jsx @@ -10,13 +10,10 @@ jest.mock('../../../../api/models/Credentials'); const initialValues = { credential: null, custom_virtualenv: '', - group_by: '', - instance_filters: '', overwrite: false, overwrite_vars: false, source_path: '', source_project: null, - source_regions: '', source_script: null, source_vars: '---\n', update_cache_timeout: 0, @@ -27,11 +24,7 @@ const initialValues = { const mockSourceOptions = { actions: { - POST: { - source_regions: { - azure_rm_region_choices: [], - }, - }, + POST: {}, }, }; @@ -58,7 +51,6 @@ describe('', () => { test('should render subform fields', () => { expect(wrapper.find('FormGroup[label="Credential"]')).toHaveLength(1); - expect(wrapper.find('FormGroup[label="Regions"]')).toHaveLength(1); expect(wrapper.find('FormGroup[label="Verbosity"]')).toHaveLength(1); expect(wrapper.find('FormGroup[label="Update options"]')).toHaveLength(1); expect( diff --git a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/CloudFormsSubForm.test.jsx b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/CloudFormsSubForm.test.jsx index e46ac8d8fa..8e46b042fd 100644 --- a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/CloudFormsSubForm.test.jsx +++ b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/CloudFormsSubForm.test.jsx @@ -10,13 +10,10 @@ jest.mock('../../../../api/models/Credentials'); const initialValues = { credential: null, custom_virtualenv: '', - group_by: '', - instance_filters: '', overwrite: false, overwrite_vars: false, source_path: '', source_project: null, - source_regions: '', source_script: null, source_vars: '---\n', update_cache_timeout: 0, diff --git a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/EC2SubForm.jsx b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/EC2SubForm.jsx index d74e770895..32fc581742 100644 --- a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/EC2SubForm.jsx +++ b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/EC2SubForm.jsx @@ -3,24 +3,10 @@ import { useField } from 'formik'; import { withI18n } from '@lingui/react'; import { t } from '@lingui/macro'; import CredentialLookup from '../../../../components/Lookup/CredentialLookup'; -import { - GroupByField, - InstanceFiltersField, - OptionsField, - RegionsField, - SourceVarsField, - VerbosityField, -} from './SharedFields'; +import { OptionsField, SourceVarsField, VerbosityField } from './SharedFields'; -const EC2SubForm = ({ i18n, sourceOptions }) => { +const EC2SubForm = ({ i18n }) => { const [credentialField, , credentialHelpers] = useField('credential'); - const groupByOptionsObj = Object.assign( - {}, - ...sourceOptions?.actions?.POST?.group_by?.ec2_group_by_choices.map( - ([key, val]) => ({ [key]: val }) - ) - ); - return ( <> { credentialHelpers.setValue(value); }} /> - - - diff --git a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/EC2SubForm.test.jsx b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/EC2SubForm.test.jsx index fc15d03ea9..7a41471ec2 100644 --- a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/EC2SubForm.test.jsx +++ b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/EC2SubForm.test.jsx @@ -10,13 +10,10 @@ jest.mock('../../../../api/models/Credentials'); const initialValues = { credential: null, custom_virtualenv: '', - group_by: '', - instance_filters: '', overwrite: false, overwrite_vars: false, source_path: '', source_project: null, - source_regions: '', source_script: null, source_vars: '---\n', update_cache_timeout: 0, @@ -27,14 +24,7 @@ const initialValues = { const mockSourceOptions = { actions: { - POST: { - source_regions: { - ec2_region_choices: [], - }, - group_by: { - ec2_group_by_choices: [], - }, - }, + POST: {}, }, }; @@ -61,9 +51,6 @@ describe('', () => { test('should render subform fields', () => { expect(wrapper.find('FormGroup[label="Credential"]')).toHaveLength(1); - expect(wrapper.find('FormGroup[label="Regions"]')).toHaveLength(1); - expect(wrapper.find('FormGroup[label="Instance filters"]')).toHaveLength(1); - expect(wrapper.find('FormGroup[label="Only group by"]')).toHaveLength(1); expect(wrapper.find('FormGroup[label="Verbosity"]')).toHaveLength(1); expect(wrapper.find('FormGroup[label="Update options"]')).toHaveLength(1); expect( diff --git a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/GCESubForm.jsx b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/GCESubForm.jsx index 0451e80b86..fcbbffa040 100644 --- a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/GCESubForm.jsx +++ b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/GCESubForm.jsx @@ -3,9 +3,9 @@ import { useField } from 'formik'; import { withI18n } from '@lingui/react'; import { t } from '@lingui/macro'; import CredentialLookup from '../../../../components/Lookup/CredentialLookup'; -import { OptionsField, RegionsField, VerbosityField } from './SharedFields'; +import { OptionsField, VerbosityField } from './SharedFields'; -const GCESubForm = ({ i18n, sourceOptions }) => { +const GCESubForm = ({ i18n }) => { const [credentialField, credentialMeta, credentialHelpers] = useField( 'credential' ); @@ -24,11 +24,6 @@ const GCESubForm = ({ i18n, sourceOptions }) => { value={credentialField.value} required /> - diff --git a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/GCESubForm.test.jsx b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/GCESubForm.test.jsx index a7845972c1..4655d0ad3f 100644 --- a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/GCESubForm.test.jsx +++ b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/GCESubForm.test.jsx @@ -10,13 +10,10 @@ jest.mock('../../../../api/models/Credentials'); const initialValues = { credential: null, custom_virtualenv: '', - group_by: '', - instance_filters: '', overwrite: false, overwrite_vars: false, source_path: '', source_project: null, - source_regions: '', source_script: null, source_vars: '---\n', update_cache_timeout: 0, @@ -27,11 +24,7 @@ const initialValues = { const mockSourceOptions = { actions: { - POST: { - source_regions: { - gce_region_choices: [], - }, - }, + POST: {}, }, }; @@ -58,7 +51,6 @@ describe('', () => { test('should render subform fields', () => { expect(wrapper.find('FormGroup[label="Credential"]')).toHaveLength(1); - expect(wrapper.find('FormGroup[label="Regions"]')).toHaveLength(1); expect(wrapper.find('FormGroup[label="Verbosity"]')).toHaveLength(1); expect(wrapper.find('FormGroup[label="Update options"]')).toHaveLength(1); expect( diff --git a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/OpenStackSubForm.test.jsx b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/OpenStackSubForm.test.jsx index b4be2c1aff..f912186816 100644 --- a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/OpenStackSubForm.test.jsx +++ b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/OpenStackSubForm.test.jsx @@ -10,13 +10,10 @@ jest.mock('../../../../api/models/Credentials'); const initialValues = { credential: null, custom_virtualenv: '', - group_by: '', - instance_filters: '', overwrite: false, overwrite_vars: false, source_path: '', source_project: null, - source_regions: '', source_script: null, source_vars: '---\n', update_cache_timeout: 0, diff --git a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/SCMSubForm.test.jsx b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/SCMSubForm.test.jsx index 6d763b78a7..fdd4fdb317 100644 --- a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/SCMSubForm.test.jsx +++ b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/SCMSubForm.test.jsx @@ -11,13 +11,10 @@ jest.mock('../../../../api/models/Credentials'); const initialValues = { credential: null, custom_virtualenv: '', - group_by: '', - instance_filters: '', overwrite: false, overwrite_vars: false, source_path: '', source_project: null, - source_regions: '', source_script: null, source_vars: '---\n', update_cache_timeout: 0, diff --git a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/SatelliteSubForm.test.jsx b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/SatelliteSubForm.test.jsx index 5da6c02db6..2934390896 100644 --- a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/SatelliteSubForm.test.jsx +++ b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/SatelliteSubForm.test.jsx @@ -10,13 +10,10 @@ jest.mock('../../../../api/models/Credentials'); const initialValues = { credential: null, custom_virtualenv: '', - group_by: '', - instance_filters: '', overwrite: false, overwrite_vars: false, source_path: '', source_project: null, - source_regions: '', source_script: null, source_vars: '---\n', update_cache_timeout: 0, diff --git a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/SharedFields.jsx b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/SharedFields.jsx index dcfc4b70fc..3ca698641b 100644 --- a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/SharedFields.jsx +++ b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/SharedFields.jsx @@ -1,16 +1,9 @@ -import React, { useEffect, useState } from 'react'; +import React, { useEffect } from 'react'; import { withI18n } from '@lingui/react'; -import { t, Trans } from '@lingui/macro'; +import { t } from '@lingui/macro'; import { useField } from 'formik'; -import { - FormGroup, - Select, - SelectOption, - SelectVariant, -} from '@patternfly/react-core'; -import { arrayToString, stringToArray } from '../../../../util/strings'; +import { FormGroup } from '@patternfly/react-core'; import { minMaxValue } from '../../../../util/validators'; -import { BrandName } from '../../../../variables'; import AnsibleSelect from '../../../../components/AnsibleSelect'; import { VariablesField } from '../../../../components/CodeMirrorInput'; import FormField, { @@ -32,196 +25,6 @@ export const SourceVarsField = withI18n()(({ i18n }) => ( )); -export const RegionsField = withI18n()(({ i18n, regionOptions }) => { - const [field, meta, helpers] = useField('source_regions'); - const [isOpen, setIsOpen] = useState(false); - const options = Object.assign( - {}, - ...regionOptions.map(([key, val]) => ({ [key]: val })) - ); - const selected = stringToArray(field?.value) - .filter(i => options[i]) - .map(val => options[val]); - - return ( - - Click on the regions field to see a list of regions for your cloud - provider. You can select multiple regions, or choose - All to include all regions. Only Hosts associated with - the selected regions will be updated. - - } - /> - } - > - - - ); -}); - -export const GroupByField = withI18n()( - ({ i18n, fixedOptions, isCreatable = false }) => { - const [field, meta, helpers] = useField('group_by'); - const fixedOptionLabels = fixedOptions && Object.values(fixedOptions); - const selections = fixedOptions - ? stringToArray(field.value).map(o => fixedOptions[o]) - : stringToArray(field.value); - const [options, setOptions] = useState(selections); - const [isOpen, setIsOpen] = useState(false); - - const renderOptions = opts => { - return opts.map(option => ( - - {option} - - )); - }; - - const handleFilter = event => { - const str = event.target.value.toLowerCase(); - let matches; - if (fixedOptions) { - matches = fixedOptionLabels.filter(o => o.toLowerCase().includes(str)); - } else { - matches = options.filter(o => o.toLowerCase().includes(str)); - } - return renderOptions(matches); - }; - - const handleSelect = (e, option) => { - let selectedValues; - if (selections.includes(option)) { - selectedValues = selections.filter(o => o !== option); - } else { - selectedValues = selections.concat(option); - } - if (fixedOptions) { - selectedValues = selectedValues.map(val => - Object.keys(fixedOptions).find(key => fixedOptions[key] === val) - ); - } - helpers.setValue(arrayToString(selectedValues)); - }; - - return ( - - Select which groups to create automatically. AWX will create - group names similar to the following examples based on the - options selected: -
-
-
    -
  • - Availability Zone: zones » us-east-1b -
  • -
  • - Image ID: images » ami-b007ab1e -
  • -
  • - Instance ID: instances » i-ca11ab1e -
  • -
  • - Instance Type: types » type_m1_medium -
  • -
  • - Key Name: keys » key_testing -
  • -
  • - Region: regions » us-east-1 -
  • -
  • - Security Group:{' '} - - security_groups » security_group_default - -
  • -
  • - Tags: tags » tag_Name_host1 -
  • -
  • - VPC ID: vpcs » vpc-5ca1ab1e -
  • -
  • - Tag None: tags » tag_none -
  • -
-
- If blank, all groups above are created except{' '} - Instance ID. - - } - /> - } - > - -
- ); - } -); - export const VerbosityField = withI18n()(({ i18n }) => { const [field, meta, helpers] = useField('verbosity'); const isValid = !(meta.touched && meta.error); @@ -351,49 +154,3 @@ export const OptionsField = withI18n()( ); } ); - -export const InstanceFiltersField = withI18n()(({ i18n }) => { - // Setting BrandName to a variable here is necessary to get the jest tests - // passing. Attempting to use BrandName in the template literal results - // in failing tests. - const brandName = BrandName; - return ( - - Provide a comma-separated list of filter expressions. Hosts are - imported to {brandName} when ANY of the filters match. -
-
- Limit to hosts having a tag: -
- tag-key=TowerManaged -
-
- Limit to hosts using either key pair: -
- key-name=staging, key-name=production -
-
- Limit to hosts where the Name tag begins with test:
- tag:Name=test* -
-
- View the - - {' '} - Describe Instances documentation{' '} - - for a complete list of supported filters. - - } - /> - ); -}); diff --git a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/TowerSubForm.jsx b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/TowerSubForm.jsx index f3fe26d3a9..3af0f9a5c6 100644 --- a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/TowerSubForm.jsx +++ b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/TowerSubForm.jsx @@ -3,11 +3,7 @@ import { useField } from 'formik'; import { withI18n } from '@lingui/react'; import { t } from '@lingui/macro'; import CredentialLookup from '../../../../components/Lookup/CredentialLookup'; -import { - InstanceFiltersField, - OptionsField, - VerbosityField, -} from './SharedFields'; +import { OptionsField, VerbosityField } from './SharedFields'; const TowerSubForm = ({ i18n }) => { const [credentialField, credentialMeta, credentialHelpers] = useField( @@ -28,7 +24,6 @@ const TowerSubForm = ({ i18n }) => { value={credentialField.value} required /> - diff --git a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/TowerSubForm.test.jsx b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/TowerSubForm.test.jsx index 71bc801823..fd7ee0488a 100644 --- a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/TowerSubForm.test.jsx +++ b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/TowerSubForm.test.jsx @@ -10,13 +10,10 @@ jest.mock('../../../../api/models/Credentials'); const initialValues = { credential: null, custom_virtualenv: '', - group_by: '', - instance_filters: '', overwrite: false, overwrite_vars: false, source_path: '', source_project: null, - source_regions: '', source_script: null, source_vars: '---\n', update_cache_timeout: 0, @@ -48,7 +45,6 @@ describe('', () => { test('should render subform fields', () => { expect(wrapper.find('FormGroup[label="Credential"]')).toHaveLength(1); - expect(wrapper.find('FormGroup[label="Instance filters"]')).toHaveLength(1); expect(wrapper.find('FormGroup[label="Verbosity"]')).toHaveLength(1); expect(wrapper.find('FormGroup[label="Update options"]')).toHaveLength(1); expect( diff --git a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/VMwareSubForm.jsx b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/VMwareSubForm.jsx index e975e789b1..555b0498e3 100644 --- a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/VMwareSubForm.jsx +++ b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/VMwareSubForm.jsx @@ -3,13 +3,7 @@ import { useField } from 'formik'; import { withI18n } from '@lingui/react'; import { t } from '@lingui/macro'; import CredentialLookup from '../../../../components/Lookup/CredentialLookup'; -import { - InstanceFiltersField, - GroupByField, - OptionsField, - SourceVarsField, - VerbosityField, -} from './SharedFields'; +import { OptionsField, SourceVarsField, VerbosityField } from './SharedFields'; const VMwareSubForm = ({ i18n }) => { const [credentialField, credentialMeta, credentialHelpers] = useField( @@ -30,8 +24,6 @@ const VMwareSubForm = ({ i18n }) => { value={credentialField.value} required /> - - diff --git a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/VMwareSubForm.test.jsx b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/VMwareSubForm.test.jsx index ba4777733d..e86bc49d50 100644 --- a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/VMwareSubForm.test.jsx +++ b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/VMwareSubForm.test.jsx @@ -10,13 +10,10 @@ jest.mock('../../../../api/models/Credentials'); const initialValues = { credential: null, custom_virtualenv: '', - group_by: '', - instance_filters: '', overwrite: false, overwrite_vars: false, source_path: '', source_project: null, - source_regions: '', source_script: null, source_vars: '---\n', update_cache_timeout: 0, @@ -27,11 +24,7 @@ const initialValues = { const mockSourceOptions = { actions: { - POST: { - source_regions: { - gce_region_choices: [], - }, - }, + POST: {}, }, }; @@ -58,8 +51,6 @@ describe('', () => { test('should render subform fields', () => { expect(wrapper.find('FormGroup[label="Credential"]')).toHaveLength(1); - expect(wrapper.find('FormGroup[label="Instance filters"]')).toHaveLength(1); - expect(wrapper.find('FormGroup[label="Only group by"]')).toHaveLength(1); expect(wrapper.find('FormGroup[label="Verbosity"]')).toHaveLength(1); expect(wrapper.find('FormGroup[label="Update options"]')).toHaveLength(1); expect( diff --git a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/VirtualizationSubForm.test.jsx b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/VirtualizationSubForm.test.jsx index 1d1526a42d..35f3933bb9 100644 --- a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/VirtualizationSubForm.test.jsx +++ b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSubForms/VirtualizationSubForm.test.jsx @@ -10,13 +10,10 @@ jest.mock('../../../../api/models/Credentials'); const initialValues = { credential: null, custom_virtualenv: '', - group_by: '', - instance_filters: '', overwrite: false, overwrite_vars: false, source_path: '', source_project: null, - source_regions: '', source_script: null, source_vars: '---\n', update_cache_timeout: 0, diff --git a/awx/ui_next/src/screens/Inventory/shared/data.inventory_source.json b/awx/ui_next/src/screens/Inventory/shared/data.inventory_source.json index c6fbf26365..ad1e313611 100644 --- a/awx/ui_next/src/screens/Inventory/shared/data.inventory_source.json +++ b/awx/ui_next/src/screens/Inventory/shared/data.inventory_source.json @@ -96,9 +96,6 @@ "source_script": "Mock Script", "source_vars":"---\nfoo: bar", "credential": 8, - "source_regions": "us-east-1,us-east-2", - "instance_filters": "filter1,filter2,filter3", - "group_by": "group1,group2,group3", "overwrite":true, "overwrite_vars":true, "custom_virtualenv":"/venv/custom",