diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2015-10-07 09:52:12 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2015-10-07 09:52:12 -0400 |
commit | 4d600babe8bfb35ab22fc16d64401003e3690187 (patch) | |
tree | 4b694d2a947a76fc6ef52943f52ad362a25089d7 | |
parent | 4263c08c55f7bc4b18cadeaed44f9ed8126ba70e (diff) | |
parent | 378d975eaa53d6c153c44471f03f9b49660cf0b0 (diff) | |
download | chat-4d600babe8bfb35ab22fc16d64401003e3690187.tar.gz chat-4d600babe8bfb35ab22fc16d64401003e3690187.tar.bz2 chat-4d600babe8bfb35ab22fc16d64401003e3690187.zip |
Merge pull request #950 from mattermost/PLT-519
PLT-519 toggle team creation link based on config setting
-rw-r--r-- | config/config.json | 2 | ||||
-rw-r--r-- | utils/config.go | 2 | ||||
-rw-r--r-- | web/react/components/navbar_dropdown.jsx | 39 |
3 files changed, 25 insertions, 18 deletions
diff --git a/config/config.json b/config/config.json index b14175372..88da33215 100644 --- a/config/config.json +++ b/config/config.json @@ -89,4 +89,4 @@ "TokenEndpoint": "", "UserApiEndpoint": "" } -} +}
\ No newline at end of file diff --git a/utils/config.go b/utils/config.go index 44c4c43af..90e44259a 100644 --- a/utils/config.go +++ b/utils/config.go @@ -179,6 +179,8 @@ func getClientProperties(c *model.Config) map[string]string { props["BuildHash"] = model.BuildHash props["SiteName"] = c.TeamSettings.SiteName + props["EnableTeamCreation"] = strconv.FormatBool(c.TeamSettings.EnableTeamCreation) + props["EnableOAuthServiceProvider"] = strconv.FormatBool(c.ServiceSettings.EnableOAuthServiceProvider) props["SegmentDeveloperKey"] = c.ServiceSettings.SegmentDeveloperKey diff --git a/web/react/components/navbar_dropdown.jsx b/web/react/components/navbar_dropdown.jsx index 78057d10b..30c4e94ae 100644 --- a/web/react/components/navbar_dropdown.jsx +++ b/web/react/components/navbar_dropdown.jsx @@ -135,30 +135,35 @@ export default class NavbarDropdown extends React.Component { var teams = []; - teams.push( - <li - className='divider' - key='div' - > - </li> - ); - if (this.state.teams.length > 1) { + teams.push( + <li + className='divider' + key='div' + > + </li> + ); + this.state.teams.forEach((teamName) => { if (teamName !== this.props.teamName) { teams.push(<li key={teamName}><a href={Utils.getWindowLocationOrigin() + '/' + teamName}>{'Switch to ' + teamName}</a></li>); } }); } - teams.push(<li key='newTeam_li'> - <a - key='newTeam_a' - target='_blank' - href={Utils.getWindowLocationOrigin() + '/signup_team'} - > - {'Create a New Team'} - </a> - </li>); + + if (global.window.config.EnableTeamCreation === 'true') { + teams.push( + <li key='newTeam_li'> + <a + key='newTeam_a' + target='_blank' + href={Utils.getWindowLocationOrigin() + '/signup_team'} + > + {'Create a New Team'} + </a> + </li> + ); + } return ( <ul className='nav navbar-nav navbar-right'> |