GH-4187 Turn off dot menu for system messages (#4198)
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
39eee5e4ec
Коммит
3a369c9de8
@@ -12,6 +12,7 @@ import TeamStore from 'stores/team_store.jsx';
|
|||||||
import UserStore from 'stores/user_store.jsx';
|
import UserStore from 'stores/user_store.jsx';
|
||||||
|
|
||||||
import * as Utils from 'utils/utils.jsx';
|
import * as Utils from 'utils/utils.jsx';
|
||||||
|
import * as PostUtils from 'utils/post_utils.jsx';
|
||||||
import Constants from 'utils/constants.jsx';
|
import Constants from 'utils/constants.jsx';
|
||||||
import {Tooltip, OverlayTrigger} from 'react-bootstrap';
|
import {Tooltip, OverlayTrigger} from 'react-bootstrap';
|
||||||
|
|
||||||
@@ -48,7 +49,7 @@ export default class PostInfo extends React.Component {
|
|||||||
var isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser();
|
var isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser();
|
||||||
const isSystemMessage = post.type && post.type.startsWith(Constants.SYSTEM_MESSAGE_PREFIX);
|
const isSystemMessage = post.type && post.type.startsWith(Constants.SYSTEM_MESSAGE_PREFIX);
|
||||||
|
|
||||||
if (post.state === Constants.POST_FAILED || post.state === Constants.POST_LOADING || Utils.isPostEphemeral(post)) {
|
if (post.state === Constants.POST_FAILED || post.state === Constants.POST_LOADING) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,7 +283,7 @@ export default class PostInfo extends React.Component {
|
|||||||
{this.createRemovePostButton()}
|
{this.createRemovePostButton()}
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
} else {
|
} else if (!PostUtils.isSystemMessage(post)) {
|
||||||
options = (
|
options = (
|
||||||
<li className='col col__reply'>
|
<li className='col col__reply'>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -100,13 +100,12 @@ export default class RhsComment extends React.Component {
|
|||||||
createDropdown() {
|
createDropdown() {
|
||||||
const post = this.props.post;
|
const post = this.props.post;
|
||||||
|
|
||||||
if (post.state === Constants.POST_FAILED || post.state === Constants.POST_LOADING || post.state === Constants.POST_DELETED) {
|
if (post.state === Constants.POST_FAILED || post.state === Constants.POST_LOADING) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
const isOwner = this.props.currentUser.id === post.user_id;
|
const isOwner = this.props.currentUser.id === post.user_id;
|
||||||
var isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser();
|
var isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser();
|
||||||
const isSystemMessage = post.type && post.type.startsWith(Constants.SYSTEM_MESSAGE_PREFIX);
|
|
||||||
|
|
||||||
var dropdownContents = [];
|
var dropdownContents = [];
|
||||||
|
|
||||||
@@ -165,7 +164,7 @@ export default class RhsComment extends React.Component {
|
|||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isOwner && !isSystemMessage) {
|
if (isOwner) {
|
||||||
dropdownContents.push(
|
dropdownContents.push(
|
||||||
<li
|
<li
|
||||||
role='presentation'
|
role='presentation'
|
||||||
@@ -294,8 +293,6 @@ export default class RhsComment extends React.Component {
|
|||||||
profilePicContainer = '';
|
profilePicContainer = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
var dropdown = this.createDropdown();
|
|
||||||
|
|
||||||
let fileAttachment = null;
|
let fileAttachment = null;
|
||||||
if (post.file_ids && post.file_ids.length > 0) {
|
if (post.file_ids && post.file_ids.length > 0) {
|
||||||
fileAttachment = (
|
fileAttachment = (
|
||||||
@@ -371,10 +368,10 @@ export default class RhsComment extends React.Component {
|
|||||||
{this.createRemovePostButton()}
|
{this.createRemovePostButton()}
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
} else {
|
} else if (!PostUtils.isSystemMessage(post)) {
|
||||||
options = (
|
options = (
|
||||||
<li className='col col__reply'>
|
<li className='col col__reply'>
|
||||||
{dropdown}
|
{this.createDropdown()}
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user