summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-02-02 16:34:18 -0800
committerCorey Hulen <corey@hulen.com>2016-02-02 16:34:18 -0800
commitddce9ae35c841a480defc47131653e8c42c9fb36 (patch)
tree2e3714bc02c4207980ac93f775778434ef68c015 /web
parentcdf4958b472ee17968ad52478ee950f2496d3bfa (diff)
parenteeb1c1b5b827cc20ae32449bfc8c227152ba1a9d (diff)
downloadchat-ddce9ae35c841a480defc47131653e8c42c9fb36.tar.gz
chat-ddce9ae35c841a480defc47131653e8c42c9fb36.tar.bz2
chat-ddce9ae35c841a480defc47131653e8c42c9fb36.zip
Merge pull request #2026 from rgarmsen2295/plt-1720
PLT-1720 Properly disable the get team link functionality when user creation is disabled
Diffstat (limited to 'web')
-rw-r--r--web/react/components/get_link_modal.jsx23
-rw-r--r--web/react/components/get_team_invite_link_modal.jsx12
-rw-r--r--web/static/i18n/en.json1
3 files changed, 28 insertions, 8 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
diff --git a/web/react/components/get_team_invite_link_modal.jsx b/web/react/components/get_team_invite_link_modal.jsx
index 883871267..299729250 100644
--- a/web/react/components/get_team_invite_link_modal.jsx
+++ b/web/react/components/get_team_invite_link_modal.jsx
@@ -16,6 +16,10 @@ const holders = defineMessages({
help: {
id: 'get_team_invite_link_modal.help',
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() {
const {formatMessage} = this.props.intl;
+ let helpText = formatMessage(holders.helpDisabled);
+
+ if (global.window.mm_config.EnableUserCreation === 'true') {
+ helpText = formatMessage(holders.help);
+ }
+
return (
<GetLinkModal
show={this.state.show}
onHide={() => this.setState({show: false})}
title={formatMessage(holders.title)}
- helpText={formatMessage(holders.help)}
+ helpText={helpText}
link={TeamStore.getCurrentInviteLink()}
/>
);
diff --git a/web/static/i18n/en.json b/web/static/i18n/en.json
index d6401ab6e..2412a1bae 100644
--- a/web/static/i18n/en.json
+++ b/web/static/i18n/en.json
@@ -526,6 +526,7 @@
"get_link.close": "Close",
"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.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.firstname": "First name",
"invite_member.lastname": "Last name",