Revert "[GH-5915] Clicking on @mention of a user in a post shows the profile popover (#6129)" (#6289)
This reverts commit 83f819451a.
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
935405f19d
Коммит
581bd8637f
@@ -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;
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
|
||||
Ссылка в новой задаче
Block a user