From 8406e854aa912f3d7f9179b10356444f07e25223 Mon Sep 17 00:00:00 2001
From: George Goldberg <george@gberg.me>
Date: Wed, 14 Dec 2016 11:11:51 +0000
Subject: PLT-4332 Position field for Users (#4632)

* Add User.Position field to store & model.

* GOFMT

* Add Position to user settings.

* Unit tests.

* Add position to profile popup.

* i18n

* Fix log message for invalid position.

* Add Position field attribute to LDAP config.

* Add Position field attribute to SAML config.

* Reword empty position message.

* Change Position Max Length to 35.

* Better invalid position error message.

* Add new fields to config.json.

* Ensure position is never longer than max when displayed.

* Hard limit of 64 chars with soft limit still 35

* Put field with other attributes.
---
 webapp/components/user_profile.jsx | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

(limited to 'webapp/components/user_profile.jsx')

diff --git a/webapp/components/user_profile.jsx b/webapp/components/user_profile.jsx
index 21dbf9699..9cf2464cd 100644
--- a/webapp/components/user_profile.jsx
+++ b/webapp/components/user_profile.jsx
@@ -182,6 +182,23 @@ export default class UserProfile extends React.Component {
 
         dataContent.push(webrtc);
 
+        const position = this.props.user.position.substring(0, Constants.MAX_POSITION_LENGTH);
+        if (position) {
+            dataContent.push(
+                <div
+                    data-toggle='tooltip'
+                    title={position}
+                    key='user-popover-position'
+                >
+                    <p
+                        className='text-nowrap'
+                    >
+                        {position}
+                    </p>
+                </div>
+            );
+        }
+
         if (global.window.mm_config.ShowEmailAddress === 'true' || UserStore.isSystemAdminForCurrentUser() || this.props.user === UserStore.getCurrentUser()) {
             dataContent.push(
                 <div
-- 
cgit v1.2.3-1-g7c22

