mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Revert "PLT-135 Showing "(Edited)" indicator if a message has been edited." (#4854)
This commit is contained in:
committed by
GitHub
parent
8b26573494
commit
8c5744492f
@@ -89,7 +89,7 @@ export default class PostMessageContainer extends React.Component {
|
||||
return (
|
||||
<PostMessageView
|
||||
options={this.props.options}
|
||||
post={this.props.post}
|
||||
message={this.props.post.message}
|
||||
emojis={this.state.emojis}
|
||||
enableFormatting={this.state.enableFormatting}
|
||||
mentionKeys={this.state.mentionKeys}
|
||||
|
||||
@@ -2,16 +2,14 @@
|
||||
// See License.txt for license information.
|
||||
|
||||
import React from 'react';
|
||||
import {FormattedMessage} from 'react-intl';
|
||||
|
||||
import * as TextFormatting from 'utils/text_formatting.jsx';
|
||||
import * as Utils from 'utils/utils.jsx';
|
||||
import * as PostUtils from 'utils/post_utils.jsx';
|
||||
|
||||
export default class PostMessageView extends React.Component {
|
||||
static propTypes = {
|
||||
options: React.PropTypes.object.isRequired,
|
||||
post: React.PropTypes.object.isRequired,
|
||||
message: React.PropTypes.string.isRequired,
|
||||
emojis: React.PropTypes.object.isRequired,
|
||||
enableFormatting: React.PropTypes.bool.isRequired,
|
||||
mentionKeys: React.PropTypes.arrayOf(React.PropTypes.string).isRequired,
|
||||
@@ -25,7 +23,7 @@ export default class PostMessageView extends React.Component {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (nextProps.post.message !== this.props.post.message) {
|
||||
if (nextProps.message !== this.props.message) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -49,28 +47,9 @@ export default class PostMessageView extends React.Component {
|
||||
return false;
|
||||
}
|
||||
|
||||
editedIndicator() {
|
||||
return (
|
||||
PostUtils.isEdited(this.props.post) ?
|
||||
<span className='edited'>
|
||||
<FormattedMessage
|
||||
id='post_message_view.edited'
|
||||
defaultMessage='(edited)'
|
||||
/>
|
||||
</span> :
|
||||
''
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
if (!this.props.enableFormatting) {
|
||||
return (
|
||||
<span>
|
||||
{this.props.post.message}
|
||||
|
||||
{this.editedIndicator()}
|
||||
</span>
|
||||
);
|
||||
return <span>{this.props.message}</span>;
|
||||
}
|
||||
|
||||
const options = Object.assign({}, this.props.options, {
|
||||
@@ -83,13 +62,10 @@ export default class PostMessageView extends React.Component {
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<span
|
||||
onClick={Utils.handleFormattedTextClick}
|
||||
dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.props.post.message, options)}}
|
||||
/>
|
||||
{this.editedIndicator()}
|
||||
</div>
|
||||
<span
|
||||
onClick={Utils.handleFormattedTextClick}
|
||||
dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.props.message, options)}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1649,7 +1649,6 @@
|
||||
"post_info.mobile.unflag": "Unflag",
|
||||
"post_info.permalink": "Permalink",
|
||||
"post_info.reply": "Reply",
|
||||
"post_message_view.edited": "(edited)",
|
||||
"posts_view.loadMore": "Load more messages",
|
||||
"posts_view.newMsg": "New Messages",
|
||||
"posts_view.newMsgBelow": "{count} new {count, plural, one {message} other {messages}} below",
|
||||
|
||||
@@ -602,7 +602,7 @@
|
||||
}
|
||||
|
||||
p + p {
|
||||
margin: 1em 0;
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
ol,
|
||||
@@ -983,20 +983,11 @@
|
||||
word-wrap: break-word;
|
||||
|
||||
p {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
div {
|
||||
margin: 0 0 .4em;
|
||||
}
|
||||
|
||||
p + p {
|
||||
margin: 1.4em 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
p:last-of-type {
|
||||
display: inline;
|
||||
margin-top: 1.4em;
|
||||
}
|
||||
|
||||
li {
|
||||
@@ -1075,11 +1066,6 @@
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
span.edited {
|
||||
color: #A3A3A3;
|
||||
font-size: 0.87em;
|
||||
}
|
||||
}
|
||||
|
||||
.post__link {
|
||||
|
||||
@@ -15,10 +15,6 @@ export function isComment(post) {
|
||||
return false;
|
||||
}
|
||||
|
||||
export function isEdited(post) {
|
||||
return post.update_at && post.update_at > post.create_at;
|
||||
}
|
||||
|
||||
export function getProfilePicSrcForPost(post, timestamp) {
|
||||
let src = Client.getUsersRoute() + '/' + post.user_id + '/image?time=' + timestamp;
|
||||
if (post.props && post.props.from_webhook && global.window.mm_config.EnablePostIconOverride === 'true') {
|
||||
@@ -32,4 +28,4 @@ export function getProfilePicSrcForPost(post, timestamp) {
|
||||
}
|
||||
|
||||
return src;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user