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