From 35b6f07ea08119dbff890b7b1d2400f68d0807d1 Mon Sep 17 00:00:00 2001 From: mahmoud adel <58145645+mahmoudadel54@users.noreply.github.com> Date: Mon, 17 Jun 2024 15:47:03 +0300 Subject: [PATCH 1/3] #10418: Share tool - the 'Add place mark and zoom to sharing link' option is not applied correctly (#10419) --- web/client/epics/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/client/epics/search.js b/web/client/epics/search.js index 5500eb7fe8..a02bceb7f6 100644 --- a/web/client/epics/search.js +++ b/web/client/epics/search.js @@ -224,7 +224,7 @@ export const getFeatureInfoOfSelectedItem = (action$, store) => ]; } } - return [Rx.Observable.empty()]; + return Rx.Observable.empty(); }).delay(50); /** * Handles show GFI button click action. From 4e8c10ed606064d6286a938d8015b935a3245f76 Mon Sep 17 00:00:00 2001 From: mahmoud adel <58145645+mahmoudadel54@users.noreply.github.com> Date: Thu, 27 Jun 2024 16:17:58 +0300 Subject: [PATCH 2/3] backport #10414 with fix conflict in migration file --- .../mapstore-migration-guide.md | 47 +++++++++++++++++++ .../security/modals/UserDetailsModal.jsx | 23 +++++---- .../__tests__/UserDetailsModal-test.jsx | 45 ++++++++++++++++++ 3 files changed, 107 insertions(+), 8 deletions(-) diff --git a/docs/developer-guide/mapstore-migration-guide.md b/docs/developer-guide/mapstore-migration-guide.md index 4972ac0359..265e1ce749 100644 --- a/docs/developer-guide/mapstore-migration-guide.md +++ b/docs/developer-guide/mapstore-migration-guide.md @@ -20,6 +20,53 @@ This is a list of things to check if you want to update from a previous version - Optionally check also accessory files like `.eslinrc`, if you want to keep aligned with lint standards. - Follow the instructions below, in order, from your version to the one you want to update to. +## Migration from 2024.01.00 to 2024.01.02 + +### Option to hide the group info of logged in user from user details modal window + +Recently, we have added the option to hide the `user group info` from the user details modal. +To enable this, you have to add a cfg in all `Login` plugin into `localConfig.json` like: + +```json +{ + "name": "Login", + "cfg": { "toolsCfg": [{"hideGroupUserInfo": true}] } +} +``` + +where the first index of toolsCfg is for `userDetails` component that is responsible for displaying the user details including `user group info` + +!!! note important notes should be considered: + +- if you have customized the Login plugin and in particular the order of toolsCfg, make sure to override the correct one as the propagation of cfg for the tools is based on index value. + +### Integration with openID Connect + +A generic OpenID Connect (OIDC) authentication support has been introduced in MapStore. This feature allows to authenticate users using an OIDC provider, like Keycloak, Okta, Google, Azure, etc. + +To provide this functionality, it is necessary to update the project's `geostore-spring-security.xml` file, if the default one is not used. +If you are using the default one, you can skip this step. + +Here the changes to apply if needed: + +```diff +@@ -24,6 +24,7 @@ + + + ++ + + + +@@ -52,6 +53,7 @@ + + + ++ + + +``` + ## Migration from 2023.02.02 to 2024.01.00 ### TOC plugin refactor diff --git a/web/client/components/security/modals/UserDetailsModal.jsx b/web/client/components/security/modals/UserDetailsModal.jsx index eb73083452..7242193f2c 100644 --- a/web/client/components/security/modals/UserDetailsModal.jsx +++ b/web/client/components/security/modals/UserDetailsModal.jsx @@ -18,6 +18,7 @@ import { isArray, isObject, isString } from 'lodash'; /** * A Modal window to show password reset form + * @prop {bool} hideGroupUserInfo It is a flag from Login plugin (cfg.toolsCfg[0].hideGroupUserInfo): to show/hide user group in user details info, by default `false` */ class UserDetails extends React.Component { static propTypes = { @@ -26,7 +27,8 @@ class UserDetails extends React.Component { show: PropTypes.bool, options: PropTypes.object, onClose: PropTypes.func, - includeCloseButton: PropTypes.bool + includeCloseButton: PropTypes.bool, + hideGroupUserInfo: PropTypes.bool }; static defaultProps = { @@ -35,23 +37,28 @@ class UserDetails extends React.Component { }, onClose: () => {}, options: {}, - includeCloseButton: true + includeCloseButton: true, + hideGroupUserInfo: false }; getUserInfo = () => { - return { + let mainUserInfo = { name: v => {v}, role: v => {this.capitalCase(v)}, email: v => {v}, company: v => {v}, - notes: v => {v}, - groups: groups => { + notes: v => {v} + }; + + if (!this.props.hideGroupUserInfo) { + mainUserInfo.groups = groups => { const gr = isArray(groups) && [...groups] || groups.group && isArray(groups.group) && [...groups.group] || groups.group && isObject(groups.group) && [{...groups.group}]; return gr && gr.map(group => { - return group.groupName &&
{group.groupName}
|| null; + return group.groupName &&
{group.groupName}
|| null; }).filter(v => v) || null; - } - }; + }; + } + return mainUserInfo; } renderAttributes = () => { diff --git a/web/client/components/security/modals/__tests__/UserDetailsModal-test.jsx b/web/client/components/security/modals/__tests__/UserDetailsModal-test.jsx index 5a82ff6dcf..b2a778c500 100644 --- a/web/client/components/security/modals/__tests__/UserDetailsModal-test.jsx +++ b/web/client/components/security/modals/__tests__/UserDetailsModal-test.jsx @@ -75,4 +75,49 @@ describe("Test user details modal", () => { expect(modalDOM.getElementsByClassName('row').length).toEqual(6); }); + it('test hide group user info if hideGroupUserInfo = true', () => { + let testUser = { + "attribute": [ + { + "name": "company", + "value": "Some Company" + }, + { + "name": "email", + "value": "user@email.com" + }, + { + "name": "notes", + "value": "some notes" + }, + { + "name": "UUID", + "value": "260a670e-4dc0-4719-8bc9-85555d7dcbe1" + } + ], + "enabled": true, + "groups": { + "group": { + "enabled": true, + "groupName": "everyone", + "id": 3 + } + }, + "id": 6, + "name": "admin", + "role": "ADMIN" + }; + let displayAttributes = (attr) => { + return attr.name && attr.name === "email" || attr.name === "company"; + }; + const cmpNormal = ReactDOM.render(, document.getElementById("container")); + expect(cmpNormal).toExist(); + const modalDOMNormal = document.getElementsByClassName('ms-resizable-modal')[0]; + expect(modalDOMNormal.querySelector('.user-group-info')).toExist(); // includes group info + + const cmpWithHide = ReactDOM.render(, document.getElementById("container")); + expect(cmpWithHide).toExist(); + const modalDOM = document.getElementsByClassName('ms-resizable-modal')[0]; + expect(modalDOM.querySelector('.user-group-info')).toNotExist(); // not include group info + }); }); From 167597d1447eb852d2d0953328123ce1c075b603 Mon Sep 17 00:00:00 2001 From: mahmoudadel54 Date: Fri, 28 Jun 2024 13:04:27 +0300 Subject: [PATCH 3/3] fix migration conflict during merge --- .../mapstore-migration-guide.md | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/docs/developer-guide/mapstore-migration-guide.md b/docs/developer-guide/mapstore-migration-guide.md index 265e1ce749..4083daa213 100644 --- a/docs/developer-guide/mapstore-migration-guide.md +++ b/docs/developer-guide/mapstore-migration-guide.md @@ -40,33 +40,6 @@ where the first index of toolsCfg is for `userDetails` component that is respons - if you have customized the Login plugin and in particular the order of toolsCfg, make sure to override the correct one as the propagation of cfg for the tools is based on index value. -### Integration with openID Connect - -A generic OpenID Connect (OIDC) authentication support has been introduced in MapStore. This feature allows to authenticate users using an OIDC provider, like Keycloak, Okta, Google, Azure, etc. - -To provide this functionality, it is necessary to update the project's `geostore-spring-security.xml` file, if the default one is not used. -If you are using the default one, you can skip this step. - -Here the changes to apply if needed: - -```diff -@@ -24,6 +24,7 @@ - - - -+ - - - -@@ -52,6 +53,7 @@ - - - -+ - - -``` - ## Migration from 2023.02.02 to 2024.01.00 ### TOC plugin refactor