Fixed warnings and removed injectIntl from System Console user list
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
62c0920943
Коммит
48eac58eaa
@@ -7,26 +7,7 @@ import UserStore from '../../stores/user_store.jsx';
|
|||||||
import ConfirmModal from '../confirm_modal.jsx';
|
import ConfirmModal from '../confirm_modal.jsx';
|
||||||
import TeamStore from '../../stores/team_store.jsx';
|
import TeamStore from '../../stores/team_store.jsx';
|
||||||
|
|
||||||
import {injectIntl, intlShape, defineMessages, FormattedMessage} from 'mm-intl';
|
import {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"'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default class UserItem extends React.Component {
|
export default class UserItem extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -336,15 +317,44 @@ export default class UserItem extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
const me = UserStore.getCurrentUser();
|
const me = UserStore.getCurrentUser();
|
||||||
const {formatMessage} = this.props.intl;
|
|
||||||
let makeDemoteModal = null;
|
let makeDemoteModal = null;
|
||||||
if (this.props.user.id === me.id) {
|
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 = (
|
makeDemoteModal = (
|
||||||
<ConfirmModal
|
<ConfirmModal
|
||||||
show={this.state.showDemoteModal}
|
show={this.state.showDemoteModal}
|
||||||
title={formatMessage(holders.confirmDemoteRoleTitle)}
|
title={title}
|
||||||
message={[formatMessage(holders.confirmDemoteDescription), React.createElement('br'), React.createElement('br'), formatMessage(holders.confirmDemotionCmd), serverError]}
|
message={message}
|
||||||
confirm_button={formatMessage(holders.confirmDemotion)}
|
confirmButton={confirmButton}
|
||||||
onConfirm={this.handleDemoteSubmit}
|
onConfirm={this.handleDemoteSubmit}
|
||||||
onCancel={this.handleDemoteCancel}
|
onCancel={this.handleDemoteCancel}
|
||||||
/>
|
/>
|
||||||
@@ -405,10 +415,7 @@ export default class UserItem extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
UserItem.propTypes = {
|
UserItem.propTypes = {
|
||||||
intl: intlShape.isRequired,
|
|
||||||
user: React.PropTypes.object.isRequired,
|
user: React.PropTypes.object.isRequired,
|
||||||
refreshProfiles: React.PropTypes.func.isRequired,
|
refreshProfiles: React.PropTypes.func.isRequired,
|
||||||
doPasswordReset: 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'
|
defaultMessage='Confirm demotion from System Admin role'
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
const message = (
|
const message = (
|
||||||
<div>
|
<div>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
|
|||||||
@@ -53,16 +53,6 @@
|
|||||||
&.padding--equal {
|
&.padding--equal {
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
}
|
}
|
||||||
&.td--action {
|
|
||||||
text-align: right;
|
|
||||||
padding: 8px 15px 8px 8px;
|
|
||||||
width: 80px;
|
|
||||||
vertical-align: middle;
|
|
||||||
position: relative;
|
|
||||||
&.lg {
|
|
||||||
width: 110px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user