Add accidentally removed prop

experiment/integration-testing
Andrew Watkins 2017-08-10 18:20:04 -07:00
parent 7ec2b47044
commit a6a5346fee
2 changed files with 10 additions and 6 deletions

View File

@ -270,6 +270,7 @@ class CellEditorOverlay extends Component {
onAddQuery={this.handleAddQuery}
activeQueryIndex={activeQueryIndex}
activeQuery={this.getActiveQuery()}
setActiveQueryIndex={this.handleSetActiveQueryIndex}
/>}
</div>
</ResizeContainer>

View File

@ -9,8 +9,8 @@ import buildInfluxQLQuery from 'utils/influxql'
const TEMPLATE_RANGE = {upper: null, lower: ':dashboardTime:'}
const rawTextBinder = (links, id, action) => text =>
action(links.queries, id, text)
const buildText = (rawText, range, q) =>
rawText || buildInfluxQLQuery(range || TEMPLATE_RANGE, q) || ''
const buildText = q =>
q.rawText || buildInfluxQLQuery(q.range || TEMPLATE_RANGE, q) || ''
const QueryMaker = ({
source: {links},
@ -20,7 +20,6 @@ const QueryMaker = ({
templates,
onAddQuery,
activeQuery,
activeQuery: {id, range, rawText},
onDeleteQuery,
activeQueryIndex,
setActiveQueryIndex,
@ -35,12 +34,16 @@ const QueryMaker = ({
activeQueryIndex={activeQueryIndex}
setActiveQueryIndex={setActiveQueryIndex}
/>
{activeQuery
{activeQuery && activeQuery.id
? <div className="query-maker--tab-contents">
<QueryTextArea
query={buildText(rawText, range, activeQuery)}
query={buildText(activeQuery)}
config={activeQuery}
onUpdate={rawTextBinder(links, id, actions.editRawTextAsync)}
onUpdate={rawTextBinder(
links,
activeQuery.id,
actions.editRawTextAsync
)}
templates={templates}
/>
<SchemaExplorer