PLT-2555/PLT-5009/PLT-5225 Changed system messages to be rendered by the client (#5209)
* Moved rendering of (message deleted) into PostMessageView * Added additional post types to constants on client * Changed system messages to be rendered in the client's language * Updated new system messages to have relevant usernames highlighted and have markdown rendered in header change messages
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
63d68b3e36
Коммит
39ee5737b7
@@ -6,7 +6,6 @@ import EventEmitter from 'events';
|
||||
import Constants from 'utils/constants.jsx';
|
||||
import UserStore from './user_store.jsx';
|
||||
import ChannelStore from './channel_store.jsx';
|
||||
import PreferenceStore from './preference_store.jsx';
|
||||
import * as UserAgent from 'utils/user_agent.jsx';
|
||||
import * as Utils from 'utils/utils.jsx';
|
||||
import * as PostUtils from 'utils/post_utils.jsx';
|
||||
@@ -35,8 +34,6 @@ class NotificationStoreClass extends EventEmitter {
|
||||
if ((UserStore.getCurrentId() !== post.user_id || post.props.from_webhook === 'true')) {
|
||||
if (PostUtils.isSystemMessage(post)) {
|
||||
return;
|
||||
} else if (!PreferenceStore.getBool(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, 'join_leave', true) && post.type === Constants.POST_TYPE_JOIN_LEAVE) {
|
||||
return;
|
||||
}
|
||||
|
||||
let mentions = [];
|
||||
|
||||
@@ -8,7 +8,7 @@ import ChannelStore from 'stores/channel_store.jsx';
|
||||
import BrowserStore from 'stores/browser_store.jsx';
|
||||
import UserStore from 'stores/user_store.jsx';
|
||||
|
||||
import Constants from 'utils/constants.jsx';
|
||||
import {Constants, PostTypes} from 'utils/constants.jsx';
|
||||
const ActionTypes = Constants.ActionTypes;
|
||||
|
||||
const CHANGE_EVENT = 'change';
|
||||
@@ -616,7 +616,9 @@ class PostStoreClass extends EventEmitter {
|
||||
|
||||
if (!joinLeave && postsList) {
|
||||
postsList.order = postsList.order.filter((id) => {
|
||||
if (postsList.posts[id].type === Constants.POST_TYPE_JOIN_LEAVE) {
|
||||
const post = postsList.posts[id];
|
||||
|
||||
if (post.type === PostTypes.JOIN_LEAVE || post.type === PostTypes.JOIN_CHANNEL || post.type === PostTypes.LEAVE_CHANNEL) {
|
||||
Reflect.deleteProperty(postsList.posts, id);
|
||||
|
||||
return false;
|
||||
|
||||
Ссылка в новой задаче
Block a user