diff --git a/.eslintrc.js b/.eslintrc.js index 2f536ec29..b9c533a2f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -24,6 +24,7 @@ module.exports = { }, }, "plugins": [ + "perfectionist", // https://github.com/azat-io/eslint-plugin-perfectionist "react" // https://github.com/yannickcr/eslint-plugin-react ], "extends": [ @@ -175,7 +176,37 @@ module.exports = { "react/sort-prop-types": 2, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-prop-types.md "react/no-did-mount-set-state": [2, "disallow-in-func"], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-mount-set-state.md "react/self-closing-comp": 2, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md - "react/jsx-wrap-multilines": 2, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-wrap-multilines.md - "react/no-access-state-in-setstate": "error" + "react/jsx-wrap-multilines": 2, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-wrap-multilines.md + "react/no-access-state-in-setstate": "error", + +/** + * Perfectionist // https://github.com/azat-io/eslint-plugin-perfectionist + */ + "perfectionist/sort-imports": [ // https://eslint-plugin-perfectionist.azat.io/rules/sort-imports + "error", + { + "type": "natural", + "order": "asc", + "groups": [ + "type", + "react", + ["builtin", "external"], + "internal-type", + "internal", + ["parent-type", "sibling-type", "index-type"], + ["parent", "sibling", "index"], + "side-effect", + "style", + "object", + "unknown" + ], + "custom-groups": { + "value": { + "react": ["react", "react-*"] + } + }, + "newlines-between": "always" + } + ] } } diff --git a/actions/browser.js b/actions/browser.js index 8d225b86e..1a34eef78 100644 --- a/actions/browser.js +++ b/actions/browser.js @@ -7,8 +7,8 @@ * LICENSE file in the root directory of this source tree. */ -import ReducerIndex from '../reducers/index'; import browserReducer from '../reducers/browser'; +import ReducerIndex from '../reducers/index'; ReducerIndex.register("browser", browserReducer); export const CHANGE_BROWSER_PROPERTIES = 'CHANGE_BROWSER_PROPERTIES'; diff --git a/actions/display.js b/actions/display.js index 1d95ec7bc..7a94b590c 100644 --- a/actions/display.js +++ b/actions/display.js @@ -6,8 +6,8 @@ * LICENSE file in the root directory of this source tree. */ -import ReducerIndex from '../reducers/index'; import displayReducer from '../reducers/display'; +import ReducerIndex from '../reducers/index'; ReducerIndex.register("display", displayReducer); export const TOGGLE_FULLSCREEN = 'TOGGLE_FULLSCREEN'; diff --git a/actions/editing.js b/actions/editing.js index 56a5faeec..13375a823 100644 --- a/actions/editing.js +++ b/actions/editing.js @@ -6,8 +6,8 @@ * LICENSE file in the root directory of this source tree. */ -import ReducerIndex from '../reducers/index'; import editingReducer from '../reducers/editing'; +import ReducerIndex from '../reducers/index'; ReducerIndex.register("editing", editingReducer); export const SET_EDIT_CONTEXT = 'SET_EDIT_CONTEXT'; diff --git a/actions/identify.js b/actions/identify.js index 0f8133f9e..63bf9d7c3 100644 --- a/actions/identify.js +++ b/actions/identify.js @@ -6,8 +6,8 @@ * LICENSE file in the root directory of this source tree. */ -import ReducerIndex from '../reducers/index'; import identifyReducer from '../reducers/identify'; +import ReducerIndex from '../reducers/index'; ReducerIndex.register("identify", identifyReducer); import ConfigUtils from '../utils/ConfigUtils'; diff --git a/actions/locale.js b/actions/locale.js index 9d395c716..935cba9c2 100644 --- a/actions/locale.js +++ b/actions/locale.js @@ -11,11 +11,12 @@ import ReducerIndex from '../reducers/index'; import localeReducer from '../reducers/locale'; ReducerIndex.register("locale", localeReducer); -import axios from 'axios'; import {getLanguageCountries} from '@ladjs/country-language'; +import axios from 'axios'; +import deepmerge from 'deepmerge'; + import ConfigUtils from '../utils/ConfigUtils'; import {UrlParams} from '../utils/PermaLinkUtils'; -import deepmerge from 'deepmerge'; export const CHANGE_LOCALE = 'CHANGE_LOCALE'; diff --git a/actions/search.js b/actions/search.js index 43270df39..091154396 100644 --- a/actions/search.js +++ b/actions/search.js @@ -10,8 +10,8 @@ import ReducerIndex from '../reducers/index'; import searchReducer from '../reducers/search'; ReducerIndex.register("search", searchReducer); -import {v1 as uuidv1} from 'uuid'; import axios from 'axios'; +import {v1 as uuidv1} from 'uuid'; export const SEARCH_CHANGE = 'SEARCH_CHANGE'; export const SEARCH_SET_REQUEST = 'SEARCH_SET_REQUEST'; diff --git a/actions/task.js b/actions/task.js index 7f37e679e..b60ff9bc6 100644 --- a/actions/task.js +++ b/actions/task.js @@ -10,12 +10,12 @@ import ReducerIndex from '../reducers/index'; import taskReducer from '../reducers/task'; ReducerIndex.register("task", taskReducer); -import {setIdentifyEnabled} from './identify'; -import {showIframeDialog} from './windows'; import ConfigUtils from '../utils/ConfigUtils'; import CoordinatesUtils from '../utils/CoordinatesUtils'; import MapUtils from '../utils/MapUtils'; import {UrlParams} from '../utils/PermaLinkUtils'; +import {setIdentifyEnabled} from './identify'; +import {showIframeDialog} from './windows'; export const SET_CURRENT_TASK = 'SET_CURRENT_TASK'; export const SET_CURRENT_TASK_BLOCKED = 'SET_CURRENT_TASK_BLOCKED'; diff --git a/actions/theme.js b/actions/theme.js index 71de49bc3..60c4f9e55 100644 --- a/actions/theme.js +++ b/actions/theme.js @@ -11,13 +11,14 @@ import themeReducer from '../reducers/theme'; ReducerIndex.register("theme", themeReducer); import isEmpty from 'lodash.isempty'; + import {setIdentifyEnabled} from '../actions/identify'; import {setCurrentTask} from '../actions/task'; import ConfigUtils from '../utils/ConfigUtils'; import CoordinatesUtils from '../utils/CoordinatesUtils'; -import MapUtils from '../utils/MapUtils'; import LayerUtils from '../utils/LayerUtils'; import LocaleUtils from '../utils/LocaleUtils'; +import MapUtils from '../utils/MapUtils'; import {UrlParams} from '../utils/PermaLinkUtils'; import ServiceLayerUtils from '../utils/ServiceLayerUtils'; import ThemeUtils from '../utils/ThemeUtils'; diff --git a/components/AppMenu.jsx b/components/AppMenu.jsx index b60b6b29a..4a7fa8528 100644 --- a/components/AppMenu.jsx +++ b/components/AppMenu.jsx @@ -7,22 +7,25 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; -import mousetrap from 'mousetrap'; + +import classnames from 'classnames'; import {remove as removeDiacritics} from 'diacritics'; import isEmpty from 'lodash.isempty'; -import classnames from 'classnames'; -import {setMenuMargin} from '../actions/windows'; +import isEqual from 'lodash.isequal'; +import mousetrap from 'mousetrap'; +import PropTypes from 'prop-types'; + import {setCurrentTask} from '../actions/task'; +import {setMenuMargin} from '../actions/windows'; import InputContainer from '../components/InputContainer'; -import LocaleUtils from '../utils/LocaleUtils'; import ConfigUtils from '../utils/ConfigUtils'; +import LocaleUtils from '../utils/LocaleUtils'; import MiscUtils from '../utils/MiscUtils'; import ThemeUtils from '../utils/ThemeUtils'; import Icon from './Icon'; + import './style/AppMenu.css'; -import isEqual from 'lodash.isequal'; class AppMenu extends React.Component { diff --git a/components/AttributeForm.jsx b/components/AttributeForm.jsx index 5424c3176..bd486ec3c 100644 --- a/components/AttributeForm.jsx +++ b/components/AttributeForm.jsx @@ -7,20 +7,23 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; -import isEmpty from 'lodash.isempty'; + import clone from 'clone'; +import isEmpty from 'lodash.isempty'; +import PropTypes from 'prop-types'; import {v1 as uuidv1} from 'uuid'; + import {setEditContext, clearEditContext, getFeatureTemplate} from '../actions/editing'; -import {setCurrentTaskBlocked} from '../actions/task'; import {LayerRole, refreshLayer} from '../actions/layers'; +import {setCurrentTaskBlocked} from '../actions/task'; +import CoordinatesUtils from '../utils/CoordinatesUtils'; +import LocaleUtils from '../utils/LocaleUtils'; import AutoEditForm from './AutoEditForm'; import LinkFeatureForm from './LinkFeatureForm'; import QtDesignerForm from './QtDesignerForm'; import ButtonBar from './widgets/ButtonBar'; -import CoordinatesUtils from '../utils/CoordinatesUtils'; -import LocaleUtils from '../utils/LocaleUtils'; + import './style/AttributeForm.css'; class AttributeForm extends React.Component { @@ -321,7 +324,7 @@ class AttributeForm extends React.Component { } } }; - checkValidity = (form, changed=false) => { + checkValidity = (form, changed = false) => { if (form) { this.setState({formValid: form.checkValidity()}); if (changed) { diff --git a/components/AutoEditForm.jsx b/components/AutoEditForm.jsx index 0e4455f80..007e3849a 100644 --- a/components/AutoEditForm.jsx +++ b/components/AutoEditForm.jsx @@ -7,12 +7,15 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; -import omit from 'lodash.omit'; import NumericInput from 'react-numeric-input2'; + +import omit from 'lodash.omit'; +import PropTypes from 'prop-types'; + import EditComboField from './EditComboField'; import EditUploadField from './EditUploadField'; import ToggleSwitch from './widgets/ToggleSwitch'; + import './style/AutoEditForm.css'; export default class AutoEditForm extends React.Component { diff --git a/components/CoordinateDisplayer.jsx b/components/CoordinateDisplayer.jsx index 880bc2e0b..44ae4928e 100644 --- a/components/CoordinateDisplayer.jsx +++ b/components/CoordinateDisplayer.jsx @@ -7,8 +7,10 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import PropTypes from 'prop-types'; + import CoordinatesUtils from '../utils/CoordinatesUtils'; import LocaleUtils from '../utils/LocaleUtils'; diff --git a/components/EditComboField.jsx b/components/EditComboField.jsx index d2edef4c3..be0a84de1 100644 --- a/components/EditComboField.jsx +++ b/components/EditComboField.jsx @@ -7,7 +7,9 @@ */ import React from 'react'; + import PropTypes from 'prop-types'; + import LocaleUtils from '../utils/LocaleUtils'; diff --git a/components/EditUploadField.jsx b/components/EditUploadField.jsx index 180438bb9..7d18e31c9 100644 --- a/components/EditUploadField.jsx +++ b/components/EditUploadField.jsx @@ -7,15 +7,18 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; + import mime from 'mime-to-extensions'; -import Icon from './Icon'; +import PropTypes from 'prop-types'; import {v1 as uuidv1} from 'uuid'; -import ModalDialog from './ModalDialog'; -import ButtonBar from './widgets/ButtonBar'; + import ConfigUtils from '../utils/ConfigUtils'; -import LocaleUtils from '../utils/LocaleUtils'; import {showImageEditor} from '../utils/ImageEditor'; +import LocaleUtils from '../utils/LocaleUtils'; +import Icon from './Icon'; +import ModalDialog from './ModalDialog'; +import ButtonBar from './widgets/ButtonBar'; + import './style/EditUploadField.css'; diff --git a/components/FullscreenSwitcher.jsx b/components/FullscreenSwitcher.jsx index c09c30775..697481571 100644 --- a/components/FullscreenSwitcher.jsx +++ b/components/FullscreenSwitcher.jsx @@ -7,10 +7,13 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import PropTypes from 'prop-types'; + import {toggleFullscreen} from '../actions/display'; import LocaleUtils from '../utils/LocaleUtils'; + import './style/FullscreenSwitcher.css'; class FullscreenSwitcher extends React.Component { diff --git a/components/Icon.jsx b/components/Icon.jsx index e386ba1f8..cc8d8c9be 100644 --- a/components/Icon.jsx +++ b/components/Icon.jsx @@ -7,10 +7,13 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; + import classnames from 'classnames'; +import PropTypes from 'prop-types'; + import ConfigUtils from '../utils/ConfigUtils'; import LocaleUtils from '../utils/LocaleUtils'; + import './style/Icon.css'; export default class Icon extends React.Component { diff --git a/components/IdentifyViewer.jsx b/components/IdentifyViewer.jsx index b69436ea9..476b2a94d 100644 --- a/components/IdentifyViewer.jsx +++ b/components/IdentifyViewer.jsx @@ -6,16 +6,18 @@ * LICENSE file in the root directory of this source tree. */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; -import isEmpty from 'lodash.isempty'; + +import clone from 'clone'; import FileSaver from 'file-saver'; import htmlReactParser, {domToReact} from 'html-react-parser'; -import clone from 'clone'; -import omit from 'lodash.omit'; import JSZip from 'jszip'; -import {LayerRole, addLayerFeatures, removeLayer} from '../actions/layers'; +import isEmpty from 'lodash.isempty'; +import omit from 'lodash.omit'; +import PropTypes from 'prop-types'; + import {setActiveLayerInfo} from '../actions/layerinfo'; +import {LayerRole, addLayerFeatures, removeLayer} from '../actions/layers'; import {zoomToExtent} from '../actions/map'; import {openExternalUrl} from '../actions/task'; import ConfigUtils from '../utils/ConfigUtils'; @@ -25,6 +27,7 @@ import LocaleUtils from '../utils/LocaleUtils'; import MiscUtils from '../utils/MiscUtils'; import VectorLayerUtils from '../utils/VectorLayerUtils'; import Icon from './Icon'; + import './style/IdentifyViewer.css'; @@ -159,19 +162,19 @@ class IdentifyViewer extends React.Component { displayResultTree: PropTypes.bool, enableExport: PropTypes.oneOfType([PropTypes.bool, PropTypes.array]), exportGeometry: PropTypes.bool, + highlightAllResults: PropTypes.bool, identifyResults: PropTypes.object, iframeDialogsInitiallyDocked: PropTypes.bool, layers: PropTypes.array, longAttributesDisplay: PropTypes.oneOf(['ellipsis', 'wrap']), mapcrs: PropTypes.string, + openExternalUrl: PropTypes.func, removeLayer: PropTypes.func, replaceImageUrls: PropTypes.bool, setActiveLayerInfo: PropTypes.func, - openExternalUrl: PropTypes.func, showLayerTitles: PropTypes.bool, theme: PropTypes.object, - zoomToExtent: PropTypes.func, - highlightAllResults: PropTypes.bool + zoomToExtent: PropTypes.func }; static defaultProps = { longAttributesDisplay: 'ellipsis', diff --git a/components/ImportLayer.jsx b/components/ImportLayer.jsx index e2def70e0..d7f7f1017 100644 --- a/components/ImportLayer.jsx +++ b/components/ImportLayer.jsx @@ -7,25 +7,28 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; -import isEmpty from 'lodash.isempty'; + import axios from 'axios'; -import url from 'url'; -import Proj4js from 'proj4'; +import isEmpty from 'lodash.isempty'; import {WorkerMessageHandler} from "pdfjs-dist/build/pdf.worker"; -import LayerCatalogWidget from './widgets/LayerCatalogWidget'; -import Spinner from './Spinner'; -import EditableSelect from '../components/widgets/EditableSelect'; +import Proj4js from 'proj4'; +import PropTypes from 'prop-types'; +import url from 'url'; + import {addLayer, addLayerFeatures} from '../actions/layers'; -import FileSelector from './widgets/FileSelector'; +import EditableSelect from '../components/widgets/EditableSelect'; import ConfigUtils from '../utils/ConfigUtils'; import CoordinatesUtils from '../utils/CoordinatesUtils'; import LocaleUtils from '../utils/LocaleUtils'; +import MiscUtils from '../utils/MiscUtils'; import ServiceLayerUtils from '../utils/ServiceLayerUtils'; import VectorLayerUtils from '../utils/VectorLayerUtils'; +import Spinner from './Spinner'; +import FileSelector from './widgets/FileSelector'; +import LayerCatalogWidget from './widgets/LayerCatalogWidget'; + import './style/ImportLayer.css'; -import MiscUtils from '../utils/MiscUtils'; class ImportLayer extends React.Component { diff --git a/components/InputContainer.jsx b/components/InputContainer.jsx index 40d651602..590c51b70 100644 --- a/components/InputContainer.jsx +++ b/components/InputContainer.jsx @@ -7,8 +7,10 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; + import classnames from 'classnames'; +import PropTypes from 'prop-types'; + import './style/InputContainer.css'; export default class InputContainer extends React.Component { diff --git a/components/LayerInfoWindow.jsx b/components/LayerInfoWindow.jsx index b4a7bba90..049815e20 100644 --- a/components/LayerInfoWindow.jsx +++ b/components/LayerInfoWindow.jsx @@ -7,15 +7,18 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import PropTypes from 'prop-types'; + import {setActiveLayerInfo} from '../actions/layerinfo'; import ResizeableWindow from '../components/ResizeableWindow'; -import {Image} from './widgets/Primitives'; import LayerUtils from '../utils/LayerUtils'; import LocaleUtils from '../utils/LocaleUtils'; import MapUtils from '../utils/MapUtils'; import MiscUtils from '../utils/MiscUtils'; +import {Image} from './widgets/Primitives'; + import './style/LayerInfoWindow.css'; class LayerInfoWindow extends React.Component { diff --git a/components/LinkFeatureForm.jsx b/components/LinkFeatureForm.jsx index 9038eafac..03075354b 100644 --- a/components/LinkFeatureForm.jsx +++ b/components/LinkFeatureForm.jsx @@ -7,13 +7,16 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import PropTypes from 'prop-types'; + import {setEditContext, getFeatureTemplate} from '../actions/editing'; import {LayerRole, addLayerFeatures, removeLayer} from '../actions/layers'; -import AttributeForm from './AttributeForm'; import LocaleUtils from '../utils/LocaleUtils'; import MapUtils from '../utils/MapUtils'; +import AttributeForm from './AttributeForm'; + import './style/LinkFeatureForm.css'; class LinkFeatureForm extends React.Component { diff --git a/components/Localized.jsx b/components/Localized.jsx index 3bb651270..fd5bbaef6 100644 --- a/components/Localized.jsx +++ b/components/Localized.jsx @@ -7,10 +7,10 @@ * LICENSE file in the root directory of this source tree. */ import React from 'react'; -import PropTypes from 'prop-types'; +import {IntlProvider} from 'react-intl'; import {connect} from 'react-redux'; -import {IntlProvider} from 'react-intl'; +import PropTypes from 'prop-types'; class Localized extends React.Component { static propTypes = { diff --git a/components/MapSelection.jsx b/components/MapSelection.jsx index e6af3049e..24fc6a501 100644 --- a/components/MapSelection.jsx +++ b/components/MapSelection.jsx @@ -7,9 +7,11 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import ol from 'openlayers'; +import PropTypes from 'prop-types'; + import FeatureStyles from '../utils/FeatureStyles'; import MapUtils from '../utils/MapUtils'; import MeasureUtils from '../utils/MeasureUtils'; diff --git a/components/MessageBar.jsx b/components/MessageBar.jsx index e1aa97248..78a18c8a4 100644 --- a/components/MessageBar.jsx +++ b/components/MessageBar.jsx @@ -7,9 +7,12 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import PropTypes from 'prop-types'; + import Icon from './Icon'; + import './style/MessageBar.css'; class MessageBar extends React.Component { diff --git a/components/ModalDialog.jsx b/components/ModalDialog.jsx index f85b662b5..4a34eceba 100644 --- a/components/ModalDialog.jsx +++ b/components/ModalDialog.jsx @@ -8,8 +8,11 @@ import React from 'react'; import ReactDOM from 'react-dom'; + import PropTypes from 'prop-types'; + import Icon from './Icon'; + import './style/ModalDialog.css'; diff --git a/components/NumericInputWindow.jsx b/components/NumericInputWindow.jsx index 69b2c099a..f5781e3c1 100644 --- a/components/NumericInputWindow.jsx +++ b/components/NumericInputWindow.jsx @@ -7,18 +7,21 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import PropTypes from 'prop-types'; import {createSelector} from 'reselect'; + import {addLayerFeatures, LayerRole, removeLayer} from '../actions/layers'; -import ResizeableWindow from './ResizeableWindow'; import displayCrsSelector from '../selectors/displaycrs'; +import CoordinatesUtils from '../utils/CoordinatesUtils'; import LocaleUtils from '../utils/LocaleUtils'; -import './style/NumericInputWindow.css'; +import VectorLayerUtils from '../utils/VectorLayerUtils'; import Icon from './Icon'; +import ResizeableWindow from './ResizeableWindow'; import TextInput from './widgets/TextInput'; -import CoordinatesUtils from '../utils/CoordinatesUtils'; -import VectorLayerUtils from '../utils/VectorLayerUtils'; + +import './style/NumericInputWindow.css'; class NumericInputWindow extends React.Component { diff --git a/components/PickFeature.jsx b/components/PickFeature.jsx index 85bbaeb66..489603b45 100644 --- a/components/PickFeature.jsx +++ b/components/PickFeature.jsx @@ -7,13 +7,16 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import isEmpty from 'lodash.isempty'; +import PropTypes from 'prop-types'; + import {LayerRole, addLayerFeatures, clearLayer} from '../actions/layers'; import IdentifyUtils from '../utils/IdentifyUtils'; import LayerUtils from '../utils/LayerUtils'; import PopupMenu from './PopupMenu'; + import './style/PickFeature.css'; diff --git a/components/PluginsContainer.jsx b/components/PluginsContainer.jsx index fe508b18d..f8b5c99a0 100644 --- a/components/PluginsContainer.jsx +++ b/components/PluginsContainer.jsx @@ -7,8 +7,10 @@ * LICENSE file in the root directory of this source tree. */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import PropTypes from 'prop-types'; + import WindowManager from './WindowManager'; import './style/PluginsContainer.css'; diff --git a/components/PopupMenu.jsx b/components/PopupMenu.jsx index 8e6b328d6..759808532 100644 --- a/components/PopupMenu.jsx +++ b/components/PopupMenu.jsx @@ -1,5 +1,6 @@ import React from 'react'; import ReactDOM from 'react-dom'; + import PropTypes from 'prop-types'; export default class PopupMenu extends React.Component { diff --git a/components/PrintFrame.jsx b/components/PrintFrame.jsx index d2858b9cd..bceda254a 100644 --- a/components/PrintFrame.jsx +++ b/components/PrintFrame.jsx @@ -7,9 +7,12 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; + import isEqual from 'lodash.isequal'; +import PropTypes from 'prop-types'; + import MapUtils from '../utils/MapUtils'; + import './style/PrintFrame.css'; export default class PrintFrame extends React.Component { diff --git a/components/QtDesignerForm.jsx b/components/QtDesignerForm.jsx index 9d6e650fc..65b3bb08d 100644 --- a/components/QtDesignerForm.jsx +++ b/components/QtDesignerForm.jsx @@ -8,21 +8,23 @@ import React from 'react'; import {connect} from 'react-redux'; -import PropTypes from 'prop-types'; + import axios from 'axios'; -import xml2js from 'xml2js'; -import {v1 as uuidv1} from 'uuid'; import isEmpty from 'lodash.isempty'; -import ButtonBar from './widgets/ButtonBar'; -import DateTimeInput from './widgets/DateTimeInput'; -import TextInput from './widgets/TextInput'; -import EditComboField, {KeyValCache} from './EditComboField'; -import EditUploadField from './EditUploadField'; -import Spinner from './Spinner'; +import PropTypes from 'prop-types'; +import {v1 as uuidv1} from 'uuid'; +import xml2js from 'xml2js'; + import ConfigUtils from '../utils/ConfigUtils'; import LocaleUtils from '../utils/LocaleUtils'; import MiscUtils from '../utils/MiscUtils'; +import EditComboField, {KeyValCache} from './EditComboField'; +import EditUploadField from './EditUploadField'; import Icon from './Icon'; +import Spinner from './Spinner'; +import ButtonBar from './widgets/ButtonBar'; +import DateTimeInput from './widgets/DateTimeInput'; +import TextInput from './widgets/TextInput'; import './style/QtDesignerForm.css'; diff --git a/components/ResizeableWindow.jsx b/components/ResizeableWindow.jsx index f6c66089a..91974623c 100644 --- a/components/ResizeableWindow.jsx +++ b/components/ResizeableWindow.jsx @@ -7,15 +7,18 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; -import classnames from 'classnames'; import {connect} from 'react-redux'; import {Rnd} from 'react-rnd'; + +import classnames from 'classnames'; +import PropTypes from 'prop-types'; import {v1 as uuidv1} from 'uuid'; + import {raiseWindow, registerWindow, unregisterWindow, setSplitScreen} from '../actions/windows'; import ConfigUtils from '../utils/ConfigUtils'; import LocaleUtils from '../utils/LocaleUtils'; import Icon from './Icon'; + import './style/ResizeableWindow.css'; const WINDOW_GEOMETRIES = {}; diff --git a/components/Search.jsx b/components/Search.jsx index 8ff1dcc19..569db584d 100644 --- a/components/Search.jsx +++ b/components/Search.jsx @@ -7,24 +7,23 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import axios from 'axios'; -import {createSelector} from 'reselect'; import classnames from 'classnames'; import isEmpty from 'lodash.isempty'; import isEqual from 'lodash.isequal'; -import Icon from './Icon'; -import Spinner from './Spinner'; -import MessageBar from './MessageBar'; +import PropTypes from 'prop-types'; +import {createSelector} from 'reselect'; + import {LayerRole, addLayerFeatures, removeLayer, addLayer, addThemeSublayer, changeLayerProperty} from '../actions/layers'; import {zoomToPoint, zoomToExtent} from '../actions/map'; import {changeSearch, startSearch, searchMore, setCurrentSearchResult, SearchResultType} from '../actions/search'; import {setCurrentTask} from '../actions/task'; import {setCurrentTheme} from '../actions/theme'; import {showNotification} from '../actions/windows'; -import searchProvidersSelector from '../selectors/searchproviders'; import displayCrsSelector from '../selectors/displaycrs'; +import searchProvidersSelector from '../selectors/searchproviders'; import ConfigUtils from '../utils/ConfigUtils'; import CoordinatesUtils from '../utils/CoordinatesUtils'; import LayerUtils from '../utils/LayerUtils'; @@ -33,6 +32,10 @@ import MapUtils from '../utils/MapUtils'; import MiscUtils from '../utils/MiscUtils'; import {UrlParams} from '../utils/PermaLinkUtils'; import VectorLayerUtils from '../utils/VectorLayerUtils'; +import Icon from './Icon'; +import MessageBar from './MessageBar'; +import Spinner from './Spinner'; + import './style/Search.css'; class Search extends React.Component { diff --git a/components/SearchBox.jsx b/components/SearchBox.jsx index 7994315d1..2590c3bff 100644 --- a/components/SearchBox.jsx +++ b/components/SearchBox.jsx @@ -7,39 +7,42 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; -import {createSelector} from 'reselect'; -import isEmpty from 'lodash.isempty'; + import axios from 'axios'; -import {v1 as uuidv1} from 'uuid'; import classnames from 'classnames'; -import polygonIntersectTest from 'polygon-intersect-test'; +import isEmpty from 'lodash.isempty'; import pointInPolygon from 'point-in-polygon'; -import {SearchResultType} from '../actions/search'; +import polygonIntersectTest from 'polygon-intersect-test'; +import PropTypes from 'prop-types'; +import {createSelector} from 'reselect'; +import {v1 as uuidv1} from 'uuid'; + +import {LayerRole, addLayerFeatures, addThemeSublayer, removeLayer, addLayer} from '../actions/layers'; import {logAction} from '../actions/logging'; import {panTo, zoomToExtent, zoomToPoint} from '../actions/map'; -import {LayerRole, addLayerFeatures, addThemeSublayer, removeLayer, addLayer} from '../actions/layers'; -import {setCurrentTheme} from '../actions/theme'; +import {SearchResultType} from '../actions/search'; import {openExternalUrl, setCurrentTask} from '../actions/task'; +import {setCurrentTheme} from '../actions/theme'; import {showNotification} from '../actions/windows'; -import MapSelection from './MapSelection'; -import Icon from './Icon'; -import InputContainer from './InputContainer'; -import Spinner from './Spinner'; -import ButtonBar from './widgets/ButtonBar'; -import ComboBox from './widgets/ComboBox'; -import NumberInput from './widgets/NumberInput'; import displayCrsSelector from '../selectors/displaycrs'; import searchProvidersSelector from '../selectors/searchproviders'; import ConfigUtils from '../utils/ConfigUtils'; +import CoordinatesUtils from '../utils/CoordinatesUtils'; import LayerUtils from '../utils/LayerUtils'; import LocaleUtils from '../utils/LocaleUtils'; -import CoordinatesUtils from '../utils/CoordinatesUtils'; -import VectorLayerUtils from '../utils/VectorLayerUtils'; import MapUtils from '../utils/MapUtils'; import MiscUtils from '../utils/MiscUtils'; import {UrlParams} from '../utils/PermaLinkUtils'; +import VectorLayerUtils from '../utils/VectorLayerUtils'; +import Icon from './Icon'; +import InputContainer from './InputContainer'; +import MapSelection from './MapSelection'; +import Spinner from './Spinner'; +import ButtonBar from './widgets/ButtonBar'; +import ComboBox from './widgets/ComboBox'; +import NumberInput from './widgets/NumberInput'; + import './style/SearchBox.css'; class SearchBox extends React.Component { diff --git a/components/ServiceInfoWindow.jsx b/components/ServiceInfoWindow.jsx index c35ac5cc8..e374dfab4 100644 --- a/components/ServiceInfoWindow.jsx +++ b/components/ServiceInfoWindow.jsx @@ -7,19 +7,22 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import PropTypes from 'prop-types'; + import {setActiveServiceInfo} from '../actions/serviceinfo'; import ResizeableWindow from '../components/ResizeableWindow'; import LocaleUtils from '../utils/LocaleUtils'; import MiscUtils from '../utils/MiscUtils'; + import './style/ServiceInfoWindow.css'; class ServiceInfoWindow extends React.Component { static propTypes = { + layerInfoGeometry: PropTypes.object, service: PropTypes.object, - setActiveServiceInfo: PropTypes.func, - layerInfoGeometry: PropTypes.object + setActiveServiceInfo: PropTypes.func }; renderLink(text, url) { if (url) { @@ -48,8 +51,8 @@ class ServiceInfoWindow extends React.Component { } return (

{this.props.service.title}

diff --git a/components/SideBar.jsx b/components/SideBar.jsx index cb6035a47..df88de110 100644 --- a/components/SideBar.jsx +++ b/components/SideBar.jsx @@ -7,13 +7,16 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; -import {Swipeable} from './Swipeable'; -import Icon from './Icon'; + +import classnames from 'classnames'; +import PropTypes from 'prop-types'; + import {setCurrentTask} from '../actions/task'; import LocaleUtils from '../utils/LocaleUtils'; -import classnames from 'classnames'; +import Icon from './Icon'; +import {Swipeable} from './Swipeable'; + import './style/SideBar.css'; class SideBar extends React.Component { diff --git a/components/Spinner.jsx b/components/Spinner.jsx index 8b83ad7c3..23f3ae625 100644 --- a/components/Spinner.jsx +++ b/components/Spinner.jsx @@ -6,6 +6,7 @@ */ import React from 'react'; + import './style/Spinner.css'; export default class Spinner extends React.Component { diff --git a/components/StandardApp.jsx b/components/StandardApp.jsx index 15642ed38..44daa993a 100644 --- a/components/StandardApp.jsx +++ b/components/StandardApp.jsx @@ -7,27 +7,23 @@ * LICENSE file in the root directory of this source tree. */ import React from 'react'; -import PropTypes from 'prop-types'; import {Provider, connect} from 'react-redux'; import axios from 'axios'; -import Proj4js from 'proj4'; -import {register as olProj4Register} from 'ol/proj/proj4'; import deepmerge from 'deepmerge'; - -import Localized from './Localized'; -import StandardStore from '../stores/StandardStore'; -import PluginsContainer from './PluginsContainer'; +import {register as olProj4Register} from 'ol/proj/proj4'; +import Proj4js from 'proj4'; +import PropTypes from 'prop-types'; import {changeBrowserProperties} from '../actions/browser'; -import {loadLocale} from '../actions/locale'; -import {localConfigLoaded, setStartupParameters, setColorScheme} from '../actions/localConfig'; import {addLayer} from '../actions/layers'; +import {localConfigLoaded, setStartupParameters, setColorScheme} from '../actions/localConfig'; +import {loadLocale} from '../actions/locale'; import {changeSearch} from '../actions/search'; -import {themesLoaded, setCurrentTheme} from '../actions/theme'; import {setCurrentTask} from '../actions/task'; +import {themesLoaded, setCurrentTheme} from '../actions/theme'; import {NotificationType, showNotification} from '../actions/windows'; - +import StandardStore from '../stores/StandardStore'; import ConfigUtils from '../utils/ConfigUtils'; import CoordinatesUtils from '../utils/CoordinatesUtils'; import LocaleUtils from '../utils/LocaleUtils'; @@ -35,9 +31,11 @@ import MapUtils from '../utils/MapUtils'; import MiscUtils from '../utils/MiscUtils'; import {UrlParams, resolvePermaLink} from '../utils/PermaLinkUtils'; import ThemeUtils from '../utils/ThemeUtils'; +import Localized from './Localized'; +import PluginsContainer from './PluginsContainer'; -import './style/DefaultColorScheme.css'; import './style/App.css'; +import './style/DefaultColorScheme.css'; const CSRF_TOKEN = MiscUtils.getCsrfToken(); diff --git a/components/TaskBar.jsx b/components/TaskBar.jsx index bca8db4de..4b24d047a 100644 --- a/components/TaskBar.jsx +++ b/components/TaskBar.jsx @@ -7,8 +7,10 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import PropTypes from 'prop-types'; + import {setCurrentTask, setCurrentTaskBlocked} from '../actions/task'; import MessageBar from './MessageBar'; diff --git a/components/ThemeLayersListWindow.jsx b/components/ThemeLayersListWindow.jsx index cfa3263d0..9c53c5ab0 100644 --- a/components/ThemeLayersListWindow.jsx +++ b/components/ThemeLayersListWindow.jsx @@ -7,15 +7,18 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; -import Icon from './Icon'; import {connect} from 'react-redux'; -import ResizeableWindow from './ResizeableWindow'; + +import PropTypes from 'prop-types'; + import {LayerRole, addLayer} from '../actions/layers'; -import {setThemeLayersList} from '../actions/theme'; import {setCurrentTask} from '../actions/task'; +import {setThemeLayersList} from '../actions/theme'; import LocaleUtils from '../utils/LocaleUtils'; import ThemeUtils from '../utils/ThemeUtils'; +import Icon from './Icon'; +import ResizeableWindow from './ResizeableWindow'; + import './style/ThemeLayersListWindow.css'; class ThemeLayersListWindow extends React.Component { diff --git a/components/ThemeList.jsx b/components/ThemeList.jsx index 0bcb6030c..a3ad8f46d 100644 --- a/components/ThemeList.jsx +++ b/components/ThemeList.jsx @@ -7,20 +7,23 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import axios from 'axios'; -import isEmpty from 'lodash.isempty'; import {remove as removeDiacritics} from 'diacritics'; -import Icon from './Icon'; +import isEmpty from 'lodash.isempty'; +import PropTypes from 'prop-types'; + +import {setActiveLayerInfo} from '../actions/layerinfo'; +import {LayerRole, addLayer} from '../actions/layers'; +import {setUserInfoFields} from '../actions/localConfig'; +import {setCurrentTask} from '../actions/task'; +import {setCurrentTheme, setThemeLayersList} from '../actions/theme'; import ConfigUtils from '../utils/ConfigUtils'; import LocaleUtils from '../utils/LocaleUtils'; import ThemeUtils from '../utils/ThemeUtils'; -import {LayerRole, addLayer} from '../actions/layers'; -import {setCurrentTheme, setThemeLayersList} from '../actions/theme'; -import {setCurrentTask} from '../actions/task'; -import {setActiveLayerInfo} from '../actions/layerinfo'; -import {setUserInfoFields} from '../actions/localConfig'; +import Icon from './Icon'; + import './style/ThemeList.css'; class ThemeList extends React.Component { diff --git a/components/Toolbar.jsx b/components/Toolbar.jsx index a2dde9a51..2f63a0055 100644 --- a/components/Toolbar.jsx +++ b/components/Toolbar.jsx @@ -7,13 +7,16 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import Mousetrap from 'mousetrap'; -import LocaleUtils from '../utils/LocaleUtils'; +import PropTypes from 'prop-types'; + import {setCurrentTask} from '../actions/task'; -import Icon from './Icon'; import ConfigUtils from '../utils/ConfigUtils'; +import LocaleUtils from '../utils/LocaleUtils'; +import Icon from './Icon'; + import './style/Toolbar.css'; class Toolbar extends React.Component { diff --git a/components/WindowManager.jsx b/components/WindowManager.jsx index 10de7f35a..eed85bf2a 100644 --- a/components/WindowManager.jsx +++ b/components/WindowManager.jsx @@ -7,11 +7,13 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import PropTypes from 'prop-types'; + +import {closeWindow, closeAllWindows, NotificationType} from '../actions/windows'; import Icon from './Icon'; import ResizeableWindow from './ResizeableWindow'; -import {closeWindow, closeAllWindows, NotificationType} from '../actions/windows'; import './style/WindowManager.css'; diff --git a/components/map/OlLayer.jsx b/components/map/OlLayer.jsx index 154349f4e..1ba2ff8ee 100644 --- a/components/map/OlLayer.jsx +++ b/components/map/OlLayer.jsx @@ -8,13 +8,15 @@ */ import React from 'react'; import {connect} from 'react-redux'; -import PropTypes from 'prop-types'; + import ol from 'openlayers'; +import PropTypes from 'prop-types'; + import {setLayerLoading} from '../../actions/layers'; import CoordinatesUtils from '../../utils/CoordinatesUtils'; +import MapUtils from '../../utils/MapUtils'; import Signal from '../../utils/Signal'; import LayerRegistry from './layers/index'; -import MapUtils from '../../utils/MapUtils'; export const OlLayerAdded = new Signal(); export const OlLayerUpdated = new Signal(); diff --git a/components/map/OlLocate.js b/components/map/OlLocate.js index ad6621a06..90fb8749a 100644 --- a/components/map/OlLocate.js +++ b/components/map/OlLocate.js @@ -7,8 +7,10 @@ * LICENSE file in the root directory of this source tree. */ import ol from 'openlayers'; + import CoordinatesUtils from '../../utils/CoordinatesUtils'; import LocaleUtils from '../../utils/LocaleUtils'; + import './OlLocate.css'; const createPopup = function() { diff --git a/components/map/OlMap.jsx b/components/map/OlMap.jsx index 2970a41b6..84b06cbf8 100644 --- a/components/map/OlMap.jsx +++ b/components/map/OlMap.jsx @@ -6,17 +6,19 @@ * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ -import ol from 'openlayers'; import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import ol from 'openlayers'; +import PropTypes from 'prop-types'; + import {changeMapView, clickOnMap} from '../../actions/map'; import {changeMousePositionState} from '../../actions/mousePosition'; import {setCurrentTask} from '../../actions/task'; import ConfigUtils from '../../utils/ConfigUtils'; +import CoordinatesUtils from '../../utils/CoordinatesUtils'; import LocaleUtils from '../../utils/LocaleUtils'; import MapUtils from '../../utils/MapUtils'; -import CoordinatesUtils from '../../utils/CoordinatesUtils'; ol.Map.prototype.setRequestsPaused = function(paused) { this.requestsPaused_ = paused; @@ -249,7 +251,7 @@ class OlMap extends React.Component { } }); view.setZoom(this.props.zoom); - view.setCenter(this.props.center) + view.setCenter(this.props.center); this.map.render(); } diff --git a/components/map/layers/GoogleLayer.js b/components/map/layers/GoogleLayer.js index 2f7914b30..3e2975add 100644 --- a/components/map/layers/GoogleLayer.js +++ b/components/map/layers/GoogleLayer.js @@ -8,6 +8,7 @@ */ import React from 'react'; + import ol from 'openlayers'; let layersMap; diff --git a/components/map/layers/MVTLayer.js b/components/map/layers/MVTLayer.js index 87786d862..6564c7033 100644 --- a/components/map/layers/MVTLayer.js +++ b/components/map/layers/MVTLayer.js @@ -6,8 +6,8 @@ * LICENSE file in the root directory of this source tree. */ -import ol from 'openlayers'; import {applyStyle} from 'ol-mapbox-style'; +import ol from 'openlayers'; export default { create: (options) => { diff --git a/components/map/layers/VectorLayer.js b/components/map/layers/VectorLayer.js index 6451461e4..631ec14ef 100644 --- a/components/map/layers/VectorLayer.js +++ b/components/map/layers/VectorLayer.js @@ -8,6 +8,7 @@ */ import ol from 'openlayers'; + import FeatureStyles from '../../../utils/FeatureStyles'; export default { diff --git a/components/map/layers/WFSLayer.js b/components/map/layers/WFSLayer.js index 23700de91..1b64d71c6 100644 --- a/components/map/layers/WFSLayer.js +++ b/components/map/layers/WFSLayer.js @@ -8,6 +8,7 @@ import ol from 'openlayers'; import url from 'url'; + import CoordinatesUtils from '../../../utils/CoordinatesUtils'; import FeatureStyles from '../../../utils/FeatureStyles'; diff --git a/components/map/layers/WMSLayer.js b/components/map/layers/WMSLayer.js index cef7c2fcc..35327cfbf 100644 --- a/components/map/layers/WMSLayer.js +++ b/components/map/layers/WMSLayer.js @@ -7,11 +7,12 @@ * LICENSE file in the root directory of this source tree. */ +import axios from 'axios'; import ol from 'openlayers'; import url from 'url'; -import axios from 'axios'; -import CoordinatesUtils from '../../../utils/CoordinatesUtils'; + import ConfigUtils from '../../../utils/ConfigUtils'; +import CoordinatesUtils from '../../../utils/CoordinatesUtils'; import MiscUtils from '../../../utils/MiscUtils'; diff --git a/components/map/layers/WMTSLayer.js b/components/map/layers/WMTSLayer.js index e526d7ec2..a58e52e5e 100644 --- a/components/map/layers/WMTSLayer.js +++ b/components/map/layers/WMTSLayer.js @@ -8,6 +8,7 @@ */ import ol from 'openlayers'; + import CoordinatesUtils from '../../../utils/CoordinatesUtils'; function getWMSURLs(urls) { diff --git a/components/map/layers/index.js b/components/map/layers/index.js index a0079949d..b69823c59 100644 --- a/components/map/layers/index.js +++ b/components/map/layers/index.js @@ -15,9 +15,9 @@ import mvtLayer from './MVTLayer'; import osmLayer from './OSMLayer'; import overlayLayer from './OverlayLayer'; import vectorLayer from './VectorLayer'; +import wfsLayer from './WFSLayer'; import wmsLayer from './WMSLayer'; import wmtsLayer from './WMTSLayer'; -import wfsLayer from './WFSLayer'; import xyzLayer from './XYZLayer'; export default { diff --git a/components/share/ShareLink.jsx b/components/share/ShareLink.jsx index dee8e711d..86ad6785c 100644 --- a/components/share/ShareLink.jsx +++ b/components/share/ShareLink.jsx @@ -7,9 +7,12 @@ */ import React from 'react'; + import PropTypes from 'prop-types'; -import CopyButton from '../widgets/CopyButton'; + import LocaleUtils from '../../utils/LocaleUtils'; +import CopyButton from '../widgets/CopyButton'; + import './style/ShareLink.css'; export default class ShareLink extends React.Component { diff --git a/components/share/ShareQRCode.jsx b/components/share/ShareQRCode.jsx index afdaeb1fe..85c60e724 100644 --- a/components/share/ShareQRCode.jsx +++ b/components/share/ShareQRCode.jsx @@ -8,10 +8,12 @@ */ import React from 'react'; + import PropTypes from 'prop-types'; import {QRCodeCanvas} from 'qrcode.react'; -import CopyButton from '../widgets/CopyButton'; + import LocaleUtils from '../../utils/LocaleUtils'; +import CopyButton from '../widgets/CopyButton'; export default class ShareQRCode extends React.Component { static propTypes = { diff --git a/components/share/ShareSocials.jsx b/components/share/ShareSocials.jsx index 51809647d..2b2d3fcc2 100644 --- a/components/share/ShareSocials.jsx +++ b/components/share/ShareSocials.jsx @@ -8,7 +8,6 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import { FacebookShareButton, LinkedinShareButton, @@ -22,7 +21,11 @@ import { WhatsappIcon, EmailIcon } from 'react-share'; + +import PropTypes from 'prop-types'; + import LocaleUtils from '../../utils/LocaleUtils'; + import './style/ShareSocials.css'; diff --git a/components/timeline/FixedTimeline.jsx b/components/timeline/FixedTimeline.jsx index 253d0e971..b242dca72 100644 --- a/components/timeline/FixedTimeline.jsx +++ b/components/timeline/FixedTimeline.jsx @@ -7,12 +7,15 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; + import dayjs from 'dayjs'; +import PropTypes from 'prop-types'; + +import LocaleUtils from '../../utils/LocaleUtils'; import Icon from '../Icon'; import ButtonBar from '../widgets/ButtonBar'; import Input from '../widgets/Input'; -import LocaleUtils from '../../utils/LocaleUtils'; + import './style/FixedTimeline.css'; export default class FixedTimeline extends React.Component { diff --git a/components/timeline/InfiniteTimeline.jsx b/components/timeline/InfiniteTimeline.jsx index 6c7fb78af..60d930578 100644 --- a/components/timeline/InfiniteTimeline.jsx +++ b/components/timeline/InfiniteTimeline.jsx @@ -7,12 +7,15 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; + import dayjs from 'dayjs'; +import PropTypes from 'prop-types'; + +import LocaleUtils from '../../utils/LocaleUtils'; import Icon from '../Icon'; import ButtonBar from '../widgets/ButtonBar'; import NumberInput from '../widgets/NumberInput'; -import LocaleUtils from '../../utils/LocaleUtils'; + import './style/InfiniteTimeline.css'; diff --git a/components/timeline/TimelineFeaturesSlider.jsx b/components/timeline/TimelineFeaturesSlider.jsx index 9a9c02127..65619dabc 100644 --- a/components/timeline/TimelineFeaturesSlider.jsx +++ b/components/timeline/TimelineFeaturesSlider.jsx @@ -7,15 +7,18 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import dayjs from 'dayjs'; +import PropTypes from 'prop-types'; import randomcolor from 'randomcolor'; + import {addLayerFeatures, removeLayer, LayerRole} from '../../actions/layers'; -import Spinner from '../Spinner'; -import Input from '../widgets/Input'; import LocaleUtils from '../../utils/LocaleUtils'; import MiscUtils from '../../utils/MiscUtils'; +import Spinner from '../Spinner'; +import Input from '../widgets/Input'; + import './style/TimelineFeaturesSlider.css'; diff --git a/components/widgets/AccordeonWidget.jsx b/components/widgets/AccordeonWidget.jsx index bdaddc71d..14e442dd8 100644 --- a/components/widgets/AccordeonWidget.jsx +++ b/components/widgets/AccordeonWidget.jsx @@ -7,9 +7,12 @@ */ import React from 'react'; + import PropTypes from 'prop-types'; -import Icon from '../Icon'; + import LocaleUtils from '../../utils/LocaleUtils'; +import Icon from '../Icon'; + import './style/AccordeonWidget.css'; export default class AccordeonWidget extends React.Component { diff --git a/components/widgets/ButtonBar.jsx b/components/widgets/ButtonBar.jsx index 5fceda5f0..4bfa5ad82 100644 --- a/components/widgets/ButtonBar.jsx +++ b/components/widgets/ButtonBar.jsx @@ -7,12 +7,15 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import classnames from 'classnames'; -import MenuButton from './MenuButton'; -import Icon from '../Icon'; +import PropTypes from 'prop-types'; + import LocaleUtils from '../../utils/LocaleUtils'; +import Icon from '../Icon'; +import MenuButton from './MenuButton'; + import './style/ButtonBar.css'; const ButtonPropShape = PropTypes.shape({ diff --git a/components/widgets/ColorButton.jsx b/components/widgets/ColorButton.jsx index fa63e72c4..55c769244 100644 --- a/components/widgets/ColorButton.jsx +++ b/components/widgets/ColorButton.jsx @@ -7,7 +7,9 @@ */ import React from 'react'; + import PropTypes from 'prop-types'; + import './style/ColorButton.css'; const defaultColors = [ diff --git a/components/widgets/ComboBox.jsx b/components/widgets/ComboBox.jsx index 691298d01..e2985a63a 100644 --- a/components/widgets/ComboBox.jsx +++ b/components/widgets/ComboBox.jsx @@ -7,11 +7,14 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; + import classnames from 'classnames'; +import PropTypes from 'prop-types'; + +import MiscUtils from '../../utils/MiscUtils'; import Icon from '../Icon'; import PopupMenu from '../PopupMenu'; -import MiscUtils from '../../utils/MiscUtils'; + import './style/ComboBox.css'; export default class ComboBox extends React.Component { diff --git a/components/widgets/CopyButton.jsx b/components/widgets/CopyButton.jsx index 23a069448..86f0533b0 100644 --- a/components/widgets/CopyButton.jsx +++ b/components/widgets/CopyButton.jsx @@ -7,9 +7,12 @@ */ import React from 'react'; + import PropTypes from 'prop-types'; -import Icon from '../Icon'; + import LocaleUtils from '../../utils/LocaleUtils'; +import Icon from '../Icon'; + import './style/CopyButton.css'; diff --git a/components/widgets/DateTimeInput.jsx b/components/widgets/DateTimeInput.jsx index eb46f5959..8ec5e017b 100644 --- a/components/widgets/DateTimeInput.jsx +++ b/components/widgets/DateTimeInput.jsx @@ -7,7 +7,9 @@ */ import React from 'react'; + import PropTypes from 'prop-types'; + import InputContainer from '../InputContainer'; export default class DateTimeInput extends React.Component { diff --git a/components/widgets/EditableSelect.jsx b/components/widgets/EditableSelect.jsx index c55233d0f..242b185d6 100644 --- a/components/widgets/EditableSelect.jsx +++ b/components/widgets/EditableSelect.jsx @@ -7,10 +7,12 @@ */ import React from 'react'; + import PropTypes from 'prop-types'; + +import MiscUtils from '../../utils/MiscUtils'; import Icon from '../Icon'; import InputContainer from '../InputContainer'; -import MiscUtils from '../../utils/MiscUtils'; import './style/EditableSelect.css'; diff --git a/components/widgets/FileSelector.jsx b/components/widgets/FileSelector.jsx index 1d8281c07..5d7a14dfc 100644 --- a/components/widgets/FileSelector.jsx +++ b/components/widgets/FileSelector.jsx @@ -7,9 +7,12 @@ */ import React from 'react'; + import PropTypes from 'prop-types'; -import Icon from '../Icon'; + import LocaleUtils from '../../utils/LocaleUtils'; +import Icon from '../Icon'; + import './style/FileSelector.css'; export default class FileSelector extends React.Component { @@ -60,7 +63,7 @@ export default class FileSelector extends React.Component { - { this.fileinput = el; }} type="file" multiple={this.props.multiple} /> + { this.fileinput = el; }} type="file" />
); } diff --git a/components/widgets/Input.jsx b/components/widgets/Input.jsx index 2fe4939c7..333456c74 100644 --- a/components/widgets/Input.jsx +++ b/components/widgets/Input.jsx @@ -7,6 +7,7 @@ */ import React from 'react'; + import PropTypes from 'prop-types'; class Input extends React.Component { diff --git a/components/widgets/LayerCatalogWidget.jsx b/components/widgets/LayerCatalogWidget.jsx index e5a0e6caa..80ed6f777 100644 --- a/components/widgets/LayerCatalogWidget.jsx +++ b/components/widgets/LayerCatalogWidget.jsx @@ -1,14 +1,17 @@ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; -import isEmpty from 'lodash.isempty'; + import {remove as removeDiacritics} from 'diacritics'; +import isEmpty from 'lodash.isempty'; +import PropTypes from 'prop-types'; + import {addLayer} from '../../actions/layers'; -import InputContainer from '../InputContainer'; import LayerUtils from '../../utils/LayerUtils'; import LocaleUtils from '../../utils/LocaleUtils'; import ServiceLayerUtils from '../../utils/ServiceLayerUtils'; import Icon from '../Icon'; +import InputContainer from '../InputContainer'; + import './style/LayerCatalogWidget.css'; class LayerCatalogWidget extends React.PureComponent { diff --git a/components/widgets/MenuButton.jsx b/components/widgets/MenuButton.jsx index 79049faaa..793274be1 100644 --- a/components/widgets/MenuButton.jsx +++ b/components/widgets/MenuButton.jsx @@ -1,8 +1,11 @@ import React from 'react'; -import PropTypes from 'prop-types'; + import classnames from 'classnames'; +import PropTypes from 'prop-types'; + import Icon from '../Icon'; import PopupMenu from '../PopupMenu'; + import './style/MenuButton.css'; export default class MenuButton extends React.Component { diff --git a/components/widgets/NavBar.jsx b/components/widgets/NavBar.jsx index dd2c9d3e0..f2bbffda4 100644 --- a/components/widgets/NavBar.jsx +++ b/components/widgets/NavBar.jsx @@ -7,9 +7,12 @@ */ import React from 'react'; + import PropTypes from 'prop-types'; -import Icon from '../Icon'; + import LocaleUtils from '../../utils/LocaleUtils'; +import Icon from '../Icon'; + import './style/NavBar.css'; diff --git a/components/widgets/NumberInput.jsx b/components/widgets/NumberInput.jsx index 5648301f9..c3ed14b2f 100644 --- a/components/widgets/NumberInput.jsx +++ b/components/widgets/NumberInput.jsx @@ -7,6 +7,7 @@ */ import React from 'react'; + import PropTypes from 'prop-types'; class NumberInput extends React.Component { diff --git a/components/widgets/SearchWidget.jsx b/components/widgets/SearchWidget.jsx index fbd46c846..b83bb8582 100644 --- a/components/widgets/SearchWidget.jsx +++ b/components/widgets/SearchWidget.jsx @@ -8,13 +8,16 @@ import React from 'react'; -import PropTypes from 'prop-types'; + import axios from 'axios'; -import {v1 as uuidv1} from 'uuid'; import isEmpty from 'lodash.isempty'; -import Spinner from '../Spinner'; +import PropTypes from 'prop-types'; +import {v1 as uuidv1} from 'uuid'; + import LocaleUtils from '../../utils/LocaleUtils'; import MiscUtils from '../../utils/MiscUtils'; +import Spinner from '../Spinner'; + import './style/SearchWidget.css'; export default class SearchWidget extends React.Component { diff --git a/components/widgets/SuggestionInput.jsx b/components/widgets/SuggestionInput.jsx index 415d22bbd..5f18a6f2c 100644 --- a/components/widgets/SuggestionInput.jsx +++ b/components/widgets/SuggestionInput.jsx @@ -7,8 +7,10 @@ */ import React from 'react'; + import PropTypes from 'prop-types'; import {v1 as uuidv1} from 'uuid'; + import './style/SuggestionInput.css'; diff --git a/components/widgets/TextInput.jsx b/components/widgets/TextInput.jsx index 57ce6f25b..a82d66e77 100644 --- a/components/widgets/TextInput.jsx +++ b/components/widgets/TextInput.jsx @@ -7,10 +7,13 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; + import classNames from 'classnames'; +import PropTypes from 'prop-types'; + import LocaleUtils from '../../utils/LocaleUtils'; import MiscUtils from '../../utils/MiscUtils'; + import './style/TextInput.css'; class TextInput extends React.Component { diff --git a/components/widgets/ToggleSwitch.jsx b/components/widgets/ToggleSwitch.jsx index 044cd8185..f7a316356 100644 --- a/components/widgets/ToggleSwitch.jsx +++ b/components/widgets/ToggleSwitch.jsx @@ -7,9 +7,12 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; + import classnames from 'classnames'; +import PropTypes from 'prop-types'; + import Icon from '../Icon'; + import './style/ToggleSwitch.css'; export default class ToggleSwitch extends React.Component { diff --git a/components/widgets/VectorLayerPicker.jsx b/components/widgets/VectorLayerPicker.jsx index 9e9abd55f..d5d75a015 100644 --- a/components/widgets/VectorLayerPicker.jsx +++ b/components/widgets/VectorLayerPicker.jsx @@ -7,8 +7,10 @@ */ import React from 'react'; + import PropTypes from 'prop-types'; import {v4 as uuidv4} from 'uuid'; + import Icon from '../../components/Icon'; import LocaleUtils from '../../utils/LocaleUtils'; diff --git a/libs/openlayers.js b/libs/openlayers.js index 657d24954..818334e92 100644 --- a/libs/openlayers.js +++ b/libs/openlayers.js @@ -7,61 +7,61 @@ * LICENSE file in the root directory of this source tree. */ -import OlControlAttribution from 'ol/control/Attribution'; import OlCollection from 'ol/Collection'; +import OlFeature from 'ol/Feature'; +import OlGeolocation from 'ol/Geolocation'; +import OlKinetic from 'ol/Kinetic'; +import OlMap from 'ol/Map'; +import OlObject from 'ol/Object'; +import OlOverlay from 'ol/Overlay'; +import OlTileQueue from 'ol/TileQueue'; +import OlView from 'ol/View'; import {defaults as olControlDefaults} from 'ol/control'; +import OlControlAttribution from 'ol/control/Attribution'; import OlControlOverviewMap from 'ol/control/OverviewMap'; import OlControlScaleLine from 'ol/control/ScaleLine'; import OlControlZoom from 'ol/control/Zoom'; import * as OlEventsCondition from 'ol/events/condition'; import * as OlExtent from 'ol/extent'; -import OlFeature from 'ol/Feature'; -import OlFormatGeoJSON from 'ol/format/GeoJSON'; import OlFormatGML2 from 'ol/format/GML2'; import OlFormatGML3 from 'ol/format/GML3'; import OlFormatGML32 from 'ol/format/GML32'; +import OlFormatGeoJSON from 'ol/format/GeoJSON'; import OlFormatKML from 'ol/format/KML'; import OlFormatMVT from 'ol/format/MVT'; import OlFormatWFS from 'ol/format/WFS'; +import OlFormatWKT from 'ol/format/WKT'; import OlFormatWMSCapabilities from 'ol/format/WMSCapabilities'; import OlFormatWMTSCapabilities from 'ol/format/WMTSCapabilities'; -import OlFormatWKT from 'ol/format/WKT'; -import OlGeolocation from 'ol/Geolocation'; import OlGeomCircle from 'ol/geom/Circle'; import OlGeomGeometryCollection from 'ol/geom/GeometryCollection'; import OlGeomMultiPoint from 'ol/geom/MultiPoint'; import OlGeomPoint from 'ol/geom/Point'; import OlGeomPolygon from 'ol/geom/Polygon'; import {fromCircle as olPolygonFromCircle} from 'ol/geom/Polygon'; -import OlGraticule from 'ol/layer/Graticule'; import {defaults as olInteractionDefaults} from 'ol/interaction'; import OlInteractionDoubleClickZoom from 'ol/interaction/DoubleClickZoom'; +import OlInteractionDragBox from 'ol/interaction/DragBox'; import OlInteractionDragPan from 'ol/interaction/DragPan'; import OlInteractionDraw from 'ol/interaction/Draw'; -import OlInteractionDrawRegular from 'ol-ext/interaction/DrawRegular'; -import OlInteractionDragBox from 'ol/interaction/DragBox'; import {createBox as olCreateBox} from 'ol/interaction/Draw'; +import OlInteractionInteraction from 'ol/interaction/Interaction'; import OlInteractionKeyboardPan from 'ol/interaction/KeyboardPan'; import OlInteractionKeyboardZoom from 'ol/interaction/KeyboardZoom'; -import OlInteractionInteraction from 'ol/interaction/Interaction'; -import OlInteractionPointer from 'ol/interaction/Pointer'; import OlInteractionModify from 'ol/interaction/Modify'; import OlInteractionMouseWheelZoom from 'ol/interaction/MouseWheelZoom'; +import OlInteractionPointer from 'ol/interaction/Pointer'; import OlInteractionSelect from 'ol/interaction/Select'; import OlInteractionSnap from 'ol/interaction/Snap'; -import OlInteractionTransform from 'ol-ext/interaction/Transform'; import OlInteractionTranslate from 'ol/interaction/Translate'; -import OlKinetic from 'ol/Kinetic'; -import OlLayer from 'ol/layer/Layer'; +import OlGraticule from 'ol/layer/Graticule'; +import OlLayerGroup from 'ol/layer/Group'; import OlLayerImage from 'ol/layer/Image'; +import OlLayer from 'ol/layer/Layer'; import OlLayerTile from 'ol/layer/Tile'; import OlLayerVector from 'ol/layer/Vector'; import OlLayerVectorTile from 'ol/layer/VectorTile'; -import OlLayerGroup from 'ol/layer/Group'; import * as OlLoadingstrategy from 'ol/loadingstrategy'; -import OlMap from 'ol/Map'; -import OlObject from 'ol/Object'; -import OlOverlay from 'ol/Overlay'; import * as OlProj from 'ol/proj'; import OlSourceBingMaps from 'ol/source/BingMaps'; import OlSourceImageStatic from 'ol/source/ImageStatic'; @@ -80,10 +80,11 @@ import OlStyleRegularShape from 'ol/style/RegularShape'; import OlStyleStroke from 'ol/style/Stroke'; import OlStyleStyle from 'ol/style/Style'; import OlStyleText from 'ol/style/Text'; -import OlTileQueue from 'ol/TileQueue'; import OlTilegridTileGrid from 'ol/tilegrid/TileGrid'; import OlTilegridWMTS from 'ol/tilegrid/WMTS'; -import OlView from 'ol/View'; +import OlInteractionDrawRegular from 'ol-ext/interaction/DrawRegular'; +import OlInteractionTransform from 'ol-ext/interaction/Transform'; + import 'ol/ol.css'; diff --git a/package.json b/package.json index ada080a17..0cc9b10da 100644 --- a/package.json +++ b/package.json @@ -76,6 +76,7 @@ "@babel/preset-react": "^7.23.3", "@furkot/webfonts-generator": "^2.0.0", "@types/react": "^18.2.45", + "eslint-plugin-perfectionist": "^2.5.0", "mkdirp": "^3.0.1", "object-path": "^0.11.8" } diff --git a/plugins/API.jsx b/plugins/API.jsx index 1d6d8eee4..f10695fd9 100644 --- a/plugins/API.jsx +++ b/plugins/API.jsx @@ -7,21 +7,22 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; -import {LayerRole} from '../actions/layers'; -import LayerUtils from '../utils/LayerUtils'; -import CoordinatesUtils from '../utils/CoordinatesUtils'; -import ServiceLayerUtils from '../utils/ServiceLayerUtils'; -import VectorLayerUtils from '../utils/VectorLayerUtils'; + +import PropTypes from 'prop-types'; import * as displayActions from '../actions/display'; +import {LayerRole} from '../actions/layers'; import * as layerActions from '../actions/layers'; import * as locateActions from '../actions/locate'; import * as mapActions from '../actions/map'; import * as taskActions from '../actions/task'; import * as themeActions from '../actions/theme'; import * as windowsActions from '../actions/windows'; +import CoordinatesUtils from '../utils/CoordinatesUtils'; +import LayerUtils from '../utils/LayerUtils'; +import ServiceLayerUtils from '../utils/ServiceLayerUtils'; +import VectorLayerUtils from '../utils/VectorLayerUtils'; /** diff --git a/plugins/AttributeTable.jsx b/plugins/AttributeTable.jsx index aafd08d42..0f2bb425f 100644 --- a/plugins/AttributeTable.jsx +++ b/plugins/AttributeTable.jsx @@ -7,10 +7,12 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; -import isEmpty from 'lodash.isempty'; + import FileSaver from 'file-saver'; +import isEmpty from 'lodash.isempty'; +import PropTypes from 'prop-types'; + import {getFeatureTemplate} from '../actions/editing'; import {LayerRole} from '../actions/layers'; import {zoomToExtent, zoomToPoint} from '../actions/map'; @@ -19,16 +21,17 @@ import EditComboField, {KeyValCache} from '../components/EditComboField'; import EditUploadField from '../components/EditUploadField'; import Icon from '../components/Icon'; import ResizeableWindow from '../components/ResizeableWindow'; -import NavBar from '../components/widgets/NavBar'; import Spinner from '../components/Spinner'; +import NavBar from '../components/widgets/NavBar'; import TextInput from '../components/widgets/TextInput'; import ConfigUtils from '../utils/ConfigUtils'; -import EditingInterface from '../utils/EditingInterface'; import CoordinatesUtils from '../utils/CoordinatesUtils'; +import EditingInterface from '../utils/EditingInterface'; import LayerUtils from '../utils/LayerUtils'; import LocaleUtils from '../utils/LocaleUtils'; import MapUtils from '../utils/MapUtils'; import VectorLayerUtils from '../utils/VectorLayerUtils'; + import './style/AttributeTable.css'; /** diff --git a/plugins/Authentication.jsx b/plugins/Authentication.jsx index f2fa502fd..58dd29de4 100644 --- a/plugins/Authentication.jsx +++ b/plugins/Authentication.jsx @@ -7,9 +7,11 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import PropTypes from 'prop-types'; import url from 'url'; + import ConfigUtils from '../utils/ConfigUtils'; diff --git a/plugins/BackgroundSwitcher.jsx b/plugins/BackgroundSwitcher.jsx index d288344fe..b5883efe6 100644 --- a/plugins/BackgroundSwitcher.jsx +++ b/plugins/BackgroundSwitcher.jsx @@ -7,15 +7,18 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import classnames from 'classnames'; import isEmpty from 'lodash.isempty'; import sortBy from 'lodash.sortby'; +import PropTypes from 'prop-types'; + import {LayerRole, changeLayerProperty} from '../actions/layers'; import Icon from '../components/Icon'; import ConfigUtils from '../utils/ConfigUtils'; import LocaleUtils from '../utils/LocaleUtils'; + import './style/BackgroundSwitcher.css'; diff --git a/plugins/Bookmark.jsx b/plugins/Bookmark.jsx index 837683e61..0f8b2c189 100644 --- a/plugins/Bookmark.jsx +++ b/plugins/Bookmark.jsx @@ -8,16 +8,19 @@ import React from 'react'; import {connect} from 'react-redux'; + import classnames from 'classnames'; +import isEmpty from 'lodash.isempty'; import PropTypes from 'prop-types'; -import LocaleUtils from '../utils/LocaleUtils'; -import ConfigUtils from '../utils/ConfigUtils'; + import Icon from '../components/Icon'; import SideBar from '../components/SideBar'; import Spinner from '../components/Spinner'; +import ConfigUtils from '../utils/ConfigUtils'; +import LocaleUtils from '../utils/LocaleUtils'; import {createBookmark, getUserBookmarks, removeBookmark, updateBookmark} from '../utils/PermaLinkUtils'; + import './style/Bookmark.css'; -import isEmpty from 'lodash.isempty'; /** diff --git a/plugins/BottomBar.jsx b/plugins/BottomBar.jsx index 5c0a155ba..39ebfeef9 100644 --- a/plugins/BottomBar.jsx +++ b/plugins/BottomBar.jsx @@ -7,12 +7,14 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; -import {createSelector} from 'reselect'; + import pickBy from 'lodash.pickby'; -import {changeMousePositionState} from '../actions/mousePosition'; +import PropTypes from 'prop-types'; +import {createSelector} from 'reselect'; + import {changeZoomLevel, setBottombarHeight} from '../actions/map'; +import {changeMousePositionState} from '../actions/mousePosition'; import {openExternalUrl} from '../actions/task'; import CoordinateDisplayer from '../components/CoordinateDisplayer'; import InputContainer from '../components/InputContainer'; @@ -20,6 +22,7 @@ import displayCrsSelector from '../selectors/displaycrs'; import CoordinatesUtils from '../utils/CoordinatesUtils'; import LocaleUtils from '../utils/LocaleUtils'; import MapUtils from '../utils/MapUtils'; + import './style/BottomBar.css'; diff --git a/plugins/Cyclomedia.jsx b/plugins/Cyclomedia.jsx index 7187dec2a..022365652 100644 --- a/plugins/Cyclomedia.jsx +++ b/plugins/Cyclomedia.jsx @@ -7,17 +7,20 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import PropTypes from 'prop-types'; +import MapUtils from 'qwc2/utils/MapUtils'; +import ResourceRegistry from 'qwc2/utils/ResourceRegistry'; + import {addLayer, addLayerFeatures, changeLayerProperty, removeLayer, LayerRole} from '../actions/layers'; import {setCurrentTask} from '../actions/task'; import ResizeableWindow from '../components/ResizeableWindow'; import Spinner from '../components/Spinner'; import CoordinatesUtils from '../utils/CoordinatesUtils'; import LocaleUtils from '../utils/LocaleUtils'; + import './style/Cyclomedia.css'; -import MapUtils from 'qwc2/utils/MapUtils'; -import ResourceRegistry from 'qwc2/utils/ResourceRegistry'; const Status = {LOGIN: 0, INITIALIZING: 1, INITIALIZED: 2, ERROR: 3, LOADPOS: 4, HAVEPOS: 5}; @@ -194,7 +197,7 @@ class Cyclomedia extends React.Component { initialX={this.props.geometry.initialX} initialY={this.props.geometry.initialY} initiallyDocked={this.props.geometry.initiallyDocked} onClose={this.onClose} splitScreenWhenDocked title={LocaleUtils.trmsg("cyclomedia.title")} - > + >
{this.props.mapScale > this.props.maxMapScale && this.state.status > Status.LOGIN ? (
diff --git a/plugins/DxfExport.jsx b/plugins/DxfExport.jsx index f3d8fb95a..70c02e912 100644 --- a/plugins/DxfExport.jsx +++ b/plugins/DxfExport.jsx @@ -7,20 +7,23 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import axios from 'axios'; -import isEmpty from 'lodash.isempty'; -import formDataEntries from 'formdata-json'; import FileSaver from 'file-saver'; +import formDataEntries from 'formdata-json'; +import isEmpty from 'lodash.isempty'; +import PropTypes from 'prop-types'; + import {LayerRole} from '../actions/layers'; import {setCurrentTask} from '../actions/task'; import InputContainer from '../components/InputContainer'; -import TaskBar from '../components/TaskBar'; import PrintFrame from '../components/PrintFrame'; +import TaskBar from '../components/TaskBar'; import CoordinatesUtils from '../utils/CoordinatesUtils'; import LocaleUtils from '../utils/LocaleUtils'; import MiscUtils from '../utils/MiscUtils'; + import './style/DxfExport.css'; diff --git a/plugins/Editing.jsx b/plugins/Editing.jsx index 9d294fcb8..40c7f0374 100644 --- a/plugins/Editing.jsx +++ b/plugins/Editing.jsx @@ -7,15 +7,17 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import isEmpty from 'lodash.isempty'; import isEqual from 'lodash.isequal'; +import PropTypes from 'prop-types'; import {v1 as uuidv1} from 'uuid'; + import {setEditContext, clearEditContext, getFeatureTemplate} from '../actions/editing'; -import {setCurrentTask, setCurrentTaskBlocked} from '../actions/task'; import {LayerRole, addLayerFeatures, removeLayer, refreshLayer, changeLayerProperty} from '../actions/layers'; import {setSnappingConfig} from '../actions/map'; +import {setCurrentTask, setCurrentTaskBlocked} from '../actions/task'; import AttributeForm from '../components/AttributeForm'; import Icon from '../components/Icon'; import PickFeature from '../components/PickFeature'; @@ -26,6 +28,7 @@ import EditingInterface from '../utils/EditingInterface'; import LayerUtils from '../utils/LayerUtils'; import LocaleUtils from '../utils/LocaleUtils'; import MapUtils from '../utils/MapUtils'; + import './style/Editing.css'; @@ -256,7 +259,7 @@ class Editing extends React.Component { "Multi" + feature.geometry.type === geomType || (feature.geometry.type.replace(/^Multi/, "") === geomType && feature.geometry.coordinates.length === 1) ); - } + }; geomPicked = (layer, feature) => { const geomType = this.props.theme.editConfig[this.state.selectedLayer]?.geomType; let geometry = feature.geometry; diff --git a/plugins/FeatureForm.jsx b/plugins/FeatureForm.jsx index 1f143beb2..924bf020d 100644 --- a/plugins/FeatureForm.jsx +++ b/plugins/FeatureForm.jsx @@ -7,9 +7,11 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import isEmpty from 'lodash.isempty'; +import PropTypes from 'prop-types'; + import {setEditContext, clearEditContext} from '../actions/editing'; import {LayerRole} from '../actions/layers'; import {setCurrentTask} from '../actions/task'; @@ -20,6 +22,7 @@ import EditingInterface from '../utils/EditingInterface'; import LayerUtils from '../utils/LayerUtils'; import LocaleUtils from '../utils/LocaleUtils'; import MapUtils from '../utils/MapUtils'; + import './style/FeatureForm.css'; diff --git a/plugins/FeatureSearch.jsx b/plugins/FeatureSearch.jsx index 4e8c82222..b6ce029df 100644 --- a/plugins/FeatureSearch.jsx +++ b/plugins/FeatureSearch.jsx @@ -8,16 +8,19 @@ import React from 'react'; +import {connect} from 'react-redux'; + import axios from 'axios'; +import isEmpty from 'lodash.isempty'; import PropTypes from 'prop-types'; -import {connect} from 'react-redux'; import {v1 as uuidv1} from 'uuid'; -import isEmpty from 'lodash.isempty'; + import IdentifyViewer from '../components/IdentifyViewer'; import SideBar from '../components/SideBar'; import Spinner from '../components/Spinner'; import IdentifyUtils from '../utils/IdentifyUtils'; import LocaleUtils from '../utils/LocaleUtils'; + import "./style/FeatureSearch.css"; diff --git a/plugins/HeightProfile.jsx b/plugins/HeightProfile.jsx index c3bedd0c5..f2949ddd0 100644 --- a/plugins/HeightProfile.jsx +++ b/plugins/HeightProfile.jsx @@ -7,12 +7,11 @@ */ import React from 'react'; -import axios from 'axios'; -import PropTypes from 'prop-types'; -import {connect} from 'react-redux'; -import ReactDOM from 'react-dom'; -import isEmpty from 'lodash.isempty'; import {Line} from "react-chartjs-2"; +import ReactDOM from 'react-dom'; +import {connect} from 'react-redux'; + +import axios from 'axios'; import { Chart as ChartJS, CategoryScale, @@ -25,6 +24,9 @@ import { BubbleController } from 'chart.js'; import FileSaver from 'file-saver'; +import isEmpty from 'lodash.isempty'; +import PropTypes from 'prop-types'; + import {addMarker, removeMarker} from '../actions/layers'; import {changeMeasurementState} from '../actions/measurement'; import ResizeableWindow from '../components/ResizeableWindow'; diff --git a/plugins/Help.jsx b/plugins/Help.jsx index fbdc42bbd..86756b65c 100644 --- a/plugins/Help.jsx +++ b/plugins/Help.jsx @@ -7,9 +7,11 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import axios from 'axios'; +import PropTypes from 'prop-types'; + import SideBar from '../components/SideBar'; diff --git a/plugins/HomeButton.jsx b/plugins/HomeButton.jsx index 4682aa3cb..069f48c0b 100644 --- a/plugins/HomeButton.jsx +++ b/plugins/HomeButton.jsx @@ -7,12 +7,15 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; -import LocaleUtils from '../utils/LocaleUtils'; + +import PropTypes from 'prop-types'; + import {zoomToExtent} from '../actions/map'; import Icon from '../components/Icon'; +import LocaleUtils from '../utils/LocaleUtils'; import ThemeUtils from '../utils/ThemeUtils'; + import './style/Buttons.css'; diff --git a/plugins/Identify.jsx b/plugins/Identify.jsx index d33820c09..60d835615 100644 --- a/plugins/Identify.jsx +++ b/plugins/Identify.jsx @@ -7,16 +7,18 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import isEmpty from 'lodash.isempty'; +import PropTypes from 'prop-types'; + import {LayerRole, addLayerFeatures, addMarker, removeMarker, removeLayer} from '../actions/layers'; import {setCurrentTask} from '../actions/task'; import IdentifyViewer from '../components/IdentifyViewer'; import MapSelection from '../components/MapSelection'; -import NumberInput from '../components/widgets/NumberInput'; import ResizeableWindow from '../components/ResizeableWindow'; import TaskBar from '../components/TaskBar'; +import NumberInput from '../components/widgets/NumberInput'; import IdentifyUtils from '../utils/IdentifyUtils'; import LocaleUtils from '../utils/LocaleUtils'; import MeasureUtils from '../utils/MeasureUtils'; diff --git a/plugins/LayerCatalog.jsx b/plugins/LayerCatalog.jsx index b7a8ee355..0d8501b58 100644 --- a/plugins/LayerCatalog.jsx +++ b/plugins/LayerCatalog.jsx @@ -8,12 +8,15 @@ import React from 'react'; import {connect} from 'react-redux'; -import PropTypes from 'prop-types'; + import axios from 'axios'; +import PropTypes from 'prop-types'; + import {setCurrentTask} from '../actions/task'; -import LayerCatalogWidget from '../components/widgets/LayerCatalogWidget'; import ResizeableWindow from '../components/ResizeableWindow'; +import LayerCatalogWidget from '../components/widgets/LayerCatalogWidget'; import LocaleUtils from '../utils/LocaleUtils'; + import './style/LayerCatalog.css'; diff --git a/plugins/LayerTree.jsx b/plugins/LayerTree.jsx index 81efaa71e..07af03396 100644 --- a/plugins/LayerTree.jsx +++ b/plugins/LayerTree.jsx @@ -7,16 +7,18 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; -import classnames from 'classnames'; -import isEmpty from 'lodash.isempty'; import Sortable from 'react-sortablejs'; + +import classnames from 'classnames'; import FileSaver from 'file-saver'; -import {LayerRole, changeLayerProperty, removeLayer, reorderLayer, setSwipe, addLayerSeparator} from '../actions/layers'; +import isEmpty from 'lodash.isempty'; +import PropTypes from 'prop-types'; + import {setActiveLayerInfo} from '../actions/layerinfo'; -import {setActiveServiceInfo} from '../actions/serviceinfo'; +import {LayerRole, changeLayerProperty, removeLayer, reorderLayer, setSwipe, addLayerSeparator} from '../actions/layers'; import {toggleMapTips, zoomToExtent} from '../actions/map'; +import {setActiveServiceInfo} from '../actions/serviceinfo'; import Icon from '../components/Icon'; import ImportLayer from '../components/ImportLayer'; import LayerInfoWindow from '../components/LayerInfoWindow'; @@ -30,6 +32,7 @@ import LocaleUtils from '../utils/LocaleUtils'; import MapUtils from '../utils/MapUtils'; import MiscUtils from '../utils/MiscUtils'; import VectorLayerUtils from '../utils/VectorLayerUtils'; + import './style/LayerTree.css'; diff --git a/plugins/LocateButton.jsx b/plugins/LocateButton.jsx index 73ddd476a..c829440bc 100644 --- a/plugins/LocateButton.jsx +++ b/plugins/LocateButton.jsx @@ -8,14 +8,17 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import classnames from 'classnames'; -import LocaleUtils from '../utils/LocaleUtils'; +import PropTypes from 'prop-types'; + import {changeLocateState} from '../actions/locate'; import Icon from '../components/Icon'; import Spinner from '../components/Spinner'; +import LocaleUtils from '../utils/LocaleUtils'; import ThemeUtils from '../utils/ThemeUtils'; + import './style/Buttons.css'; diff --git a/plugins/LoginUser.jsx b/plugins/LoginUser.jsx index 81ed7a841..e557aea2e 100644 --- a/plugins/LoginUser.jsx +++ b/plugins/LoginUser.jsx @@ -7,10 +7,13 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import PropTypes from 'prop-types'; + import Icon from '../components/Icon'; import ConfigUtils from '../utils/ConfigUtils'; + import './style/LoginUser.css'; diff --git a/plugins/Map.jsx b/plugins/Map.jsx index f86839584..dbf23a5ba 100644 --- a/plugins/Map.jsx +++ b/plugins/Map.jsx @@ -8,13 +8,15 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import isEmpty from 'lodash.isempty'; +import PropTypes from 'prop-types'; + import {LayerRole} from '../actions/layers'; -import OlMap from '../components/map/OlMap'; -import OlLayer from '../components/map/OlLayer'; import Spinner from '../components/Spinner'; +import OlLayer from '../components/map/OlLayer'; +import OlMap from '../components/map/OlMap'; import LayerUtils from '../utils/LayerUtils'; import LocaleUtils from '../utils/LocaleUtils'; @@ -37,7 +39,7 @@ class MapPlugin extends React.Component { panStepSize: PropTypes.number, panPageSize: PropTypes.number, constrainExtent: PropTypes.bool, - kineticPanParams: PropTypes.object, + kineticPanParams: PropTypes.object }), /** Whether to display the loading spinner when layers are loading. */ showLoading: PropTypes.bool, diff --git a/plugins/MapCompare.jsx b/plugins/MapCompare.jsx index df616cc90..26ff4ba2e 100644 --- a/plugins/MapCompare.jsx +++ b/plugins/MapCompare.jsx @@ -7,8 +7,10 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import PropTypes from 'prop-types'; + import {setSwipe} from '../actions/layers'; import Icon from '../components/Icon'; diff --git a/plugins/MapCopyright.jsx b/plugins/MapCopyright.jsx index 9f98522a9..11d8cfb35 100644 --- a/plugins/MapCopyright.jsx +++ b/plugins/MapCopyright.jsx @@ -7,11 +7,14 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import isEmpty from 'lodash.isempty'; +import PropTypes from 'prop-types'; + import LayerUtils from '../utils/LayerUtils'; import LocaleUtils from '../utils/LocaleUtils'; + import './style/MapCopyright.css'; @@ -26,7 +29,7 @@ class MapCopyright extends React.Component { /** Whether to prepend the layer name to the attribution string. */ prefixCopyrightsWithLayerNames: PropTypes.bool, /** Whether to only display the attribution of the theme, omitting external layers. */ - showThemeCopyrightOnly: PropTypes.bool, + showThemeCopyrightOnly: PropTypes.bool }; state = { currentCopyrights: {} diff --git a/plugins/MapExport.jsx b/plugins/MapExport.jsx index 6cbb13c81..3f95437ac 100644 --- a/plugins/MapExport.jsx +++ b/plugins/MapExport.jsx @@ -6,13 +6,15 @@ * LICENSE file in the root directory of this source tree. */ -import axios from 'axios'; import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import axios from 'axios'; import FileSaver from 'file-saver'; -import isEmpty from 'lodash.isempty'; import formDataEntries from 'formdata-json'; +import isEmpty from 'lodash.isempty'; +import PropTypes from 'prop-types'; + import {LayerRole} from '../actions/layers'; import {setCurrentTask} from '../actions/task'; import Icon from '../components/Icon'; @@ -27,6 +29,7 @@ import LocaleUtils from '../utils/LocaleUtils'; import MapUtils from '../utils/MapUtils'; import MiscUtils from '../utils/MiscUtils'; import VectorLayerUtils from '../utils/VectorLayerUtils'; + import './style/MapExport.css'; diff --git a/plugins/MapFilter.jsx b/plugins/MapFilter.jsx index 73969797f..4ed77a80a 100644 --- a/plugins/MapFilter.jsx +++ b/plugins/MapFilter.jsx @@ -7,27 +7,30 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import axios from 'axios'; import classNames from 'classnames'; import isEmpty from 'lodash.isempty'; +import PropTypes from 'prop-types'; import {v1 as uuidv1} from 'uuid'; -import {setPermalinkParameters} from '../actions/localConfig'; + import {LayerRole, setFilter} from '../actions/layers'; +import {setPermalinkParameters} from '../actions/localConfig'; import {setCurrentTask} from '../actions/task'; -import ButtonBar from '../components/widgets/ButtonBar'; -import ComboBox from '../components/widgets/ComboBox'; -import DateTimeInput from '../components/widgets/DateTimeInput'; import Icon from '../components/Icon'; import MapSelection from '../components/MapSelection'; import PickFeature from '../components/PickFeature'; import SideBar from '../components/SideBar'; +import ButtonBar from '../components/widgets/ButtonBar'; +import ComboBox from '../components/widgets/ComboBox'; +import DateTimeInput from '../components/widgets/DateTimeInput'; import TextInput from '../components/widgets/TextInput'; import ToggleSwitch from '../components/widgets/ToggleSwitch'; import ConfigUtils from '../utils/ConfigUtils'; import LayerUtils from '../utils/LayerUtils'; import LocaleUtils from '../utils/LocaleUtils'; + import './style/MapFilter.css'; diff --git a/plugins/MapInfoTooltip.jsx b/plugins/MapInfoTooltip.jsx index cda3b3b73..97d481d15 100644 --- a/plugins/MapInfoTooltip.jsx +++ b/plugins/MapInfoTooltip.jsx @@ -7,18 +7,21 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; -import {createSelector} from 'reselect'; + import axios from 'axios'; +import PropTypes from 'prop-types'; +import {createSelector} from 'reselect'; + import {setCurrentTask} from '../actions/task'; +import Icon from '../components/Icon'; +import CopyButton from '../components/widgets/CopyButton'; +import displayCrsSelector from '../selectors/displaycrs'; import ConfigUtils from '../utils/ConfigUtils'; import CoordinatesUtils from '../utils/CoordinatesUtils'; import LocaleUtils from '../utils/LocaleUtils'; import MapUtils from '../utils/MapUtils'; -import CopyButton from '../components/widgets/CopyButton'; -import Icon from '../components/Icon'; -import displayCrsSelector from '../selectors/displaycrs'; + import './style/MapInfoTooltip.css'; @@ -199,7 +202,7 @@ class MapInfoTooltip extends React.Component { {routingButtons} - {this.props.plugins.map((Plugin, idx) => ())} + {this.props.plugins.map((Plugin, idx) => ())}
diff --git a/plugins/MapLegend.jsx b/plugins/MapLegend.jsx index 8bf3c360e..346f3da44 100644 --- a/plugins/MapLegend.jsx +++ b/plugins/MapLegend.jsx @@ -8,15 +8,18 @@ import React from 'react'; import {connect} from 'react-redux'; + +import isEmpty from 'lodash.isempty'; import PropTypes from 'prop-types'; + import {setCurrentTask} from '../actions/task'; import ResizeableWindow from '../components/ResizeableWindow'; import {Image} from '../components/widgets/Primitives'; import LayerUtils from '../utils/LayerUtils'; import LocaleUtils from '../utils/LocaleUtils'; import MapUtils from '../utils/MapUtils'; + import './style/MapLegend.css'; -import isEmpty from 'lodash.isempty'; /** * Displays the map legend in a floating dialog. diff --git a/plugins/MapTip.jsx b/plugins/MapTip.jsx index 80550b95b..062db3992 100644 --- a/plugins/MapTip.jsx +++ b/plugins/MapTip.jsx @@ -7,15 +7,18 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import htmlReactParser, {domToReact} from 'html-react-parser'; import isEmpty from 'lodash.isempty'; +import PropTypes from 'prop-types'; import {v1 as uuidv1} from 'uuid'; -import htmlReactParser, {domToReact} from 'html-react-parser'; + +import {LayerRole, addLayerFeatures, removeLayer} from '../actions/layers'; import {openExternalUrl} from '../actions/task'; import ConfigUtils from '../utils/ConfigUtils'; import IdentifyUtils from '../utils/IdentifyUtils'; -import {LayerRole, addLayerFeatures, removeLayer} from '../actions/layers'; + import './style/MapTip.css'; /** diff --git a/plugins/Measure.jsx b/plugins/Measure.jsx index 92d9f6997..ab9493863 100644 --- a/plugins/Measure.jsx +++ b/plugins/Measure.jsx @@ -7,17 +7,20 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import PropTypes from 'prop-types'; import {createSelector} from 'reselect'; -import LocaleUtils from '../utils/LocaleUtils'; -import MeasureUtils from '../utils/MeasureUtils'; + import {setSnappingConfig} from '../actions/map.js'; import {changeMeasurementState} from '../actions/measurement.js'; -import displayCrsSelector from '../selectors/displaycrs'; import TaskBar from '../components/TaskBar'; import ButtonBar from '../components/widgets/ButtonBar'; import CopyButton from '../components/widgets/CopyButton'; +import displayCrsSelector from '../selectors/displaycrs'; +import LocaleUtils from '../utils/LocaleUtils'; +import MeasureUtils from '../utils/MeasureUtils'; + import './style/Measure.css'; diff --git a/plugins/NewsPopup.jsx b/plugins/NewsPopup.jsx index c1e4a7735..fa3059cc9 100644 --- a/plugins/NewsPopup.jsx +++ b/plugins/NewsPopup.jsx @@ -7,9 +7,12 @@ */ import React from 'react'; + import PropTypes from 'prop-types'; + import Icon from '../components/Icon'; import LocaleUtils from '../utils/LocaleUtils'; + import './style/NewsPopup.css'; diff --git a/plugins/Portal.jsx b/plugins/Portal.jsx index c3dc84161..058e6b1bd 100644 --- a/plugins/Portal.jsx +++ b/plugins/Portal.jsx @@ -7,8 +7,10 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import PropTypes from 'prop-types'; + import {setCurrentTask, openExternalUrl} from '../actions/task'; import AppMenu from '../components/AppMenu'; import Icon from '../components/Icon'; @@ -17,6 +19,7 @@ import ConfigUtils from '../utils/ConfigUtils'; import LocaleUtils from '../utils/LocaleUtils'; import {UrlParams} from '../utils/PermaLinkUtils'; import ThemeUtils from '../utils/ThemeUtils'; + import './style/Portal.css'; diff --git a/plugins/Print.jsx b/plugins/Print.jsx index bf278db66..8570a7c6b 100644 --- a/plugins/Print.jsx +++ b/plugins/Print.jsx @@ -7,12 +7,14 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import axios from 'axios'; -import isEmpty from 'lodash.isempty'; import FileSaver from 'file-saver'; import formDataEntries from 'formdata-json'; +import isEmpty from 'lodash.isempty'; +import PropTypes from 'prop-types'; + import {LayerRole, addLayerFeatures, clearLayer} from '../actions/layers'; import {changeRotation, panTo} from '../actions/map'; import Icon from '../components/Icon'; @@ -29,6 +31,7 @@ import LocaleUtils from '../utils/LocaleUtils'; import MapUtils from '../utils/MapUtils'; import MiscUtils from '../utils/MiscUtils'; import VectorLayerUtils from '../utils/VectorLayerUtils'; + import './style/Print.css'; diff --git a/plugins/ProcessNotifications.jsx b/plugins/ProcessNotifications.jsx index c956fa685..ad2cc2272 100644 --- a/plugins/ProcessNotifications.jsx +++ b/plugins/ProcessNotifications.jsx @@ -7,12 +7,15 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import classnames from 'classnames'; +import PropTypes from 'prop-types'; + import {clearProcess, ProcessStatus} from '../actions/processNotifications'; import Icon from '../components/Icon'; import Spinner from '../components/Spinner'; + import './style/ProcessNotifications.css'; /** diff --git a/plugins/RasterExport.jsx b/plugins/RasterExport.jsx index a411fe15e..efe0fda03 100644 --- a/plugins/RasterExport.jsx +++ b/plugins/RasterExport.jsx @@ -6,13 +6,15 @@ * LICENSE file in the root directory of this source tree. */ -import axios from 'axios'; import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import axios from 'axios'; import FileSaver from 'file-saver'; -import isEmpty from 'lodash.isempty'; import formDataEntries from 'formdata-json'; +import isEmpty from 'lodash.isempty'; +import PropTypes from 'prop-types'; + import {LayerRole} from '../actions/layers'; import {setCurrentTask} from '../actions/task'; import Icon from '../components/Icon'; @@ -27,6 +29,7 @@ import LocaleUtils from '../utils/LocaleUtils'; import MapUtils from '../utils/MapUtils'; import MiscUtils from '../utils/MiscUtils'; import VectorLayerUtils from '../utils/VectorLayerUtils'; + import './style/RasterExport.css'; diff --git a/plugins/Redlining.jsx b/plugins/Redlining.jsx index eb62503cf..d037fbb61 100644 --- a/plugins/Redlining.jsx +++ b/plugins/Redlining.jsx @@ -7,15 +7,17 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; -import {connect} from 'react-redux'; import NumericInput from 'react-numeric-input2'; -import Mousetrap from 'mousetrap'; +import {connect} from 'react-redux'; + import FileSaver from 'file-saver'; +import Mousetrap from 'mousetrap'; import ol from 'openlayers'; -import {changeRedliningState} from '../actions/redlining'; +import PropTypes from 'prop-types'; + import {LayerRole, addLayer} from '../actions/layers'; import {setSnappingConfig} from '../actions/map'; +import {changeRedliningState} from '../actions/redlining'; import Icon from '../components/Icon'; import TaskBar from '../components/TaskBar'; import ButtonBar from '../components/widgets/ButtonBar'; @@ -23,10 +25,11 @@ import ColorButton from '../components/widgets/ColorButton'; import ComboBox from '../components/widgets/ComboBox'; import MenuButton from '../components/widgets/MenuButton'; import VectorLayerPicker from '../components/widgets/VectorLayerPicker'; +import {END_MARKERS} from '../utils/FeatureStyles'; import LocaleUtils from '../utils/LocaleUtils'; import MapUtils from '../utils/MapUtils'; -import {END_MARKERS} from '../utils/FeatureStyles'; import VectorLayerUtils from '../utils/VectorLayerUtils'; + import './style/Redlining.css'; diff --git a/plugins/Routing.jsx b/plugins/Routing.jsx index 7840fc727..93aa238c1 100644 --- a/plugins/Routing.jsx +++ b/plugins/Routing.jsx @@ -7,22 +7,24 @@ */ import React from 'react'; +import NumericInput from 'react-numeric-input2'; import {connect} from 'react-redux'; +import Sortable from 'react-sortablejs'; + +import FileSaver from 'file-saver'; import PropTypes from 'prop-types'; import {createSelector} from 'reselect'; -import FileSaver from 'file-saver'; -import NumericInput from 'react-numeric-input2'; -import Sortable from 'react-sortablejs'; + import {LayerRole, addLayerFeatures, removeLayer} from '../actions/layers'; import {zoomToExtent} from '../actions/map'; import {setCurrentTask} from '../actions/task'; import Icon from '../components/Icon'; import InputContainer from '../components/InputContainer'; +import ResizeableWindow from '../components/ResizeableWindow'; +import Spinner from '../components/Spinner'; import ButtonBar from '../components/widgets/ButtonBar'; import DateTimeInput from '../components/widgets/DateTimeInput'; import SearchWidget from '../components/widgets/SearchWidget'; -import Spinner from '../components/Spinner'; -import ResizeableWindow from '../components/ResizeableWindow'; import ToggleSwitch from '../components/widgets/ToggleSwitch'; import VectorLayerPicker from '../components/widgets/VectorLayerPicker'; import displayCrsSelector from '../selectors/displaycrs'; @@ -31,9 +33,10 @@ import CoordinatesUtils from '../utils/CoordinatesUtils'; import LocaleUtils from '../utils/LocaleUtils'; import MeasureUtils from '../utils/MeasureUtils'; import RoutingInterface from '../utils/RoutingInterface'; -import './style/Routing.css'; import VectorLayerUtils from '../utils/VectorLayerUtils'; +import './style/Routing.css'; + /** * Compute routes and isochrones. diff --git a/plugins/ScratchDrawing.jsx b/plugins/ScratchDrawing.jsx index 342f8d89d..de3607dcb 100644 --- a/plugins/ScratchDrawing.jsx +++ b/plugins/ScratchDrawing.jsx @@ -7,13 +7,15 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import Mousetrap from 'mousetrap'; +import PropTypes from 'prop-types'; import {v1 as uuidv1} from 'uuid'; -import {changeRedliningState} from '../actions/redlining'; + import {LayerRole, addLayerFeatures, removeLayer, clearLayer} from '../actions/layers'; import {setSnappingConfig} from '../actions/map'; +import {changeRedliningState} from '../actions/redlining'; import {setCurrentTask} from '../actions/task'; import TaskBar from '../components/TaskBar'; import LocaleUtils from '../utils/LocaleUtils'; diff --git a/plugins/Settings.jsx b/plugins/Settings.jsx index 4d1395912..e90ad4319 100644 --- a/plugins/Settings.jsx +++ b/plugins/Settings.jsx @@ -8,16 +8,19 @@ import React from 'react'; import {connect} from 'react-redux'; -import PropTypes from 'prop-types'; + import axios from 'axios'; import isEmpty from 'lodash.isempty'; +import PropTypes from 'prop-types'; import url from 'url'; + import {setColorScheme, setUserInfoFields} from '../actions/localConfig'; import SideBar from '../components/SideBar'; import ConfigUtils from '../utils/ConfigUtils'; -import {getUserBookmarks} from '../utils/PermaLinkUtils'; import LocaleUtils from '../utils/LocaleUtils'; +import {getUserBookmarks} from '../utils/PermaLinkUtils'; import ThemeUtils from '../utils/ThemeUtils'; + import './style/Settings.css'; diff --git a/plugins/Share.jsx b/plugins/Share.jsx index 27f89aa0c..01389f7d9 100644 --- a/plugins/Share.jsx +++ b/plugins/Share.jsx @@ -8,17 +8,20 @@ import React from 'react'; import {connect} from 'react-redux'; + import PropTypes from 'prop-types'; import url from 'url'; + import {addMarker, removeMarker} from '../actions/layers'; -import ShareSocials from '../components/share/ShareSocials'; -import ShareQRCode from '../components/share/ShareQRCode'; -import ShareLink from '../components/share/ShareLink'; import SideBar from '../components/SideBar'; +import ShareLink from '../components/share/ShareLink'; +import ShareQRCode from '../components/share/ShareQRCode'; +import ShareSocials from '../components/share/ShareSocials'; import ToggleSwitch from '../components/widgets/ToggleSwitch'; -import LocaleUtils from '../utils/LocaleUtils'; import CoordinatesUtils from '../utils/CoordinatesUtils'; +import LocaleUtils from '../utils/LocaleUtils'; import {generatePermaLink} from '../utils/PermaLinkUtils'; + import './style/Share.css'; diff --git a/plugins/StartupMarker.jsx b/plugins/StartupMarker.jsx index e145dc1d7..a1b5623e9 100644 --- a/plugins/StartupMarker.jsx +++ b/plugins/StartupMarker.jsx @@ -7,8 +7,10 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import PropTypes from 'prop-types'; + import {addMarker, removeMarker} from '../actions/layers'; import {UrlParams} from '../utils/PermaLinkUtils'; diff --git a/plugins/TaskButton.jsx b/plugins/TaskButton.jsx index 8c38d6cec..25454c274 100644 --- a/plugins/TaskButton.jsx +++ b/plugins/TaskButton.jsx @@ -7,14 +7,17 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import classnames from 'classnames'; +import PropTypes from 'prop-types'; + import {setCurrentTask} from '../actions/task'; import Icon from '../components/Icon'; import ConfigUtils from '../utils/ConfigUtils'; import LocaleUtils from "../utils/LocaleUtils"; import ThemeUtils from '../utils/ThemeUtils'; + import './style/BackgroundSwitcher.css'; /** diff --git a/plugins/ThemeSwitcher.jsx b/plugins/ThemeSwitcher.jsx index 74fe6da0b..8fe767dd4 100644 --- a/plugins/ThemeSwitcher.jsx +++ b/plugins/ThemeSwitcher.jsx @@ -7,15 +7,18 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import PropTypes from 'prop-types'; + import Icon from '../components/Icon'; import InputContainer from '../components/InputContainer'; import SideBar from '../components/SideBar'; +import ThemeLayersListWindow from '../components/ThemeLayersListWindow'; import ThemeList from '../components/ThemeList'; import ConfigUtils from '../utils/ConfigUtils'; import LocaleUtils from '../utils/LocaleUtils'; -import ThemeLayersListWindow from '../components/ThemeLayersListWindow'; + import './style/ThemeSwitcher.css'; diff --git a/plugins/TimeManager.jsx b/plugins/TimeManager.jsx index 5dbc10b36..c089348b2 100644 --- a/plugins/TimeManager.jsx +++ b/plugins/TimeManager.jsx @@ -8,34 +8,36 @@ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; -import {createSelector} from 'reselect'; + +import dateParser, { Format } from 'any-date-parser'; import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; -import {v1 as uuidv1} from 'uuid'; -import ol from 'openlayers'; -import isEqual from 'lodash.isequal'; import isEmpty from 'lodash.isempty'; -import dateParser, { Format } from 'any-date-parser'; +import isEqual from 'lodash.isequal'; +import ol from 'openlayers'; +import PropTypes from 'prop-types'; +import {createSelector} from 'reselect'; +import {v1 as uuidv1} from 'uuid'; + import {setLayerDimensions, addLayerFeatures, refreshLayer, removeLayer, LayerRole} from '../actions/layers'; import {setCurrentTask, setCurrentTaskBlocked} from '../actions/task'; import Icon from '../components/Icon'; -import TimelineFeaturesSlider from '../components/timeline/TimelineFeaturesSlider'; +import ResizeableWindow from '../components/ResizeableWindow'; import FixedTimeline from '../components/timeline/FixedTimeline'; import InfiniteTimeline from '../components/timeline/InfiniteTimeline'; +import TimelineFeaturesSlider from '../components/timeline/TimelineFeaturesSlider'; import ButtonBar from '../components/widgets/ButtonBar'; import NumberInput from '../components/widgets/NumberInput'; import ToggleSwitch from '../components/widgets/ToggleSwitch'; -import ResizeableWindow from '../components/ResizeableWindow'; import IdentifyUtils from '../utils/IdentifyUtils'; import LayerUtils from '../utils/LayerUtils'; import LocaleUtils from '../utils/LocaleUtils'; import VectorLayerUtils from '../utils/VectorLayerUtils'; -import './style/TimeManager.css'; - import markerIcon from '../utils/img/marker-icon.png'; +import './style/TimeManager.css'; + dayjs.extend(utc); const DateUnitLabels = { diff --git a/plugins/TopBar.jsx b/plugins/TopBar.jsx index 9f169357e..87d19fb13 100644 --- a/plugins/TopBar.jsx +++ b/plugins/TopBar.jsx @@ -7,9 +7,11 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; -import classnames from 'classnames'; import {connect} from 'react-redux'; + +import classnames from 'classnames'; +import PropTypes from 'prop-types'; + import {toggleFullscreen} from '../actions/display'; import {setTopbarHeight} from '../actions/map'; import {openExternalUrl} from '../actions/task'; @@ -18,6 +20,7 @@ import Icon from '../components/Icon'; import {Swipeable} from '../components/Swipeable'; import ConfigUtils from '../utils/ConfigUtils'; import LocaleUtils from '../utils/LocaleUtils'; + import './style/TopBar.css'; diff --git a/plugins/ZoomButtons.jsx b/plugins/ZoomButtons.jsx index 4b7351e7f..43a41c038 100644 --- a/plugins/ZoomButtons.jsx +++ b/plugins/ZoomButtons.jsx @@ -7,12 +7,15 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; -import LocaleUtils from '../utils/LocaleUtils'; + +import PropTypes from 'prop-types'; + import {changeZoomLevel} from '../actions/map'; import Icon from '../components/Icon'; +import LocaleUtils from '../utils/LocaleUtils'; import ThemeUtils from '../utils/ThemeUtils'; + import './style/Buttons.css'; /** diff --git a/plugins/map/EditingSupport.jsx b/plugins/map/EditingSupport.jsx index 2acefe9ee..896484eb6 100644 --- a/plugins/map/EditingSupport.jsx +++ b/plugins/map/EditingSupport.jsx @@ -7,9 +7,11 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import ol from 'openlayers'; +import PropTypes from 'prop-types'; + import {setEditContext} from '../../actions/editing'; import FeatureStyles from "../../utils/FeatureStyles"; diff --git a/plugins/map/LocateSupport.jsx b/plugins/map/LocateSupport.jsx index 96d6f98bd..dafc617d4 100644 --- a/plugins/map/LocateSupport.jsx +++ b/plugins/map/LocateSupport.jsx @@ -9,10 +9,12 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; -import OlLocate from '../../components/map/OlLocate'; + +import PropTypes from 'prop-types'; + import {changeLocateState, changeLocatePosition, onLocateError} from '../../actions/locate'; +import OlLocate from '../../components/map/OlLocate'; class LocateSupport extends React.Component { static propTypes = { diff --git a/plugins/map/MeasurementSupport.jsx b/plugins/map/MeasurementSupport.jsx index 79709db4a..8ff5df9d8 100644 --- a/plugins/map/MeasurementSupport.jsx +++ b/plugins/map/MeasurementSupport.jsx @@ -9,13 +9,15 @@ import React from 'react'; import {connect} from 'react-redux'; + +import ol from 'openlayers'; import PropTypes from 'prop-types'; import {createSelector} from 'reselect'; -import ol from 'openlayers'; + import {changeMeasurementState} from '../../actions/measurement'; import displayCrsSelector from '../../selectors/displaycrs'; -import MeasureUtils from '../../utils/MeasureUtils'; import FeatureStyles from '../../utils/FeatureStyles'; +import MeasureUtils from '../../utils/MeasureUtils'; class MeasurementSupport extends React.Component { diff --git a/plugins/map/OverviewSupport.jsx b/plugins/map/OverviewSupport.jsx index dbe05e346..7e7a7427b 100644 --- a/plugins/map/OverviewSupport.jsx +++ b/plugins/map/OverviewSupport.jsx @@ -8,9 +8,11 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import ol from 'openlayers'; +import PropTypes from 'prop-types'; + import {LayerRole} from '../../actions/layers'; import OlLayer from '../../components/map/OlLayer'; diff --git a/plugins/map/RedliningPickSupport.jsx b/plugins/map/RedliningPickSupport.jsx index 995d93d1f..11fdc01b5 100644 --- a/plugins/map/RedliningPickSupport.jsx +++ b/plugins/map/RedliningPickSupport.jsx @@ -7,10 +7,12 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import isEmpty from 'lodash.isempty'; import ol from 'openlayers'; +import PropTypes from 'prop-types'; + import {changeRedliningPickState} from '../../actions/redliningPick'; import FeatureStyles from "../../utils/FeatureStyles"; diff --git a/plugins/map/RedliningSupport.jsx b/plugins/map/RedliningSupport.jsx index 4b8977349..267a2aae5 100644 --- a/plugins/map/RedliningSupport.jsx +++ b/plugins/map/RedliningSupport.jsx @@ -7,17 +7,19 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; -import {createSelector} from 'reselect'; -import {v4 as uuidv4} from 'uuid'; -import ol from 'openlayers'; + import polySelfIntersections from 'geojson-polygon-self-intersections'; import isEmpty from 'lodash.isempty'; -import {changeRedliningState} from '../../actions/redlining'; +import ol from 'openlayers'; +import PropTypes from 'prop-types'; +import {createSelector} from 'reselect'; +import {v4 as uuidv4} from 'uuid'; + import {LayerRole, addLayerFeatures, removeLayerFeatures} from '../../actions/layers'; -import {OlLayerAdded, OlLayerUpdated} from '../../components/map/OlLayer'; +import {changeRedliningState} from '../../actions/redlining'; import NumericInputWindow from '../../components/NumericInputWindow'; +import {OlLayerAdded, OlLayerUpdated} from '../../components/map/OlLayer'; import displayCrsSelector from '../../selectors/displaycrs'; import FeatureStyles from '../../utils/FeatureStyles'; import MapUtils from '../../utils/MapUtils'; diff --git a/plugins/map/ScaleBarSupport.jsx b/plugins/map/ScaleBarSupport.jsx index 606cd6d48..94ad1c7be 100644 --- a/plugins/map/ScaleBarSupport.jsx +++ b/plugins/map/ScaleBarSupport.jsx @@ -8,8 +8,9 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; + import ol from 'openlayers'; +import PropTypes from 'prop-types'; export default class ScaleBarSupport extends React.Component { static propTypes = { diff --git a/plugins/map/SnapSupport.jsx b/plugins/map/SnapSupport.jsx index a867ddfb8..09bf961b5 100644 --- a/plugins/map/SnapSupport.jsx +++ b/plugins/map/SnapSupport.jsx @@ -6,15 +6,17 @@ * LICENSE file in the root directory of this source tree. */ -import axios from 'axios'; import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + +import axios from 'axios'; import ol from 'openlayers'; +import PropTypes from 'prop-types'; import {v4 as uuidv4} from 'uuid'; + import {LayerRole} from '../../actions/layers'; -import IdentifyUtils from '../../utils/IdentifyUtils'; import FeatureStyles from "../../utils/FeatureStyles"; +import IdentifyUtils from '../../utils/IdentifyUtils'; class SnapSupport extends React.Component { static propTypes = { diff --git a/plugins/map/SnappingSupport.jsx b/plugins/map/SnappingSupport.jsx index 7e6075dd4..0c94e568a 100644 --- a/plugins/map/SnappingSupport.jsx +++ b/plugins/map/SnappingSupport.jsx @@ -7,18 +7,20 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; import {connect} from 'react-redux'; + import isEmpty from 'lodash.isempty'; import ol from 'openlayers'; +import PropTypes from 'prop-types'; import {v1 as uuidv1} from 'uuid'; + import {LayerRole} from '../../actions/layers'; import {setSnappingConfig} from '../../actions/map'; import Icon from '../../components/Icon'; import Spinner from '../../components/Spinner'; +import IdentifyUtils from '../../utils/IdentifyUtils'; import LocaleUtils from '../../utils/LocaleUtils'; import MapUtils from '../../utils/MapUtils'; -import IdentifyUtils from '../../utils/IdentifyUtils'; import VectorLayerUtils from '../../utils/VectorLayerUtils'; import SnapInteraction from './SnapInteraction'; diff --git a/plugins/redlining/RedliningBufferSupport.jsx b/plugins/redlining/RedliningBufferSupport.jsx index 4add57b64..dae214f18 100644 --- a/plugins/redlining/RedliningBufferSupport.jsx +++ b/plugins/redlining/RedliningBufferSupport.jsx @@ -7,11 +7,13 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; +import NumericInput from 'react-numeric-input2'; import {connect} from 'react-redux'; + import buffer from '@turf/buffer'; +import PropTypes from 'prop-types'; import {v4 as uuidv4} from 'uuid'; -import NumericInput from 'react-numeric-input2'; + import {LayerRole, addLayer, addLayerFeatures} from '../../actions/layers'; import VectorLayerPicker from '../../components/widgets/VectorLayerPicker'; import LocaleUtils from '../../utils/LocaleUtils'; diff --git a/reducers/layers.js b/reducers/layers.js index 829b2b840..16db106c7 100644 --- a/reducers/layers.js +++ b/reducers/layers.js @@ -8,10 +8,8 @@ */ import isEmpty from 'lodash.isempty'; -import {UrlParams} from '../utils/PermaLinkUtils'; -import LayerUtils from '../utils/LayerUtils'; -import VectorLayerUtils from '../utils/VectorLayerUtils'; import {v4 as uuidv4} from 'uuid'; + import { LayerRole, SET_LAYER_LOADING, @@ -32,6 +30,9 @@ import { SET_LAYERS, SET_FILTER } from '../actions/layers'; +import LayerUtils from '../utils/LayerUtils'; +import {UrlParams} from '../utils/PermaLinkUtils'; +import VectorLayerUtils from '../utils/VectorLayerUtils'; function propagateLayerProperty(newlayer, property, value, path = null) { diff --git a/reducers/localConfig.js b/reducers/localConfig.js index d836fa9a5..c8be2edae 100644 --- a/reducers/localConfig.js +++ b/reducers/localConfig.js @@ -8,7 +8,6 @@ */ import {LOCAL_CONFIG_LOADED, SET_STARTUP_PARAMETERS, SET_COLOR_SCHEME, SET_USER_INFO_FIELDS, SET_PERMALINK_PARAMETERS} from '../actions/localConfig'; - import ConfigUtils from '../utils/ConfigUtils'; import {UrlParams} from '../utils/PermaLinkUtils'; diff --git a/reducers/locale.js b/reducers/locale.js index 75765ac03..f49345ba6 100644 --- a/reducers/locale.js +++ b/reducers/locale.js @@ -7,9 +7,10 @@ * LICENSE file in the root directory of this source tree. */ -import {CHANGE_LOCALE} from '../actions/locale'; import {flatten} from 'flat'; +import {CHANGE_LOCALE} from '../actions/locale'; + const defaultState = { messages: {}, fallbackMessages: {}, diff --git a/reducers/map.js b/reducers/map.js index e56c76825..f2e8af528 100644 --- a/reducers/map.js +++ b/reducers/map.js @@ -7,15 +7,16 @@ * LICENSE file in the root directory of this source tree. */ +import isEmpty from 'lodash.isempty'; + import { CHANGE_MAP_VIEW, CONFIGURE_MAP, CHANGE_ZOOM_LVL, ZOOM_TO_EXTENT, ZOOM_TO_POINT, PAN_TO, CHANGE_ROTATION, CLICK_ON_MAP, TOGGLE_MAPTIPS, SET_TOPBAR_HEIGHT, SET_BOTTOMBAR_HEIGHT, SET_SNAPPING_CONFIG } from '../actions/map'; -import isEmpty from 'lodash.isempty'; -import MapUtils from '../utils/MapUtils'; -import {UrlParams} from '../utils/PermaLinkUtils'; import ConfigUtils from '../utils/ConfigUtils'; import CoordinatesUtils from '../utils/CoordinatesUtils'; +import MapUtils from '../utils/MapUtils'; +import {UrlParams} from '../utils/PermaLinkUtils'; const defaultState = { bbox: {bounds: [0, 0, 0, 0], rotation: 0}, diff --git a/reducers/windows.js b/reducers/windows.js index b3f5a5631..c4b04b978 100644 --- a/reducers/windows.js +++ b/reducers/windows.js @@ -39,7 +39,7 @@ function computeMapMargins(windowMargins, menuMargins) { top: windowMargins.top, right: windowMargins.right + menuMargins.right, bottom: windowMargins.bottom - } + }; } export default function windows(state = defaultState, action) { diff --git a/scripts/themesConfig.js b/scripts/themesConfig.js index 72368cace..e14082aad 100644 --- a/scripts/themesConfig.js +++ b/scripts/themesConfig.js @@ -655,15 +655,15 @@ function genThemes(themesConfig) { } lookup(os.hostname(), { hints: dns.ADDRCONFIG }) - .then((result) => lookupService(result.address, 0)) - .then((result) => { - hostFqdn = "http://" + result.hostname; - console.log("Reading " + themesConfigPath); - - genThemes(themesConfigPath); - }) - .catch((error) => { - process.nextTick(() => { - throw error; + .then((result) => lookupService(result.address, 0)) + .then((result) => { + hostFqdn = "http://" + result.hostname; + console.log("Reading " + themesConfigPath); + + genThemes(themesConfigPath); + }) + .catch((error) => { + process.nextTick(() => { + throw error; + }); }); - }); diff --git a/scripts/updateTranslations.js b/scripts/updateTranslations.js index 4ce7d6c0f..6237d793c 100644 --- a/scripts/updateTranslations.js +++ b/scripts/updateTranslations.js @@ -65,7 +65,7 @@ const listDir = (dir, pattern) => { return results; }; -const updateTsConfig = (topdir, tsconfig, collectedMsgIds=null) => { +const updateTsConfig = (topdir, tsconfig, collectedMsgIds = null) => { const files = listDir(topdir, new RegExp("^.*\.jsx?$")); const trRegEx = /LocaleUtils\.tr(?:msg)?\((['\"])([A-Za-z0-9\._]+)\1/g; const msgIds = new Set(); diff --git a/selectors/searchproviders.js b/selectors/searchproviders.js index be070505e..8c64843ab 100644 --- a/selectors/searchproviders.js +++ b/selectors/searchproviders.js @@ -7,6 +7,7 @@ */ import {createSelector} from 'reselect'; + import {LayerRole} from '../actions/layers'; import ConfigUtils from '../utils/ConfigUtils'; import LocaleUtils from '../utils/LocaleUtils'; diff --git a/stores/StandardStore.js b/stores/StandardStore.js index 373d00d52..e1f21bc18 100644 --- a/stores/StandardStore.js +++ b/stores/StandardStore.js @@ -7,9 +7,10 @@ * LICENSE file in the root directory of this source tree. */ import {configureStore} from '@reduxjs/toolkit'; +import merge from 'deepmerge'; import {combineReducers} from 'redux'; import {logger} from 'redux-logger'; -import merge from 'deepmerge'; + import {CHANGE_BROWSER_PROPERTIES} from '../actions/browser'; import ReducerIndex from '../reducers/index'; diff --git a/utils/ConfigUtils.js b/utils/ConfigUtils.js index e511be69d..3c5fcc532 100644 --- a/utils/ConfigUtils.js +++ b/utils/ConfigUtils.js @@ -8,8 +8,9 @@ */ import axios from 'axios'; -import url from 'url'; import isMobile from 'ismobilejs'; +import url from 'url'; + import StandardStore from '../stores/StandardStore'; let defaultConfig = { diff --git a/utils/CoordinatesUtils.js b/utils/CoordinatesUtils.js index f4f5f1bf2..5742f9e66 100644 --- a/utils/CoordinatesUtils.js +++ b/utils/CoordinatesUtils.js @@ -6,8 +6,8 @@ * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ -import Proj4js from 'proj4'; import ol from 'openlayers'; +import Proj4js from 'proj4'; const crsLabels = { "EPSG:4326": "WGS 84", diff --git a/utils/EditingInterface.js b/utils/EditingInterface.js index 18972512a..45a01cd0f 100644 --- a/utils/EditingInterface.js +++ b/utils/EditingInterface.js @@ -15,6 +15,7 @@ */ import axios from 'axios'; import isEmpty from 'lodash.isempty'; + import ConfigUtils from './ConfigUtils'; import LocaleUtils from './LocaleUtils'; diff --git a/utils/FeatureStyles.js b/utils/FeatureStyles.js index c413967d9..fa5fb6d88 100644 --- a/utils/FeatureStyles.js +++ b/utils/FeatureStyles.js @@ -7,10 +7,11 @@ */ import ol from 'openlayers'; + import ConfigUtils from './ConfigUtils'; import ResourceRegistry from './ResourceRegistry'; -import markerIcon from './img/marker-icon.png'; import arrowhead from './img/arrowhead.svg'; +import markerIcon from './img/marker-icon.png'; import measurehead from './img/measurehead.svg'; const DEFAULT_FEATURE_STYLE = { diff --git a/utils/IdentifyUtils.js b/utils/IdentifyUtils.js index 09363c0c4..e60453e38 100644 --- a/utils/IdentifyUtils.js +++ b/utils/IdentifyUtils.js @@ -6,15 +6,16 @@ * LICENSE file in the root directory of this source tree. */ -import isEmpty from 'lodash.isempty'; +import axios from 'axios'; import geojsonBbox from 'geojson-bounding-box'; +import isEmpty from 'lodash.isempty'; import ol from 'openlayers'; import url from 'url'; -import axios from 'axios'; import {v1 as uuidv1} from 'uuid'; + import {LayerRole} from '../actions/layers'; -import CoordinatesUtils from '../utils/CoordinatesUtils'; import ConfigUtils from '../utils/ConfigUtils'; +import CoordinatesUtils from '../utils/CoordinatesUtils'; import LayerUtils from '../utils/LayerUtils'; import MapUtils from '../utils/MapUtils'; import VectorLayerUtils from './VectorLayerUtils'; diff --git a/utils/ImageEditor.js b/utils/ImageEditor.js index 41e2615b2..8354473ca 100644 --- a/utils/ImageEditor.js +++ b/utils/ImageEditor.js @@ -7,8 +7,10 @@ */ import Painterro from 'painterro'; -import LocaleUtils from '../utils/LocaleUtils'; + import StandardStore from '../stores/StandardStore'; +import LocaleUtils from '../utils/LocaleUtils'; + import '../components/style/ModalDialog.css'; export function showImageEditor(imageData, imageDataCallback) { diff --git a/utils/LayerUtils.js b/utils/LayerUtils.js index d6fca29a5..f62aabcca 100644 --- a/utils/LayerUtils.js +++ b/utils/LayerUtils.js @@ -8,12 +8,13 @@ import isEmpty from 'lodash.isempty'; import isEqual from 'lodash.isequal'; -import {v4 as uuidv4} from 'uuid'; import url from 'url'; +import {v4 as uuidv4} from 'uuid'; + +import {LayerRole} from '../actions/layers'; import ConfigUtils from './ConfigUtils'; import CoordinatesUtils from './CoordinatesUtils'; import MapUtils from './MapUtils'; -import {LayerRole} from '../actions/layers'; import VectorLayerUtils from './VectorLayerUtils'; const LayerUtils = { @@ -774,7 +775,7 @@ const LayerUtils = { LAYER: layername, STYLES: style, FILTER: layer.params.FILTER ?? '' - } + }; delete urlParts.search; return url.format(urlParts); } diff --git a/utils/MeasureUtils.js b/utils/MeasureUtils.js index b5c4e7657..fec727b49 100644 --- a/utils/MeasureUtils.js +++ b/utils/MeasureUtils.js @@ -8,6 +8,7 @@ */ import ol from 'openlayers'; + import ConfigUtils from './ConfigUtils'; import CoordinatesUtils from "./CoordinatesUtils"; import LocaleUtils from './LocaleUtils'; diff --git a/utils/PermaLinkUtils.js b/utils/PermaLinkUtils.js index ca383c657..7ddba83af 100644 --- a/utils/PermaLinkUtils.js +++ b/utils/PermaLinkUtils.js @@ -6,8 +6,9 @@ * LICENSE file in the root directory of this source tree. */ -import url from 'url'; import axios from 'axios'; +import url from 'url'; + import {LayerRole} from '../actions/layers'; import ConfigUtils from '../utils/ConfigUtils'; import LayerUtils from '../utils/LayerUtils'; diff --git a/utils/RoutingInterface.js b/utils/RoutingInterface.js index b612fafae..0dc37f03a 100644 --- a/utils/RoutingInterface.js +++ b/utils/RoutingInterface.js @@ -9,6 +9,7 @@ import axios from 'axios'; import {v1 as uuidv1} from 'uuid'; + import ConfigUtils from './ConfigUtils'; import LocaleUtils from './LocaleUtils'; import VectorLayerUtils from './VectorLayerUtils'; diff --git a/utils/ServiceLayerUtils.js b/utils/ServiceLayerUtils.js index b71ac8efb..7cd1f8cf1 100644 --- a/utils/ServiceLayerUtils.js +++ b/utils/ServiceLayerUtils.js @@ -6,18 +6,19 @@ * LICENSE file in the root directory of this source tree. */ -import ol from 'openlayers'; import axios from 'axios'; import deepmerge from 'deepmerge'; -import isEmpty from 'lodash.isempty'; import {XMLParser} from 'fast-xml-parser'; +import isEmpty from 'lodash.isempty'; +import ol from 'openlayers'; import randomColor from 'randomcolor'; import url from 'url'; + +import {LayerRole} from '../actions/layers'; import ConfigUtils from './ConfigUtils'; import CoordinatesUtils from './CoordinatesUtils'; import LayerUtils from './LayerUtils'; import MiscUtils from './MiscUtils'; -import {LayerRole} from '../actions/layers'; function strcmp(a, b) { const al = a.toLowerCase(); diff --git a/utils/ThemeUtils.js b/utils/ThemeUtils.js index eebd44c54..7e5fd2ab1 100644 --- a/utils/ThemeUtils.js +++ b/utils/ThemeUtils.js @@ -6,13 +6,13 @@ * LICENSE file in the root directory of this source tree. */ +import {remove as removeDiacritics} from 'diacritics'; import isEmpty from 'lodash.isempty'; import url from 'url'; import {v4 as uuidv4} from 'uuid'; -import {remove as removeDiacritics} from 'diacritics'; -import {SearchResultType} from '../actions/search'; import {LayerRole} from '../actions/layers'; +import {SearchResultType} from '../actions/search'; import {NotificationType, showNotification} from '../actions/windows'; import ConfigUtils from './ConfigUtils'; import LayerUtils from './LayerUtils'; diff --git a/utils/VectorLayerUtils.js b/utils/VectorLayerUtils.js index 750233c5c..ae2464cf2 100644 --- a/utils/VectorLayerUtils.js +++ b/utils/VectorLayerUtils.js @@ -6,14 +6,15 @@ * LICENSE file in the root directory of this source tree. */ -import {v1 as uuidv1} from 'uuid'; -import ol from 'openlayers'; -import isEmpty from 'lodash.isempty'; import geojsonBbox from 'geojson-bounding-box'; +import isEmpty from 'lodash.isempty'; +import {getDefaultImageStyle} from 'ol/format/KML'; +import ol from 'openlayers'; import svgpath from 'svgpath'; -import CoordinatesUtils from '../utils/CoordinatesUtils'; +import {v1 as uuidv1} from 'uuid'; + import ConfigUtils from '../utils/ConfigUtils'; -import {getDefaultImageStyle} from 'ol/format/KML'; +import CoordinatesUtils from '../utils/CoordinatesUtils'; import {END_MARKERS, computeFeatureStyle} from '../utils/FeatureStyles';