mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Fixed warnings and removed injectIntl from System Console user list
This commit is contained in:
committed by
Harrison Healey
parent
62c0920943
commit
48eac58eaa
@@ -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);
|
||||
|
||||
@@ -263,6 +263,7 @@ export default class TeamMembersDropdown extends React.Component {
|
||||
defaultMessage='Confirm demotion from System Admin role'
|
||||
/>
|
||||
);
|
||||
|
||||
const message = (
|
||||
<div>
|
||||
<FormattedMessage
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user