Properly disable the get team link functionality when user creation is disabled
Этот коммит содержится в:
@@ -41,6 +41,8 @@ export default class GetLinkModal extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
const userCreationEnabled = global.window.mm_config.EnableUserCreation === 'true';
|
||||||
|
|
||||||
let helpText = null;
|
let helpText = null;
|
||||||
if (this.props.helpText) {
|
if (this.props.helpText) {
|
||||||
helpText = (
|
helpText = (
|
||||||
@@ -53,7 +55,7 @@ export default class GetLinkModal extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let copyLink = null;
|
let copyLink = null;
|
||||||
if (document.queryCommandSupported('copy')) {
|
if (userCreationEnabled && document.queryCommandSupported('copy')) {
|
||||||
copyLink = (
|
copyLink = (
|
||||||
<button
|
<button
|
||||||
data-copy-btn='true'
|
data-copy-btn='true'
|
||||||
@@ -69,6 +71,18 @@ export default class GetLinkModal extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let linkText = null;
|
||||||
|
if (userCreationEnabled) {
|
||||||
|
linkText = (
|
||||||
|
<textarea
|
||||||
|
className='form-control no-resize min-height'
|
||||||
|
readOnly='true'
|
||||||
|
ref='textarea'
|
||||||
|
value={this.props.link}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
var copyLinkConfirm = null;
|
var copyLinkConfirm = null;
|
||||||
if (this.state.copiedLink) {
|
if (this.state.copiedLink) {
|
||||||
copyLinkConfirm = (
|
copyLinkConfirm = (
|
||||||
@@ -92,12 +106,7 @@ export default class GetLinkModal extends React.Component {
|
|||||||
</Modal.Header>
|
</Modal.Header>
|
||||||
<Modal.Body>
|
<Modal.Body>
|
||||||
{helpText}
|
{helpText}
|
||||||
<textarea
|
{linkText}
|
||||||
className='form-control no-resize min-height'
|
|
||||||
readOnly='true'
|
|
||||||
ref='textarea'
|
|
||||||
value={this.props.link}
|
|
||||||
/>
|
|
||||||
</Modal.Body>
|
</Modal.Body>
|
||||||
<Modal.Footer>
|
<Modal.Footer>
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ const holders = defineMessages({
|
|||||||
help: {
|
help: {
|
||||||
id: 'get_team_invite_link_modal.help',
|
id: 'get_team_invite_link_modal.help',
|
||||||
defaultMessage: 'Send teammates the link below for them to sign-up to this team site.'
|
defaultMessage: 'Send teammates the link below for them to sign-up to this team site.'
|
||||||
|
},
|
||||||
|
helpDisabled: {
|
||||||
|
id: 'get_team_invite_link_modal.helpDisabled',
|
||||||
|
defaultMessage: 'User creation has been disabled for your team. Please ask your team administrator for details.'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -47,12 +51,18 @@ class GetTeamInviteLinkModal extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
const {formatMessage} = this.props.intl;
|
const {formatMessage} = this.props.intl;
|
||||||
|
|
||||||
|
let helpText = formatMessage(holders.helpDisabled);
|
||||||
|
|
||||||
|
if (global.window.mm_config.EnableUserCreation === 'true') {
|
||||||
|
helpText = formatMessage(holders.help);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<GetLinkModal
|
<GetLinkModal
|
||||||
show={this.state.show}
|
show={this.state.show}
|
||||||
onHide={() => this.setState({show: false})}
|
onHide={() => this.setState({show: false})}
|
||||||
title={formatMessage(holders.title)}
|
title={formatMessage(holders.title)}
|
||||||
helpText={formatMessage(holders.help)}
|
helpText={helpText}
|
||||||
link={TeamStore.getCurrentInviteLink()}
|
link={TeamStore.getCurrentInviteLink()}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -526,6 +526,7 @@
|
|||||||
"get_link.close": "Close",
|
"get_link.close": "Close",
|
||||||
"get_team_invite_link_modal.title": "Team Invite Link",
|
"get_team_invite_link_modal.title": "Team Invite Link",
|
||||||
"get_team_invite_link_modal.help": "Send teammates the link below for them to sign-up to this team site.",
|
"get_team_invite_link_modal.help": "Send teammates the link below for them to sign-up to this team site.",
|
||||||
|
"get_team_invite_link_modal.helpDisabled": "User creation has been disabled for your team. Please ask your team administrator for details.",
|
||||||
"invite_member.emailError": "Please enter a valid email address",
|
"invite_member.emailError": "Please enter a valid email address",
|
||||||
"invite_member.firstname": "First name",
|
"invite_member.firstname": "First name",
|
||||||
"invite_member.lastname": "Last name",
|
"invite_member.lastname": "Last name",
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user