Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPMRPP-95913 || Remove 'Compare' button on History Table for Member Viewer #4081

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading