DE tab names include measurement and all tag values

pull/2329/head
Luke Morris 2017-11-09 18:38:09 -08:00
parent 5ed210fff2
commit 045185cdab
1 changed files with 14 additions and 3 deletions

View File

@ -88,7 +88,14 @@ class ChronoTable extends Component {
) )
} }
makeTabName = ({name, tags}) => (tags ? `${name}.${tags[name]}` : name) makeTabName = ({name, tags}) => {
if (!tags) {
return name
}
const tagKeys = Object.keys(tags).sort()
const tagValues = tagKeys.map(key => tags[key]).join('.')
return `${name}.${tagValues}`
}
render() { render() {
const {containerWidth, height, query} = this.props const {containerWidth, height, query} = this.props
@ -135,9 +142,13 @@ class ChronoTable extends Component {
</div> </div>
: <Dropdown : <Dropdown
className="dropdown-160 table--tabs-dropdown" className="dropdown-160 table--tabs-dropdown"
items={series.map((s, index) => ({...s, text: s.name, index}))} items={series.map((s, index) => ({
...s,
text: this.makeTabName(s),
index,
}))}
onChoose={this.handleClickDropdown} onChoose={this.handleClickDropdown}
selected={series[activeSeriesIndex].name} selected={this.makeTabName(series[activeSeriesIndex])}
buttonSize="btn-xs" buttonSize="btn-xs"
/>} />}
<div className="table--tabs-content"> <div className="table--tabs-content">