[explorev2] using label in 'Visualization Type' Select instead of key (#1927)

* [explorev2] using label in 'Visualization Type' Select

* moved url related logic upstream in the caller
* moved option creation logic from render method to the constructor as
  it only needs to be executed once

* Refactoring out getOptions
This commit is contained in:
Maxime Beauchemin
2017-01-12 12:32:42 -08:00
committed by GitHub
parent 0ce7fc18a8
commit ff4020ea73
2 changed files with 43 additions and 23 deletions

View File

@@ -44,7 +44,11 @@ export const fields = {
label: 'Visualization Type',
clearable: false,
default: 'table',
choices: formatSelectOptions(Object.keys(visTypes)),
choices: Object.keys(visTypes).map(vt => [
vt,
visTypes[vt].label,
`/static/assets/images/viz_thumbnails/${vt}.png`,
]),
description: 'The type of visualization to display',
},