/* eslint camelcase: 0 */ import React, { PropTypes } from 'react'; import { bindActionCreators } from 'redux'; import * as actions from '../actions/exploreActions'; import { connect } from 'react-redux'; import { Panel, Alert } from 'react-bootstrap'; import { sectionsToRender } from '../stores/visTypes'; import ControlPanelSection from './ControlPanelSection'; import FieldSetRow from './FieldSetRow'; import FieldSet from './FieldSet'; import fields from '../stores/fields'; const propTypes = { datasource_type: PropTypes.string.isRequired, actions: PropTypes.object.isRequired, fields: PropTypes.object.isRequired, isDatasourceMetaLoading: PropTypes.bool.isRequired, form_data: PropTypes.object.isRequired, y_axis_zero: PropTypes.any, alert: PropTypes.string, exploreState: PropTypes.object.isRequired, }; class ControlPanelsContainer extends React.Component { constructor(props) { super(props); this.removeAlert = this.removeAlert.bind(this); this.getFieldData = this.getFieldData.bind(this); } getFieldData(fieldName) { const mapF = fields[fieldName].mapStateToProps; if (mapF) { return Object.assign({}, this.props.fields[fieldName], mapF(this.props.exploreState)); } return this.props.fields[fieldName]; } sectionsToRender() { return sectionsToRender(this.props.form_data.viz_type, this.props.datasource_type); } removeAlert() { this.props.actions.removeControlPanelAlert(); } render() { return (