From 029b8f94d1617f3c4ff58d775911e978d52ded21 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Fri, 8 Nov 2019 14:48:54 +0300 Subject: [PATCH 1/6] web: People: Hide Settings for People module administrator --- .../Client/src/components/pages/Profile/Section/Body/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/products/ASC.People/Client/src/components/pages/Profile/Section/Body/index.js b/products/ASC.People/Client/src/components/pages/Profile/Section/Body/index.js index d4118e1c6c..391c0f9689 100644 --- a/products/ASC.People/Client/src/components/pages/Profile/Section/Body/index.js +++ b/products/ASC.People/Client/src/components/pages/Profile/Section/Body/index.js @@ -104,7 +104,7 @@ class SectionBodyContent extends React.PureComponent { )} - {isSelf && ( + {(isSelf && false) && ( From 4e1ae0d953853ae720e1d3ff0b371de517405786 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Fri, 8 Nov 2019 14:49:12 +0300 Subject: [PATCH 2/6] web: Client: Hide Settings for People module administrator --- web/ASC.Web.Client/src/components/Layout/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/ASC.Web.Client/src/components/Layout/index.js b/web/ASC.Web.Client/src/components/Layout/index.js index 65512666e2..6c06bfee07 100644 --- a/web/ASC.Web.Client/src/components/Layout/index.js +++ b/web/ASC.Web.Client/src/components/Layout/index.js @@ -7,7 +7,7 @@ import { logout } from "../../store/auth/actions"; import { withTranslation, I18nextProvider } from 'react-i18next'; import i18n from "./i18n"; import isEqual from "lodash/isEqual"; -import { isAdmin } from "../../store/auth/selectors"; +//import { isAdmin } from "../../store/auth/selectors"; class PureStudioLayout extends React.Component { shouldComponentUpdate(nextProps, nextState) { @@ -64,7 +64,7 @@ class PureStudioLayout extends React.Component { const getAvailableModules = (modules, currentUser) => { - const isUserAdmin = isAdmin(currentUser); + const isUserAdmin = currentUser.isAdmin; const separator = { separator: true, id: "nav-separator-1" }; const customModules = isUserAdmin ? [ { From d14d647efba34cd409d86bd3a40fd683c6fb1b73 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Fri, 8 Nov 2019 14:51:48 +0300 Subject: [PATCH 3/6] web: People: Addition for commit (029b8f94d1617f3c4ff58d775911e978d52ded21) --- products/ASC.People/Client/src/components/Layout/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/products/ASC.People/Client/src/components/Layout/index.js b/products/ASC.People/Client/src/components/Layout/index.js index d0b41a2a75..7410ddf3f1 100644 --- a/products/ASC.People/Client/src/components/Layout/index.js +++ b/products/ASC.People/Client/src/components/Layout/index.js @@ -6,7 +6,7 @@ import { Layout, Toast } from 'asc-web-components'; import { logout } from '../../store/auth/actions'; import { withTranslation, I18nextProvider } from 'react-i18next'; import i18n from "./i18n"; -import { isAdmin } from "../../store/auth/selectors"; +//import { isAdmin } from "../../store/auth/selectors"; class PurePeopleLayout extends React.Component { shouldComponentUpdate(nextProps) { @@ -68,7 +68,7 @@ class PurePeopleLayout extends React.Component { const getAvailableModules = (modules, currentUser) => { - const isUserAdmin = isAdmin(currentUser); + const isUserAdmin = currentUser.isAdmin; const customModules = isUserAdmin ? [ { separator: true, From cf402ced13e8fd42fb1154e6a2f2d4ceff4e2e28 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Fri, 8 Nov 2019 15:03:30 +0300 Subject: [PATCH 4/6] web: People: Removed unused function from PeopleRow --- .../components/pages/Home/Section/Body/userContent.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/products/ASC.People/Client/src/components/pages/Home/Section/Body/userContent.js b/products/ASC.People/Client/src/components/pages/Home/Section/Body/userContent.js index 6f831fff90..f81ef49c0c 100644 --- a/products/ASC.People/Client/src/components/pages/Home/Section/Body/userContent.js +++ b/products/ASC.People/Client/src/components/pages/Home/Section/Body/userContent.js @@ -1,6 +1,6 @@ import React, { useCallback } from "react"; import { withRouter } from "react-router"; -import { RowContent, Link, LinkWithDropdown, Icons, toastr, Text } from "asc-web-components"; +import { RowContent, Link, LinkWithDropdown, Icons, Text } from "asc-web-components"; import { connect } from "react-redux"; import { getUserStatus } from "../../../../../store/people/selectors"; import { useTranslation } from 'react-i18next'; @@ -60,11 +60,6 @@ const UserContent = ({ user, history, settings }) => { [history, settings.homepage, userName] ); - const onUserTitleClick = useCallback( - () => toastr.success(`Filter action by user title: ${title}`), - [title] - ); - const onPhoneClick = useCallback( () => window.open(`sms:${mobilePhone}`), [mobilePhone] @@ -77,7 +72,7 @@ const UserContent = ({ user, history, settings }) => { const nameColor = status === 'pending' ? '#A3A9AE' : '#333333'; const sideInfoColor = status === 'pending' ? '#D0D5DA' : '#A3A9AE'; - const { t } = useTranslation(); + //const { t } = useTranslation(); const headDepartmentStyle = { width: '110px' From 967e0f62c65cbb1957b934212ddf81b121132951 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Fri, 8 Nov 2019 15:04:33 +0300 Subject: [PATCH 5/6] web: Components: Fixed getUserRole function for module admins at Layout component --- .../src/components/layout/sub-components/profile-actions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/ASC.Web.Components/src/components/layout/sub-components/profile-actions.js b/web/ASC.Web.Components/src/components/layout/sub-components/profile-actions.js index dacb545091..1b3b3d03c3 100644 --- a/web/ASC.Web.Components/src/components/layout/sub-components/profile-actions.js +++ b/web/ASC.Web.Components/src/components/layout/sub-components/profile-actions.js @@ -58,7 +58,7 @@ class ProfileActions extends React.PureComponent { getUserRole = user => { if (user.isOwner) return "owner"; - if (user.isAdmin) return "admin"; + if (user.isAdmin || user.listAdminModules.length) return "admin"; if (user.isVisitor) return "guest"; return "user"; }; From 5a2fc248d36fd79d86e6ef4ebaa407f38fa6a9be Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Fri, 8 Nov 2019 15:04:48 +0300 Subject: [PATCH 6/6] web: components: bump version --- web/ASC.Web.Components/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/ASC.Web.Components/package.json b/web/ASC.Web.Components/package.json index 1b85b5457a..2d49bc76a2 100644 --- a/web/ASC.Web.Components/package.json +++ b/web/ASC.Web.Components/package.json @@ -1,6 +1,6 @@ { "name": "asc-web-components", - "version": "1.0.160", + "version": "1.0.161", "description": "Ascensio System SIA component library", "license": "AGPL-3.0", "main": "dist/asc-web-components.js",