Merge pull request #697 from influxdata/super-hot-fix

Use InfluxQL instead of Raw Text
pull/696/head
Will Piers 2016-12-15 12:47:49 -08:00 committed by GitHub
commit 34f233a370
2 changed files with 9 additions and 4 deletions

View File

@ -137,7 +137,12 @@ const Panel = React.createClass({
return (
<div className="panel--tabs">
{queries.map((q) => {
const queryTabText = (q.measurement && q.fields.length !== 0) ? `${q.measurement}.${q.fields[0].field}` : 'Query';
let queryTabText;
if (q.rawText) {
queryTabText = 'InfluxQL';
} else {
queryTabText = (q.measurement && q.fields.length !== 0) ? `${q.measurement}.${q.fields[0].field}` : 'Query';
}
return (
<QueryTabItem
isActive={this.getActiveQuery().id === q.id}
@ -160,7 +165,7 @@ const Panel = React.createClass({
case 'Query Builder':
this.handleAddQuery();
break;
case 'Raw Text':
case 'InfluxQL':
this.handleAddRawQuery();
break;
}
@ -168,7 +173,7 @@ const Panel = React.createClass({
renderAddQuery() {
return (
<SimpleDropdown onChoose={this.onChoose} items={[{text: 'Query Builder'}, {text: 'Raw Text'}]} className="panel--tab-new">
<SimpleDropdown onChoose={this.onChoose} items={[{text: 'Query Builder'}, {text: 'InfluxQL'}]} className="panel--tab-new">
<span className="icon plus"></span>
</SimpleDropdown>
);

View File

@ -24,7 +24,7 @@ const QueryTabItem = React.createClass({
render() {
return (
<div className={classNames('panel--tab', {active: this.props.isActive})} onClick={this.handleSelect}>
<span className="panel--tab-label">{this.props.query.rawText ? 'Raw Text' : this.props.queryTabText}</span>
<span className="panel--tab-label">{this.props.queryTabText}</span>
<span className="panel--tab-delete" onClick={this.handleDelete}></span>
</div>
);