summaryrefslogtreecommitdiffstats
path: root/web/react/components/get_link_modal.jsx
diff options
context:
space:
mode:
authorReed Garmsen <rgarmsen2295@gmail.com>2016-01-29 13:29:43 -0800
committerReed Garmsen <rgarmsen2295@gmail.com>2016-02-02 12:09:44 -0800
commiteeb1c1b5b827cc20ae32449bfc8c227152ba1a9d (patch)
tree8d1ed5957ea85bb5d62fea0ed36331ccb50b87db /web/react/components/get_link_modal.jsx
parent320fe1c39240644ce15fa2a436ac4a5591b95083 (diff)
downloadchat-eeb1c1b5b827cc20ae32449bfc8c227152ba1a9d.tar.gz
chat-eeb1c1b5b827cc20ae32449bfc8c227152ba1a9d.tar.bz2
chat-eeb1c1b5b827cc20ae32449bfc8c227152ba1a9d.zip
Properly disable the get team link functionality when user creation is disabled
Diffstat (limited to 'web/react/components/get_link_modal.jsx')
-rw-r--r--web/react/components/get_link_modal.jsx23
1 files changed, 16 insertions, 7 deletions
diff --git a/web/react/components/get_link_modal.jsx b/web/react/components/get_link_modal.jsx
index 3fc71ff96..de3387a35 100644
--- a/web/react/components/get_link_modal.jsx
+++ b/web/react/components/get_link_modal.jsx
@@ -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