From a6102e27d48d00fcc733c4d16754961903a239e0 Mon Sep 17 00:00:00 2001
From: Elias Nahum <nahumhbl@gmail.com>
Date: Sun, 31 Jan 2016 22:03:30 -0300
Subject: PLT-7: Refactoring frontend (chunk 8) - Sidebar and related
 components - Small Tweak to demotion and add msg for terminal cmd

---
 web/react/components/admin_console/user_item.jsx | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

(limited to 'web/react/components/admin_console/user_item.jsx')

diff --git a/web/react/components/admin_console/user_item.jsx b/web/react/components/admin_console/user_item.jsx
index 5ab429dd5..02b01b090 100644
--- a/web/react/components/admin_console/user_item.jsx
+++ b/web/react/components/admin_console/user_item.jsx
@@ -9,7 +9,7 @@ import TeamStore from '../../stores/team_store.jsx';
 
 import {injectIntl, intlShape, defineMessages, FormattedMessage} from 'mm-intl';
 
-var messages = defineMessages({
+var holders = defineMessages({
     confirmDemoteRoleTitle: {
         id: 'admin.user_item.confirmDemoteRoleTitle',
         defaultMessage: 'Confirm demotion from System Admin role'
@@ -21,6 +21,10 @@ var messages = defineMessages({
     confirmDemoteDescription: {
         id: 'admin.user_item.confirmDemoteDescription',
         defaultMessage: 'If you demote yourself from the System Admin role and there is not another user with System Admin privileges, you\'ll need to re-assign a System Admin by accessing the Mattermost server through a terminal and running the following command.'
+    },
+    confirmDemotionCmd: {
+        id: 'admin.user_item.confirmDemotionCmd',
+        defaultMessage: 'platform -assign_role -team_name="yourteam" -email="name@yourcompany.com" -role="system_admin"'
     }
 });
 
@@ -332,14 +336,15 @@ export default class UserItem extends React.Component {
             );
         }
         const me = UserStore.getCurrentUser();
+        const {formatMessage} = this.props.intl;
         let makeDemoteModal = null;
         if (this.props.user.id === me.id) {
             makeDemoteModal = (
                 <ConfirmModal
                     show={this.state.showDemoteModal}
-                    title={this.props.intl.formatMessage(messages.confirmDemoteRoleTitle)}
-                    message={[this.props.intl.formatMessage(messages.confirmDemoteDescription), React.createElement('br'), React.createElement('br'), './platform -assign_role -team_name="yourteam" -email="name@yourcompany.com" -role="system_admin"', serverError]}
-                    confirm_button={this.props.intl.formatMessage(messages.confirmDemotion)}
+                    title={formatMessage(holders.confirmDemoteRoleTitle)}
+                    message={[formatMessage(holders.confirmDemoteDescription), React.createElement('br'), React.createElement('br'), formatMessage(holders.confirmDemotionCmd), serverError]}
+                    confirm_button={formatMessage(holders.confirmDemotion)}
                     onConfirm={this.handleDemoteSubmit}
                     onCancel={this.handleDemoteCancel}
                 />
-- 
cgit v1.2.3-1-g7c22

