mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
put FormGroup component in form instead of in AnsibleSelect component
This commit is contained in:
parent
f2ab7f62b9
commit
b4007c7e04
@ -1,7 +1,6 @@
|
||||
import React from 'react';
|
||||
|
||||
import {
|
||||
FormGroup,
|
||||
Select,
|
||||
SelectOption,
|
||||
} from '@patternfly/react-core';
|
||||
@ -33,17 +32,15 @@ class AnsibleSelect extends React.Component {
|
||||
|
||||
render () {
|
||||
const { count } = this.state;
|
||||
const { labelName, value, data, fieldId } = this.props;
|
||||
const { value, data } = this.props;
|
||||
let elem;
|
||||
if (count > 1) {
|
||||
elem = (
|
||||
<FormGroup label={labelName} fieldId={fieldId || 'ansible-select'}>
|
||||
<Select value={value} id={`select-${fieldId}` || 'ansible-select-element'} onChange={this.onSelectChange} aria-label="Select Input">
|
||||
{data.map((datum) => (
|
||||
<SelectOption isDisabled={datum.disabled} key={datum} value={datum} label={datum} />
|
||||
))}
|
||||
</Select>
|
||||
</FormGroup>
|
||||
<Select value={value} onChange={this.onSelectChange} aria-label="Select Input">
|
||||
{data.map((datum) => (
|
||||
<SelectOption isDisabled={datum.disabled} key={datum} value={datum} label={datum} />
|
||||
))}
|
||||
</Select>
|
||||
);
|
||||
} else {
|
||||
elem = null;
|
||||
|
||||
@ -135,14 +135,14 @@ class OrganizationAdd extends React.Component {
|
||||
</FormGroup>
|
||||
<ConfigContext.Consumer>
|
||||
{({ custom_virtualenvs }) => (
|
||||
<AnsibleSelect
|
||||
fieldId="add-org-form-virtual-env"
|
||||
labelName="Ansible Environment"
|
||||
name="custom_virtualenv"
|
||||
value={custom_virtualenv}
|
||||
onChange={this.onFieldChange}
|
||||
data={custom_virtualenvs}
|
||||
/>
|
||||
<FormGroup label="Ansible Environment" fieldId="add-org-form-custom-virtualenv">
|
||||
<AnsibleSelect
|
||||
name="custom_virtualenv"
|
||||
value={custom_virtualenv}
|
||||
onChange={this.onFieldChange}
|
||||
data={custom_virtualenvs}
|
||||
/>
|
||||
</FormGroup>
|
||||
)}
|
||||
</ConfigContext.Consumer>
|
||||
</Gallery>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user