diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/admin_console/user_item.jsx | 61 | ||||
-rw-r--r-- | web/react/components/team_members_dropdown.jsx | 1 | ||||
-rw-r--r-- | web/sass-files/sass/partials/_modal.scss | 10 |
3 files changed, 35 insertions, 37 deletions
diff --git a/web/react/components/admin_console/user_item.jsx b/web/react/components/admin_console/user_item.jsx index 009a9f004..4af350bcd 100644 --- a/web/react/components/admin_console/user_item.jsx +++ b/web/react/components/admin_console/user_item.jsx @@ -7,26 +7,7 @@ import UserStore from '../../stores/user_store.jsx'; import ConfirmModal from '../confirm_modal.jsx'; import TeamStore from '../../stores/team_store.jsx'; -import {injectIntl, intlShape, defineMessages, FormattedMessage} from 'mm-intl'; - -var holders = defineMessages({ - confirmDemoteRoleTitle: { - id: 'admin.user_item.confirmDemoteRoleTitle', - defaultMessage: 'Confirm demotion from System Admin role' - }, - confirmDemotion: { - id: 'admin.user_item.confirmDemotion', - defaultMessage: 'Confirm Demotion' - }, - 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"' - } -}); +import {FormattedMessage} from 'mm-intl'; export default class UserItem extends React.Component { constructor(props) { @@ -336,15 +317,44 @@ 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) { + const title = ( + <FormattedMessage + id='admin.user_item.confirmDemoteRoleTitle' + defaultMessage='Confirm demotion from System Admin role' + /> + ); + + const message = ( + <div> + <FormattedMessage + 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." + /> + <br/> + <br/> + <FormattedMessage + id='admin.user_item.confirmDemotionCmd' + defaultMessage='platform -assign_role -team_name="yourteam" -email="name@yourcompany.com" -role="system_admin"' + /> + {serverError} + </div> + ); + + const confirmButton = ( + <FormattedMessage + id='admin.user_item.confirmDemotion' + defaultMessage='Confirm Demotion' + /> + ); + makeDemoteModal = ( <ConfirmModal show={this.state.showDemoteModal} - title={formatMessage(holders.confirmDemoteRoleTitle)} - message={[formatMessage(holders.confirmDemoteDescription), React.createElement('br'), React.createElement('br'), formatMessage(holders.confirmDemotionCmd), serverError]} - confirm_button={formatMessage(holders.confirmDemotion)} + title={title} + message={message} + confirmButton={confirmButton} onConfirm={this.handleDemoteSubmit} onCancel={this.handleDemoteCancel} /> @@ -405,10 +415,7 @@ export default class UserItem extends React.Component { } UserItem.propTypes = { - intl: intlShape.isRequired, user: React.PropTypes.object.isRequired, refreshProfiles: React.PropTypes.func.isRequired, doPasswordReset: React.PropTypes.func.isRequired }; - -export default injectIntl(UserItem); diff --git a/web/react/components/team_members_dropdown.jsx b/web/react/components/team_members_dropdown.jsx index 7a298d26a..8aacba8ca 100644 --- a/web/react/components/team_members_dropdown.jsx +++ b/web/react/components/team_members_dropdown.jsx @@ -263,6 +263,7 @@ export default class TeamMembersDropdown extends React.Component { defaultMessage='Confirm demotion from System Admin role' /> ); + const message = ( <div> <FormattedMessage diff --git a/web/sass-files/sass/partials/_modal.scss b/web/sass-files/sass/partials/_modal.scss index fc4c13038..ca83c77da 100644 --- a/web/sass-files/sass/partials/_modal.scss +++ b/web/sass-files/sass/partials/_modal.scss @@ -53,16 +53,6 @@ &.padding--equal { padding: 8px; } - &.td--action { - text-align: right; - padding: 8px 15px 8px 8px; - width: 80px; - vertical-align: middle; - position: relative; - &.lg { - width: 110px; - } - } } } } |