Skip to content

Commit

Permalink
Merge branch 'master' into upgrade-ag-grid
Browse files Browse the repository at this point in the history
  • Loading branch information
dnlkoch committed Oct 15, 2018
2 parents 0b9975a + 4e7376f commit 45e88a4
Show file tree
Hide file tree
Showing 21 changed files with 168 additions and 59 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"dependencies": {
"@turf/turf": "5.1.6",
"@terrestris/base-util": "0.1.1",
"@terrestris/ol-util": "1.3.0",
"@terrestris/ol-util": "1.5.0",
"ag-grid-community": "19.0.0",
"ag-grid-react": "19.0.0",
"lodash": "4.17.11",
Expand All @@ -89,13 +89,13 @@
"validator": "10.8.0"
},
"devDependencies": {
"antd": "3.9.3",
"antd": "3.10.1",
"babel-cli": "6.26.0",
"babel-core": "6.26.3",
"babel-eslint": "10.0.1",
"babel-jest": "23.4.2",
"babel-loader": "7.1.5",
"babel-plugin-dynamic-import-node": "2.1.0",
"babel-plugin-dynamic-import-node": "2.2.0",
"babel-plugin-import": "1.9.1",
"babel-plugin-transform-es2015-modules-commonjs": "6.26.2",
"babel-plugin-transform-import-extension-jsx-to-js": "0.1.0",
Expand All @@ -106,8 +106,8 @@
"canvas-prebuilt": "1.6.5-prerelease.1",
"coveralls": "3.0.2",
"css-loader": "1.0.0",
"enzyme": "3.6.0",
"enzyme-adapter-react-16": "1.5.0",
"enzyme": "3.7.0",
"enzyme-adapter-react-16": "1.6.0",
"eslint": "5.6.0",
"eslint-plugin-html": "4.0.6",
"eslint-plugin-markdown": "1.0.0-beta.7",
Expand All @@ -119,12 +119,12 @@
"np": "3.0.4",
"ol": "5.2.0",
"react": "16.5.2",
"react-styleguidist": "7.3.8",
"react-styleguidist": "7.3.10",
"react-test-renderer": "16.5.2",
"regenerator-runtime": "0.12.1",
"rimraf": "2.6.2",
"style-loader": "0.23.0",
"url-loader": "1.1.1",
"style-loader": "0.23.1",
"url-loader": "1.1.2",
"webpack": "4.20.2",
"whatwg-fetch": "3.0.0"
}
Expand Down
6 changes: 3 additions & 3 deletions src/Button/DigitizeButton/DigitizeButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ import React from 'react';
import PropTypes from 'prop-types';

import { Modal, Input } from 'antd';

const TextArea = Input.TextArea;

import isFunction from 'lodash/isFunction.js';

import OlMap from 'ol/Map';
import OlLayerVector from 'ol/layer/Vector';
import OlSourceVector from 'ol/source/Vector';
Expand All @@ -22,11 +19,14 @@ import OlInteractionModify from 'ol/interaction/Modify';
import OlInteractionTranslate from 'ol/interaction/Translate';
import { never, singleClick } from 'ol/events/condition';

import isFunction from 'lodash/isFunction';

import ToggleButton from '../ToggleButton/ToggleButton.jsx';
import MapUtil from '@terrestris/ol-util/src/MapUtil/MapUtil';
import StringUtil from '@terrestris/base-util/src/StringUtil/StringUtil';
import AnimateUtil from '@terrestris/ol-util/src/AnimateUtil/AnimateUtil';
import Logger from '@terrestris/base-util/src/Logger';

import { CSS_PREFIX } from '../../constants';

