Skip to content

Commit

Permalink
Fix #1247. Add style name to the style entry in selector (#1250)
Browse files Browse the repository at this point in the history
  • Loading branch information
offtherailz authored Nov 7, 2016
1 parent 311d212 commit ba7ff95
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion web/client/components/TOC/fragments/settings/WMSStyle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,20 @@ const WMSStyle = React.createClass({
// https://github.com/highsource/ogc-schemas/issues/183
return null;
},
renderItemLabel(item) {
return (<div>
<div key="item-title">{item.title || item.name}</div>
<div><small className="text-muted"key="item-key-description">{item.name}</small></div>
</div>);
},
renderError() {
if (this.props.element && this.props.element.capabilities && this.props.element && this.props.element.capabilities.error) {
return <Alert bsStyle="danger"><Message msgId="layerProperties.styleListLoadError" /></Alert>;
}
},
render() {
let options = [{label: "Default Style", value: ""}].concat((this.props.element.availableStyles || []).map((item) => {
return {label: item.title || item.name, value: item.name};
return {label: this.renderItemLabel(item), value: item.name};
}));
let currentStyleIndex = this.props.element.style && this.props.element.availableStyles && this.props.element.availableStyles.findIndex( el => el.name === this.props.element.style);
if (!(currentStyleIndex >= 0) && this.props.element.style) {
Expand Down

0 comments on commit ba7ff95

Please sign in to comment.