Skip to content

Commit efb1ef9

Browse files
author
kappu
committed
fixes on Lorenzo's commnets
1 parent 1c89162 commit efb1ef9

3 files changed

Lines changed: 17 additions & 9 deletions

File tree

web/client/components/manager/rulesmanager/RoiCql.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class RoiCql extends React.Component {
4949
lineNumbers: true,
5050
lineWrapping: true
5151
}}/>
52-
<Button style={{"float": "rigth"}} disabled={this.props.wkt === this.state.cql} text={LocaleUtils.getMessageById(this.context.messages, "rulesmanager.apply")} onClick={this.apply}/>
52+
<Button disabled={this.props.wkt === this.state.cql} text={LocaleUtils.getMessageById(this.context.messages, "rulesmanager.apply")} onClick={this.apply}/>
5353
</div>}
5454
</ContainerDimensions>);
5555
}

web/client/components/manager/rulesmanager/SimpleSpatialFilter.jsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ class SpatialFilter extends React.Component {
100100
</div>
101101
);
102102
};
103-
renderSpatialPanel = (drawLabel) => {
103+
renderSpatialPanel = () => {
104+
const showLabel = this.getMethodFromId(this.props.spatialField.method) && this.props.spatialField.method !== "CQL" && !this.props.spatialField.geometry;
104105
return (
105106
<Panel className="spatial-panel">
106107
{this.props.spatialMethodOptions.length > 1 ? this.renderSpatialHeader() : <span/>}
@@ -109,7 +110,13 @@ class SpatialFilter extends React.Component {
109110
)}
110111
<Row>
111112
<Col xs={12}>
112-
{drawLabel}
113+
{showLabel && (
114+
<span>
115+
<div className="m-label m-caption text-center">
116+
<I18N.Message msgId={"queryform.spatialfilter.draw_start_label"}/>
117+
</div>
118+
</span>)
119+
}
113120
</Col>
114121
</Row>
115122
</Panel>
@@ -128,10 +135,6 @@ class SpatialFilter extends React.Component {
128135
return buttons;
129136
};
130137
render() {
131-
let drawLabel = null;
132-
if ( this.getMethodFromId(this.props.spatialField.method) && this.props.spatialField.method !== "CQL" && !this.props.spatialField.geometry) {
133-
drawLabel = (<span><div className="m-label m-caption text-center"><I18N.Message msgId={"queryform.spatialfilter.draw_start_label"}/></div></span>);
134-
}
135138
return (
136139
<div className="query-filter-container">
137140
<SwitchPanel
@@ -142,7 +145,7 @@ class SpatialFilter extends React.Component {
142145
expanded={this.props.spatialPanelExpanded}
143146
onSwitch={(expanded) => this.props.actions.onExpandSpatialFilterPanel(expanded)}
144147
>
145-
{this.renderSpatialPanel(drawLabel)}
148+
{this.renderSpatialPanel()}
146149
</SwitchPanel>
147150
</div>
148151
);

web/client/components/map/enhancers/withDraw.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ state.draw || {}, {
1818
onDrawStopped: drawStopped,
1919
setCurrentStyle: setCurrentStyle
2020
});
21-
21+
/**
22+
* Add the draw tool to base-map. The draw support is already present in plugins but It needs
23+
* to be connected and added to tools to work.
24+
* It's possible to pass a connect function to override default connection to state and action
25+
* @param {function} connectFunction connect function to override default connection of the draw tool.
26+
*/
2227
module.exports = (connectFunction = defaultDrawConnect) => withPropsOnChange(
2328
['plugins'],
2429
({plugins}= {}) => {

0 commit comments

Comments
 (0)