From 6deca1dbae8e41f76359a432c7f743dc799f5907 Mon Sep 17 00:00:00 2001 From: mbarto Date: Tue, 28 Mar 2017 15:00:07 +0200 Subject: [PATCH 1/3] Documented the dynamic configuration feature for plugins (#1651) * Documented the dynamic configuration feature for plugins * Fixed typo --- docs/developer-guide/plugins-architecture.md | 2 +- docs/developer-guide/plugins-documentation.md | 37 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/docs/developer-guide/plugins-architecture.md b/docs/developer-guide/plugins-architecture.md index 7ade494e9f..39561d3ce4 100644 --- a/docs/developer-guide/plugins-architecture.md +++ b/docs/developer-guide/plugins-architecture.md @@ -99,7 +99,7 @@ My.jsx: // this is a dumb component const MyComponent = require('../components/MyComponent'); -const {connect} = require('react-redux'); +const {connect} = require('../utils/PluginsUtils'); // let's wire it to state and actions const MyPlugin = connect((state) => ({ diff --git a/docs/developer-guide/plugins-documentation.md b/docs/developer-guide/plugins-documentation.md index 29a09b7fe1..b3914ede4d 100644 --- a/docs/developer-guide/plugins-documentation.md +++ b/docs/developer-guide/plugins-documentation.md @@ -40,4 +40,41 @@ or fully configured: ] } ``` + +## Dynamic configuration +Configuration properties of plugins can use expressions, so that they are dynamically bound to the +application state. + +An expression is anything between curly brackets ({...}) that is a javascript expression, +where the **monitored state** of the application is available as a set of variables. + +To define the monitored state, you have to add a **monitorState** property in **localConfig.json**. + +```js +{ + ... + "monitorState": [{"name": "mapType", "path": "mapType.mapType"}] + ... +} +``` + +Where: + * **name** is the name of the variable that can be used in expressions + * **path** is a javascript object path to the state fragment to be monitored (e.g. map.present.zoom) + +When you have a monitored state, you can use it in configuration properties this way: + +```js +"cfg": { + ... + "myProp": "{mapType === 'openlayers' ? 1 : 2}" + ... +} +``` + +Expressions are supported in **cfg** properties and in **hideFrom** and **showIn** sections. + +In addition to monitored state also the **page request parameters** are available as variables to be +used in expressions. + Look at the [plugin reference page](./api/plugins) for a list of available configuration properties. From 9231e08069bb53dd8929602310c1b0d23d011ed7 Mon Sep 17 00:00:00 2001 From: mbarto Date: Tue, 28 Mar 2017 15:00:37 +0200 Subject: [PATCH 2/3] Allow custom plugins definition in JS API (#1649) --- .../components/plugins/PluginsContainer.jsx | 4 +- web/client/examples/api/app.js | 2 +- web/client/examples/api/plugins.js | 47 ++ web/client/jsapi/MapStore2.js | 111 ++-- web/client/jsapi/mapstore2.css | 599 ------------------ web/client/utils/PluginsUtils.js | 2 +- 6 files changed, 113 insertions(+), 652 deletions(-) create mode 100644 web/client/examples/api/plugins.js delete mode 100644 web/client/jsapi/mapstore2.css diff --git a/web/client/components/plugins/PluginsContainer.jsx b/web/client/components/plugins/PluginsContainer.jsx index bf691efbab..c4d3a54139 100644 --- a/web/client/components/plugins/PluginsContainer.jsx +++ b/web/client/components/plugins/PluginsContainer.jsx @@ -62,7 +62,7 @@ const PluginsContainer = React.createClass({ return plugins .filter((Plugin) => !Plugin.hide) .map(this.getPluginDescriptor) - .filter((Plugin) => !Plugin.impl.loadPlugin) + .filter((Plugin) => Plugin && !Plugin.impl.loadPlugin) .filter(this.filterPlugins) .map((Plugin) => ); @@ -87,7 +87,7 @@ const PluginsContainer = React.createClass({ (this.props.pluginsConfig && this.props.pluginsConfig[this.props.mode] || []) .map((plugin) => PluginsUtils.getPluginDescriptor(this.getState, this.props.plugins, this.props.pluginsConfig[this.props.mode], plugin, this.state.loadedPlugins)) - .filter((plugin) => plugin.impl.loadPlugin).forEach((plugin) => { + .filter((plugin) => plugin && plugin.impl.loadPlugin).forEach((plugin) => { if (!this.state.loadedPlugins[plugin.name]) { if (!plugin.impl.enabler || plugin.impl.enabler(state)) { plugin.impl.loadPlugin((impl) => this.loadPlugin(plugin, impl)); diff --git a/web/client/examples/api/app.js b/web/client/examples/api/app.js index 5cc37075be..852505ada5 100644 --- a/web/client/examples/api/app.js +++ b/web/client/examples/api/app.js @@ -6,5 +6,5 @@ * LICENSE file in the root directory of this source tree. */ -const MapStore2 = require('../../jsapi/MapStore2'); +const MapStore2 = require('../../jsapi/MapStore2').withPlugins(require('./plugins')); window.MapStore2 = MapStore2; diff --git a/web/client/examples/api/plugins.js b/web/client/examples/api/plugins.js new file mode 100644 index 0000000000..f5ab80c48f --- /dev/null +++ b/web/client/examples/api/plugins.js @@ -0,0 +1,47 @@ +/** + * Copyright 2016, GeoSolutions Sas. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +module.exports = { + plugins: { + MapPlugin: require('../../plugins/Map'), + ToolbarPlugin: require('../../plugins/Toolbar'), + DrawerMenuPlugin: require('../../plugins/DrawerMenu'), + ShapeFilePlugin: require('../../plugins/ShapeFile'), + SnapshotPlugin: require('../../plugins/Snapshot'), + SettingsPlugin: require('../../plugins/Settings'), + ExpanderPlugin: require('../../plugins/Expander'), + SearchPlugin: require('../../plugins/Search'), + ScaleBoxPlugin: require('../../plugins/ScaleBox'), + LocatePlugin: require('../../plugins/Locate'), + ZoomInPlugin: require('../../plugins/ZoomIn'), + ZoomOutPlugin: require('../../plugins/ZoomOut'), + ZoomAllPlugin: require('../../plugins/ZoomAll'), + MapLoadingPlugin: require('../../plugins/MapLoading'), + HelpPlugin: require('../../plugins/Help'), + HomePlugin: require('../../plugins/Home'), + MetadataExplorerPlugin: require('../../plugins/MetadataExplorer'), + LoginPlugin: require('../../plugins/Login'), + OmniBarPlugin: require('../../plugins/OmniBar'), + BurgerMenuPlugin: require('../../plugins/BurgerMenu'), + UndoPlugin: require('../../plugins/History'), + RedoPlugin: require('../../plugins/History'), + MapsPlugin: require('../../plugins/Maps'), + MapSearchPlugin: require('../../plugins/MapSearch'), + LanguagePlugin: require('../../plugins/Language'), + ManagerPlugin: require('../../plugins/manager/Manager'), + RulesManagerPlugin: require('../../plugins/manager/RulesManager'), + ManagerMenuPlugin: require('../../plugins/manager/ManagerMenu'), + SharePlugin: require('../../plugins/Share'), + SavePlugin: require('../../plugins/Save'), + SaveAsPlugin: require('../../plugins/SaveAs') + }, + requires: { + ReactSwipe: require('react-swipeable-views').default, + SwipeHeader: require('../../components/data/identify/SwipeHeader') + } +}; diff --git a/web/client/jsapi/MapStore2.js b/web/client/jsapi/MapStore2.js index 3ae91f1fc0..1769709982 100644 --- a/web/client/jsapi/MapStore2.js +++ b/web/client/jsapi/MapStore2.js @@ -19,8 +19,7 @@ const url = require('url'); const ThemeUtils = require('../utils/ThemeUtils'); const assign = require('object-assign'); - -require('./mapstore2.css'); +const {partialRight} = require('lodash'); const defaultConfig = { "map": { @@ -223,8 +222,7 @@ const MapStore2 = { * @static * @param {string} container id of the DOM element that should contain the embedded MapStore2 * @param {object} options set of options of the embedded app - * - * The options object can contain the following properties, to configure the app UI and state: + * * The options object can contain the following properties, to configure the app UI and state: * * **plugins**: list of plugins (and the related configuration) to be included in the app * look at [Plugins documentation](./plugins-documentation) for further details * * **config**: map configuration object for the application (look at [Map Configuration](./maps-configuration) for details) @@ -259,64 +257,67 @@ const MapStore2 = { * } * } * ``` + * @param {object} [plugins] optional plugins definition (defaults to local plugins list) + * @param {object} [component] optional page component (defaults to MapStore2 Embedded Page) * @example * MapStore2.create('container', { * plugins: ['Map'] * }); */ - create(container, options) { + create(container, options, plugins, component) { const embedded = require('../containers/Embedded'); const {initialState, storeOpts} = options; + require.ensure([], () => { + const pluginsDef = plugins || require('./plugins'); + const pages = [{ + name: "embedded", + path: "/", + component: component || embedded, + pageConfig: { + pluginsConfig: options.plugins || defaultPlugins + } + }]; - const pluginsDef = require('./plugins'); - const pages = [{ - name: "embedded", - path: "/", - component: embedded, - pageConfig: { - pluginsConfig: options.plugins || defaultPlugins - } - }]; - - const StandardRouter = connect((state) => ({ - locale: state.locale || {}, - pages - }))(require('../components/app/StandardRouter')); + const StandardRouter = connect((state) => ({ + locale: state.locale || {}, + pages + }))(require('../components/app/StandardRouter')); - const appStore = require('../stores/StandardStore').bind(null, initialState || {}, {}, {}); - const initialActions = getInitialActions(options); - const appConfig = { - storeOpts: assign({}, storeOpts, {notify: true}), - appStore, - pluginsDef, - initialActions, - appComponent: StandardRouter, - printingEnabled: false - }; - if (options.style) { - let dom = document.getElementById('custom_theme'); - if (!dom) { - dom = document.createElement('style'); - dom.id = 'custom_theme'; - document.head.appendChild(dom); + const appStore = require('../stores/StandardStore').bind(null, initialState || {}, {}, {}); + const initialActions = getInitialActions(options); + const appConfig = { + storeOpts: assign({}, storeOpts, {notify: true}), + appStore, + pluginsDef, + initialActions, + appComponent: StandardRouter, + printingEnabled: false + }; + if (options.style) { + let dom = document.getElementById('custom_theme'); + if (!dom) { + dom = document.createElement('style'); + dom.id = 'custom_theme'; + document.head.appendChild(dom); + } + ThemeUtils.renderFromLess(options.style, 'custom_theme', 'themes/default/'); } - ThemeUtils.renderFromLess(options.style, 'custom_theme', 'themes/default/'); - } - const defaultThemeCfg = { - prefixContainer: '#' + container - }; + const defaultThemeCfg = { + prefixContainer: '#' + container + }; - const themeCfg = options.theme && assign({}, defaultThemeCfg, options.theme) || defaultThemeCfg; - app = ReactDOM.render(, document.getElementById(container)); - app.store.addActionListener((action) => { - (actionListeners[action.type] || []).concat(actionListeners['*'] || []).forEach((listener) => { - listener.call(null, action); + const themeCfg = options.theme && assign({}, defaultThemeCfg, options.theme) || defaultThemeCfg; + app = ReactDOM.render(, document.getElementById(container)); + app.store.addActionListener((action) => { + (actionListeners[action.type] || []).concat(actionListeners['*'] || []).forEach((listener) => { + listener.call(null, action); + }); }); - }); - app.store.subscribe(() => { - stateChangeListeners.forEach(({listener, selector}) => { - listener.call(null, selector(app.store.getState())); + app.store.subscribe(() => { + stateChangeListeners.forEach(({listener, selector}) => { + listener.call(null, selector(app.store.getState())); + }); }); }); }, @@ -385,6 +386,18 @@ const MapStore2 = { */ offStateChange: (listener) => { stateChangeListeners = stateChangeListeners.filter((l) => l !== listener); + }, + /** + * Returns a new custom API object using the given plugins list. + * + * @memberof MapStore2 + * @static + * @param {object} plugins list of included plugins + * @example + * MapStore2.withPlugins({...}); + */ + withPlugins: (plugins) => { + return assign({}, MapStore2, {create: partialRight(MapStore2.create, plugins)}); } }; diff --git a/web/client/jsapi/mapstore2.css b/web/client/jsapi/mapstore2.css deleted file mode 100644 index 6b1271711b..0000000000 --- a/web/client/jsapi/mapstore2.css +++ /dev/null @@ -1,599 +0,0 @@ -.fill, .mapstore2-embedded, #map { - width: 100%; - height: 100%; -} - -.fill { - overflow: hidden; - position: relative; -} - -#mapstore-settings .btn-group { - width: auto; - float: right; -} - -#mapstore-settings .modal-body #mapstore-mousepositionsettings button { - float: none; - margin-left: 40%; -} - -#mapstore-settings .modal-body #mapstore-mousepositionsettings select { - float: none; - margin-left: 40%; -} - -#mapstore-settings .modal-body .form-group { - margin-top: 15px; - border-top: solid 1px #EEE; - padding-top: 10px; -} - -#mapstore-mousepositionsettings .form-group { - margin-bottom: 0 !important; -} - -#mapstore-mousepositionsettings select, #mapstore-mousepositionsettings button { - width: 60% !important; - float: right; - height: 35px; -} - -#mapstore-mousepositionsettings label { - width: 100% !important; -} - -.swipe-header-left-button { - float: none !important; - right: 45px; - top: 4px; - position: absolute; -} - -.swipe-header-right-button { - float: none !important; - position: absolute; - top: 4px; - right: 5px; -} - -#mapstore-identify-revgeocoder { - min-height: 40px; - margin-bottom: 10px; - border-bottom: solid 1px #BBB; -} - -#mapstore-getfeatureinfo { - max-width: 100%; -} - -@media (min-width: 500px) { - #mapstore-getfeatureinfo { - min-width: 500px !important; - } -} - -#mapstore-getfeatureinfo .swipeable-view .panel-heading { - background-color: white; - border: none; - height: 60px; - padding: 0; -} - -#mapstore-getfeatureinfo .swipeable-view .panel { - border: none; -} - -#mapstore-getfeatureinfo .modal-body .panel-body { - padding: 0; -} - -#mapstore-getfeatureinfo .swipeable-view .panel-heading .swipe-header-left-button { - right: 55px; - top: 0; -} - -#mapstore-getfeatureinfo .swipeable-view .panel-heading .swipe-header-right-button { - top: 0; -} - -#mapstore-getfeatureinfo .swipeable-view .panel-title { - font-weight: bold; -} - -.hidden { - display: none !important; -} - -.react-draggable .panel-heading { - cursor: move; -} - -.btn-xs { - font-size: 15px; -} -.ol-attribution li:first-child{ - display:none; - visibility: hidden; -} -.leaflet-control-attribution a:first-child{ - display:none; - visibility: hidden; -} -.Sortable { - position: relative; - display: block; - overflow: visible; - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; -} - -.SortableItem { - cursor: -webkit-grab; cursor:-moz-grab; cursor: grab; -} - -.SortableItem.is-dragging { - cursor: move; - position: absolute; - z-index: 1688; - background-color: rgba(218, 218, 218, 0.8);; - border: 1px dashed #8E8E8E; - border-radius: 5px; - box-shadow: 4px 4px 9px rgba(0, 0, 0, 0.28); -} - -.SortableItem.is-placeholder { - border: 1px dashed #8E8E8E; - border-radius: 5px; -} - -.SortableItem.is-undraggable { - cursor: not-allowed; -} - -#mapstore-scalebox-container { - z-index: 10; - bottom: -16px !important; - right: 55px; - left: auto !important; - position: absolute; - margin: 8px; - width: 148px; -} - -#mapstore-scalebox { - width: 148px; -} - -.leafletbottom.leafletright, .leaflet-control-minimap{ - bottom: 47px !important; - right: 49px !important; -} - -.leaflet-control-scale { - position: absolute; - bottom: -1px; - right: 47px; - z-index: 1000; -} -.leaflet-control-attribution { - width: 165px; - position: absolute; - right: 0; - bottom: 0; -} - -.leaflet-bottom.leaflet-right { - margin-bottom: 0 !important; -} - -.ol-custom-overviewmap, .ol-custom-overviewmap.ol-uncollapsible { - bottom: 55px !important; - left: auto !important; - right: 57px !important; - top: auto !important; -} - -.ol-scale-line.ol-unselectable { - right: 58px; - left: auto; - bottom: 3px; -} - -#navigationBar .mapToolbar { - top: auto !important; - bottom: 5px; - right: 0 !important; -} - -#navigationBar .toolbar-panel { - bottom: 80px !important; -} - -#identifyBar .mapToolbar { - top: auto !important; - bottom: 5px; - right: 212px !important; -} - -.panel-close { - float: right; - width: 10px; - cursor: pointer; -} - -#mapstore-mousepositionsettings .form-group { - margin-bottom: 0 !important; -} - -#mapstore-mousepositionsettings select, #mapstore-mousepositionsettings button { - width: 60% !important; - float: right; - height: 35px; -} - -#mapstore-mousepositionsettings label { - width: 100% !important; -} - -#mapstore-globalspinner { - margin: 0 !important; - width: 40px !important; - position:static !important; - border-radius: 0 !important; -} - -#mapstore-mouseposition .label-info { - white-space: normal !important; - color: black !important; - font-size: 110%; - padding: 0 !important; -} - -#mapstore-mouseposition { - bottom: 5px !important; - right: 264px !important; - top: auto !important; - margin: 0 !important; - text-shadow: none !important; - background-color: white !important; - width: 160px !important; - height: 46px !important; - padding-left: 5px; - padding-top: 2px; -} - -#mapstore-mouseposition h5 { - margin-top: 5px !important; -} - -.mouseposition-separator { - display: block; -} - -#drawer-menu-button { - position: absolute; -} - - -.swipe-header-left-button { - float: none !important; - right: 45px; - top: 4px; - position: absolute; -} - -.swipe-header-right-button { - float: none !important; - position: absolute; - top: 4px; - right: 5px; -} - -#mapstore-identify-revgeocoder { - min-height: 40px; - margin-bottom: 10px; - border-bottom: solid 1px #BBB; -} - -#mapstore-getfeatureinfo { - max-width: 100%; -} - -@media (min-width: 500px) { - #mapstore-getfeatureinfo { - min-width: 500px !important; - } -} - -#mapstore-getfeatureinfo .swipeable-view .panel-heading { - background-color: white; - border: none; - height: 60px; - padding: 0; -} - -#mapstore-getfeatureinfo .swipeable-view .panel { - border: none; -} - -#mapstore-getfeatureinfo .modal-body .panel-body { - padding: 0; -} - -#mapstore-getfeatureinfo .swipeable-view .panel-heading .swipe-header-left-button { - right: 55px; - top: 0; -} - -#mapstore-getfeatureinfo .swipeable-view .panel-heading .swipe-header-right-button { - top: 0; -} - -#mapstore-getfeatureinfo .swipeable-view .panel-title { - font-weight: bold; -} - -#mapstore-settings .btn-group { - width: auto; - float: right; -} - -#mapstore-settings .modal-body #mapstore-mousepositionsettings button { - float: none; - margin-left: 40%; -} - -#mapstore-settings .modal-body #mapstore-mousepositionsettings select { - float: none; - margin-left: 40%; -} - -#mapstore-settings .modal-body .form-group { - margin-top: 15px; - border-top: solid 1px #EEE; - padding-top: 10px; -} - -.modal-header button.close { - margin-top: -7px; - opacity: 1; -} - -.modal-header button.close:hover { - opacity: 0.5; - color: white; -} - -.modal-header button.close:focus { - opacity: 0.5; - color: white; -} -@media (min-width: 992px) { - #mapstore-print-panel { - width: 825px !important; - } -} - -@media (max-width: 991px) { - #mapstore-print-panel { - width: 500px !important; - } -} - -.panel-close:after { - content: 'x'; -} - -#mapstore-print-panel .modal-body .print-mappreview-refresh { - top: -96px; -} - -#mapstore-print-panel .print-submit { - float: right; -} - -#mapstore-print-panel input[type=radio] { - margin-left: 20px; -} - -#mapstore-print-panel .print-map-preview { - margin-bottom: 15px; -} - -#mapstore-print-panel .panel-default { - border: none; -} - -#mapstore-print-panel .panel-heading .panel-title { - font-weight: bold; -} - -#mapstore-print-panel .panel-heading { - padding-left: 0; - background-color: transparent; -} - -#mapstore-print-panel .panel-body { - padding: 10px; - border: solid 1px #078AA3; -} - -#mapstore-print-panel .form-control { - padding: 0 10px; - height: 25px; -} - -#mapstore-print-panel .print-download { - margin-right: 10px; -} - -#mapstore-print-panel .print-download a { - color: white; -} - -#mapstore-print-panel .print-legend-options .container-fluid { - padding-left: 0; - padding-right: 0; -} - -#mapstore-snapshot-panel { - position: absolute; - right: 200px; - min-width: 725px; -} - -#mapstore-catalog-panel .record-item { - min-height: 150px; -} - -#mapstore-about { - position: fixed; - top: 0; - left: calc(50% - 500px); - width: 500px; -} - -#mapstore-login-panel { - width: 300px; -} -#mapstore-login-panel button { - float: right !important; -} - -.modal { - overflow-y: auto !important; -} - -.draggable-header { - cursor: move; -} - -.ms2-loading { - background-color: #078aa3 !important; - border-bottom: 2px solid #5C9FB4 !important; -} - -.ms2-loading .sk-circle-wrapper { - width: 30px; - height: 30px; - margin-left: 10px !important; - margin-top: 10px !important; -} - -.ms2-loading .sk-circle-wrapper .sk-circle:before { - background-color: white !important; -} - -.modal-body { - background-color: white; -} - -#mapstore-shapefile-upload { - width: 300px; -} - -#mapstore-shapefile-upload button { - float: right; -} - -#mapstore-layer-settings { - min-width: 400px; -} - -#mapstore-layer-settings .noUi-background { - background:#CCC; -} - -#mapstore-layer-settings .noUi-horizontal { - height: 2px; - width: 260px; - margin:auto; -} -#mapstore-layer-settings .noUi-target { - position: relative; - direction: ltr; -} - -#mapstore-layer-settings .noUi-base { - width: 100%; - height: 100%; - position: relative; - z-index: 1; -} - -#mapstore-layer-settings .noUi-horizontal .noUi-handle { - width: 23px; - height: 23px; - top: -10px; -} - -#mapstore-layer-settings .noUi-handle { - background: #078AA3; - cursor: default; - border-radius:50px; -} - -#mapstore-layer-settings .noUi-handle { - position: relative; - z-index: 1; -} -#mapstore-layer-settings .noUi-target, .noUi-target * { - -webkit-touch-callout: none; - -webkit-user-select: none; - -ms-touch-action: none; - touch-action: none; - -ms-user-select: none; - -moz-user-select: none; - -moz-box-sizing: border-box; - box-sizing: border-box; -} - -#mapstore-layer-settings .noUi-target { - position: relative; - direction: ltr; -} - -#mapstore-layer-settings .noUi-target { - width: 94%; - margin-bottom: 10px; -} - -#mapstore-layer-settings .noUi-handle:before, #mapstore-layer-settings .noUi-handle:after { - background: none; -} - -.btn .badge { - position: absolute; - top: -10px; - left: -10px; -} - -.themed .btn .badge { - top: -35px; - left: -50px; -} - -#helpbadge-scaleBox { - left: 0 !important; - background-color: #078aa3; - color: #ffffff; -} - -#mapstore-navbar #helpbadge-search-help { - position: absolute; - left: -10px; - bottom: -8px; - z-index: 1; - background-color: #078aa3; - color: #ffffff; -} - -.badge { - cursor: pointer; -} - -#navigationBar #locate-btn { - position: static; -} diff --git a/web/client/utils/PluginsUtils.js b/web/client/utils/PluginsUtils.js index 70d0884d09..3f0d56db01 100644 --- a/web/client/utils/PluginsUtils.js +++ b/web/client/utils/PluginsUtils.js @@ -190,7 +190,7 @@ const PluginsUtils = { const pluginKey = (isObject(pluginDef) ? pluginDef.name : pluginDef) + 'Plugin'; const impl = plugins[pluginKey]; if (!impl) { - throw "the plugin \"" + pluginKey + " \"is undefinded"; + return null; } return { id: id || name, From b8a360c1a330fc78226d6bc5a40098ec02fd0ba9 Mon Sep 17 00:00:00 2001 From: Lorenzo Pini Date: Mon, 27 Mar 2017 14:46:02 +0200 Subject: [PATCH 3/3] Use https wherever possible --- docs/developer-guide/application-tutorial.md | 2 +- web/client/config.json | 8 +- web/client/examples/3dviewer/config.json | 2 +- web/client/examples/data/mapStoreConfig.json | 2 +- web/client/examples/login/config.json | 2 +- web/client/examples/myapp/config.json | 2 +- web/client/examples/plugins/config.json | 12 +- web/client/examples/print/config.json | 2 +- web/client/examples/queryform/app.jsx | 4 +- web/client/examples/queryform/config.json | 2 +- web/client/examples/rasterstyler/config.json | 12 +- web/client/examples/styler/config.json | 42 +- web/client/localConfig.json | 536 +++++++++--------- web/client/simple.json | 2 +- .../utils/__tests__/ConfigUtils-test.js | 6 +- 15 files changed, 318 insertions(+), 318 deletions(-) diff --git a/docs/developer-guide/application-tutorial.md b/docs/developer-guide/application-tutorial.md index 99a095c965..a6417ebb3f 100644 --- a/docs/developer-guide/application-tutorial.md +++ b/docs/developer-guide/application-tutorial.md @@ -163,7 +163,7 @@ module.exports = finalCreateStore(reducers, {}); }, { "type": "wms", - "url":"http://demo.geo-solutions.it/geoserver/wms", + "url":"https://demo.geo-solutions.it/geoserver/wms", "visibility": true, "opacity": 0.5, "title": "Weather data", diff --git a/web/client/config.json b/web/client/config.json index 14206dd6f7..c7a53f5fbe 100644 --- a/web/client/config.json +++ b/web/client/config.json @@ -62,7 +62,7 @@ }, { "type": "wms", - "url":"http://demo.geo-solutions.it/geoserver/wms", + "url":"https://demo.geo-solutions.it/geoserver/wms", "visibility": false, "title": "Natural Earth", "name": "sde:NE2_HR_LC_SR_W_DR", @@ -71,7 +71,7 @@ }, { "type": "wms", - "url":"http://demo.geo-solutions.it/geoserver/wms", + "url":"https://demo.geo-solutions.it/geoserver/wms", "visibility": false, "title": "Hypsometric", "name": "sde:HYP_HR_SR_OB_DR", @@ -80,7 +80,7 @@ }, { "type": "wms", - "url":"http://demo.geo-solutions.it/geoserver/wms", + "url":"https://demo.geo-solutions.it/geoserver/wms", "visibility": false, "title": "Gray Earth", "name": "sde:GRAY_HR_SR_OB_DR", @@ -89,7 +89,7 @@ }, { "type": "wms", - "url":"http://demo.geo-solutions.it/geoserver/wms", + "url":"https://demo.geo-solutions.it/geoserver/wms", "visibility": true, "opacity": 0.5, "title": "Weather data", diff --git a/web/client/examples/3dviewer/config.json b/web/client/examples/3dviewer/config.json index d6b4f72b25..6fd8867ec0 100644 --- a/web/client/examples/3dviewer/config.json +++ b/web/client/examples/3dviewer/config.json @@ -14,7 +14,7 @@ }, { "type": "wms", - "url":"http://demo.geo-solutions.it/geoserver/wms", + "url":"https://demo.geo-solutions.it/geoserver/wms", "visibility": true, "opacity": 0.5, "title": "Weather data", diff --git a/web/client/examples/data/mapStoreConfig.json b/web/client/examples/data/mapStoreConfig.json index 5fd06fac98..e7aeb6f00e 100644 --- a/web/client/examples/data/mapStoreConfig.json +++ b/web/client/examples/data/mapStoreConfig.json @@ -20,7 +20,7 @@ "url":"http://www.realvista.it/reflector/open/service?request=getCapabilities" }, "demo":{ - "url":"http://demo.geo-solutions.it/geoserver/wms" + "url":"https://demo.geo-solutions.it/geoserver/wms" } }, "map": { diff --git a/web/client/examples/login/config.json b/web/client/examples/login/config.json index a0850e6e8b..3f4f67b905 100644 --- a/web/client/examples/login/config.json +++ b/web/client/examples/login/config.json @@ -14,7 +14,7 @@ }, { "type": "wms", - "url": "http://demo.geo-solutions.it/geoserver/wms", + "url": "https://demo.geo-solutions.it/geoserver/wms", "visibility": true, "opacity": 0.7, "title": "Weather data", diff --git a/web/client/examples/myapp/config.json b/web/client/examples/myapp/config.json index 808967b3ef..6acc6f85f9 100644 --- a/web/client/examples/myapp/config.json +++ b/web/client/examples/myapp/config.json @@ -14,7 +14,7 @@ }, { "type": "wms", - "url":"http://demo.geo-solutions.it/geoserver/wms", + "url":"https://demo.geo-solutions.it/geoserver/wms", "visibility": true, "opacity": 0.5, "title": "Weather data", diff --git a/web/client/examples/plugins/config.json b/web/client/examples/plugins/config.json index 34843bd862..e50b704831 100644 --- a/web/client/examples/plugins/config.json +++ b/web/client/examples/plugins/config.json @@ -53,16 +53,16 @@ }, { "type": "wms", - "url":"http://213.215.135.196/reflector/open/service", + "url":"http://www.realvista.it/reflector/open/service", "visibility": false, "title": "e-Geos Ortofoto RealVista 1.0", "name": "rv1", "group": "background", - "format": "image/png" + "format": "image/jpeg" }, { "type": "wms", - "url":"http://demo.geo-solutions.it/geoserver/wms", + "url":"https://demo.geo-solutions.it/geoserver/wms", "visibility": false, "title": "Natural Earth", "name": "sde:NE2_HR_LC_SR_W_DR", @@ -71,7 +71,7 @@ }, { "type": "wms", - "url":"http://demo.geo-solutions.it/geoserver/wms", + "url":"https://demo.geo-solutions.it/geoserver/wms", "visibility": false, "title": "Hypsometric", "name": "sde:HYP_HR_SR_OB_DR", @@ -80,7 +80,7 @@ }, { "type": "wms", - "url":"http://demo.geo-solutions.it/geoserver/wms", + "url":"https://demo.geo-solutions.it/geoserver/wms", "visibility": false, "title": "Gray Earth", "name": "sde:GRAY_HR_SR_OB_DR", @@ -89,7 +89,7 @@ }, { "type": "wms", - "url":"http://demo.geo-solutions.it/geoserver/wms", + "url":"https://demo.geo-solutions.it/geoserver/wms", "visibility": true, "opacity": 0.5, "title": "Weather data", diff --git a/web/client/examples/print/config.json b/web/client/examples/print/config.json index a0850e6e8b..3f4f67b905 100644 --- a/web/client/examples/print/config.json +++ b/web/client/examples/print/config.json @@ -14,7 +14,7 @@ }, { "type": "wms", - "url": "http://demo.geo-solutions.it/geoserver/wms", + "url": "https://demo.geo-solutions.it/geoserver/wms", "visibility": true, "opacity": 0.7, "title": "Weather data", diff --git a/web/client/examples/queryform/app.jsx b/web/client/examples/queryform/app.jsx index beb48ac2b0..a3859b262b 100644 --- a/web/client/examples/queryform/app.jsx +++ b/web/client/examples/queryform/app.jsx @@ -34,8 +34,8 @@ const startApp = () => { store.dispatch(changeBrowserProperties(ConfigUtils.getBrowserProperties())); - store.dispatch(describeFeatureType('http://demo.geo-solutions.it/geoserver/wfs', 'topp:states')); - store.dispatch(loadFeature('http://demo.geo-solutions.it/geoserver/wfs', 'topp:states')); + store.dispatch(describeFeatureType('https://demo.geo-solutions.it/geoserver/wfs', 'topp:states')); + store.dispatch(loadFeature('https://demo.geo-solutions.it/geoserver/wfs', 'topp:states')); const QueryForm = require('./containers/QueryForm'); diff --git a/web/client/examples/queryform/config.json b/web/client/examples/queryform/config.json index e45f5c96f4..a794d84e45 100644 --- a/web/client/examples/queryform/config.json +++ b/web/client/examples/queryform/config.json @@ -14,7 +14,7 @@ }, { "type": "wms", - "url":"http://demo.geo-solutions.it/geoserver/wms", + "url":"https://demo.geo-solutions.it/geoserver/wms", "visibility": true, "opacity": 0.8, "title": "USA Population", diff --git a/web/client/examples/rasterstyler/config.json b/web/client/examples/rasterstyler/config.json index b10d08b879..f6ef88d0b0 100644 --- a/web/client/examples/rasterstyler/config.json +++ b/web/client/examples/rasterstyler/config.json @@ -63,7 +63,7 @@ "name": "sde:NE2_HR_LC_SR_W_DR", "title": "Natural Earth", "type": "wms", - "url": "http://demo.geo-solutions.it/geoserver/wms", + "url": "https://demo.geo-solutions.it/geoserver/wms", "visibility": false }, { @@ -72,7 +72,7 @@ "name": "sde:HYP_HR_SR_OB_DR", "title": "Hypsometric", "type": "wms", - "url": "http://demo.geo-solutions.it/geoserver/wms", + "url": "https://demo.geo-solutions.it/geoserver/wms", "visibility": false }, { @@ -81,7 +81,7 @@ "name": "sde:GRAY_HR_SR_OB_DR", "title": "Gray Earth", "type": "wms", - "url": "http://demo.geo-solutions.it/geoserver/wms", + "url": "https://demo.geo-solutions.it/geoserver/wms", "visibility": false }, { @@ -101,12 +101,12 @@ "opacity": 1, "title": "Weather data", "type": "wms", - "url": "http://demo.geo-solutions.it/geoserver/wms", + "url": "https://demo.geo-solutions.it/geoserver/wms", "visibility": true }, { "type": "wms", - "url":"http://demo.geo-solutions.it/geoserver/wms", + "url":"https://demo.geo-solutions.it/geoserver/wms", "visibility": true, "opacity": 1, "title": "HYP_HR_SR_OB_DR", @@ -125,4 +125,4 @@ "units": "m", "zoom": 4 } -} \ No newline at end of file +} diff --git a/web/client/examples/styler/config.json b/web/client/examples/styler/config.json index 91279a3abe..395fcec3fe 100644 --- a/web/client/examples/styler/config.json +++ b/web/client/examples/styler/config.json @@ -59,7 +59,7 @@ "name": "sde:NE2_HR_LC_SR_W_DR", "title": "Natural Earth", "type": "wms", - "url": "http://demo.geo-solutions.it/geoserver/wms", + "url": "https://demo.geo-solutions.it/geoserver/wms", "visibility": false }, { @@ -68,7 +68,7 @@ "name": "sde:HYP_HR_SR_OB_DR", "title": "Hypsometric", "type": "wms", - "url": "http://demo.geo-solutions.it/geoserver/wms", + "url": "https://demo.geo-solutions.it/geoserver/wms", "visibility": false }, { @@ -77,7 +77,7 @@ "name": "sde:GRAY_HR_SR_OB_DR", "title": "Gray Earth", "type": "wms", - "url": "http://demo.geo-solutions.it/geoserver/wms", + "url": "https://demo.geo-solutions.it/geoserver/wms", "visibility": false }, { @@ -97,22 +97,22 @@ "opacity": 1, "title": "Weather data", "type": "wms", - "url": "http://demo.geo-solutions.it/geoserver/wms", + "url": "https://demo.geo-solutions.it/geoserver/wms", "visibility": true }, - { - "type": "wms", - "describeLayer": { - "owsType": "WCS" - }, - "url":"http://demo.geo-solutions.it/geoserver/wms", - "visibility": true, - "opacity": 1, - "title": "HYP_HR_SR_OB_DR", - "name": "sde:HYP_HR_SR_OB_DR", - "group": "Meteo", - "format": "image/png" - }, + { + "type": "wms", + "describeLayer": { + "owsType": "WCS" + }, + "url":"https://demo.geo-solutions.it/geoserver/wms", + "visibility": true, + "opacity": 1, + "title": "HYP_HR_SR_OB_DR", + "name": "sde:HYP_HR_SR_OB_DR", + "group": "Meteo", + "format": "image/png" + }, { "describeLayer": { "owsType": "WFS", @@ -124,7 +124,7 @@ "opacity": 1, "title": "Regioni", "type": "wms", - "url": "http://demo.geo-solutions.it/geoserver/wms", + "url": "https://demo.geo-solutions.it/geoserver/wms", "visibility": true }, { @@ -138,7 +138,7 @@ "opacity": 1, "title": "NY Roads", "type": "wms", - "url": "http://demo.geo-solutions.it/geoserver/wms", + "url": "https://demo.geo-solutions.it/geoserver/wms", "visibility": true }, { @@ -152,7 +152,7 @@ "opacity": 1, "title": "NY PoI", "type": "wms", - "url": "http://demo.geo-solutions.it/geoserver/wms", + "url": "https://demo.geo-solutions.it/geoserver/wms", "visibility": true } ], @@ -166,4 +166,4 @@ "units": "m", "zoom": 3 } -} \ No newline at end of file +} diff --git a/web/client/localConfig.json b/web/client/localConfig.json index 2132105f90..95a00c2627 100644 --- a/web/client/localConfig.json +++ b/web/client/localConfig.json @@ -1,270 +1,270 @@ { - "proxyUrl": { - "url": "/mapstore/proxy/?url=", - "useCORS": ["https://demo.geo-solutions.it/geoserver"] - }, - "geoStoreUrl": "/mapstore/rest/geostore/", - "printUrl": "https://demo.geo-solutions.it/geoserver/pdf/info.json", - "bingApiKey": "AhuXBu7ipR1gNbBfXhtUAyCZ6rkC5PkWpxs2MnMRZ1ZupxQfivjLCch22ozKSCAn", - "mapquestApiKey": "__API_KEY_MAPQUEST__", - "initialMapFilter": "", - "ignoreMobileCss": true, - "useAuthenticationRules": true, - "authenticationRules": [{ - "urlPattern": ".*geostore.*", - "method": "basic" - }], - "plugins": { - "mobile": [{ - "name": "Map", - "cfg": { - "tools": ["locate"] - } - }, "DrawerMenu", { - "name": "Identify", - "showIn": ["Settings"], - "cfg": { - "style": { - "position": "absolute", - "width": "100%", - "bottom": "0px", - "zIndex": 1023, - "maxHeight": "70%", - "marginBottom": 0 - }, - "draggable": false, - "collapsible": true, - "viewerOptions": { - "container": "{context.ReactSwipe}", - "header": "{context.SwipeHeader}", - "collapsible": false - }, - "bodyClass": "mobile-feature-info" - } - }, { - "name": "Locate", - "override": { - "Toolbar": { - "alwaysVisible": true - } - } - }, "Home", "TOC", { - "name": "Tutorial", - "cfg": { - "preset": "mapMobile" - } - }, "BackgroundSwitcher", { - "name": "Settings", - "cfg": { - "wrap": true - } - }, "About", { - "name": "MousePosition", - "cfg": { - "id": "mapstore-mouseposition-mobile" - } - }, { - "name": "Search", - "cfg": { - "withToggle": ["max-width: 768px", "min-width: 768px"] - } - }, { - "name": "Toolbar", - "id": "NavigationBar", - "cfg": { - "id": "navigationBar" - } - }, { - "name": "Toolbar", - "id": "IdentifyBar", - "stateSelector": "identify", - "cfg": { - "id": "identifyBar" - }, - "isDefault": false - }, "ZoomAll", { - "name": "MapLoading", - "override": { - "Toolbar": { - "alwaysVisible": true - } - } - }, "Login", - "OmniBar", "BurgerMenu", "Expander" - ], - "desktop": ["Map", "Help", "Share", "DrawerMenu", { - "name": "Identify", - "showIn": ["IdentifyBar", "Settings"], - "cfg": { - "viewerOptions": { - "container": "{context.ReactSwipe}", - "header": "{context.SwipeHeader}", - "headerOptions": { - "useButtons": true - } - } - } - }, - "MadeWithLove", { - "name": "Locate", - "override": { - "Toolbar": { - "alwaysVisible": true - } - } - }, "Home", "FeatureGrid", { - "name": "TOC", - "cfg": { - "activateQueryTool": true - } - }, "Tutorial", "BackgroundSwitcher", { - "name": "Measure", - "cfg": { - "showResults": false - } - }, "MeasureResults", "Print", "ShapeFile", { - "name": "Settings", - "cfg": { - "wrap": true - } - }, { - "name": "MetadataExplorer", - "cfg": { - "wrap": true, - "initialCatalogURL": { - "csw": "http://demo.geo-solutions.it/geoserver/csw", - "wms": "http://demo.geo-solutions.it/geoserver/wms", - "wmts": "http://demo.geo-solutions.it/geoserver/gwc/service/wmts" - } - } - }, "About", "MousePosition", { - "name": "Search", - "cfg": { - "withToggle": ["max-width: 768px", "min-width: 768px"] - } - }, { - "name": "Toolbar", - "id": "NavigationBar", - "cfg": { - "id": "navigationBar" - } - }, { - "name": "Toolbar", - "id": "IdentifyBar", - "stateSelector": "identify", - "cfg": { - "id": "identifyBar" - }, - "isDefault": false - }, - "ScaleBox", "ZoomAll", { - "name": "MapLoading", - "override": { - "Toolbar": { - "alwaysVisible": true - } - } - }, { - "name": "Snapshot", - "cfg": { - "wrap": true - } - }, { - "name": "ZoomIn", - "override": { - "Toolbar": { - "alwaysVisible": true - } - } - }, { - "name": "ZoomOut", - "override": { - "Toolbar": { - "alwaysVisible": true - } - } - }, - "OmniBar", "Login", "Save", "SaveAs", "BurgerMenu", "Expander", "Undo", "Redo" - ], - "embedded": [{ - "name": "Map", - "cfg": { - "tools": ["locate"] - } - }, "Help", "DrawerMenu", { - "name": "Identify", - "showIn": ["Settings"], - "cfg": { - "style": { - "position": "absolute", - "width": "100%", - "bottom": "0px", - "zIndex": 1010, - "maxHeight": "70%", - "marginBottom": 0 - }, - "draggable": false, - "collapsible": true, - "viewerOptions": { - "container": "{context.ReactSwipe}", - "header": "{context.SwipeHeader}", - "collapsible": false - }, - "bodyClass": "mobile-feature-info" - } - }, { - "name": "Locate", - "override": { - "Toolbar": { - "alwaysVisible": true - } - } - }, "TOC", "BackgroundSwitcher", { - "name": "Settings", - "cfg": { - "wrap": true - } - }, "About", { - "name": "MousePosition", - "cfg": { - "id": "mapstore-mouseposition-mobile" - } - }, { - "name": "Search", - "cfg": { - "withToggle": ["max-width: 768px", "min-width: 768px"] - } - }, { - "name": "Toolbar", - "id": "NavigationBar", - "cfg": { - "id": "navigationBar" - } - }, { - "name": "Toolbar", - "id": "IdentifyBar", - "stateSelector": "identify", - "cfg": { - "id": "identifyBar" - }, - "isDefault": false - }, { - "name": "MapLoading", - "override": { - "Toolbar": { - "alwaysVisible": true - } - } - }, - "OmniBar", "BurgerMenu" - ], - "common": [{ - "name": "OmniBar", - "cfg": { - "className": "navbar shadow navbar-home" - } - }, "ManagerMenu", "Login", "Language", "Attribution"], - "maps": ["Header", "Fork", "MapSearch", "HomeDescription", "MapType", "ThemeSwitcher", "CreateNewMap", "Maps", "Examples", "Footer"], - "manager": ["Header", "Redirect", "Manager", "Home", "UserManager", "GroupManager", "Footer"] - } + "proxyUrl": { + "url": "/mapstore/proxy/?url=", + "useCORS": ["https://demo.geo-solutions.it/geoserver"] + }, + "geoStoreUrl": "/mapstore/rest/geostore/", + "printUrl": "https://demo.geo-solutions.it/geoserver/pdf/info.json", + "bingApiKey": "AhuXBu7ipR1gNbBfXhtUAyCZ6rkC5PkWpxs2MnMRZ1ZupxQfivjLCch22ozKSCAn", + "mapquestApiKey": "__API_KEY_MAPQUEST__", + "initialMapFilter": "", + "ignoreMobileCss": true, + "useAuthenticationRules": true, + "authenticationRules": [{ + "urlPattern": ".*geostore.*", + "method": "basic" + }], + "plugins": { + "mobile": [{ + "name": "Map", + "cfg": { + "tools": ["locate"] + } + }, "DrawerMenu", { + "name": "Identify", + "showIn": ["Settings"], + "cfg": { + "style": { + "position": "absolute", + "width": "100%", + "bottom": "0px", + "zIndex": 1023, + "maxHeight": "70%", + "marginBottom": 0 + }, + "draggable": false, + "collapsible": true, + "viewerOptions": { + "container": "{context.ReactSwipe}", + "header": "{context.SwipeHeader}", + "collapsible": false + }, + "bodyClass": "mobile-feature-info" + } + }, { + "name": "Locate", + "override": { + "Toolbar": { + "alwaysVisible": true + } + } + }, "Home", "TOC", { + "name": "Tutorial", + "cfg": { + "preset": "mapMobile" + } + }, "BackgroundSwitcher", { + "name": "Settings", + "cfg": { + "wrap": true + } + }, "About", { + "name": "MousePosition", + "cfg": { + "id": "mapstore-mouseposition-mobile" + } + }, { + "name": "Search", + "cfg": { + "withToggle": ["max-width: 768px", "min-width: 768px"] + } + }, { + "name": "Toolbar", + "id": "NavigationBar", + "cfg": { + "id": "navigationBar" + } + }, { + "name": "Toolbar", + "id": "IdentifyBar", + "stateSelector": "identify", + "cfg": { + "id": "identifyBar" + }, + "isDefault": false + }, "ZoomAll", { + "name": "MapLoading", + "override": { + "Toolbar": { + "alwaysVisible": true + } + } + }, "Login", + "OmniBar", "BurgerMenu", "Expander" + ], + "desktop": ["Map", "Help", "Share", "DrawerMenu", { + "name": "Identify", + "showIn": ["IdentifyBar", "Settings"], + "cfg": { + "viewerOptions": { + "container": "{context.ReactSwipe}", + "header": "{context.SwipeHeader}", + "headerOptions": { + "useButtons": true + } + } + } + }, + "MadeWithLove", { + "name": "Locate", + "override": { + "Toolbar": { + "alwaysVisible": true + } + } + }, "Home", "FeatureGrid", { + "name": "TOC", + "cfg": { + "activateQueryTool": true + } + }, "Tutorial", "BackgroundSwitcher", { + "name": "Measure", + "cfg": { + "showResults": false + } + }, "MeasureResults", "Print", "ShapeFile", { + "name": "Settings", + "cfg": { + "wrap": true + } + }, { + "name": "MetadataExplorer", + "cfg": { + "wrap": true, + "initialCatalogURL": { + "csw": "http://demo.geo-solutions.it/geoserver/csw", + "wms": "http://demo.geo-solutions.it/geoserver/wms", + "wmts": "http://demo.geo-solutions.it/geoserver/gwc/service/wmts" + } + } + }, "About", "MousePosition", { + "name": "Search", + "cfg": { + "withToggle": ["max-width: 768px", "min-width: 768px"] + } + }, { + "name": "Toolbar", + "id": "NavigationBar", + "cfg": { + "id": "navigationBar" + } + }, { + "name": "Toolbar", + "id": "IdentifyBar", + "stateSelector": "identify", + "cfg": { + "id": "identifyBar" + }, + "isDefault": false + }, + "ScaleBox", "ZoomAll", { + "name": "MapLoading", + "override": { + "Toolbar": { + "alwaysVisible": true + } + } + }, { + "name": "Snapshot", + "cfg": { + "wrap": true + } + }, { + "name": "ZoomIn", + "override": { + "Toolbar": { + "alwaysVisible": true + } + } + }, { + "name": "ZoomOut", + "override": { + "Toolbar": { + "alwaysVisible": true + } + } + }, + "OmniBar", "Login", "Save", "SaveAs", "BurgerMenu", "Expander", "Undo", "Redo" + ], + "embedded": [{ + "name": "Map", + "cfg": { + "tools": ["locate"] + } + }, "Help", "DrawerMenu", { + "name": "Identify", + "showIn": ["Settings"], + "cfg": { + "style": { + "position": "absolute", + "width": "100%", + "bottom": "0px", + "zIndex": 1010, + "maxHeight": "70%", + "marginBottom": 0 + }, + "draggable": false, + "collapsible": true, + "viewerOptions": { + "container": "{context.ReactSwipe}", + "header": "{context.SwipeHeader}", + "collapsible": false + }, + "bodyClass": "mobile-feature-info" + } + }, { + "name": "Locate", + "override": { + "Toolbar": { + "alwaysVisible": true + } + } + }, "TOC", "BackgroundSwitcher", { + "name": "Settings", + "cfg": { + "wrap": true + } + }, "About", { + "name": "MousePosition", + "cfg": { + "id": "mapstore-mouseposition-mobile" + } + }, { + "name": "Search", + "cfg": { + "withToggle": ["max-width: 768px", "min-width: 768px"] + } + }, { + "name": "Toolbar", + "id": "NavigationBar", + "cfg": { + "id": "navigationBar" + } + }, { + "name": "Toolbar", + "id": "IdentifyBar", + "stateSelector": "identify", + "cfg": { + "id": "identifyBar" + }, + "isDefault": false + }, { + "name": "MapLoading", + "override": { + "Toolbar": { + "alwaysVisible": true + } + } + }, + "OmniBar", "BurgerMenu" + ], + "common": [{ + "name": "OmniBar", + "cfg": { + "className": "navbar shadow navbar-home" + } + }, "ManagerMenu", "Login", "Language", "Attribution"], + "maps": ["Header", "Fork", "MapSearch", "HomeDescription", "MapType", "ThemeSwitcher", "CreateNewMap", "Maps", "Examples", "Footer"], + "manager": ["Header", "Redirect", "Manager", "Home", "UserManager", "GroupManager", "Footer"] + } } diff --git a/web/client/simple.json b/web/client/simple.json index 8ce5fb64aa..94547316bc 100644 --- a/web/client/simple.json +++ b/web/client/simple.json @@ -172,7 +172,7 @@ "cfg": { "wrap": true, "chooseCatalogUrl": false, - "initialCatalogURL": "http://demo.geo-solutions.it/geoserver/csw" + "initialCatalogURL": "https://demo.geo-solutions.it/geoserver/csw" } }, { "name": "About", diff --git a/web/client/utils/__tests__/ConfigUtils-test.js b/web/client/utils/__tests__/ConfigUtils-test.js index 67e9655a08..637baaf357 100644 --- a/web/client/utils/__tests__/ConfigUtils-test.js +++ b/web/client/utils/__tests__/ConfigUtils-test.js @@ -61,10 +61,10 @@ function resetLConfig() { "ptype": "gxp_olsource" }, "demo": { - "url": "http://demo.geo-solutions.it/geoserver/wms" + "url": "https://demo.geo-solutions.it/geoserver/wms" }, "demo2": { - "url": "http://demo.geo-solutions.it/geoserver/wms?params" + "url": "https://demo.geo-solutions.it/geoserver/wms?params" } }, "map": { @@ -145,7 +145,7 @@ describe('ConfigUtils', () => { var config = ConfigUtils.convertFromLegacy(lconfig); const layers = config.layers.filter((layer) => layer.name === "nurc:Arc_Sample2"); expect(layers.length).toBe(1); - expect(layers[0].url).toBe("http://demo.geo-solutions.it/geoserver/wms"); + expect(layers[0].url).toBe("https://demo.geo-solutions.it/geoserver/wms"); }); it('check sources default values assigned', () => { var config = ConfigUtils.convertFromLegacy(lconfig);