Merge branch 'master' into feature/generic-oauth

pull/10616/head
Chris Goller 2017-04-06 16:47:58 -05:00
commit 978838cf2c
6 changed files with 50 additions and 5 deletions

View File

@ -17,6 +17,7 @@
1. [#1179](https://github.com/influxdata/chronograf/pull/1179): Admin Databases Page will render a database without retention policies
1. [#1128](https://github.com/influxdata/chronograf/pull/1128): No more ghost dashboards 👻
1. [#1189](https://github.com/influxdata/chronograf/pull/1189): Clicking inside the graph header edit box will no longer blur the field. Use the Escape key for that behavior instead.
1. [#1193](https://github.com/influxdata/chronograf/issues/1193): Fix no quoting of raw InfluxQL fields with function names
1. [#1195](https://github.com/influxdata/chronograf/issues/1195): Chronograf was not redirecting with authentiation for Influx Enterprise Meta service
1. [#1095](https://github.com/influxdata/chronograf/pull/1095): Make logout button display again
1. [#1209](https://github.com/influxdata/chronograf/pull/1209): HipChat Kapacitor config now uses only the subdomain instead of asking for the entire HipChat URL.

View File

@ -15,7 +15,7 @@ func Convert(influxQL string) (chronograf.QueryConfig, error) {
}
raw := chronograf.QueryConfig{
RawText: query.String(),
RawText: influxQL,
Fields: []chronograf.Field{},
GroupBy: chronograf.GroupBy{
Tags: []string{},

42
influx/query_test.go Normal file
View File

@ -0,0 +1,42 @@
package influx
import (
"reflect"
"testing"
"github.com/influxdata/chronograf"
)
func TestConvert(t *testing.T) {
tests := []struct {
name string
influxQL string
want chronograf.QueryConfig
wantErr bool
}{
{
name: "Test named count field",
influxQL: `SELECT moving_average(mean("count"),14) FROM "usage_computed"."autogen".unique_clusters_by_day WHERE time > now() - 90d AND product = 'influxdb' group by time(1d)`,
want: chronograf.QueryConfig{
RawText: `SELECT moving_average(mean("count"),14) FROM "usage_computed"."autogen".unique_clusters_by_day WHERE time > now() - 90d AND product = 'influxdb' group by time(1d)`,
Fields: []chronograf.Field{},
Tags: map[string][]string{},
GroupBy: chronograf.GroupBy{
Tags: []string{},
},
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := Convert(tt.influxQL)
if (err != nil) != tt.wantErr {
t.Errorf("Convert() error = %v, wantErr %v", err, tt.wantErr)
return
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("Convert() = %#v, want %#v", got, tt.want)
}
})
}
}

View File

@ -246,7 +246,7 @@ func Test_newDashboardResponse(t *testing.T) {
{
Command: "SELECT donors from hill_valley_preservation_society where time > '1985-10-25 08:00:00'",
QueryConfig: chronograf.QueryConfig{
RawText: "SELECT donors FROM hill_valley_preservation_society WHERE time > '1985-10-25 08:00:00'",
RawText: "SELECT donors from hill_valley_preservation_society where time > '1985-10-25 08:00:00'",
Fields: []chronograf.Field{},
GroupBy: chronograf.GroupBy{
Tags: []string{},

View File

@ -100,7 +100,8 @@ export const LayoutRenderer = React.createClass({
// on a stable query representation.
let queryText
if (query.queryConfig) {
queryText = buildInfluxQLQuery(timeRange, query.queryConfig)
const {queryConfig: {rawText}} = query
queryText = rawText || buildInfluxQLQuery(timeRange, query.queryConfig)
} else {
queryText = this.buildQueryForOldQuerySchema(query)
}

View File

@ -57,6 +57,7 @@ $dash-graph-options-arrow: 8px;
left: 0;
}
.dash-graph--container {
z-index: 0;
user-select: none !important;
-o-user-select: none !important;
-moz-user-select: none !important;
@ -88,7 +89,7 @@ $dash-graph-options-arrow: 8px;
}
}
.dash-graph--heading {
z-index: 1;
z-index: 0;
user-select: none !important;
-o-user-select: none !important;
-moz-user-select: none !important;
@ -146,7 +147,7 @@ $dash-graph-options-arrow: 8px;
.dash-graph--options {
width: $dash-graph-heading;
position: absolute;
z-index: 2;
z-index: 1;
right: 0px;
top: 0px;