From c90e224349eb6105ef1d3ecf20c519238ba5e018 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Fri, 5 Feb 2016 11:29:03 -0500 Subject: Remove appearance settings tab and move theme management to display settings tab --- .../components/user_settings/user_settings_modal.jsx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'web/react/components/user_settings/user_settings_modal.jsx') diff --git a/web/react/components/user_settings/user_settings_modal.jsx b/web/react/components/user_settings/user_settings_modal.jsx index 2a0a90cf5..57796d559 100644 --- a/web/react/components/user_settings/user_settings_modal.jsx +++ b/web/react/components/user_settings/user_settings_modal.jsx @@ -2,9 +2,13 @@ // See License.txt for license information. import ConfirmModal from '../confirm_modal.jsx'; -const Modal = ReactBootstrap.Modal; -import SettingsSidebar from '../settings_sidebar.jsx'; import UserSettings from './user_settings.jsx'; +import SettingsSidebar from '../settings_sidebar.jsx'; + +import UserStore from '../../stores/user_store.jsx'; +import * as Utils from '../../utils/utils.jsx'; + +const Modal = ReactBootstrap.Modal; import {intlShape, injectIntl, defineMessages, FormattedMessage} from 'mm-intl'; @@ -21,10 +25,6 @@ const holders = defineMessages({ id: 'user.settings.modal.notifications', defaultMessage: 'Notifications' }, - appearance: { - id: 'user.settings.modal.appearance', - defaultMessage: 'Appearance' - }, developer: { id: 'user.settings.modal.developer', defaultMessage: 'Developer' @@ -214,6 +214,10 @@ class UserSettingsModal extends React.Component { if (!skipConfirm && this.requireConfirm) { this.showConfirmModal(() => this.updateSection(section, true)); } else { + if (this.state.active_section === 'theme' && section !== 'theme') { + const user = UserStore.getCurrentUser(); + Utils.applyTheme(user.theme_props); + } this.setState({active_section: section}); } } @@ -224,7 +228,6 @@ class UserSettingsModal extends React.Component { tabs.push({name: 'general', uiName: formatMessage(holders.general), icon: 'glyphicon glyphicon-cog'}); tabs.push({name: 'security', uiName: formatMessage(holders.security), icon: 'glyphicon glyphicon-lock'}); tabs.push({name: 'notifications', uiName: formatMessage(holders.notifications), icon: 'glyphicon glyphicon-exclamation-sign'}); - tabs.push({name: 'appearance', uiName: formatMessage(holders.appearance), icon: 'glyphicon glyphicon-wrench'}); if (global.window.mm_config.EnableOAuthServiceProvider === 'true') { tabs.push({name: 'developer', uiName: formatMessage(holders.developer), icon: 'glyphicon glyphicon-th'}); } @@ -294,4 +297,4 @@ UserSettingsModal.propTypes = { onModalDismissed: React.PropTypes.func.isRequired }; -export default injectIntl(UserSettingsModal); \ No newline at end of file +export default injectIntl(UserSettingsModal); -- cgit v1.2.3-1-g7c22 From 39b35b7b394cdc2391beaff8b96cd733400ebcb8 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Mon, 8 Feb 2016 07:28:04 -0500 Subject: Fix cancel bug --- web/react/components/user_settings/user_settings_modal.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'web/react/components/user_settings/user_settings_modal.jsx') diff --git a/web/react/components/user_settings/user_settings_modal.jsx b/web/react/components/user_settings/user_settings_modal.jsx index 57796d559..e0b72157b 100644 --- a/web/react/components/user_settings/user_settings_modal.jsx +++ b/web/react/components/user_settings/user_settings_modal.jsx @@ -216,7 +216,9 @@ class UserSettingsModal extends React.Component { } else { if (this.state.active_section === 'theme' && section !== 'theme') { const user = UserStore.getCurrentUser(); - Utils.applyTheme(user.theme_props); + if (user.theme_props != null) { + Utils.applyTheme(user.theme_props); + } } this.setState({active_section: section}); } -- cgit v1.2.3-1-g7c22