Skip to content

Commit

Permalink
Fixed geosolutions-it#2809. Moved utility function in the proper place
Browse files Browse the repository at this point in the history
  • Loading branch information
offtherailz committed Apr 9, 2018
1 parent 99bafe5 commit 4192378
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion web/client/components/app/StandardApp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class StandardApp extends React.Component {
onPersist: onInit.bind(null, config)
}, {
initialState: this.parseInitialState(config.initialState, {
mode: this.props.mode || ConfigUtils.getBrowserProperties().mobile ? 'mobile' : 'desktop'
mode: this.props.mode || (ConfigUtils.getBrowserProperties().mobile ? 'mobile' : 'desktop')
}) || {defaultState: {}, mobile: {}}
});
this.store = this.props.appStore(this.props.pluginsDef.plugins, opts);
Expand Down
14 changes: 2 additions & 12 deletions web/client/observables/wfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,7 @@ const workaroundGEOS7233 = ({ totalFeatures, features, ...rest } = {}, { startIn
};

};
const getWFSFilterData = (filterObj) => {
let data;
if (typeof filterObj === 'string') {
data = filterObj;
} else {
data = filterObj.filterType === "OGC"
? FilterUtils.toOGCFilter(filterObj.featureTypeName, filterObj, filterObj.ogcVersion, filterObj.sortOptions, filterObj.hits)
: FilterUtils.toCQLFilter(filterObj);
}
return data;
};


const getPagination = (filterObj = {}, options = {}) =>
filterObj.pagination
Expand All @@ -100,7 +90,7 @@ const getPagination = (filterObj = {}, options = {}) =>
* @return {Observable} a stream that emits the GeoJSON or an error.
*/
const getJSONFeature = (searchUrl, filterObj, options = {}) => {
const data = getWFSFilterData(filterObj);
const data = FilterUtils.getWFSFilterData(filterObj);

const urlParsedObj = Url.parse(searchUrl, true);
let params = isObject(urlParsedObj.query) ? urlParsedObj.query : {};
Expand Down
2 changes: 0 additions & 2 deletions web/client/product/pages/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ const PropTypes = require('prop-types');
*/
const React = require('react');

require("../assets/css/maps.css");

const {connect} = require('react-redux');

const url = require('url');
Expand Down
11 changes: 11 additions & 0 deletions web/client/utils/FilterUtils.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,17 @@ const FilterUtils = {
ogcListField,
ogcBooleanField,
ogcStringField,
getWFSFilterData: (filterObj) => {
let data;
if (typeof filterObj === 'string') {
data = filterObj;
} else {
data = filterObj.filterType === "OGC"
? FilterUtils.toOGCFilter(filterObj.featureTypeName, filterObj, filterObj.ogcVersion, filterObj.sortOptions, filterObj.hits)
: FilterUtils.toCQLFilter(filterObj);
}
return data;
},
isLikeOrIlike: (operator) => operator === "ilike" || operator === "like",
isFilterValid: (f = {}) =>
(f.filterFields && f.filterFields.length > 0)
Expand Down

0 comments on commit 4192378

Please sign in to comment.