Skip to content

Commit

Permalink
EPMRPP-95913 || Remove 'Compare' button on History Table for Member V…
Browse files Browse the repository at this point in the history
…iewer
  • Loading branch information
maria-hambardzumian committed Nov 4, 2024
1 parent 35c56ec commit c47940b
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -36,6 +38,7 @@ const cx = classNames.bind(styles);
(state) => ({
breadcrumbs: breadcrumbsSelector(state),
isEmptyHistory: isEmptyHistorySelector(state),
userRoles: userRolesSelector(state),
}),
{
restorePath: restorePathAction,
Expand All @@ -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,
};
Expand Down Expand Up @@ -86,8 +90,11 @@ export class HistoryActionPanel extends Component {
customBlock,
isEmptyHistory,
parentItem,
userRoles,
} = this.props;

const canManageTestItems = canWorkWithTests(userRoles);

return (
<div
className={cx('history-action-panel', {
Expand All @@ -106,9 +113,11 @@ export class HistoryActionPanel extends Component {
{customBlock}
<div className={cx('action-buttons')}>
{parentItem && <ParentInfo parentItem={parentItem} />}
<div className={cx('action-button')}>
<CompareWithFilterControl disabled={!showBreadcrumbs || isEmptyHistory} />
</div>
{canManageTestItems && (
<div className={cx('action-button')}>
<CompareWithFilterControl disabled={!showBreadcrumbs || isEmptyHistory} />
</div>
)}
{!!buttons.length &&
buttons.map((button, index) => (
// eslint-disable-next-line react/no-array-index-key
Expand Down

0 comments on commit c47940b

Please sign in to comment.