summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-09-06 16:41:10 -0400
committerenahum <nahumhbl@gmail.com>2016-09-06 17:41:10 -0300
commit12e48ca7b297f83ebbf65cb25a65b396b94f75d4 (patch)
tree44587532016dda857b678eccaecf884801217fd8
parent16a8d3d016d004df94c6905c3f8260b901c2264d (diff)
downloadchat-12e48ca7b297f83ebbf65cb25a65b396b94f75d4.tar.gz
chat-12e48ca7b297f83ebbf65cb25a65b396b94f75d4.tar.bz2
chat-12e48ca7b297f83ebbf65cb25a65b396b94f75d4.zip
Allowed post formatting to be disabled regardless of whether EnableDeveloper is set (#3975)
-rw-r--r--webapp/components/channel_header.jsx15
-rw-r--r--webapp/components/user_settings/user_settings_advanced.jsx4
2 files changed, 11 insertions, 8 deletions
diff --git a/webapp/components/channel_header.jsx b/webapp/components/channel_header.jsx
index 05a487756..add088913 100644
--- a/webapp/components/channel_header.jsx
+++ b/webapp/components/channel_header.jsx
@@ -29,8 +29,7 @@ import Client from 'client/web_client.jsx';
import * as AsyncClient from 'utils/async_client.jsx';
import {getFlaggedPosts} from 'actions/post_actions.jsx';
-import Constants from 'utils/constants.jsx';
-const ActionTypes = Constants.ActionTypes;
+import {ActionTypes, Constants, Preferences} from 'utils/constants.jsx';
import React from 'react';
import {FormattedMessage} from 'react-intl';
@@ -64,7 +63,8 @@ export default class ChannelHeader extends React.Component {
memberChannel: ChannelStore.getMember(this.props.channelId),
users: extraInfo.members,
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 (
<div
id='channel-header'
@@ -564,7 +571,7 @@ export default class ChannelHeader extends React.Component {
<div
onClick={Utils.handleFormattedTextClick}
className='description'
- dangerouslySetInnerHTML={{__html: TextFormatting.formatText(channel.header, {singleline: true, mentionHighlight: false, siteURL: Utils.getSiteURL()})}}
+ dangerouslySetInnerHTML={{__html: headerText}}
/>
</OverlayTrigger>
</div>
diff --git a/webapp/components/user_settings/user_settings_advanced.jsx b/webapp/components/user_settings/user_settings_advanced.jsx
index 157488559..88fd410c8 100644
--- a/webapp/components/user_settings/user_settings_advanced.jsx
+++ b/webapp/components/user_settings/user_settings_advanced.jsx
@@ -160,10 +160,6 @@ export default class AdvancedSettingsDisplay extends React.Component {
}
renderFormattingSection() {
- if (window.mm_config.EnableDeveloper === 'false') {
- return null;
- }
-
if (this.props.activeSection === 'formatting') {
return (
<SettingItemMax