Add DocLabel to settings modal

This commit is contained in:
Lukas Martinelli 2017-01-09 22:37:21 +01:00
parent d739ca812c
commit a3caf8499c
2 changed files with 9 additions and 8 deletions

View file

@ -1,6 +1,6 @@
import React from 'react' import React from 'react'
import GlSpec from 'mapbox-gl-style-spec/reference/latest.min.js' import GlSpec from 'mapbox-gl-style-spec/reference/latest.js'
import JSONEditor from './JSONEditor' import JSONEditor from './JSONEditor'
import FilterEditor from '../filter/FilterEditor' import FilterEditor from '../filter/FilterEditor'
import PropertyGroup from '../fields/PropertyGroup' import PropertyGroup from '../fields/PropertyGroup'

View file

@ -1,5 +1,6 @@
import React from 'react' import React from 'react'
import GlSpec from 'mapbox-gl-style-spec/reference/latest.js'
import InputBlock from '../inputs/InputBlock' import InputBlock from '../inputs/InputBlock'
import StringInput from '../inputs/StringInput' import StringInput from '../inputs/StringInput'
import SelectInput from '../inputs/SelectInput' import SelectInput from '../inputs/SelectInput'
@ -43,42 +44,42 @@ class SettingsModal extends React.Component {
return <Modal return <Modal
isOpen={this.props.isOpen} isOpen={this.props.isOpen}
onOpenToggle={this.props.onOpenToggle} onOpenToggle={this.props.onOpenToggle}
title={'StyleSettings'} title={'Style Settings'}
> >
<InputBlock label={"Name"}> <InputBlock label={"Name"} doc={GlSpec['$root'].name.doc}>
<StringInput {...inputProps} <StringInput {...inputProps}
value={this.props.mapStyle.name} value={this.props.mapStyle.name}
onChange={this.changeStyleProperty.bind(this, "name")} onChange={this.changeStyleProperty.bind(this, "name")}
/> />
</InputBlock> </InputBlock>
<InputBlock label={"Owner"}> <InputBlock label={"Owner"} doc={"Owner ID of the style. Used by Mapbox or future style APIs."}>
<StringInput {...inputProps} <StringInput {...inputProps}
value={this.props.mapStyle.owner} value={this.props.mapStyle.owner}
onChange={this.changeStyleProperty.bind(this, "owner")} onChange={this.changeStyleProperty.bind(this, "owner")}
/> />
</InputBlock> </InputBlock>
<InputBlock label={"Sprite URL"}> <InputBlock label={"Sprite URL"} doc={GlSpec['$root'].sprite.doc}>
<StringInput {...inputProps} <StringInput {...inputProps}
value={this.props.mapStyle.sprite} value={this.props.mapStyle.sprite}
onChange={this.changeStyleProperty.bind(this, "sprite")} onChange={this.changeStyleProperty.bind(this, "sprite")}
/> />
</InputBlock> </InputBlock>
<InputBlock label={"Glyphs URL"}> <InputBlock label={"Glyphs URL"} doc={GlSpec['$root'].glyphs.doc}>
<StringInput {...inputProps} <StringInput {...inputProps}
value={this.props.mapStyle.glyphs} value={this.props.mapStyle.glyphs}
onChange={this.changeStyleProperty.bind(this, "glyphs")} onChange={this.changeStyleProperty.bind(this, "glyphs")}
/> />
</InputBlock> </InputBlock>
<InputBlock label={"Access Token"}> <InputBlock label={"Access Token"} doc={"Public access token for Mapbox GL."}>
<StringInput {...inputProps} <StringInput {...inputProps}
value={metadata['maputnik:access_token']} value={metadata['maputnik:access_token']}
onChange={this.changeMetadataProperty.bind(this, "maputnik:access_token")} onChange={this.changeMetadataProperty.bind(this, "maputnik:access_token")}
/> />
</InputBlock> </InputBlock>
<InputBlock label={"Style Renderer"}> <InputBlock label={"Style Renderer"} doc={"Choose the default Maputnik renderer for this style."}>
<SelectInput {...inputProps} <SelectInput {...inputProps}
options={[ options={[
['mbgljs', 'MapboxGL JS'], ['mbgljs', 'MapboxGL JS'],