From 69690b0e302a577f614698f74f1e601a97767727 Mon Sep 17 00:00:00 2001 From: Suren Date: Mon, 7 Aug 2023 16:48:08 +0530 Subject: [PATCH] #634: Update MS to latest version to include Phase II issues (#635) (#636) --- MapStore2 | 2 +- configs/localConfig.json | 15 +++++++++-- configs/pluginsConfig.json | 12 +++++++++ js/app.jsx | 6 +++++ js/epics/login.js | 27 ++++++++++++++++++++ js/plugins/Login.jsx | 2 ++ package.json | 2 ++ version.txt | 2 +- web/src/main/resources/sample_categories.xml | 3 +++ 9 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 js/epics/login.js diff --git a/MapStore2 b/MapStore2 index 3df202c14..c4f94e3b7 160000 --- a/MapStore2 +++ b/MapStore2 @@ -1 +1 @@ -Subproject commit 3df202c147f39261236f0a3c0a762896f877262a +Subproject commit c4f94e3b7bfd22eaf94e22aebf6d9f1b09a61b6f diff --git a/configs/localConfig.json b/configs/localConfig.json index 55441b4f4..02a249028 100644 --- a/configs/localConfig.json +++ b/configs/localConfig.json @@ -45,6 +45,7 @@ }], "monitorState": [ {"name": "router", "path": "router.location.pathname"}, + {"name": "userrole", "path": "security.user.role"}, {"name": "browser", "path": "browser"}, {"name": "geostorymode", "path": "geostory.mode"}, {"name": "featuregridmode", "path": "featuregrid.mode"}, @@ -417,6 +418,7 @@ } } }, + "Permalink", "MetadataExplorer", "MapImport", "MapExport", @@ -471,6 +473,7 @@ } } }, + "Permalink", { "name": "Identify", "cfg": { @@ -890,6 +893,7 @@ } } }, + "Permalink", { "name": "DashboardEditor", "cfg": { @@ -1005,7 +1009,8 @@ "sectionId": true } } - } + }, + "Permalink" ], "geostory-embedded": [ "GeoStory", @@ -1022,6 +1027,10 @@ } } ], + "permalink": [ + "Permalink", + "FeedbackMask" + ], "admin": [{ "name": "Header", "cfg": { @@ -1081,7 +1090,9 @@ "cfg": { "containerPosition": "header" } - } + }, + "ContextImport", + "ContextExport" ], "context": [ "Header" diff --git a/configs/pluginsConfig.json b/configs/pluginsConfig.json index bedde4c48..4a8856347 100644 --- a/configs/pluginsConfig.json +++ b/configs/pluginsConfig.json @@ -148,8 +148,20 @@ "description": "plugins.Share.description", "dependencies": [ "SidebarMenu" + ], + "children": [ + "Permalink" + ], + "autoEnableChildren": [ + "Permalink" ] }, + { + "name": "Permalink", + "glyph": "link", + "title": "plugins.Permalink.title", + "description": "plugins.Permalink.description" + }, { "name": "Version", "glyph": "info-sign", diff --git a/js/app.jsx b/js/app.jsx index 144e23dc4..3350a7ad3 100644 --- a/js/app.jsx +++ b/js/app.jsx @@ -19,6 +19,7 @@ import MapViewer from "@mapstore/product/pages/MapViewer"; import Maps from "@mapstore/product/pages/Maps"; import Dashboard from "@mapstore/product/pages/Dashboard"; import GeoStory from "@mapstore/product/pages/GeoStory"; +import Permalink from "@mapstore/product/pages/Permalink"; import ContextCreator from "@mapstore/product/pages/ContextCreator"; import Context from "@mapstore/product/pages/Context"; import Admin from "./pages/Admin"; @@ -148,6 +149,11 @@ const appConfig = assign({}, appCfg, { name: "geostory", path: "/geostory/shared/:gid/section/:sectionId/column/:columnId", component: GeoStory + }, + { + name: "permalink", + path: "/permalink/:pid", + component: Permalink } ], appEpics: {} diff --git a/js/epics/login.js b/js/epics/login.js new file mode 100644 index 000000000..f278dace2 --- /dev/null +++ b/js/epics/login.js @@ -0,0 +1,27 @@ +/* + * Copyright 2023, 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 {Observable} from "rxjs"; +import { LOGIN_REQUIRED } from '@mapstore/actions/security'; + +const goToLoginPage = () => { + window.location.replace('/?login'); +}; +const redirectToLoginPage = (action$) => + action$.ofType(LOGIN_REQUIRED) + .switchMap(() => { + /* + Note: After login the user is not redirected back to the same resource requested, + as CAS login currently doesn't support that + */ + goToLoginPage(); + return Observable.empty(); + }); + +export default { + redirectToLoginPage +}; diff --git a/js/plugins/Login.jsx b/js/plugins/Login.jsx index e20e0388d..a67a9486c 100644 --- a/js/plugins/Login.jsx +++ b/js/plugins/Login.jsx @@ -9,6 +9,7 @@ import {createPlugin} from "@mapstore/utils/PluginsUtils"; import {connect} from "react-redux"; import User from "../components/User"; import security from "@mapstore/reducers/security"; +import loginEpic from "@js/epics/login"; const LoginState = connect((state) => ({ user: state.security && state.security.user, @@ -33,6 +34,7 @@ export default createPlugin('Login', { doNotHide: true } }, + epics: loginEpic, reducers: { security } diff --git a/package.json b/package.json index a0ee89a4b..0aea19c07 100644 --- a/package.json +++ b/package.json @@ -82,6 +82,7 @@ "karma-webpack": "5.0.0", "less": "4.1.1", "less-loader": "8.0.0", + "markdownlint-cli": "0.32.2", "mini-css-extract-plugin": "1.3.9", "mkdirp": "0.5.1", "ncp": "2.0.0", @@ -103,6 +104,7 @@ "rimraf": "2.5.2", "simple-git": "2.20.1", "style-loader": "2.0.0", + "terser": "5.18.1", "url-loader": "0.5.7", "vusion-webfonts-generator": "0.4.1", "webpack": "5.9.0", diff --git a/version.txt b/version.txt index 66b9d0b8b..ad953ca22 100644 --- a/version.txt +++ b/version.txt @@ -1,2 +1,2 @@ -2023.02.xx +2023.02.00-RC2-geOrchestra 2023.02.xx diff --git a/web/src/main/resources/sample_categories.xml b/web/src/main/resources/sample_categories.xml index 899bf857c..1673bffa9 100644 --- a/web/src/main/resources/sample_categories.xml +++ b/web/src/main/resources/sample_categories.xml @@ -24,4 +24,7 @@ USERSESSION + + PERMALINK +