Allow read-only users to close the review panel (#18040)

GitOrigin-RevId: 93a470152da6dd215db07e3060621f32e5ae701d
This commit is contained in:
Alf Eaton 2024-04-22 13:51:21 +01:00 committed by Copybot
parent 92d6966f69
commit cca569e22c
2 changed files with 1 additions and 12 deletions

View file

@ -39,8 +39,6 @@ const ToolbarHeader = React.memo(function ToolbarHeader({
}) {
const { t } = useTranslation()
const shouldDisplayPublishButton = hasPublishPermissions && PublishButton
const shouldDisplayTrackChangesButton =
trackChangesVisible && !isRestrictedTokenMember
return (
<header
@ -66,7 +64,7 @@ const ToolbarHeader = React.memo(function ToolbarHeader({
<div className="toolbar-right">
<OnlineUsersWidget onlineUsers={onlineUsers} goToUser={goToUser} />
{shouldDisplayTrackChangesButton && (
{trackChangesVisible && (
<TrackChangesToggleButton
onMouseDown={toggleReviewPanelOpen}
disabled={historyIsOpen}

View file

@ -51,15 +51,6 @@ describe('<ToolbarHeader />', function () {
screen.getByText('Review')
})
it('is not displayed when "isRestrictedTokenMember" prop is set to true', function () {
const props = {
...defaultProps,
isRestrictedTokenMember: true,
}
renderWithEditorContext(<ToolbarHeader {...props} />)
expect(screen.queryByText('Review')).to.not.exist
})
it('is not displayed when "trackChangesVisible" prop is set to false', function () {
const props = {
...defaultProps,