mirror of
https://github.com/ansible/awx.git
synced 2026-05-16 13:57:39 -02:30
Rename Select components to FormSelect for @patternfly/react-core 2.1.8
This commit is contained in:
@@ -44,6 +44,6 @@ describe('<AnsibleSelect />', () => {
|
|||||||
defaultSelected={mockData[1]}
|
defaultSelected={mockData[1]}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
expect(wrapper.find('Select')).toHaveLength(1);
|
expect(wrapper.find('FormSelect')).toHaveLength(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -172,8 +172,8 @@ describe('<OrganizationAdd />', () => {
|
|||||||
</I18nProvider>
|
</I18nProvider>
|
||||||
</MemoryRouter>
|
</MemoryRouter>
|
||||||
).find('OrganizationAdd').find('AnsibleSelect');
|
).find('OrganizationAdd').find('AnsibleSelect');
|
||||||
expect(wrapper.find('Select')).toHaveLength(1);
|
expect(wrapper.find('FormSelect')).toHaveLength(1);
|
||||||
expect(wrapper.find('SelectOption')).toHaveLength(2);
|
expect(wrapper.find('FormSelectOption')).toHaveLength(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('AnsibleSelect component does not render if there are 0 virtual environments', () => {
|
test('AnsibleSelect component does not render if there are 0 virtual environments', () => {
|
||||||
@@ -189,6 +189,6 @@ describe('<OrganizationAdd />', () => {
|
|||||||
</I18nProvider>
|
</I18nProvider>
|
||||||
</MemoryRouter>
|
</MemoryRouter>
|
||||||
).find('OrganizationAdd').find('AnsibleSelect');
|
).find('OrganizationAdd').find('AnsibleSelect');
|
||||||
expect(wrapper.find('Select')).toHaveLength(0);
|
expect(wrapper.find('FormSelect')).toHaveLength(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Select,
|
FormSelect,
|
||||||
SelectOption,
|
FormSelectOption,
|
||||||
} from '@patternfly/react-core';
|
} from '@patternfly/react-core';
|
||||||
|
|
||||||
class AnsibleSelect extends React.Component {
|
class AnsibleSelect extends React.Component {
|
||||||
@@ -21,11 +21,11 @@ class AnsibleSelect extends React.Component {
|
|||||||
render () {
|
render () {
|
||||||
const { label, value, data, defaultSelected } = this.props;
|
const { label, value, data, defaultSelected } = this.props;
|
||||||
return (
|
return (
|
||||||
<Select value={value} onChange={this.onSelectChange} aria-label="Select Input">
|
<FormSelect value={value} onChange={this.onSelectChange} aria-label="Select Input">
|
||||||
{data.map((datum) => (datum === defaultSelected
|
{data.map((datum) => (datum === defaultSelected
|
||||||
? (<SelectOption key="" value="" label={`Use Default ${label}`} />) : (<SelectOption key={datum} value={datum} label={datum} />)))
|
? (<FormSelectOption key="" value="" label={`Use Default ${label}`} />) : (<FormSelectOption key={datum} value={datum} label={datum} />)))
|
||||||
}
|
}
|
||||||
</Select>
|
</FormSelect>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user