[PLT-5864] Move teammate name display setting to the System Console (#6681)

* move teammate name display setting to the system console

* update all the likes of TeammateNameDisplay names

* fix gofmt error

* rebase and fix conflict
Этот коммит содержится в:
Saturnino Abril
2017-06-30 16:06:59 +08:00
коммит произвёл George Goldberg
родитель fb57b3dd53
Коммит eea64f8049
17 изменённых файлов: 102 добавлений и 227 удалений

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

@@ -4,9 +4,7 @@
import ProfilePicture from 'components/profile_picture.jsx';
import UserStore from 'stores/user_store.jsx';
import PreferenceStore from 'stores/preference_store.jsx';
import Constants from 'utils/constants.jsx';
import * as Utils from 'utils/utils.jsx';
import {Client4} from 'mattermost-redux/client';
@@ -16,13 +14,10 @@ import React from 'react';
import {FormattedHTMLMessage} from 'react-intl';
export default function UserListRow({user, extraInfo, actions, actionProps, actionUserProps, userCount}) {
const nameFormat = PreferenceStore.get(Constants.Preferences.CATEGORY_DISPLAY_SETTINGS, 'name_format', '');
let name = user.username;
if (user.nickname && nameFormat === Constants.Preferences.DISPLAY_PREFER_NICKNAME) {
name = `${user.nickname} (@${user.username})`;
} else if ((user.first_name || user.last_name) && (nameFormat === Constants.Preferences.DISPLAY_PREFER_NICKNAME || nameFormat === Constants.Preferences.DISPLAY_PREFER_FULL_NAME)) {
name = `${Utils.getFullName(user)} (@${user.username})`;
const displayName = Utils.displayUsernameForUser(user);
let name = `${displayName} (@${user.username})`;
if (displayName === user.username) {
name = user.username;
}
let buttons = null;