Commit 5d409bcd authored by Paul Kaplan's avatar Paul Kaplan

Allow admins to toggle comments

parent a2e46ea6
......@@ -57,6 +57,7 @@ const PreviewPresentation = ({
canRestoreComments,
canSave,
canShare,
canToggleComments,
canUseBackpack,
cloudHost,
comments,
......@@ -489,7 +490,7 @@ const PreviewPresentation = ({
<div className="comments-container">
<FlexRow className="comments-header">
<h4><FormattedMessage id="project.comments.header" /></h4>
{userOwnsProject ? (
{canToggleComments ? (
<div>
<label>
<input
......@@ -593,6 +594,7 @@ PreviewPresentation.propTypes = {
canRestoreComments: PropTypes.bool,
canSave: PropTypes.bool,
canShare: PropTypes.bool,
canToggleComments: PropTypes.bool,
canUseBackpack: PropTypes.bool,
cloudHost: PropTypes.string,
comments: PropTypes.arrayOf(PropTypes.object),
......
......@@ -547,6 +547,7 @@ class Preview extends React.Component {
canRestoreComments={this.props.isAdmin}
canSave={this.props.canSave}
canShare={this.props.canShare || this.props.isAdmin}
canToggleComments={this.props.canToggleComments}
canUseBackpack={this.props.canUseBackpack}
cloudHost={this.props.cloudHost}
comments={this.props.comments}
......@@ -663,6 +664,7 @@ Preview.propTypes = {
canReport: PropTypes.bool,
canSave: PropTypes.bool,
canShare: PropTypes.bool,
canToggleComments: PropTypes.bool,
canUseBackpack: PropTypes.bool,
cloudHost: PropTypes.string,
comments: PropTypes.arrayOf(PropTypes.object),
......@@ -775,6 +777,7 @@ const mapStateToProps = state => {
canReport: isLoggedIn && !userOwnsProject,
canSave: isLoggedIn && userOwnsProject,
canShare: userOwnsProject && state.permissions.social,
canToggleComments: userOwnsProject || isAdmin,
canUseBackpack: isLoggedIn,
comments: state.preview.comments,
enableCommunity: projectInfoPresent,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment