summaryrefslogtreecommitdiffstats
path: root/webapp/components/post_view
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-05-01 17:40:54 -0400
committerJoram Wilander <jwawilander@gmail.com>2017-05-01 17:40:54 -0400
commit581bd8637fa860fa26f60d8089c5d6e3f613d23f (patch)
treeb0ba799af7f873b460e45f5e6057b357be0e8047 /webapp/components/post_view
parent935405f19d4a0d78f1a84964460635ec5a091e0c (diff)
downloadchat-581bd8637fa860fa26f60d8089c5d6e3f613d23f.tar.gz
chat-581bd8637fa860fa26f60d8089c5d6e3f613d23f.tar.bz2
chat-581bd8637fa860fa26f60d8089c5d6e3f613d23f.zip
Revert "[GH-5915] Clicking on @mention of a user in a post shows the profile popover (#6129)" (#6289)
This reverts commit 83f819451a80a767170b927eb2f0d5ed63f03239.
Diffstat (limited to 'webapp/components/post_view')
-rw-r--r--webapp/components/post_view/components/post.jsx2
-rw-r--r--webapp/components/post_view/components/post_header.jsx2
-rw-r--r--webapp/components/post_view/components/post_message_view.jsx40
3 files changed, 3 insertions, 41 deletions
diff --git a/webapp/components/post_view/components/post.jsx b/webapp/components/post_view/components/post.jsx
index cf25b28e4..f5c96d2bc 100644
--- a/webapp/components/post_view/components/post.jsx
+++ b/webapp/components/post_view/components/post.jsx
@@ -3,7 +3,7 @@
import PostHeader from './post_header.jsx';
import PostBody from './post_body.jsx';
-import ProfilePicture from 'components/profile_popover/picture_profile_popover.jsx';
+import ProfilePicture from 'components/profile_picture.jsx';
import Constants from 'utils/constants.jsx';
const ActionTypes = Constants.ActionTypes;
diff --git a/webapp/components/post_view/components/post_header.jsx b/webapp/components/post_view/components/post_header.jsx
index e19285963..9de0b7e79 100644
--- a/webapp/components/post_view/components/post_header.jsx
+++ b/webapp/components/post_view/components/post_header.jsx
@@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
-import UserProfile from 'components/profile_popover/username_profile_popover.jsx';
+import UserProfile from 'components/user_profile.jsx';
import PostInfo from './post_info.jsx';
import {FormattedMessage} from 'react-intl';
diff --git a/webapp/components/post_view/components/post_message_view.jsx b/webapp/components/post_view/components/post_message_view.jsx
index db522c974..5b0790f36 100644
--- a/webapp/components/post_view/components/post_message_view.jsx
+++ b/webapp/components/post_view/components/post_message_view.jsx
@@ -3,9 +3,6 @@
import React from 'react';
import {FormattedMessage} from 'react-intl';
-import {Parser, ProcessNodeDefinitions} from 'html-to-react';
-
-import AtMentionProfile from 'components/profile_popover/atmention_profile_popover.jsx';
import Constants from 'utils/constants.jsx';
import * as PostUtils from 'utils/post_utils.jsx';
@@ -91,38 +88,6 @@ export default class PostMessageView extends React.Component {
);
}
- postMessageHtmlToComponent(html) {
- const parser = new Parser();
- const attrib = 'data-mention';
- const processNodeDefinitions = new ProcessNodeDefinitions(React);
-
- function isValidNode() {
- return true;
- }
-
- const processingInstructions = [
- {
- replaceChildren: true,
- shouldProcessNode: (node) => node.attribs && node.attribs[attrib] && this.props.usernameMap.hasOwnProperty(node.attribs[attrib]),
- processNode: (node) => {
- const username = node.attribs[attrib];
- return (
- <AtMentionProfile
- user={this.props.usernameMap[username]}
- username={username}
- />
- );
- }
- },
- {
- shouldProcessNode: () => true,
- processNode: processNodeDefinitions.processDefaultNode
- }
- ];
-
- return parser.parseWithInstructions(html, isValidNode, processingInstructions);
- }
-
render() {
if (this.props.post.state === Constants.POST_DELETED) {
return this.renderDeletedPost();
@@ -146,17 +111,14 @@ export default class PostMessageView extends React.Component {
return <div>{renderedSystemMessage}</div>;
}
- const htmlFormattedText = TextFormatting.formatText(this.props.post.message, options);
- const postMessageComponent = this.postMessageHtmlToComponent(htmlFormattedText);
-
return (
<div>
<span
id={this.props.isLastPost ? 'lastPostMessageText' : null}
className='post-message__text'
onClick={Utils.handleFormattedTextClick}
+ dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.props.post.message, options)}}
/>
- {postMessageComponent}
{this.renderEditedIndicator()}
</div>
);