mirror of
https://github.com/ansible/awx.git
synced 2026-02-01 09:38:10 -03:30
Merge pull request #53 from ansible/add-org-new
Basic Add Organization View
This commit is contained in:
36
src/components/AnsibleSelect/AnsibleSelect.jsx
Normal file
36
src/components/AnsibleSelect/AnsibleSelect.jsx
Normal file
@@ -0,0 +1,36 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
FormGroup,
|
||||
Select,
|
||||
SelectOption,
|
||||
} from '@patternfly/react-core';
|
||||
|
||||
class AnsibleSelect extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.onSelectChange = this.onSelectChange.bind(this);
|
||||
}
|
||||
|
||||
onSelectChange(val, _) {
|
||||
this.props.selectChange(val);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { hidden } = this.props;
|
||||
if (hidden) {
|
||||
return null;
|
||||
} else {
|
||||
return (
|
||||
<FormGroup label={this.props.labelName} fieldId="ansible-select">
|
||||
<Select value={this.props.selected} onChange={this.onSelectChange} aria-label="Select Input">
|
||||
{this.props.data.map((env, index) => (
|
||||
<SelectOption isDisabled={env.disabled} key={index} value={env} label={env} />
|
||||
))}
|
||||
</Select>
|
||||
</FormGroup>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default AnsibleSelect;
|
||||
3
src/components/AnsibleSelect/index.js
Normal file
3
src/components/AnsibleSelect/index.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import AnsibleSelect from './AnsibleSelect';
|
||||
|
||||
export default AnsibleSelect;
|
||||
Reference in New Issue
Block a user