Show key value in builder textArea for map type template vals

pull/10616/head
ebb-tide 2018-07-03 13:57:01 -07:00
parent 3c554095b7
commit f6b4e1cf48
1 changed files with 5 additions and 1 deletions

View File

@ -24,9 +24,13 @@ class MapTemplateBuilder extends PureComponent<TemplateBuilderProps, State> {
public constructor(props: TemplateBuilderProps) {
super(props)
const templateValues = props.template.values.map(v => v.value)
const templateKeys = props.template.values.map(v => v.key)
const templateValuesString = templateKeys
.map((v, i) => `${v}, ${templateValues[i]}`)
.join('\n')
this.state = {
templateValuesString: templateValues.join(', '),
templateValuesString,
}
}