Change behavior of Template Variables autocomplete filtering in Query Editor to match from front of string only (#1474)

* Filter template variables by exact match from front of string

* Changedate uplog

* Use a more semantic method for filtering

* Clarify changebog
pull/10616/head
Jared Scheib 2017-05-15 10:50:48 -07:00 committed by GitHub
parent c74fbf5f17
commit 7766e75b05
2 changed files with 2 additions and 1 deletions

View File

@ -8,6 +8,7 @@
### Features
1. [#1477](https://github.com/influxdata/chronograf/pull/1477): Add ability to log alerts
1. [#1474](https://github.com/influxdata/chronograf/pull/1474): Change behavior of template variable autocomplete to filter by exact match from front of string
### UI Improvements
1. [#1451](https://github.com/influxdata/chronograf/pull/1451): Refactor scrollbars to support non-webkit browsers

View File

@ -164,7 +164,7 @@ class QueryEditor extends Component {
const start = this.editor.selectionStart
const end = this.editor.selectionEnd
const filteredTemplates = templates.filter(t =>
t.tempVar.includes(matched[0].substring(1))
t.tempVar.startsWith(matched[0])
)
const found = filteredTemplates.find(