diff --git a/web/client/components/data/featuregrid/DockedFeatureGrid.jsx b/web/client/components/data/featuregrid/DockedFeatureGrid.jsx index 03ef556b56..960f201de8 100644 --- a/web/client/components/data/featuregrid/DockedFeatureGrid.jsx +++ b/web/client/components/data/featuregrid/DockedFeatureGrid.jsx @@ -3,7 +3,7 @@ const {connect} = require('react-redux'); const {isObject} = require('lodash'); const Dock = require('react-dock'); -const {Modal, Panel, Grid, Row, Col, Button} = require('react-bootstrap'); +const {Modal} = require('react-bootstrap'); const FilterUtils = require('../../../utils/FilterUtils'); @@ -15,11 +15,12 @@ const FeatureGrid = connect((state) => { }; }, {})(require('./FeatureGrid')); -const LocaleUtils = require('../../../utils/LocaleUtils'); const I18N = require('../../../components/I18N/I18N'); const Spinner = require('react-spinkit'); const assign = require('object-assign'); +require("./featuregrid.css"); + const DockedFeatureGrid = React.createClass({ propTypes: { open: React.PropTypes.bool, @@ -60,7 +61,8 @@ const DockedFeatureGrid = React.createClass({ cleanError: React.PropTypes.func, selectAllToggle: React.PropTypes.func, templateProfile: React.PropTypes.string, - zoomToFeatureAction: React.PropTypes.func + zoomToFeatureAction: React.PropTypes.func, + style: React.PropTypes.object }, contextTypes: { messages: React.PropTypes.object @@ -129,10 +131,6 @@ const DockedFeatureGrid = React.createClass({ }, false); }, componentWillUpdate(nextProps) { - if (nextProps.initWidth !== this.props.initWidth) { - let height = getWindowSize().maxHeight - 108; - this.setState({width: `calc( ${this.props.initWidth} - 30px)`, height}); - } if (!nextProps.loadingGrid && nextProps.pagination && (nextProps.dataSourceOptions !== this.props.dataSourceOptions)) { this.dataSource = this.getDataSource(nextProps.dataSourceOptions); } @@ -193,24 +191,6 @@ const DockedFeatureGrid = React.createClass({ overflowSize: 20 }; }, - renderHeader() { - const header = LocaleUtils.getMessageById(this.context.messages, this.props.header); - - return ( -
- - - - {header} - - - - - - -
- ); - }, renderLoadingException(loadingError, msg) { let exception; if (isObject(loadingError)) { @@ -269,54 +249,53 @@ const DockedFeatureGrid = React.createClass({ position={"bottom" /* 'left', 'top', 'right', 'bottom' */} size={this.state.size} dimMode={"none" /*'transparent', 'none', 'opaque'*/} - isVisible={this.state.isVisible || true} + isVisible={true} onVisibleChange={this.handleVisibleChange} - onSizeChange={this.handleSizeChange} fluid={true} dimStyle={{ background: 'rgba(0, 0, 100, 0.2)' }} dockStyle={null} dockHiddenStyle={null} > - -
- -
Risultati - {this.props.totalFeatures !== -1 ? this.props.totalFeatures : ()}
- - + {this.props.loadingGrid ? +
+
+
- {this.props.loadingGrid ? (
-
- -
-
) : null} - +
: +
+ +
} ); } diff --git a/web/client/components/data/featuregrid/FeatureGrid.jsx b/web/client/components/data/featuregrid/FeatureGrid.jsx index 4b02925b91..72b355e363 100644 --- a/web/client/components/data/featuregrid/FeatureGrid.jsx +++ b/web/client/components/data/featuregrid/FeatureGrid.jsx @@ -63,7 +63,10 @@ const FeatureGrid = React.createClass({ columnDefs: null, changeMapView: () => {}, selectFeatures: () => {}, - style: {height: "400px", width: "800px"}, + style: { + height: "400px", + width: "800px" + }, virtualPaging: false, paging: false, overflowSize: 10, @@ -179,40 +182,44 @@ const FeatureGrid = React.createClass({ } return ( -
-
- ', - last: '>|', - first: '|<', - previous: '<'}} - onGridReady={this.onGridReady} - {...this.props.agGridOptions} - /> -
+
+
+ ', + last: '>|', + first: '|<', + previous: '<'}} + onGridReady={this.onGridReady} + {...this.props.agGridOptions} + /> +
- - {tools.map((tool) => tool)} - + + {tools.map((tool) => tool)} +
); }, // If props.columnDefs is missing try to generate from features, add zoomTo as first column diff --git a/web/client/components/data/featuregrid/ZoomToFeatureRenderer.jsx b/web/client/components/data/featuregrid/ZoomToFeatureRenderer.jsx index 2fb44d6707..017581d1a5 100644 --- a/web/client/components/data/featuregrid/ZoomToFeatureRenderer.jsx +++ b/web/client/components/data/featuregrid/ZoomToFeatureRenderer.jsx @@ -13,7 +13,7 @@ const ZoomToFeatureRenderer = React.createClass({ params: React.PropTypes.object }, render() { - const geometry = this.props.params.data.geometry; + const geometry = this.props.params && this.props.params.data && this.props.params.data.geometry; return geometry && geometry.coordinates ? ( ) : null; diff --git a/web/client/components/data/featuregrid/featuregrid.css b/web/client/components/data/featuregrid/featuregrid.css index e69de29bb2..d5ed283e9f 100644 --- a/web/client/components/data/featuregrid/featuregrid.css +++ b/web/client/components/data/featuregrid/featuregrid.css @@ -0,0 +1,5 @@ +.featuregrid .ag-header-cell, .ag-header-row{ + background-color: #078AA3; + color: white; + font-family: Raleway; +} diff --git a/web/client/components/data/query/queryform.css b/web/client/components/data/query/queryform.css index 7c2a574ef4..754a04afec 100644 --- a/web/client/components/data/query/queryform.css +++ b/web/client/components/data/query/queryform.css @@ -114,6 +114,7 @@ overflow-x: hidden; overflow-y: auto; border: none; + min-width: 700px; } .queryFormToolbar{ diff --git a/web/client/examples/queryform/components/Results.jsx b/web/client/examples/queryform/components/Results.jsx index c046905352..ff59c80fc9 100644 --- a/web/client/examples/queryform/components/Results.jsx +++ b/web/client/examples/queryform/components/Results.jsx @@ -13,7 +13,7 @@ const JSONViewer = require('../../../components/data/identify/viewers/JSONViewer const {Panel} = require('react-bootstrap'); const Draggable = require('react-draggable'); -const {resetQuery} = require('../actions/wfsquery'); +const {resetQuery} = require('../actions/query'); const Results = React.createClass({ propTypes: { diff --git a/web/client/plugins/FeatureGrid.jsx b/web/client/plugins/FeatureGrid.jsx index 4d89a0f02c..ff4f5a235e 100644 --- a/web/client/plugins/FeatureGrid.jsx +++ b/web/client/plugins/FeatureGrid.jsx @@ -6,6 +6,7 @@ * LICENSE file in the root directory of this source tree. */ const {connect} = require('react-redux'); +const {updateHighlighted} = require('../actions/highlight'); module.exports = { FeatureGridPlugin: connect((state) => ({ @@ -21,5 +22,8 @@ module.exports = { field: attr.attribute })), totalFeatures: state.query && state.query.result && state.query.result.totalFeatures - }))(require('../components/data/featuregrid/DockedFeatureGrid')) + }), + { + selectFeatures: updateHighlighted + })(require('../components/data/featuregrid/DockedFeatureGrid')) }; diff --git a/web/client/reducers/query.js b/web/client/reducers/query.js index 9c3823ee13..0b5528b439 100644 --- a/web/client/reducers/query.js +++ b/web/client/reducers/query.js @@ -68,7 +68,7 @@ const extractData = (feature) => { const initialState = { featureTypes: {}, data: {}, - result: '', + result: null, resultError: null }; @@ -108,14 +108,14 @@ function query(state = initialState, action) { } case QUERY_ERROR: { return assign({}, state, { - result: '', + result: null, resultError: action.error }); } case QUERY_FORM_RESET: case RESET_QUERY: { return assign({}, state, { - result: '', + result: null, resultError: null }); }