From 2793e1525ef67e4f3398c5dbdfc47b18bdb526f2 Mon Sep 17 00:00:00 2001 From: iso9000t <119494473+iso9000t@users.noreply.github.com> Date: Tue, 14 Jan 2025 17:55:38 +0400 Subject: [PATCH] EPMRPP-98421 || Code review fixes - 1 --- .../membersPage/userNameCell/userNameCell.jsx | 6 +++--- .../personalInfoBlock/personalInfoBlock.jsx | 20 +++++++++---------- .../allUsersListTable/allUsersListTable.jsx | 11 +--------- .../organizationUsersListTable.jsx | 11 +--------- .../projectTeamListTable.jsx | 11 +--------- 5 files changed, 16 insertions(+), 43 deletions(-) diff --git a/app/src/pages/common/membersPage/userNameCell/userNameCell.jsx b/app/src/pages/common/membersPage/userNameCell/userNameCell.jsx index dbb06bee63..d46980bd33 100644 --- a/app/src/pages/common/membersPage/userNameCell/userNameCell.jsx +++ b/app/src/pages/common/membersPage/userNameCell/userNameCell.jsx @@ -20,16 +20,17 @@ import classNames from 'classnames/bind'; import { Tooltip } from '@reportportal/ui-kit'; import { ADMIN_TYPE } from 'common/utils/permissions/constants'; import { messages } from 'pages/common/users/membersListTable/messages'; +import { UserAvatar } from 'pages/inside/common/userAvatar'; import styles from './userNameCell.scss'; const cx = classNames.bind(styles); -export const UserNameCell = ({ user, badges, userAvatar: UserAvatar }) => { +export const UserNameCell = ({ user, badges }) => { const { formatMessage } = useIntl(); return (
- +
{user.fullName}
{badges.map(({ title, type }) => { @@ -68,7 +69,6 @@ UserNameCell.propTypes = { type: PropTypes.string.isRequired, }), ), - userAvatar: PropTypes.elementType.isRequired, }; UserNameCell.defaultProps = { diff --git a/app/src/pages/inside/profilePage/personalInfoBlock/personalInfoBlock.jsx b/app/src/pages/inside/profilePage/personalInfoBlock/personalInfoBlock.jsx index c0f7601279..5ef339fafd 100644 --- a/app/src/pages/inside/profilePage/personalInfoBlock/personalInfoBlock.jsx +++ b/app/src/pages/inside/profilePage/personalInfoBlock/personalInfoBlock.jsx @@ -81,8 +81,8 @@ const messages = defineMessages({ @connect( (state) => ({ - userId: userInfoSelector(state).userId, - currentUserId: userInfoSelector(state).id, + userLogin: userInfoSelector(state).userId, + userId: userInfoSelector(state).id, accountType: userInfoSelector(state).accountType, isDemoInstance: isDemoInstanceSelector(state), }), @@ -96,8 +96,8 @@ const messages = defineMessages({ @track() export class PersonalInfoBlock extends Component { static propTypes = { - userId: PropTypes.string, - currentUserId: PropTypes.number, + userLogin: PropTypes.string, + userId: PropTypes.number, accountType: PropTypes.string, intl: PropTypes.object.isRequired, showModalAction: PropTypes.func.isRequired, @@ -110,14 +110,14 @@ export class PersonalInfoBlock extends Component { isDemoInstance: PropTypes.bool, }; static defaultProps = { - userId: '', - currentUserId: null, + userLogin: '', + userId: null, accountType: '', isDemoInstance: false, }; state = { - avatarSource: URLS.userAvatar(this.props.currentUserId, false), + avatarSource: URLS.userAvatar(this.props.userId, false), forceUpdateInProgress: false, }; @@ -193,9 +193,9 @@ export class PersonalInfoBlock extends Component { }; render() { - const { intl, accountType, userId, isDemoInstance } = this.props; + const { intl, accountType, userLogin, isDemoInstance } = this.props; const { forceUpdateInProgress } = this.state; - const isDefaultUser = userId === DEFAULT_USER_ID; + const isDefaultUser = userLogin === DEFAULT_USER_ID; const isChangePasswordDisabled = isDemoInstance && isDefaultUser; return (
@@ -211,7 +211,7 @@ export class PersonalInfoBlock extends Component { />
- + {accountType === INTERNAL && ( ( - - )} - /> - ), + component: , }, email: user.email, lastLogin: { diff --git a/app/src/pages/organization/organizationUsersPage/organizationUsersListTable/organizationUsersListTable.jsx b/app/src/pages/organization/organizationUsersPage/organizationUsersListTable/organizationUsersListTable.jsx index e0382b43d3..14c64f4af6 100644 --- a/app/src/pages/organization/organizationUsersPage/organizationUsersListTable/organizationUsersListTable.jsx +++ b/app/src/pages/organization/organizationUsersPage/organizationUsersListTable/organizationUsersListTable.jsx @@ -39,7 +39,6 @@ import { } from 'controllers/organization/users'; import { SORTING_KEY } from 'controllers/organization/projects'; import { UserNameCell } from 'pages/common/membersPage/userNameCell/userNameCell'; -import { UserAvatar } from 'pages/inside/common/userAvatar'; import { MembersListTable } from '../../../common/users/membersListTable'; import { messages } from '../../../common/users/membersListTable/messages'; import styles from './organizationUsersListTable.scss'; @@ -101,15 +100,7 @@ const OrgTeamListTableWrapped = ({ id, fullName: { content: fullName, - component: ( - ( - - )} - /> - ), + component: , }, email, lastLogin: { diff --git a/app/src/pages/organization/projectTeamPage/projectTeamListTable/projectTeamListTable.jsx b/app/src/pages/organization/projectTeamPage/projectTeamListTable/projectTeamListTable.jsx index 3b41032bdb..2e58e1fc7b 100644 --- a/app/src/pages/organization/projectTeamPage/projectTeamListTable/projectTeamListTable.jsx +++ b/app/src/pages/organization/projectTeamPage/projectTeamListTable/projectTeamListTable.jsx @@ -22,7 +22,6 @@ import { useDispatch, useSelector } from 'react-redux'; import { activeProjectKeySelector, userIdSelector } from 'controllers/user'; import { AbsRelTime } from 'components/main/absRelTime'; import { MeatballMenuIcon, Popover } from '@reportportal/ui-kit'; -import { UserAvatar } from 'pages/inside/common/userAvatar'; import { urlOrganizationSlugSelector, userRolesSelector } from 'controllers/pages'; import { SORTING_ASC, withSortingURL } from 'controllers/sorting'; import { DEFAULT_SORT_COLUMN, NAMESPACE } from 'controllers/members/constants'; @@ -90,15 +89,7 @@ const ProjectTeamListTableWrapped = ({ id, fullName: { content: fullName, - component: ( - ( - - )} - /> - ), + component: , }, email, lastLogin: {