diff --git a/docs/developer-guide/mapstore-migration-guide.md b/docs/developer-guide/mapstore-migration-guide.md index 2e9ce4d813..37b4da6b92 100644 --- a/docs/developer-guide/mapstore-migration-guide.md +++ b/docs/developer-guide/mapstore-migration-guide.md @@ -20,7 +20,25 @@ 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.02.00 +## 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 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 &&