From c47940b47791d36e9d54bda3b6633d9077ce2199 Mon Sep 17 00:00:00 2001 From: maria-hambardzumian Date: Mon, 4 Nov 2024 04:02:10 +0400 Subject: [PATCH] EPMRPP-95913 || Remove 'Compare' button on History Table for Member Viewer --- .../actionPanel/historyActionPanel.jsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/src/pages/inside/historyPage/historyToolbar/actionPanel/historyActionPanel.jsx b/app/src/pages/inside/historyPage/historyToolbar/actionPanel/historyActionPanel.jsx index dad4041b35..8854ed47ff 100644 --- a/app/src/pages/inside/historyPage/historyToolbar/actionPanel/historyActionPanel.jsx +++ b/app/src/pages/inside/historyPage/historyToolbar/actionPanel/historyActionPanel.jsx @@ -27,6 +27,8 @@ import { isEmptyHistorySelector } from 'controllers/itemsHistory'; import { Breadcrumbs, breadcrumbDescriptorShape } from 'components/main/breadcrumbs'; import { GhostButton } from 'components/buttons/ghostButton'; import { ParentInfo } from 'pages/inside/common/infoLine/parentInfo'; +import { userRolesSelector } from 'controllers/pages'; +import { canWorkWithTests } from 'common/utils/permissions'; import { CompareWithFilterControl } from './compareWithFilterControl'; import styles from './historyActionPanel.scss'; @@ -36,6 +38,7 @@ const cx = classNames.bind(styles); (state) => ({ breadcrumbs: breadcrumbsSelector(state), isEmptyHistory: isEmptyHistorySelector(state), + userRoles: userRolesSelector(state), }), { restorePath: restorePathAction, @@ -55,6 +58,7 @@ export class HistoryActionPanel extends Component { showBreadcrumbs: PropTypes.bool, isEmptyHistory: PropTypes.bool, parentItem: PropTypes.object, + userRoles: PropTypes.object, onRefresh: PropTypes.func, restorePath: PropTypes.func, }; @@ -86,8 +90,11 @@ export class HistoryActionPanel extends Component { customBlock, isEmptyHistory, parentItem, + userRoles, } = this.props; + const canManageTestItems = canWorkWithTests(userRoles); + return (
{parentItem && } -
- -
+ {canManageTestItems && ( +
+ +
+ )} {!!buttons.length && buttons.map((button, index) => ( // eslint-disable-next-line react/no-array-index-key