Properly disable the get team link functionality when user creation is disabled
Этот коммит содержится в:
@@ -41,6 +41,8 @@ export default class GetLinkModal extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const userCreationEnabled = global.window.mm_config.EnableUserCreation === 'true';
|
||||
|
||||
let helpText = null;
|
||||
if (this.props.helpText) {
|
||||
helpText = (
|
||||
@@ -53,7 +55,7 @@ export default class GetLinkModal extends React.Component {
|
||||
}
|
||||
|
||||
let copyLink = null;
|
||||
if (document.queryCommandSupported('copy')) {
|
||||
if (userCreationEnabled && document.queryCommandSupported('copy')) {
|
||||
copyLink = (
|
||||
<button
|
||||
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;
|
||||
if (this.state.copiedLink) {
|
||||
copyLinkConfirm = (
|
||||
@@ -92,12 +106,7 @@ export default class GetLinkModal extends React.Component {
|
||||
</Modal.Header>
|
||||
<Modal.Body>
|
||||
{helpText}
|
||||
<textarea
|
||||
className='form-control no-resize min-height'
|
||||
readOnly='true'
|
||||
ref='textarea'
|
||||
value={this.props.link}
|
||||
/>
|
||||
{linkText}
|
||||
</Modal.Body>
|
||||
<Modal.Footer>
|
||||
<button
|
||||
|
||||
Ссылка в новой задаче
Block a user