Fix visualization selection functionality.

pull/1797/head
Hunter Trujillo 2017-07-06 12:27:02 -06:00 committed by Andrew Watkins
parent c336805943
commit 562729b6b5
3 changed files with 20 additions and 5 deletions

View File

@ -29,6 +29,7 @@ class CellEditorOverlay extends Component {
this.handleSaveCell = ::this.handleSaveCell
this.handleSelectGraphType = ::this.handleSelectGraphType
this.handleSelectDisplayOptions = ::this.handleSelectDisplayOptions
this.handleSetActiveQueryIndex = ::this.handleSetActiveQueryIndex
this.handleEditRawText = ::this.handleEditRawText
@ -197,7 +198,10 @@ class CellEditorOverlay extends Component {
isSavable={queriesWorkingDraft.every(isQuerySavable)}
/>
{isDisplayOptionsTabOpen
? <DisplayOptions />
? <DisplayOptions
selectedGraphType={cellWorkingType}
onSelectGraphType={this.handleSelectGraphType}
/>
: <QueryMaker
source={source}
templates={templates}

View File

@ -1,8 +1,20 @@
import React, {PropTypes} from 'react'
const DisplayOptions = () =>
<div className="display-options">Display Options</div>
import GraphTypeSelector from 'src/dashboards/components/GraphTypeSelector'
DisplayOptions.propTypes = {}
const DisplayOptions = ({selectedGraphType, onSelectGraphType}) =>
<div className="display-options">
<GraphTypeSelector
selectedGraphType={selectedGraphType}
onSelectGraphType={onSelectGraphType}
/>
</div>
const {func, string} = PropTypes
DisplayOptions.propTypes = {
selectedGraphType: string.isRequired,
onSelectGraphType: func.isRequired,
}
export default DisplayOptions

View File

@ -5,7 +5,6 @@ import graphTypes from 'hson!shared/data/graphTypes.hson'
const GraphTypeSelector = ({selectedGraphType, onSelectGraphType}) =>
<div className="overlay-controls">
<h3 className="overlay--graph-name">Cell Editor</h3>
<div className="overlay-controls--right">
<p>Visualization Type</p>
<ul className="nav nav-tablist nav-tablist-sm">