From bedf85a122359a70cbb21be1219a5d566466273e Mon Sep 17 00:00:00 2001
From: =Corey Hulen <corey@hulen.com>
Date: Thu, 29 Oct 2015 08:54:27 -0700
Subject: Adding error when enabling team dir without global prop being set.

---
 web/react/components/team_general_tab.jsx | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

(limited to 'web/react/components/team_general_tab.jsx')

diff --git a/web/react/components/team_general_tab.jsx b/web/react/components/team_general_tab.jsx
index 591d031bf..69ba44664 100644
--- a/web/react/components/team_general_tab.jsx
+++ b/web/react/components/team_general_tab.jsx
@@ -53,7 +53,12 @@ export default class GeneralTab extends React.Component {
     }
 
     handleTeamListingRadio(listing) {
-        this.setState({allow_team_listing: listing});
+        if (global.window.mm_config.EnableTeamListing !== 'true' && listing) {
+            ReactDOM.findDOMNode(this.refs.teamListingRadioNo).checked = true;
+            this.setState({clientError: 'Team directory has been disabled.  Please ask a system admin to enable it.'});
+        } else {
+            this.setState({allow_team_listing: listing});
+        }
     }
 
     handleOpenInviteSubmit(e) {
@@ -263,6 +268,7 @@ export default class GeneralTab extends React.Component {
                     <div className='radio'>
                         <label>
                             <input
+                                ref='teamListingRadioNo'
                                 name='userTeamListingOptions'
                                 type='radio'
                                 defaultChecked={!this.state.allow_team_listing}
@@ -272,7 +278,7 @@ export default class GeneralTab extends React.Component {
                         </label>
                         <br/>
                     </div>
-                    <div><br/>{'When allowed then the team will appear on the main page as part of team directory if team browsing is enabled in the system console.'}</div>
+                    <div><br/>{'When allowed the team will appear on the main page as part of team directory.'}</div>
                 </div>
             ];
 
@@ -282,6 +288,7 @@ export default class GeneralTab extends React.Component {
                     inputs={inputs}
                     submit={this.handleTeamListingSubmit}
                     server_error={serverError}
+                    client_error={clientError}
                     updateSection={this.onUpdateTeamListingSection}
                 />
             );
-- 
cgit v1.2.3-1-g7c22

