-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PLT-4332 Position field for Users #4632
Conversation
@@ -3760,6 +3760,10 @@ | |||
"translation": "Invalid nickname" | |||
}, | |||
{ | |||
"id": "model.user.is_valid.position.app_error", | |||
"translation": "Invalid position" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should be more specific on why this field is invalid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does "Invalid Position: maximum length is 128 characters." sound?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
if (this.props.activeSection === 'position') { | ||
let extraInfo; | ||
let submit = null; | ||
if ((this.props.user.auth_service === 'ldap' || this.props.user.auth_service === Constants.SAML_SERVICE) && global.window.mm_config.PositionAttributeSet === 'true') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is the case, we should add this to SAML and LDAP, if not we should remove this and add it later in case it applies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to raise this question on pre-release as I'm not sure of the answer myself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, what is the question here? @grundleborg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yangchen1 sorry, there isn't actually a question there! It was "Should the position field be populated automatically from external auth providers, like other fields are?". I think we've come to the conclusion that the answer is yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah OK, great! :) That sounds right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
describe = ( | ||
<FormattedMessage | ||
id='user.settings.general.emptyPosition' | ||
defaultMessage="Click 'Edit' to add your position" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this string says much, is it related to your job position? maybe discuss this with a PM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deferring to a PM on this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@grundleborg If it isn't clear, let's say Click 'Edit' to add your job title / position.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Changing this to be reviewed by a PM first cause this qualifies as a new feature |
Overall looks good! Thanks @grundleborg I forgot to include the character limit in the spec, which should be no more than 35 characters including spaces. Otherwise it goes too out of the box here: Also, this is probably not related to this PR, but clicking the profile picture seems to not display the position field, but clicking people's username does - it should probably show for both. |
3e08b12
to
a124919
Compare
@yangchen1 fixed the limit to be 35 characters instead. You can also now see the Position attribute setting in LDAP and SAML settings pages of Admin Console. |
@grundleborg to add automatic truncation if LDAP position is longer than 35 characters |
@yangchen1 fixed. |
Looks good! :) 👍 |
@@ -188,7 +188,8 @@ | |||
"SkipCertificateVerification": false, | |||
"QueryTimeout": 60, | |||
"MaxPageSize": 0, | |||
"LoginFieldName": "" | |||
"LoginFieldName": "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this so it is with the other attributes?
Discussion on pre-release: https://pre-release.mattermost.com/core/pl/iabmurbjx7y1z8u8off1mkcsjy Let's make the back-end implementation be a custom field so we can expand on this later. |
@@ -50,6 +50,7 @@ func NewSqlUserStore(sqlStore *SqlStore) UserStore { | |||
table.ColMap("NotifyProps").SetMaxSize(2000) | |||
table.ColMap("Locale").SetMaxSize(5) | |||
table.ColMap("MfaSecret").SetMaxSize(128) | |||
table.ColMap("Position").SetMaxSize(35) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would set it to something more std like 64 chars then limit in the UI or via checks. We do this all over the place because we change our minds so often on size. That way the DB doesn't need to change, just a random constant somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, will change this to 64 char hard limit in DB, with validation/UI limit of 35 char.
@crspeller Sorry, UI fail. Was suposed to say that to @enahum and to add to your one that we decided against custom fields in dev meeting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other than @crspeller and @coreyhulen comments
also I think it needs a rebase |
b6d55df
to
32bc67e
Compare
@crspeller @coreyhulen rebased and fixed both your review comments. |
Feel free to merge once build is complete. |
Please could someone with the necessary permissions merge this? |
Summary
Adds a Position field to users, editable in the Account Settings general tab, and displayed below the name in the profile popover.
Ticket Link
#4188
https://mattermost.atlassian.net/browse/PLT-4332
Issues
Need to decide on if/how to integrate this change with other authentication systems.Checklist