Disabling ability to enable team listing on a system where EnableTeamListing=false

Этот коммит содержится в:
Reed Garmsen
2015-12-10 11:18:24 -08:00
родитель aef1686606
Коммит 612a9b4fd6

Просмотреть файл

@@ -248,44 +248,59 @@ export default class GeneralTab extends React.Component {
serverError = this.state.serverError; serverError = this.state.serverError;
} }
const enableTeamListing = global.window.mm_config.EnableTeamListing === 'true';
let teamListingSection; let teamListingSection;
if (this.props.activeSection === 'team_listing') { if (this.props.activeSection === 'team_listing') {
const inputs = [ const inputs = [];
<div key='userTeamListingOptions'> let submitHandle = null;
<div className='radio'>
<label> if (enableTeamListing) {
<input submitHandle = this.handleTeamListingSubmit;
name='userTeamListingOptions'
type='radio' inputs.push(
defaultChecked={this.state.allow_team_listing} <div key='userTeamListingOptions'>
onChange={this.handleTeamListingRadio.bind(this, true)} <div className='radio'>
/> <label>
{'Yes'} <input
</label> name='userTeamListingOptions'
<br/> type='radio'
defaultChecked={this.state.allow_team_listing}
onChange={this.handleTeamListingRadio.bind(this, true)}
/>
{'Yes'}
</label>
<br/>
</div>
<div className='radio'>
<label>
<input
ref='teamListingRadioNo'
name='userTeamListingOptions'
type='radio'
defaultChecked={!this.state.allow_team_listing}
onChange={this.handleTeamListingRadio.bind(this, false)}
/>
{'No'}
</label>
<br/>
</div>
<div><br/>{'Including this team will display the team name from the Team Directory section of the Home Page, and provide a link to the sign-in page.'}</div>
</div> </div>
<div className='radio'> );
<label> } else {
<input inputs.push(
ref='teamListingRadioNo' <div key='userTeamListingOptions'>
name='userTeamListingOptions' <div><br/>{'Contact your system administrator to turn on the team directory on the system home page.'}</div>
type='radio'
defaultChecked={!this.state.allow_team_listing}
onChange={this.handleTeamListingRadio.bind(this, false)}
/>
{'No'}
</label>
<br/>
</div> </div>
<div><br/>{'Including this team will display the team name from the Team Directory section of the Home Page, and provide a link to the sign-in page.'}</div> );
</div> }
];
teamListingSection = ( teamListingSection = (
<SettingItemMax <SettingItemMax
title='Include this team in the Team Directory' title='Include this team in the Team Directory'
inputs={inputs} inputs={inputs}
submit={this.handleTeamListingSubmit} submit={submitHandle}
server_error={serverError} server_error={serverError}
client_error={clientError} client_error={clientError}
updateSection={this.onUpdateTeamListingSection} updateSection={this.onUpdateTeamListingSection}
@@ -293,10 +308,15 @@ export default class GeneralTab extends React.Component {
); );
} else { } else {
let describe = ''; let describe = '';
if (this.state.allow_team_listing === true) {
describe = 'Yes'; if (enableTeamListing) {
if (this.state.allow_team_listing === true) {
describe = 'Yes';
} else {
describe = 'No';
}
} else { } else {
describe = 'No'; describe = 'Team directory is turned off for this system.';
} }
teamListingSection = ( teamListingSection = (