Merge pull request #1785 from mattermost/plt-1492

PLT-1492 Fix default for teammate name display setting
Этот коммит содержится в:
Corey Hulen
2016-01-04 08:34:23 -06:00
родитель 4a80238487 c81814ee1e
Коммит 8b9f9fb9c1

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

@@ -141,6 +141,9 @@ export default class UserSettingsDisplay extends React.Component {
); );
} }
const showUsername = 'Show username (team default)';
const showNickname = 'Show nickname if one exists, otherwise show first and last name';
const showFullName = 'Show first and last name';
if (this.props.activeSection === 'name_format') { if (this.props.activeSection === 'name_format') {
const nameFormat = [false, false, false]; const nameFormat = [false, false, false];
if (this.state.nameFormat === 'nickname_full_name') { if (this.state.nameFormat === 'nickname_full_name') {
@@ -157,10 +160,10 @@ export default class UserSettingsDisplay extends React.Component {
<label> <label>
<input <input
type='radio' type='radio'
checked={nameFormat[0]} checked={nameFormat[1]}
onChange={this.handleNameRadio.bind(this, 'nickname_full_name')} onChange={this.handleNameRadio.bind(this, 'username')}
/> />
{'Show nickname if one exists, otherwise show first and last name (team default)'} {showUsername}
</label> </label>
<br/> <br/>
</div> </div>
@@ -168,10 +171,10 @@ export default class UserSettingsDisplay extends React.Component {
<label> <label>
<input <input
type='radio' type='radio'
checked={nameFormat[1]} checked={nameFormat[0]}
onChange={this.handleNameRadio.bind(this, 'username')} onChange={this.handleNameRadio.bind(this, 'nickname_full_name')}
/> />
{'Show username'} {showNickname}
</label> </label>
<br/> <br/>
</div> </div>
@@ -182,11 +185,11 @@ export default class UserSettingsDisplay extends React.Component {
checked={nameFormat[2]} checked={nameFormat[2]}
onChange={this.handleNameRadio.bind(this, 'full_name')} onChange={this.handleNameRadio.bind(this, 'full_name')}
/> />
{'Show first and last name'} {showFullName}
</label> </label>
<br/> <br/>
</div> </div>
<div><br/>{'Set what name to display in the Direct Messages list.'}</div> <div><br/>{'Set how to display other user\'s names in posts and the Direct Messages list.'}</div>
</div> </div>
]; ];
@@ -205,11 +208,11 @@ export default class UserSettingsDisplay extends React.Component {
} else { } else {
let describe = ''; let describe = '';
if (this.state.nameFormat === 'username') { if (this.state.nameFormat === 'username') {
describe = 'Show username'; describe = showUsername;
} else if (this.state.nameFormat === 'full_name') { } else if (this.state.nameFormat === 'full_name') {
describe = 'Show first and last name'; describe = showFullName;
} else { } else {
describe = 'Show nickname if one exists, otherwise show first and last name (team default)'; describe = showNickname;
} }
nameFormatSection = ( nameFormatSection = (