Files
superset2/caravel/assets/javascripts/explorev2/components/SelectField.jsx
Alanna Scott 4156ad5a30 [explore-v2] control panel fixes (#1529)
* make fieldset conditions more clear

* make label required

* use render* pattern

* use slugify util for turning labels into ids

* use field rather than html

* don't need panel-title class here
2016-11-02 21:51:56 -07:00

30 lines
851 B
JavaScript

import React, { PropTypes } from 'react';
import { FormGroup, FormControl } from 'react-bootstrap';
import ControlLabelWithTooltip from './ControlLabelWithTooltip';
import { slugify } from '../../modules/utils';
const propTypes = {
label: PropTypes.string,
description: PropTypes.string,
};
const defaultProps = {
label: null,
description: null,
};
export default function SelectField({ label, description }) {
return (
<FormGroup controlId={`formControlsSelect-${slugify(label)}`}>
<ControlLabelWithTooltip label={label} description={description} />
<FormControl componentClass="select" placeholder="select">
<option value="select">select</option>
<option value="other">...</option>
</FormControl>
</FormGroup>
);
}
SelectField.propTypes = propTypes;
SelectField.defaultProps = defaultProps;