From c93e690498483fcde68f8737b6fbc20aa28bab0c Mon Sep 17 00:00:00 2001 From: Mauro Bartolomeoli Date: Wed, 16 Oct 2019 16:32:41 +0200 Subject: [PATCH] Fixes #37: initial implementation of security integration (automatic login using georchestra security headers) --- .babelrc | 15 - .eslintrc | 53 +- MapStore2 | 2 +- js/app.jsx | 43 +- js/components/User.jsx | 23 + js/pages/Admin.jsx | 23 + js/plugins.js | 109 ++++ js/plugins/Login.jsx | 43 ++ js/plugins/NotAllowed.jsx | 14 + localConfig.json | 511 ++++++++++++++++++ package.json | 124 +++-- themes.js | 23 + themes/default/georchestra.less | 8 + themes/default/theme.less | 8 + themes/default/variables.less | 1 + translations/data.en-US | 8 + translations/data.fr-FR | 8 + translations/data.it-IT | 8 + web/pom.xml | 2 +- .../resources/geostore-spring-security.xml | 149 +++++ web/src/main/resources/sample_categories.xml | 3 + webpack.config.js | 38 +- 22 files changed, 1099 insertions(+), 117 deletions(-) delete mode 100644 .babelrc create mode 100644 js/components/User.jsx create mode 100644 js/pages/Admin.jsx create mode 100644 js/plugins.js create mode 100644 js/plugins/Login.jsx create mode 100644 js/plugins/NotAllowed.jsx create mode 100644 localConfig.json create mode 100644 themes.js create mode 100644 themes/default/georchestra.less create mode 100644 themes/default/theme.less create mode 100644 themes/default/variables.less create mode 100644 translations/data.en-US create mode 100644 translations/data.fr-FR create mode 100644 translations/data.it-IT create mode 100644 web/src/main/resources/geostore-spring-security.xml diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 1f798c4dc..000000000 --- a/.babelrc +++ /dev/null @@ -1,15 +0,0 @@ -{ - "presets": ["es2015", "react", "stage-0"], - "env": { - "development": { - "plugins": [ - ["react-transform", { - "transforms": [ { - "transform": "react-transform-catch-errors", - "imports": ["react", "redbox-react"] - }] - }] - ] - } - } -} diff --git a/.eslintrc b/.eslintrc index be9887449..12f1fb1ae 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,11 +1,13 @@ { "parser": "babel-eslint", // https://github.com/babel/babel-eslint "plugins": [ + "no-only-tests", // https://github.com/levibuzolic/eslint-plugin-no-only-tests "react" // https://github.com/yannickcr/eslint-plugin-react ], "env": { // http://eslint.org/docs/user-guide/configuring.html#specifying-environments "browser": true, // browser global variables - "node": true // Node.js global variables and Node.js-specific rules + "node": true, // Node.js global variables and Node.js-specific rules + "es6": true // enable all ECMAScript 6 features except for modules (this automatically sets the ecmaVersion parser option to 6). }, "globals" : { /* MOCHA */ @@ -17,24 +19,6 @@ "afterEach" : false, "__DEVTOOLS__": false }, - "ecmaFeatures": { - "arrowFunctions": true, - "blockBindings": true, - "classes": true, - "defaultParams": true, - "destructuring": true, - "forOf": true, - "generators": false, - "modules": true, - "objectLiteralComputedProperties": true, - "objectLiteralDuplicateProperties": false, - "objectLiteralShorthandMethods": true, - "objectLiteralShorthandProperties": true, - "spread": true, - "superInFunctions": true, - "templateStrings": true, - "jsx": true - }, "rules": { /** * Strict mode @@ -55,17 +39,22 @@ "no-shadow-restricted-names": 2, // http://eslint.org/docs/rules/no-shadow-restricted-names "no-unused-vars": [2, { // http://eslint.org/docs/rules/no-unused-vars "vars": "local", - "args": "after-used" + "args": "after-used", + "ignoreRestSiblings": true }], "no-use-before-define": 2, // http://eslint.org/docs/rules/no-use-before-define /** * Possible errors */ + "no-only-tests/no-only-tests": ["error", {"block": ["it", "describe"], "focus": ["only"]}], "comma-dangle": [2, "never"], // http://eslint.org/docs/rules/comma-dangle "no-cond-assign": [2, "always"], // http://eslint.org/docs/rules/no-cond-assign "no-console": 1, // http://eslint.org/docs/rules/no-console "no-debugger": 1, // http://eslint.org/docs/rules/no-debugger + "no-undef": 2, // https://eslint.org/docs/rules/no-undef + "no-const-assign": 2, // https://eslint.org/docs/rules/no-const-assign + "no-duplicate-imports": 2, // https://eslint.org/docs/rules/no-duplicate-imports "no-alert": 1, // http://eslint.org/docs/rules/no-alert "no-constant-condition": 1, // http://eslint.org/docs/rules/no-constant-condition "no-dupe-keys": 2, // http://eslint.org/docs/rules/no-dupe-keys @@ -79,7 +68,7 @@ "no-invalid-regexp": 2, // http://eslint.org/docs/rules/no-invalid-regexp "no-irregular-whitespace": 2, // http://eslint.org/docs/rules/no-irregular-whitespace "no-obj-calls": 2, // http://eslint.org/docs/rules/no-obj-calls - "no-reserved-keys": 2, // http://eslint.org/docs/rules/no-reserved-keys + "quote-props": [2, "as-needed", {"keywords": true, "unnecessary": false}], // http://eslint.org/docs/rules/no-reserved-keys "no-sparse-arrays": 2, // http://eslint.org/docs/rules/no-sparse-arrays "no-unreachable": 2, // http://eslint.org/docs/rules/no-unreachable "use-isnan": 2, // http://eslint.org/docs/rules/use-isnan @@ -88,7 +77,7 @@ /** * Best practices */ - "consistent-return": 2, // http://eslint.org/docs/rules/consistent-return + "consistent-return": [2, {"treatUndefinedAsUnspecified": true}], // http://eslint.org/docs/rules/consistent-return "curly": [2, "multi-line"], // http://eslint.org/docs/rules/curly "default-case": 2, // http://eslint.org/docs/rules/default-case "dot-notation": [2, { // http://eslint.org/docs/rules/dot-notation @@ -139,9 +128,10 @@ "quotes": [ 0, "single", "avoid-escape" // http://eslint.org/docs/rules/quotes ], - "camelcase": [2, { // http://eslint.org/docs/rules/camelcase - "properties": "never" - }], + "camelcase": [1, { // http://eslint.org/docs/rules/camelcase + "properties": "never", + "allow": ["^UNSAFE_"]} + ], "comma-spacing": [2, { // http://eslint.org/docs/rules/comma-spacing "before": false, "after": true @@ -163,7 +153,7 @@ "no-new-object": 2, // http://eslint.org/docs/rules/no-new-object "no-spaced-func": 2, // http://eslint.org/docs/rules/no-spaced-func "no-trailing-spaces": 2, // http://eslint.org/docs/rules/no-trailing-spaces - "no-wrap-func": 2, // http://eslint.org/docs/rules/no-wrap-func + "no-extra-parens": [2, "functions"], // http://eslint.org/docs/rules/no-wrap-func "no-underscore-dangle": 0, // http://eslint.org/docs/rules/no-underscore-dangle "one-var": [2, "never"], // http://eslint.org/docs/rules/one-var "padded-blocks": [0, "never"], // http://eslint.org/docs/rules/padded-blocks @@ -172,12 +162,12 @@ "before": false, "after": true }], - "space-after-keywords": 2, // http://eslint.org/docs/rules/space-after-keywords + "keyword-spacing": [2, {"after": true}], // http://eslint.org/docs/rules/space-after-keywords "space-before-blocks": 2, // http://eslint.org/docs/rules/space-before-blocks "space-before-function-paren": [2, "never"], // http://eslint.org/docs/rules/space-before-function-paren "space-infix-ops": 2, // http://eslint.org/docs/rules/space-infix-ops - "space-return-throw-case": 2, // http://eslint.org/docs/rules/space-return-throw-case - "spaced-line-comment": 2, // http://eslint.org/docs/rules/spaced-line-comment + // "space-return-throw-case": 2, // http://eslint.org/docs/rules/space-return-throw-case + "spaced-comment": 2, // http://eslint.org/docs/rules/spaced-line-comment /** * JSX style @@ -194,7 +184,7 @@ "react/no-did-update-set-state": 2, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-update-set-state.md "react/no-multi-comp": 0, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md "react/no-unknown-property": 2, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md - "react/prop-types": [2, { ignore: ["children"]}], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md + "react/prop-types": [2, { "ignore": ["children"]}], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md "react/react-in-jsx-scope": 2, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md "react/self-closing-comp": 2, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md "react/wrap-multilines": 2, // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/wrap-multilines.md @@ -213,10 +203,13 @@ "/^state$/", "getInitialState", "getChildContext", + "UNSAFE_componentWillMount", "componentWillMount", "componentDidMount", + "UNSAFE_componentWillReceiveProps", "componentWillReceiveProps", "shouldComponentUpdate", + "UNSAFE_componentWillUpdate", "componentWillUpdate", "componentDidUpdate", "componentWillUnmount", diff --git a/MapStore2 b/MapStore2 index f828320e8..43a979967 160000 --- a/MapStore2 +++ b/MapStore2 @@ -1 +1 @@ -Subproject commit f828320e86712c47f8266072ec9450c4d7369c74 +Subproject commit 43a979967a95895801d8f6cd9d30393532c082a8 diff --git a/js/app.jsx b/js/app.jsx index ca63be370..fc3a7c75d 100644 --- a/js/app.jsx +++ b/js/app.jsx @@ -1,18 +1,24 @@ /** - * Copyright 2016, GeoSolutions Sas. + * Copyright 2019, 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. */ -const ConfigUtils = require('@mapstore/utils/ConfigUtils'); +import assign from "object-assign"; +import ConfigUtils from "@mapstore/utils/ConfigUtils"; +import appCfg from "@mapstore/product/appConfig"; +import plugins from "./plugins"; +import main from "@mapstore/product/main"; +import Login from "./plugins/Login"; + /** * Add custom (overriding) translations with: * * ConfigUtils.setConfigProp('translationsPath', ['./MapStore2/web/client/translations', './translations']); */ -ConfigUtils.setConfigProp('translationsPath', './MapStore2/web/client/translations'); +ConfigUtils.setConfigProp('translationsPath', ['./MapStore2/web/client/translations', './translations']); ConfigUtils.setConfigProp('themePrefix', 'GeOrchestra'); /** @@ -20,7 +26,7 @@ ConfigUtils.setConfigProp('themePrefix', 'GeOrchestra'); * * ConfigUtils.setLocalConfigurationFile('localConfig.json'); */ -ConfigUtils.setLocalConfigurationFile('MapStore2/web/client/localConfig.json'); +ConfigUtils.setLocalConfigurationFile('localConfig.json'); /** * Use a custom application configuration file with: @@ -37,13 +43,34 @@ ConfigUtils.setLocalConfigurationFile('MapStore2/web/client/localConfig.json'); * }] * }); */ -const appConfig = require('@mapstore/product/appConfig'); - +const appConfig = assign({}, appCfg, { + pages: [{ + name: "mapviewer", + path: "/", + component: require('@mapstore/product/pages/MapViewer') + }, { + name: "admin", + path: "/admin", + component: require('./pages/Admin').default + }], + storeOpts: { + persist: { + // we don't want security to be persisted, so that we get updated headers for each reload + whitelist: [] + } + } +}); /** * Define a custom list of plugins with: * * const plugins = require('./plugins'); */ -const plugins = require('@mapstore/product/plugins'); +const appPlugins = { + plugins: { + ...plugins.plugins, + LoginPlugin: Login + }, + requires: plugins.requires +}; -require('@mapstore/product/main')(appConfig, plugins); +main(appConfig, appPlugins); diff --git a/js/components/User.jsx b/js/components/User.jsx new file mode 100644 index 000000000..da085c46c --- /dev/null +++ b/js/components/User.jsx @@ -0,0 +1,23 @@ +/* + * Copyright 2019, 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. + */ +import React, { useEffect } from "react"; +import loadingState from "@mapstore/components/misc/enhancers/loadingState"; +const UserInfo = ({user, error}) => {error && "GUEST" || user.role}; +const LoadingUser = loadingState(({ user, error }) => !user && !error)(UserInfo); +const User = ({className, user, error, ...props}) => { + return
; +}; + +export const AutoLogin = ({ onLogin }) => { + useEffect(() => { + onLogin("", ""); + }, []); + return null; +}; + +export default User; diff --git a/js/pages/Admin.jsx b/js/pages/Admin.jsx new file mode 100644 index 000000000..79cf2d349 --- /dev/null +++ b/js/pages/Admin.jsx @@ -0,0 +1,23 @@ +/* + * Copyright 2019, 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. + */ +import React from "react"; +import {connect} from "react-redux"; +import Page from "@mapstore/containers/Page"; + +const AdminPage = ({plugins, match, role}) => { + return (); +}; + +export default connect(state => ({ + role: state.security && state.security.user && state.security.user.role || 'GUEST' +}))(AdminPage); diff --git a/js/plugins.js b/js/plugins.js new file mode 100644 index 000000000..675ee9d49 --- /dev/null +++ b/js/plugins.js @@ -0,0 +1,109 @@ +/** + * 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. + */ + +/** + * Please, keep them sorted alphabetically + */ +module.exports = { + plugins: { + // framework plugins + AddGroupPlugin: require('@mapstore/plugins/AddGroup').default, + AnnotationsPlugin: require('@mapstore/plugins/Annotations'), + AutoMapUpdatePlugin: require('@mapstore/plugins/AutoMapUpdate'), + BackgroundSelectorPlugin: require('@mapstore/plugins/BackgroundSelector'), + BackgroundSwitcherPlugin: require('@mapstore/plugins/BackgroundSwitcher'), + BurgerMenuPlugin: require('@mapstore/plugins/BurgerMenu'), + CRSSelectorPlugin: require('@mapstore/plugins/CRSSelector'), + ContentTabs: require('@mapstore/plugins/ContentTabs'), + CookiePlugin: require('@mapstore/plugins/Cookie'), + CreateNewMapPlugin: require('@mapstore/plugins/CreateNewMap'), + Dashboard: require('@mapstore/plugins/Dashboard'), + DashboardEditor: require('@mapstore/plugins/DashboardEditor'), + DashboardsPlugin: require('@mapstore/plugins/Dashboards'), + DetailsPlugin: require('@mapstore/plugins/Details'), + DrawerMenuPlugin: require('@mapstore/plugins/DrawerMenu'), + ExpanderPlugin: require('@mapstore/plugins/Expander'), + FeatureEditorPlugin: require('@mapstore/plugins/FeatureEditor'), + FeaturedMaps: require('@mapstore/plugins/FeaturedMaps'), + FeedbackMaskPlugin: require('@mapstore/plugins/FeedbackMask'), + FloatingLegendPlugin: require('@mapstore/plugins/FloatingLegend'), + FullScreenPlugin: require('@mapstore/plugins/FullScreen'), + GeoStoryPlugin: require('@mapstore/plugins/GeoStory').default, + GeoStoryEditorPlugin: require('@mapstore/plugins/GeoStoryEditor').default, + GeoStorySavePlugin: require('@mapstore/plugins/GeoStorySave').GeoStorySave, + GeoStorySaveAsPlugin: require('@mapstore/plugins/GeoStorySave').GeoStorySaveAs, + GeoStoryNavigationPlugin: require('@mapstore/plugins/GeoStoryNavigation').default, + GlobeViewSwitcherPlugin: require('@mapstore/plugins/GlobeViewSwitcher'), + GoFull: require('@mapstore/plugins/GoFull'), + GridContainerPlugin: require('@mapstore/plugins/GridContainer'), + GroupManagerPlugin: require('@mapstore/plugins/manager/GroupManager'), + HelpLinkPlugin: require('@mapstore/plugins/HelpLink'), + HelpPlugin: require('@mapstore/plugins/Help'), + HomePlugin: require('@mapstore/plugins/Home'), + IdentifyPlugin: require('@mapstore/plugins/Identify'), + LanguagePlugin: require('@mapstore/plugins/Language'), + LocatePlugin: require('@mapstore/plugins/Locate'), + LoginPlugin: require('@mapstore/plugins/Login'), + ManagerMenuPlugin: require('@mapstore/plugins/manager/ManagerMenu'), + ManagerPlugin: require('@mapstore/plugins/manager/Manager'), + MapExportPlugin: require('@mapstore/plugins/MapExport'), + MapFooterPlugin: require('@mapstore/plugins/MapFooter'), + MapImportPlugin: require('@mapstore/plugins/MapImport'), + MapLoadingPlugin: require('@mapstore/plugins/MapLoading'), + MapPlugin: require('@mapstore/plugins/Map'), + MapSearchPlugin: require('@mapstore/plugins/MapSearch'), + MapsPlugin: require('@mapstore/plugins/Maps'), + MeasurePlugin: require('@mapstore/plugins/Measure'), + MediaEditorPlugin: require('@mapstore/plugins/MediaEditor').default, + MetadataExplorerPlugin: require('@mapstore/plugins/MetadataExplorer'), + MousePositionPlugin: require('@mapstore/plugins/MousePosition'), + NotificationsPlugin: require('@mapstore/plugins/Notifications'), + OmniBarPlugin: require('@mapstore/plugins/OmniBar'), + PlaybackPlugin: require('@mapstore/plugins/Playback.jsx'), + PrintPlugin: require('@mapstore/plugins/Print'), + QueryPanelPlugin: require('@mapstore/plugins/QueryPanel'), + RedirectPlugin: require('@mapstore/plugins/Redirect'), + RedoPlugin: require('@mapstore/plugins/History'), + RulesDataGridPlugin: require('@mapstore/plugins/RulesDataGrid'), + RulesEditorPlugin: require('@mapstore/plugins/RulesEditor'), + RulesManagerFooter: require('@mapstore/plugins/RulesManagerFooter'), + SaveAsPlugin: require('@mapstore/plugins/SaveAs'), + SavePlugin: require('@mapstore/plugins/Save'), + SaveStoryPlugin: require('@mapstore/plugins/GeoStorySave'), + ScaleBoxPlugin: require('@mapstore/plugins/ScaleBox'), + ScrollTopPlugin: require('@mapstore/plugins/ScrollTop'), + SearchPlugin: require('@mapstore/plugins/Search'), + SearchServicesConfigPlugin: require('@mapstore/plugins/SearchServicesConfig'), + SettingsPlugin: require('@mapstore/plugins/Settings'), + SharePlugin: require('@mapstore/plugins/Share'), + SnapshotPlugin: require('@mapstore/plugins/Snapshot'), + StyleEditorPlugin: require('@mapstore/plugins/StyleEditor'), + TOCItemsSettingsPlugin: require('@mapstore/plugins/TOCItemsSettings'), + TOCPlugin: require('@mapstore/plugins/TOC'), + ThematicLayerPlugin: require('@mapstore/plugins/ThematicLayer'), + ThemeSwitcherPlugin: require('@mapstore/plugins/ThemeSwitcher'), + TimelinePlugin: require('@mapstore/plugins/Timeline'), + ToolbarPlugin: require('@mapstore/plugins/Toolbar'), + TutorialPlugin: require('@mapstore/plugins/Tutorial'), + UndoPlugin: require('@mapstore/plugins/History'), + UserManagerPlugin: require('@mapstore/plugins/manager/UserManager'), + VersionPlugin: require('@mapstore/plugins/Version'), + WFSDownloadPlugin: require('@mapstore/plugins/WFSDownload'), + WidgetsBuilderPlugin: require('@mapstore/plugins/WidgetsBuilder'), + WidgetsPlugin: require('@mapstore/plugins/Widgets'), + WidgetsTrayPlugin: require('@mapstore/plugins/WidgetsTray'), + ZoomAllPlugin: require('@mapstore/plugins/ZoomAll'), + ZoomInPlugin: require('@mapstore/plugins/ZoomIn'), + ZoomOutPlugin: require('@mapstore/plugins/ZoomOut'), + NotAllowedPlugin: require('./plugins/NotAllowed').default + }, + requires: { + ReactSwipe: require('react-swipeable-views').default, + SwipeHeader: require('@mapstore/components/data/identify/SwipeHeader') + } +}; diff --git a/js/plugins/Login.jsx b/js/plugins/Login.jsx new file mode 100644 index 000000000..577c9b4da --- /dev/null +++ b/js/plugins/Login.jsx @@ -0,0 +1,43 @@ +/* + * Copyright 2019, 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. + */ +import {createPlugin} from "@mapstore/utils/PluginsUtils"; +import {login} from "@mapstore/actions/security"; +import {connect} from "react-redux"; +import User, {AutoLogin} from "../components/User"; +import security from "@mapstore/reducers/security"; + +const LoginState = connect((state) => ({ + user: state.security && state.security.user, + error: state.security && state.security.loginError, + bsStyle: "primary", + className: "square-button georchestra-login" +}), { + onLogin: login +})(User); + +const AutoLoginAction = connect(() => ({ +}), { + onLogin: login +})(AutoLogin); + + +export default createPlugin('Login', { + component: AutoLoginAction, + containers: { + OmniBar: { + name: "login", + position: 3, + tool: LoginState, + priority: 1, + doNotHide: true + } + }, + reducers: { + security + } +}); diff --git a/js/plugins/NotAllowed.jsx b/js/plugins/NotAllowed.jsx new file mode 100644 index 000000000..fda60abbb --- /dev/null +++ b/js/plugins/NotAllowed.jsx @@ -0,0 +1,14 @@ +/* + * Copyright 2019, 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. + */ +import React from "react"; +import { createPlugin } from "@mapstore/utils/PluginsUtils"; +import Message from "@mapstore/components/I18N/Message"; + +export default createPlugin('NotAllowed', { + component: () =>
+}); diff --git a/localConfig.json b/localConfig.json new file mode 100644 index 000000000..f18b31605 --- /dev/null +++ b/localConfig.json @@ -0,0 +1,511 @@ +{ + "proxyUrl": { + "url": "proxy/?url=", + "useCORS": [ + "https://georchestra.geo-solutions.it" + ] + }, + "geoStoreUrl": "rest/geostore/", + "printUrl": "pdf/info.json", + "bingApiKey": "AhuXBu7ipR1gNbBfXhtUAyCZ6rkC5PkWpxs2MnMRZ1ZupxQfivjLCch22ozKSCAn", + "mapquestApiKey": "__API_KEY_MAPQUEST__", + "initialMapFilter": "", + "ignoreMobileCss": false, + "useAuthenticationRules": true, + "loadAfterTheme": true, + "defaultMapOptions": { + "cesium": { + "flyTo": true, + "navigationTools": true, + "terrainProvider": { + "type": "ellipsoid" + } + } + }, + "authenticationRules": [{ + "urlPattern": ".*geostore.*", + "method": "bearer" + }, { + "urlPattern": "http(s)?\\:\\/\\/gs-stable\\.geo-solutions\\.it\\/geoserver/.*", + "authkeyParamName": "authkey", + "method": "authkey" + }], + "monitorState": [ + {"name": "router", "path": "router.location.pathname"}, + {"name": "browser", "path": "browser"}, + {"name": "featuregridmode", "path": "featuregrid.mode"}], + "projectionDefs": [], + "initialState": { + "defaultState": { + "annotations": { + "config": { + "multiGeometry": true, + "validationErrors": {} + }, + "format": "decimal", + "defaultTextAnnotation": "New" + }, + "maptype": { + "mapType": "{context.mode === 'desktop' ? 'openlayers' : 'leaflet'}" + }, + "catalog": { + "default": { + "newService": { + "url": "", + "type": "wms", + "title": "", + "isNew": true, + "autoload": false + }, + "selectedService": "gs_stable_csw", + "services": { + "gs_stable_csw": { + "url": "https://gs-stable.geo-solutions.it/geoserver/csw", + "type": "csw", + "title": "GeoSolutions GeoServer CSW", + "autoload": true + }, + "gs_stable_wms": { + "url": "https://gs-stable.geo-solutions.it/geoserver/wms", + "type": "wms", + "title": "GeoSolutions GeoServer WMS", + "autoload": false + }, + "gs_stable_wmts": { + "url": "https://gs-stable.geo-solutions.it/geoserver/gwc/service/wmts", + "type": "wmts", + "title": "GeoSolutions GeoServer WMTS", + "autoload": false + } + } + } + }, + "locales": { + "supportedLocales": { + "it": { + "code": "it-IT", + "description": "Italiano" + }, + "en": { + "code": "en-US", + "description": "English" + }, + "fr": { + "code": "fr-FR", + "description": "Français" + }, + "de": { + "code": "de-DE", + "description": "Deutsch" + }, + "es": { + "code": "es-ES", + "description": "Español" + } + } + } + } + }, + "plugins": { + "mobile": [{ + "name": "Map", + "cfg": { + "mapOptions": { + "openlayers": { + "interactions": { + "pinchRotate": false, + "altShiftDragRotate": false + } + } + }, + "tools": ["locate"] + } + }, "Version", "DrawerMenu", + { + "name": "BackgroundSelector", + "cfg": { + "bottom": 25, + "dimensions": { + "side": 65, + "sidePreview": 65, + "frame": 3, + "margin": 5, + "label": false, + "vertical": true + } + } + }, + { + "name": "Identify", + "showIn": ["Settings"], + "cfg": { + "showFullscreen": true, + "position": "bottom", + "size": 0.5, + "fluid": true, + "viewerOptions": { + "container": "{context.ReactSwipe}" + } + } + }, { + "name": "Locate", + "override": { + "Toolbar": { + "alwaysVisible": true + } + } + }, "Home", { + "name": "TOC", + "cfg": { + "activateMetedataTool": false, + "activateMapTitle": false, + "activateSortLayer": false, + "activateLayerFilterTool": false, + "activateQueryTool": false + } + }, "AddGroup", { + "name": "TOCItemsSettings", + "cfg": { + "width": 300 + } + }, { + "name": "Tutorial", + "cfg": { + "preset": "default_mobile_tutorial" + } + }, { + "name": "Settings", + "cfg": { + "wrap": true + } + }, { + "name": "Search", + "cfg": { + "showOptions": false, + "withToggle": ["max-width: 768px", "min-width: 768px"] + } + }, { + "name": "Toolbar", + "id": "NavigationBar", + "cfg": { + "id": "navigationBar" + } + }, "ZoomAll", { + "name": "MapLoading", + "override": { + "Toolbar": { + "alwaysVisible": true + } + } + }, { + "name": "FullScreen", + "override": { + "Toolbar": { + "alwaysVisible": false + } + } + }, "Login", + "OmniBar", "BurgerMenu", "Expander", "GlobeViewSwitcher", { + "name": "Cookie", + "cfg": { + "externalCookieUrl" : "", + "declineUrl" : "http://www.google.com" + } + }, + "FeedbackMask" + ], + "desktop": [ "Details", + { + "name": "Map", + "cfg": { + "mapOptions": { + "openlayers": { + "interactions": { + "pinchRotate": false, + "altShiftDragRotate": false + }, + "attribution": { + "container": "#mapstore-map-footer-container" + } + }, + "leaflet": { + "attribution": { + "container": "#mapstore-map-footer-container" + } + } + }, + "toolsOptions": { + "scalebar": { + "container" : "#mapstore-map-footer-container" + } + } + } + }, "AutoMapUpdate", "HelpLink", "Share", "DrawerMenu", "Version", "Notifications", "BackgroundSelector", "Annotations", + { + "name": "Identify", + "cfg": { + "showHighlightFeatureButton": true, + "viewerOptions": { + "container": "{context.ReactSwipe}" + } + }, + "override": { + "Toolbar": { + "position": 11 + } + } + }, + { + "name": "Locate", + "override": { + "Toolbar": { + "alwaysVisible": true + } + } + }, "Home", "FeatureEditor", + "WFSDownload", + { + "name": "QueryPanel", + "cfg": { + "activateQueryTool": true, + "spatialOperations": [ + {"id": "INTERSECTS", "name": "queryform.spatialfilter.operations.intersects"}, + {"id": "CONTAINS", "name": "queryform.spatialfilter.operations.contains"}, + {"id": "WITHIN", "name": "queryform.spatialfilter.operations.within"} + ], + "spatialMethodOptions": [ + {"id": "Viewport", "name": "queryform.spatialfilter.methods.viewport"}, + {"id": "BBOX", "name": "queryform.spatialfilter.methods.box"}, + {"id": "Circle", "name": "queryform.spatialfilter.methods.circle"}, + {"id": "Polygon", "name": "queryform.spatialfilter.methods.poly"} + ] + } + }, { + "name": "TOC", + "cfg": { + "activateQueryTool": true, + "activateAddLayerButton": true, + "activateAddGroupButton": true, + "activateMetedataTool": false + } + }, + "AddGroup", + "TOCItemsSettings", + "Tutorial", "MapFooter", { + "name": "Measure", + "cfg": { + "defaultOptions": { + "showAddAsAnnotation": true + } + } + }, "Print", "MapImport", "MapExport", { + "name": "Settings", + "cfg": { + "wrap": true + } + }, { + "name": "MetadataExplorer", + "cfg": { + "wrap": true + } + }, { + "name": "About", + "showIn": ["BurgerMenu"] + } + , { + "name": "MousePosition", + "cfg": { + "editCRS": true, + "showLabels": true, + "showToggle": true, + "filterAllowedCRS": ["EPSG:4326", "EPSG:3857"], + "additionalCRS": {} + } + }, { + "name": "CRSSelector", + "cfg": { + "additionalCRS": { + + }, + "filterAllowedCRS": [ + "EPSG:4326", + "EPSG:3857" + ], + "allowedRoles": [ + "ADMIN" + ] + } + }, { + "name": "Search", + "cfg": { + "withToggle": ["max-width: 768px", "min-width: 768px"] + } + }, { + "name": "Toolbar", + "id": "NavigationBar", + "cfg": { + "id": "navigationBar" + } + }, + "ScaleBox", { + "name":"ZoomAll", + "override": { + "Toolbar": { + "alwaysVisible": true + } + } + }, { + "name": "MapLoading", + "override": { + "Toolbar": { + "alwaysVisible": true + } + } + }, { + "name": "ZoomIn", + "override": { + "Toolbar": { + "alwaysVisible": true + } + } + }, { + "name": "ZoomOut", + "override": { + "Toolbar": { + "alwaysVisible": true + } + } + }, { + "name": "Cookie", + "cfg": { + "externalCookieUrl" : "", + "declineUrl" : "http://www.google.com" + } + }, + "OmniBar", "Login", "Save", "SaveAs", "BurgerMenu", "Expander", "Undo", "Redo", "FullScreen", "GlobeViewSwitcher", "SearchServicesConfig", "WidgetsBuilder", "Widgets", + "WidgetsTray", + "Timeline", + "Playback", + "FeedbackMask", + "StyleEditor" + ], + "embedded": [{ + "name": "Map", + "cfg": { + "tools": ["locate"], + "mapOptions": { + "openlayers": { + "interactions": { + "pinchRotate": false, + "altShiftDragRotate": false + }, + "attribution": { + "container": "#mapstore-map-footer-container" + } + }, + "leaflet": { + "attribution": { + "container": "#mapstore-map-footer-container" + } + } + }, + "toolsOptions": { + "scalebar": { + "container" : "#mapstore-map-footer-container" + } + } + } + }, { + "name": "DrawerMenu", + "hide": "{!(request.query && request.query.forceDrawer)}" + },{ + "name": "BackgroundSelector", + "cfg": { + "bottom": 40, + "dimensions": { + "side": 65, + "sidePreview": 65, + "frame": 3, + "margin": 5, + "label": false, + "vertical": true + } + } + }, { + "name": "Identify", + "cfg": { + "showFullscreen": true, + "position": "bottom", + "size": 0.5, + "fluid": true, + "viewerOptions": { + "container": "{context.ReactSwipe}" + } + } + }, { + "name": "ZoomAll", + "override": { + "Toolbar": { + "alwaysVisible": true + } + } + }, { + "name": "Locate", + "override": { + "Toolbar": { + "alwaysVisible": true + } + } + }, { + "name": "TOC", + "cfg": { + "activateMapTitle": false, + "activateSettingsTool": false, + "activateMetedataTool": false, + "activateRemoveLayer": false + } + + }, "AddGroup", "MapFooter", { + "name": "Settings", + "cfg": { + "wrap": true + } + }, { + "name": "Search", + "cfg": { + "showOptions": false, + "withToggle": ["max-width: 768px", "min-width: 768px"] + } + }, { + "name": "Toolbar", + "id": "NavigationBar", + "cfg": { + "id": "navigationBar" + } + }, { + "name": "MapLoading", + "override": { + "Toolbar": { + "alwaysVisible": true + } + } + }, "Cookie", + "OmniBar", { + "name": "GoFull", + "override": { + "Toolbar": { + "alwaysVisible": true + } + } + }, + "FeedbackMask" + ], + "common": [], + "admin": ["OmniBar", "Login"], + "notallowed": [ + "OmniBar", + "Login", + "NotAllowed" + ] + } +} diff --git a/package.json b/package.json index 9b0908d4e..800a97905 100644 --- a/package.json +++ b/package.json @@ -2,84 +2,86 @@ "name": "GeOrchestra", "version": "1.0.0", "description": "GeOrchestra", - "repository": "https://github.com/georchestra/mapstore2-georchestra", + "repository": "https://github.com/geosolutions-it/georchestra", "main": "index.js", "devDependencies": { + "@babel/core": "7.5.5", + "@babel/plugin-proposal-class-properties": "7.5.5", + "@babel/plugin-syntax-dynamic-import": "7.2.0", + "@babel/preset-env": "7.5.5", + "@babel/preset-react": "7.0.0", "acorn-jsx": "https://github.com/geosolutions-it/acorn-jsx/tarball/master", "axios-mock-adapter": "1.16.0", - "babel-core": "6.8.0", - "babel-eslint": "4.1.8", + "babel-eslint": "10.0.3", "babel-istanbul-loader": "0.1.0", - "babel-loader": "6.2.4", + "babel-loader": "8.0.5", "babel-plugin-add-module-exports": "0.1.4", "babel-plugin-object-assign": "1.2.1", "babel-plugin-react-transform": "2.0.2", - "babel-preset-es2015": "6.6.0", - "babel-preset-react": "6.5.0", - "babel-preset-stage-0": "6.5.0", "cesium": "1.17.0", - "copy-webpack-plugin": "4.0.1", + "copy-webpack-plugin": "5.0.2", "css-loader": "0.19.0", "denodeify": "1.2.1", - "dynamic-public-path-webpack-plugin": "1.0.4", "docma": "1.5.1", "download-cli": "1.0.1", + "dynamic-public-path-webpack-plugin": "1.0.4", "escope": "3.2.0", - "eslint": "0.24.1", + "eslint": "6.3.0", + "eslint-plugin-no-only-tests": "2.3.1", "eslint-plugin-react": "3.3.2", "expect": "1.20.1", - "extract-text-webpack-plugin": "2.1.0", "file-loader": "2.0.0", "glob": "7.1.1", "html-loader": "0.5.1", - "html-webpack-plugin": "2.17.0", - "istanbul-instrumenter-loader": "2.0.0", + "html-webpack-plugin": "3.2.0", "jsdoc": "https://github.com/geosolutions-it/jsdoc/tarball/fix_acorn_jsx", "jsdoc-jsx": "0.1.0", - "karma": "1.5.0", - "karma-chrome-launcher": "2.0.0", - "karma-cli": "1.0.1", - "karma-coverage": "1.1.1", - "karma-coveralls": "1.1.2", - "karma-firefox-launcher": "1.0.0", + "karma": "4.3.0", + "karma-chrome-launcher": "3.1.0", + "karma-cli": "2.0.0", + "karma-coverage": "2.0.1", + "karma-coveralls": "2.1.0", + "karma-firefox-launcher": "1.2.0", "karma-ie-launcher": "1.0.0", "karma-junit-reporter": "1.2.0", "karma-mocha": "1.3.0", - "karma-mocha-reporter": "2.2.2", + "karma-mocha-reporter": "2.2.5", "karma-sourcemap-loader": "0.3.7", - "karma-webpack": "2.0.2", + "karma-webpack": "4.0.2", "less": "2.7.1", - "less-loader": "2.2.3", + "less-loader": "4.1.0", + "mini-css-extract-plugin": "0.5.0", "mkdirp": "0.5.1", - "mocha": "2.4.5", + "mocha": "https://github.com/geosolutions-it/mocha/tarball/v6.2.0_uncaught", "ncp": "2.0.0", "parallelshell": "1.2.0", - "postcss": "5.2.16", - "postcss-loader": "1.3.3", - "postcss-prefix-selector": "1.6.0", + "postcss": "7.0.14", + "postcss-loader": "3.0.0", + "postcss-prefix-selector": "1.7.1", + "progress-bar-webpack-plugin": "1.12.1", "raw-loader": "0.5.1", - "react-hot-loader": "1.3.1", "react-motion": "0.5.0", - "react-transform-catch-errors": "1.0.2", "react-transition-group": "1.1.3", "readline-promise": "1.0.4", - "redbox-react": "1.3.6", "redux-devtools": "3.4.0", "redux-devtools-dock-monitor": "1.1.2", "redux-devtools-log-monitor": "1.3.0", - "redux-immutable-state-invariant": "1.2.3", + "redux-immutable-state-invariant": "2.1.0", "redux-mock-store": "1.2.2", "rimraf": "2.5.2", "simple-git": "1.33.1", "style-loader": "0.12.4", "url-loader": "0.5.7", - "webpack": "2.2.1", + "vusion-webfonts-generator": "0.4.1", + "webpack": "4.36.0", "webpack-bundle-size-analyzer": "2.0.2", - "webpack-dev-server": "2.4.1", - "webpack-parallel-uglify-plugin": "0.4.0" + "webpack-cli": "3.3.6", + "webpack-dev-server": "3.7.2", + "webpack-parallel-uglify-plugin": "1.1.2" }, "//": "replace react-sortable-items with official on npm when it will support React 15", "dependencies": { + "@boundlessgeo/jsonix": "2.4.3", "@carnesen/redux-add-action-listener-enhancer": "0.0.1", "@mapbox/geojsonhint": "2.0.1", "@mapbox/togeojson": "0.16.0", @@ -92,10 +94,10 @@ "@turf/great-circle": "5.1.5", "@turf/inside": "4.1.0", "@turf/line-intersect": "4.1.0", - "@turf/polygon-to-linestring": "4.1.0", "@turf/point-on-surface": "4.1.0", - "ag-grid": "3.3.3", - "ag-grid-react": "3.3.1", + "@turf/polygon-to-linestring": "4.1.0", + "ag-grid-community": "20.2.0", + "ag-grid-react": "20.2.0", "axios": "0.18.1", "b64-to-blob": "1.2.19", "babel-polyfill": "6.8.0", @@ -107,7 +109,8 @@ "classnames": "2.2.5", "codemirror": "5.18.2", "colorbrewer": "1.0.0", - "create-react-class": "15.6.2", + "connected-react-router": "6.3.2", + "create-react-class": "15.6.3", "css-tree": "1.0.0-alpha24", "draft-js": "0.11.0", "draft-js-inline-toolbar-plugin": "3.0.0", @@ -120,17 +123,17 @@ "eventlistener": "0.0.1", "file-saver": "1.3.3", "fs-extra": "3.0.1", - "geostyler-sld-parser": "https://github.com/geosolutions-it/geostyler-sld-parser/tarball/ms2", "geostyler-openlayers-parser": "https://github.com/geosolutions-it/geostyler-openlayers-parser/tarball/ms2", + "geostyler-sld-parser": "https://github.com/geosolutions-it/geostyler-sld-parser/tarball/ms2", "history": "4.6.1", "html2canvas": "0.5.0-beta4", "immutable": "4.0.0-rc.12", "intersection-observer": "0.7.0", "intl": "1.2.2", - "ismobilejs": "0.4.0", + "ismobilejs": "0.5.0", + "istanbul-instrumenter-loader": "3.0.1", "json-2-csv": "2.1.2", - "json-loader": "0.5.4", - "jsonix": "2.4.1", + "json-loader": "0.5.7", "jszip": "3.1.5", "keymirror": "0.1.1", "leaflet": "1.3.1", @@ -152,62 +155,63 @@ "ol": "5.3.0", "pdfviewer": "0.3.2", "proj4": "https://github.com/geosolutions-it/proj4js/tarball/mapstore2_fixes", - "prop-types": "15.6.0", - "qrcode.react": "0.6.1", - "react": "15.6.2", + "prop-types": "15.7.2", + "qrcode.react": "0.9.3", + "react": "16.10.1", "react-addons-css-transition-group": "15.6.2", "react-addons-shallow-compare": "15.6.2", "react-bootstrap": "0.31.0", "react-codemirror2": "4.0.0", - "react-color": "2.11.3", + "react-color": "2.17.0", "react-confirm-button": "0.0.2", "react-container-dimensions": "1.3.2", + "react-contenteditable": "3.3.2", "react-copy-to-clipboard": "5.0.0", "react-data-grid": "5.0.4", "react-data-grid-addons": "5.0.4", "react-dnd": "2.6.0", + "react-dnd-test-backend": "2.6.0", "react-dnd-html5-backend": "2.6.0", "react-dock": "0.2.4", - "react-dom": "15.6.2", + "react-dom": "16.10.1", "react-draft-wysiwyg": "1.13.2", "react-draggable": "2.2.6", "react-dropzone": "3.13.1", - "react-grid-layout-resize-prevent-collision": "0.16.0", + "react-error-boundary": "1.2.5", + "react-grid-layout": "0.16.6", "react-image-lightbox": "4.2.2", "react-input-autosize": "1.1.4", "react-intersection-observer": "8.24.1", "react-intl": "2.3.0", "react-joyride": "ddeath/react-joyride#fixed-positioning-and-overlay", "react-notification-system": "0.2.14", - "react-nouislider": "2.0.0", - "react-overlays": "0.6.3", - "react-pdf": "1.6.1", + "react-nouislider": "2.0.1", + "react-overlays": "1.2.0", + "react-pdf": "4.0.5", "react-quill": "1.1.0", - "react-redux": "5.0.5", + "react-redux": "6.0.0", "react-responsive": "1.3.0", "react-router": "4.1.1", "react-router-dom": "4.2.2", - "react-router-redux": "5.0.0-alpha.6", "react-scroll-up": "1.3.0", "react-select": "1.0.0-rc.4", - "react-selectize": "2.0.3", + "react-selectize": "3.0.1", "react-share": "1.15.1", "react-side-effect": "1.1.0", "react-sidebar": "2.3.2", - "react-sortable-items": "https://github.com/geosolutions-it/react-sortable-items/tarball/react15", "react-spinkit": "2.1.2", "react-swipeable-views": "0.12.2", "react-textfit": "1.1.0", "react-twitter-widgets": "1.3.0", - "react-widgets": "3.4.8", + "react-widgets": "3.5.0", "recharts": "0.22.4", "recompose": "0.24.0", "redux": "3.6.0", - "redux-logger": "2.6.1", - "redux-observable": "0.13.0", + "redux-logger": "3.0.6", + "redux-observable": "0.19.0", "redux-thunk": "0.1.0", "redux-undo": "0.5.0", - "reselect": "2.5.1", + "reselect": "4.0.0", "resize-observer-polyfill": "1.5.0", "rxjs": "5.1.1", "screenfull": "4.0.0", @@ -230,14 +234,14 @@ }, "scripts": { "clean": "rimraf dist", - "compile": "npm run clean && mkdirp ./dist && webpack --config prod-webpack.config.js --env.production", + "compile": "npm run clean && mkdirp ./dist && node --max_old_space_size=2048 ./node_modules/webpack/bin/webpack.js --config prod-webpack.config.js --env.production", "start": "webpack-dev-server --progress --colors --port 8081 --hot --inline --content-base .", "postinstall": "node checkCesium.js", "test": "karma start ./karma.conf.single-run.js", "continuoustest": "karma start ./karma.conf.continuous-test.js", "mvntest": "karma start ./karma.conf.single-run.js --reporters junit,dots,coverage", "lint": "eslint js --ext .jsx,.js", - "travis": "eslint js --ext .jsx,.js && karma start ./karma.conf.single-run.js --browsers Firefox --reporters dots,junit,coverage" + "travis": "eslint js --ext .jsx,.js && karma start ./karma.conf.single-run.js --browsers Firefox --reporters dots,junit,coverage,coveralls" }, "author": "GeoSolutions", "license": "BSD-2-Clause" diff --git a/themes.js b/themes.js new file mode 100644 index 000000000..54db6bf3e --- /dev/null +++ b/themes.js @@ -0,0 +1,23 @@ +const MiniCssExtractPlugin = require("mini-css-extract-plugin"); +var path = require("path"); +const glob = require('glob'); +const extractThemesPlugin = new MiniCssExtractPlugin({ + filename: '[name].css' +}); + + +const themeEntries = (() => { + const globPath = path.join(__dirname, "themes", "*"); + var files = glob.sync(globPath, {mark: true}); + return files.filter((f) => f.lastIndexOf('/') === f.length - 1).reduce((res, curr) => { + var finalRes = res || {}; + var themeName = path.basename(curr, path.extname(curr)); + finalRes["themes/" + themeName] = path.join(__dirname, "themes", `${themeName}`, "theme.less"); + return finalRes; + }, {}); + +})(); +module.exports = { + themeEntries, + extractThemesPlugin +}; diff --git a/themes/default/georchestra.less b/themes/default/georchestra.less new file mode 100644 index 000000000..7928b2699 --- /dev/null +++ b/themes/default/georchestra.less @@ -0,0 +1,8 @@ +.georchestra-login { + background-color: white; + text-align: center; + span { + margin-top: 16px; + display: inline-block; + } +} diff --git a/themes/default/theme.less b/themes/default/theme.less new file mode 100644 index 000000000..e64b97626 --- /dev/null +++ b/themes/default/theme.less @@ -0,0 +1,8 @@ +@import "~@mapstore/themes/default/icons.less"; +@import "~@mapstore/themes/default/base.less"; +@import "~@mapstore/themes/default/bootstrap-theme.less"; +@import "~@mapstore/themes/default/ms2-theme.less"; +@import "~@mapstore/themes/default/variables.less"; + +@import "variables.less"; +@import "georchestra.less"; diff --git a/themes/default/variables.less b/themes/default/variables.less new file mode 100644 index 000000000..ed7147f4b --- /dev/null +++ b/themes/default/variables.less @@ -0,0 +1 @@ +/* mapstore2 variables */ diff --git a/translations/data.en-US b/translations/data.en-US new file mode 100644 index 000000000..f7f314a91 --- /dev/null +++ b/translations/data.en-US @@ -0,0 +1,8 @@ +{ + "locale": "en-US", + "messages": { + "georchestra": { + "pageNotAllowed": "Access Denied" + } + } +} diff --git a/translations/data.fr-FR b/translations/data.fr-FR new file mode 100644 index 000000000..3f921e8a8 --- /dev/null +++ b/translations/data.fr-FR @@ -0,0 +1,8 @@ +{ + "locale": "fr-FR", + "messages": { + "georchestra": { + "pageNotAllowed": "Accès refusé" + } + } +} diff --git a/translations/data.it-IT b/translations/data.it-IT new file mode 100644 index 000000000..cf834c7d4 --- /dev/null +++ b/translations/data.it-IT @@ -0,0 +1,8 @@ + { + "locale": "it-IT", + "messages": { + "georchestra": { + "pageNotAllowed": "Accesso Negato" + } + } +} diff --git a/web/pom.xml b/web/pom.xml index 5ff12d3a6..eed91d807 100644 --- a/web/pom.xml +++ b/web/pom.xml @@ -22,7 +22,7 @@ it.geosolutions.geostore geostore-webapp - 1.4.2-SNAPSHOT + 1.5.0-SNAPSHOT war runtime diff --git a/web/src/main/resources/geostore-spring-security.xml b/web/src/main/resources/geostore-spring-security.xml new file mode 100644 index 000000000..6f19ed491 --- /dev/null +++ b/web/src/main/resources/geostore-spring-security.xml @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/web/src/main/resources/sample_categories.xml b/web/src/main/resources/sample_categories.xml index 6f51db9d8..754fcb565 100644 --- a/web/src/main/resources/sample_categories.xml +++ b/web/src/main/resources/sample_categories.xml @@ -12,4 +12,7 @@ DASHBOARD + + GEOSTORY + diff --git a/webpack.config.js b/webpack.config.js index 2c5f1da1d..57364b568 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,7 +1,7 @@ const path = require("path"); -const themeEntries = require('./MapStore2/build/themes.js').themeEntries; -const extractThemesPlugin = require('./MapStore2/build/themes.js').extractThemesPlugin; +const themeEntries = require('./themes.js').themeEntries; +const extractThemesPlugin = require('./themes.js').extractThemesPlugin; module.exports = require('./MapStore2/build/buildConfig')( { @@ -24,5 +24,39 @@ module.exports = require('./MapStore2/build/buildConfig')( { "@mapstore": path.resolve(__dirname, "MapStore2", "web", "client"), "@js": path.resolve(__dirname, "js") + }, + { + '/rest/geostore': { + target: "http://localhost:8080/mapstore", + secure: false, + headers: { + host: "localhost:8080" + } + }, + '/pdf': { + target: "http://localhost:8080/mapstore", + secure: false, + headers: { + host: "localhost:8080" + } + }, + '/mapstore/pdf': { + target: "http://localhost:8080", + secure: false, + headers: { + host: "localhost:8080" + } + }, + '/proxy': { + target: "http://localhost:8080/mapstore", + secure: false, + headers: { + host: "localhost:8080" + } + }, + '/docs': { + target: "http://localhost:8081", + pathRewrite: { '/docs': '/mapstore/docs' } + } } );