Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1247. Add style id to the style entry in selector #1250

Merged
merged 1 commit into from
Nov 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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