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-95442 || Add new widget button should not be visible for the M… #4024

Merged
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 @@ -232,8 +232,9 @@ export class ActionPanel extends Component {
};

isShowWidgetButton = () => {
const { activeFilterId } = this.props;
return Number.isInteger(activeFilterId);
const { activeFilterId, userRoles } = this.props;

return Number.isInteger(activeFilterId) && canWorkWithWidgets(userRoles);
};

renderCounterNotification = (number) => <span className={cx('counter')}>{number}</span>;
Expand All @@ -252,7 +253,6 @@ export class ActionPanel extends Component {
restorePath,
onAddNewWidget,
finishedLaunchesCount,
userRoles,
isImportPluginsAvailable,
} = this.props;
const actionDescriptors = this.createActionDescriptors();
Expand Down Expand Up @@ -293,11 +293,7 @@ export class ActionPanel extends Component {
)}
{this.isShowWidgetButton() && (
<div className={cx('action-button', 'mobile-hidden')}>
<GhostButton
icon={AddWidgetIcon}
onClick={onAddNewWidget}
disabled={!canWorkWithWidgets(userRoles)}
>
<GhostButton icon={AddWidgetIcon} onClick={onAddNewWidget}>
<FormattedMessage id="LaunchesPage.addNewWidget" defaultMessage="Add new widget" />
</GhostButton>
</div>
Expand Down
Loading