Allowed post formatting to be disabled regardless of whether EnableDeveloper is set (#3975)
Этот коммит содержится в:
коммит произвёл
enahum
родитель
16a8d3d016
Коммит
12e48ca7b2
@@ -29,8 +29,7 @@ import Client from 'client/web_client.jsx';
|
|||||||
import * as AsyncClient from 'utils/async_client.jsx';
|
import * as AsyncClient from 'utils/async_client.jsx';
|
||||||
import {getFlaggedPosts} from 'actions/post_actions.jsx';
|
import {getFlaggedPosts} from 'actions/post_actions.jsx';
|
||||||
|
|
||||||
import Constants from 'utils/constants.jsx';
|
import {ActionTypes, Constants, Preferences} from 'utils/constants.jsx';
|
||||||
const ActionTypes = Constants.ActionTypes;
|
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {FormattedMessage} from 'react-intl';
|
import {FormattedMessage} from 'react-intl';
|
||||||
@@ -64,7 +63,8 @@ export default class ChannelHeader extends React.Component {
|
|||||||
memberChannel: ChannelStore.getMember(this.props.channelId),
|
memberChannel: ChannelStore.getMember(this.props.channelId),
|
||||||
users: extraInfo.members,
|
users: extraInfo.members,
|
||||||
userCount: extraInfo.member_count,
|
userCount: extraInfo.member_count,
|
||||||
currentUser: UserStore.getCurrentUser()
|
currentUser: UserStore.getCurrentUser(),
|
||||||
|
enableFormatting: PreferenceStore.getBool(Preferences.CATEGORY_ADVANCED_SETTINGS, 'formatting', true)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -524,6 +524,13 @@ export default class ChannelHeader extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let headerText;
|
||||||
|
if (this.state.enableFormatting) {
|
||||||
|
headerText = TextFormatting.formatText(channel.header, {singleline: true, mentionHighlight: false, siteURL: Utils.getSiteURL()});
|
||||||
|
} else {
|
||||||
|
headerText = channel.header;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
id='channel-header'
|
id='channel-header'
|
||||||
@@ -564,7 +571,7 @@ export default class ChannelHeader extends React.Component {
|
|||||||
<div
|
<div
|
||||||
onClick={Utils.handleFormattedTextClick}
|
onClick={Utils.handleFormattedTextClick}
|
||||||
className='description'
|
className='description'
|
||||||
dangerouslySetInnerHTML={{__html: TextFormatting.formatText(channel.header, {singleline: true, mentionHighlight: false, siteURL: Utils.getSiteURL()})}}
|
dangerouslySetInnerHTML={{__html: headerText}}
|
||||||
/>
|
/>
|
||||||
</OverlayTrigger>
|
</OverlayTrigger>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -160,10 +160,6 @@ export default class AdvancedSettingsDisplay extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderFormattingSection() {
|
renderFormattingSection() {
|
||||||
if (window.mm_config.EnableDeveloper === 'false') {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.props.activeSection === 'formatting') {
|
if (this.props.activeSection === 'formatting') {
|
||||||
return (
|
return (
|
||||||
<SettingItemMax
|
<SettingItemMax
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user