mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-03 15:42:54 +00:00
Allow read-only users to close the review panel (#18040)
GitOrigin-RevId: 93a470152da6dd215db07e3060621f32e5ae701d
This commit is contained in:
parent
92d6966f69
commit
cca569e22c
2 changed files with 1 additions and 12 deletions
|
@ -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}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue