summaryrefslogtreecommitdiffstats
path: root/webapp/components/user_list_row.jsx
diff options
context:
space:
mode:
authorSaturnino Abril <saturnino.abril@gmail.com>2017-06-30 16:06:59 +0800
committerGeorge Goldberg <george@gberg.me>2017-06-30 09:06:59 +0100
commiteea64f8049d90c5dcf14a739d640f5aa6a9c7add (patch)
treefabaa232bad7f4ebddf30b073c37a5962029f7fd /webapp/components/user_list_row.jsx
parentfb57b3dd53eaca28a557ea7e334e9d7216ce6aab (diff)
downloadchat-eea64f8049d90c5dcf14a739d640f5aa6a9c7add.tar.gz
chat-eea64f8049d90c5dcf14a739d640f5aa6a9c7add.tar.bz2
chat-eea64f8049d90c5dcf14a739d640f5aa6a9c7add.zip
[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
Diffstat (limited to 'webapp/components/user_list_row.jsx')
-rw-r--r--webapp/components/user_list_row.jsx13
1 files changed, 4 insertions, 9 deletions
diff --git a/webapp/components/user_list_row.jsx b/webapp/components/user_list_row.jsx
index ac26aace7..c8a4ac7ba 100644
--- a/webapp/components/user_list_row.jsx
+++ b/webapp/components/user_list_row.jsx
@@ -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;