Skip to content

Commit

Permalink
EPMRPP-98421 || Fix missing avatar icons on "Organization Users" page
Browse files Browse the repository at this point in the history
  • Loading branch information
iso9000t committed Jan 14, 2025
1 parent 03aaaf8 commit 33251fc
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 36 deletions.
2 changes: 0 additions & 2 deletions app/src/common/urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ export const URLS = {
apiDocs: (apiType) => `${apiType}/api-docs`,

dataPhoto: (at, loadThumbnail) => `${urlBase}data/photo${getQueryParams({ at, loadThumbnail })}`,
dataUserPhoto: (projectKey, login, loadThumbnail) =>
`${urlBase}data/${projectKey}/userphoto${getQueryParams({ login, loadThumbnail })}`,
userAvatar: (userId, thumbnail = false) =>
`${urlCommonBase}users/${userId}/avatar${getQueryParams({ thumbnail })}`,

Expand Down
1 change: 0 additions & 1 deletion app/src/pages/inside/common/userAvatar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@
*/

export { UserAvatar } from './userAvatar';
export { UserAvatarWithNewApi } from './userAvatarWithNewApi';
10 changes: 2 additions & 8 deletions app/src/pages/inside/common/userAvatar/userAvatar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ import styles from './userAvatar.scss';

const cx = classNames.bind(styles);

export const UserAvatar = ({ className, userId, projectKey, isNewApi, thumbnail }) => {
const src = isNewApi
? URLS.userAvatar(userId, thumbnail)
: URLS.dataUserPhoto(projectKey, userId, true);
export const UserAvatar = ({ className, userId, thumbnail }) => {
const src = URLS.userAvatar(userId, thumbnail);

return (
<div className={cx('user-avatar', className)}>
Expand All @@ -45,14 +43,10 @@ export const UserAvatar = ({ className, userId, projectKey, isNewApi, thumbnail
UserAvatar.propTypes = {
className: PropTypes.string,
userId: PropTypes.string.isRequired,
projectKey: PropTypes.string,
isNewApi: PropTypes.bool,
thumbnail: PropTypes.bool,
};

UserAvatar.defaultProps = {
className: '',
projectKey: '',
isNewApi: false,
thumbnail: false,
};
19 changes: 0 additions & 19 deletions app/src/pages/inside/common/userAvatar/userAvatarWithNewApi.jsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { useDispatch, useSelector } from 'react-redux';
import classNames from 'classnames/bind';
import { AbsRelTime } from 'components/main/absRelTime';
import { MeatballMenuIcon, Popover } from '@reportportal/ui-kit';
import { UserAvatarWithNewApi } from 'pages/inside/common/userAvatar';
import { UserAvatar } from 'pages/inside/common/userAvatar';
import { userInfoSelector } from 'controllers/user';
import { getRoleBadgesData } from 'common/utils/permissions/getRoleTitle';
import { NAMESPACE } from 'controllers/instance/allUsers/constants';
Expand Down Expand Up @@ -90,7 +90,7 @@ const AllUsersListTableComponent = ({
user={user}
badges={memberBadges}
userAvatar={({ className, userId: avatarUserId }) => (
<UserAvatarWithNewApi thumbnail className={className} userId={avatarUserId} />
<UserAvatar thumbnail className={className} userId={avatarUserId} />
)}
/>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
} from 'controllers/organization/users';
import { SORTING_KEY } from 'controllers/organization/projects';
import { UserNameCell } from 'pages/common/membersPage/userNameCell/userNameCell';
import { UserAvatarWithNewApi } from 'pages/inside/common/userAvatar';
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';
Expand Down Expand Up @@ -106,7 +106,7 @@ const OrgTeamListTableWrapped = ({
user={user}
badges={memberBadges}
userAvatar={({ className, userId: avatarUserId }) => (
<UserAvatarWithNewApi thumbnail className={className} userId={avatarUserId} />
<UserAvatar thumbnail className={className} userId={avatarUserId} />
)}
/>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ 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 { UserAvatarWithNewApi } from 'pages/inside/common/userAvatar';
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';
Expand Down Expand Up @@ -95,7 +95,7 @@ const ProjectTeamListTableWrapped = ({
user={user}
badges={memberBadges}
userAvatar={({ className, userId: avatarUserId }) => (
<UserAvatarWithNewApi thumbnail className={className} userId={avatarUserId} />
<UserAvatar thumbnail className={className} userId={avatarUserId} />
)}
/>
),
Expand Down

0 comments on commit 33251fc

Please sign in to comment.