/**
Expand Down
5 changes: 3 additions & 2 deletions src/Button/MeasureButton/MeasureButton.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';

import isEmpty from 'lodash/isEmpty.js';

import OlMap from 'ol/Map';
import OlLayerVector from 'ol/layer/Vector';
import OlSourceVector from 'ol/source/Vector';
Expand All @@ -17,9 +15,12 @@ import OlInteractionDraw from 'ol/interaction/Draw';
import { unByKey } from 'ol/Observable';
import OlOverlay from 'ol/Overlay';

import isEmpty from 'lodash/isEmpty';

import ToggleButton from '../ToggleButton/ToggleButton.jsx';
import MeasureUtil from '@terrestris/ol-util/src/MeasureUtil/MeasureUtil';
import MapUtil from '@terrestris/ol-util/src/MapUtil/MapUtil';

import { CSS_PREFIX } from '../../constants';

import './MeasureButton.less';
Expand Down
4 changes: 3 additions & 1 deletion src/Button/ToggleButton/ToggleButton.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React from 'react';
import PropTypes from 'prop-types';

import {
Button,
Tooltip
} from 'antd';
import { Icon } from 'react-fa';
import isFunction from 'lodash/isFunction.js';

import isFunction from 'lodash/isFunction';

import './ToggleButton.less';

Expand Down
3 changes: 2 additions & 1 deletion src/Button/ToggleGroup/ToggleGroup.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import isFunction from 'lodash/isFunction.js';

import isFunction from 'lodash/isFunction';

import { CSS_PREFIX } from '../../constants';

Expand Down
6 changes: 4 additions & 2 deletions src/Container/AddWmsPanel/AddWmsPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ import { Checkbox } from 'antd';
import OlLayerTile from 'ol/layer/Tile';
import OlLayerImage from 'ol/layer/Image';
import OlMap from 'ol/Map';
import isFunction from 'lodash/isFunction.js';

import isFunction from 'lodash/isFunction';

import Panel from '../../Panel/Panel/Panel.jsx';
import Titlebar from '../../Panel/Titlebar/Titlebar.jsx';
import SimpleButton from '../../Button/SimpleButton/SimpleButton.jsx';
import Logger from '@terrestris/base-util/src/Logger';

import './AddWmsPanel.less';
import AddWmsLayerEntry from './AddWmsLayerEntry/AddWmsLayerEntry.jsx';

import './AddWmsPanel.less';

/**
* Panel containing a (checkable) list of AddWmsLayerEntry instances.
* This class can be used e.g with a result obtained by ol WMS capabilities
Expand Down
16 changes: 8 additions & 8 deletions src/Field/ScaleCombo/ScaleCombo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import React from 'react';
import PropTypes from 'prop-types';
import { Select } from 'antd';
const Option = Select.Option;

import OlMap from 'ol/Map';
import {
isInteger,
isEmpty,
isEqual,
isFunction,
reverse,
clone
} from 'lodash';

import isInteger from 'lodash/isInteger';
import isEmpty from 'lodash/isEmpty';
import isEqual from 'lodash/isEqual';
import isFunction from 'lodash/isFunction';
import reverse from 'lodash/reverse';
import clone from 'lodash/clone';

import Logger from '@terrestris/base-util/src/Logger';
import MapUtil from '@terrestris/ol-util/src/MapUtil/MapUtil';
Expand Down
13 changes: 8 additions & 5 deletions src/Field/WfsSearch/WfsSearch.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import React from 'react';
import PropTypes from 'prop-types';

import {
AutoComplete,
Spin
} from 'antd';
const Option = AutoComplete.Option;
import isFunction from 'lodash/isFunction.js';
import debounce from 'lodash/debounce.js';

import OlMap from 'ol/Map';
import OlFormatGeoJSON from 'ol/format/GeoJSON';

import isFunction from 'lodash/isFunction';
import debounce from 'lodash/debounce';

import Logger from '@terrestris/base-util/src/Logger';
import WfsFilterUtil from '@terrestris/ol-util/src/WfsFilterUtil/WfsFilterUtil';
import { CSS_PREFIX } from '../../constants';

import OlMap from 'ol/Map';
import OlFormatGeoJSON from 'ol/format/GeoJSON';
import { CSS_PREFIX } from '../../constants';

/**
* The WfsSearch field.
Expand Down
11 changes: 7 additions & 4 deletions src/Field/WfsSearchInput/WfsSearchInput.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import React from 'react';
import PropTypes from 'prop-types';

import {
Input,
Icon
} from 'antd';
import isFunction from 'lodash/isFunction.js';
import debounce from 'lodash/debounce.js';

import OlMap from 'ol/Map';

import isFunction from 'lodash/isFunction';
import debounce from 'lodash/debounce';

import Logger from '@terrestris/base-util/src/Logger';
import WfsFilterUtil from '@terrestris/ol-util/src/WfsFilterUtil/WfsFilterUtil';
import { CSS_PREFIX } from '../../constants';

import OlMap from 'ol/Map';
import { CSS_PREFIX } from '../../constants';

/**
* The WfsSearchInput field.
Expand Down
14 changes: 8 additions & 6 deletions src/Grid/AgFeatureGrid/AgFeatureGrid.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import React from 'react';
import PropTypes from 'prop-types';

import { AgGridReact } from 'ag-grid-react';
import differenceWith from 'lodash/differenceWith.js';
import isEqual from 'lodash/isEqual.js';
import isFunction from 'lodash/isFunction.js';
import kebabCase from 'lodash/kebabCase.js';

import OlStyle from 'ol/style/Style';
import OlStyleFill from 'ol/style/Fill';
import OlStyleCircle from 'ol/style/Circle';
Expand All @@ -16,12 +14,16 @@ import OlLayerVector from 'ol/layer/Vector';
import OlGeomGeometry from 'ol/geom/Geometry';
import OlGeomGeometryCollection from 'ol/geom/GeometryCollection';

import isArray from 'lodash/isArray';
import differenceWith from 'lodash/differenceWith';
import isEqual from 'lodash/isEqual';
import isFunction from 'lodash/isFunction';
import kebabCase from 'lodash/kebabCase';

import MapUtil from '@terrestris/ol-util/src/MapUtil/MapUtil';

import { CSS_PREFIX } from '../../constants';

import isArray from 'lodash/isArray.js';

import 'ag-grid-community/dist/styles/ag-grid.css';
import 'ag-grid-community/dist/styles/ag-theme-balham.css';
import 'ag-grid-community/dist/styles/ag-theme-fresh.css';
Expand Down
2 changes: 1 addition & 1 deletion src/Grid/AgFeatureGrid/AgFeatureGrid.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import OlSourceVector from 'ol/source/Vector';
import OlLayerVector from 'ol/layer/Vector';
import OlGeomGeometryCollection from 'ol/geom/GeometryCollection';

import differenceWith from 'lodash/differenceWith.js';
import differenceWith from 'lodash/differenceWith';

import TestUtil from '../../Util/TestUtil';

Expand Down
9 changes: 6 additions & 3 deletions src/Grid/FeatureGrid/FeatureGrid.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React from 'react';
import PropTypes from 'prop-types';

import { Table } from 'antd';
import isEqual from 'lodash/isEqual.js';
import isFunction from 'lodash/isFunction.js';
import kebabCase from 'lodash/kebabCase.js';

import OlStyle from 'ol/style/Style';
import OlStyleFill from 'ol/style/Fill';
import OlStyleCircle from 'ol/style/Circle';
Expand All @@ -15,6 +14,10 @@ import OlLayerVector from 'ol/layer/Vector';
import OlGeomGeometry from 'ol/geom/Geometry';
import OlGeomGeometryCollection from 'ol/geom/GeometryCollection';

import isEqual from 'lodash/isEqual';
import isFunction from 'lodash/isFunction';
import kebabCase from 'lodash/kebabCase';

import MapUtil from '@terrestris/ol-util/src/MapUtil/MapUtil';

import './FeatureGrid.less';
Expand Down
5 changes: 4 additions & 1 deletion src/Grid/PropertyGrid/PropertyGrid.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import React from 'react';
import PropTypes from 'prop-types';

import { Table } from 'antd';

import OlFeature from 'ol/Feature';
import get from 'lodash/get.js';

import get from 'lodash/get';

import { CSS_PREFIX } from '../../constants';

Expand Down
29 changes: 26 additions & 3 deletions src/HigherOrderComponent/TimeLayerAware/TimeLayerAware.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
import React from 'react';
import isArray from 'lodash/isArray.js';

import isArray from 'lodash/isArray';

/**
* Finds the key time in the passed object regardless of upper- or lowercase
* characters. Will return `TIME` (all uppercase) as a fallback.
*
* @param {Object} params The object to find the key in, basically the params of
* a WMS source that will end up as URL parameters.
* @return {String} The key for the time parameter, in the actual spelling.
*/
const findTimeParam = (params) => {
const keys = Object.keys(params);
let foundKey = 'TIME'; // fallback
keys.some(key => {
let lcKey = key && key.toLowerCase && key.toLowerCase();
if (lcKey === 'time') {
foundKey = key;
return true;
}
});
return foundKey;
};

/**
* HOC that updates layers based on the wrapped components time instant or
Expand All @@ -16,10 +38,11 @@ export function timeLayerAware(WrappedComponent, layers) {
layers.forEach(config => {
if (config.isWmsTime) {
const parms = config.layer.getSource().getParams();
const timeParam = findTimeParam(parms);
if (isArray(newValues)) {
parms.time = `${newValues[0]}/${newValues[1]}`;
parms[timeParam] = `${newValues[0]}/${newValues[1]}`;
} else {
parms.time = `${newValues}`;
parms[timeParam] = `${newValues}`;
}
config.layer.getSource().updateParams(parms);
}
Expand Down

0 comments on commit 45e88a4

Please sign in to comment.