[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 удалений

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

@@ -1015,21 +1015,19 @@ export function displayUsername(userId) {
}
export function displayUsernameForUser(user) {
const nameFormat = PreferenceStore.get(Constants.Preferences.CATEGORY_DISPLAY_SETTINGS, 'name_format', 'false');
let username = '';
if (user) {
if (nameFormat === Constants.Preferences.DISPLAY_PREFER_NICKNAME) {
username = user.nickname || getFullName(user);
} else if (nameFormat === Constants.Preferences.DISPLAY_PREFER_FULL_NAME) {
username = getFullName(user);
}
if (!username.trim().length) {
username = user.username;
const nameFormat = global.window.mm_config.TeammateNameDisplay;
let name = user.username;
if (nameFormat === Constants.TEAMMATE_NAME_DISPLAY.SHOW_NICKNAME_FULLNAME && user.nickname && user.nickname !== '') {
name = user.nickname;
} else if ((user.first_name || user.last_name) && (nameFormat === Constants.TEAMMATE_NAME_DISPLAY.SHOW_NICKNAME_FULLNAME || nameFormat === Constants.TEAMMATE_NAME_DISPLAY.SHOW_FULLNAME)) {
name = getFullName(user);
}
return name;
}
return username;
return null;
}
// Converts a file size in bytes into a human-readable string of the form '123MB'.