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.
Этот коммит содержится в:
коммит произвёл
enahum
родитель
9735854503
Коммит
8406e854aa
@@ -38,6 +38,7 @@ export default class LdapSettings extends AdminSettings {
|
||||
config.LdapSettings.NicknameAttribute = this.state.nicknameAttribute;
|
||||
config.LdapSettings.EmailAttribute = this.state.emailAttribute;
|
||||
config.LdapSettings.UsernameAttribute = this.state.usernameAttribute;
|
||||
config.LdapSettings.PositionAttribute = this.state.positionAttribute;
|
||||
config.LdapSettings.IdAttribute = this.state.idAttribute;
|
||||
config.LdapSettings.SyncIntervalMinutes = this.parseIntNonZero(this.state.syncIntervalMinutes);
|
||||
config.LdapSettings.SkipCertificateVerification = this.state.skipCertificateVerification;
|
||||
@@ -63,6 +64,7 @@ export default class LdapSettings extends AdminSettings {
|
||||
nicknameAttribute: config.LdapSettings.NicknameAttribute,
|
||||
emailAttribute: config.LdapSettings.EmailAttribute,
|
||||
usernameAttribute: config.LdapSettings.UsernameAttribute,
|
||||
positionAttribute: config.LdapSettings.PositionAttribute,
|
||||
idAttribute: config.LdapSettings.IdAttribute,
|
||||
syncIntervalMinutes: config.LdapSettings.SyncIntervalMinutes,
|
||||
skipCertificateVerification: config.LdapSettings.SkipCertificateVerification,
|
||||
@@ -299,6 +301,25 @@ export default class LdapSettings extends AdminSettings {
|
||||
onChange={this.handleChange}
|
||||
disabled={!this.state.enable}
|
||||
/>
|
||||
<TextSetting
|
||||
id='positionAttribute'
|
||||
label={
|
||||
<FormattedMessage
|
||||
id='admin.ldap.positionAttrTitle'
|
||||
defaultMessage='Position Attribute:'
|
||||
/>
|
||||
}
|
||||
placeholder={Utils.localizeMessage('admin.ldap.positionAttrEx', 'E.g.: "title"')}
|
||||
helpText={
|
||||
<FormattedMessage
|
||||
id='admin.ldap.positionAttrDesc'
|
||||
defaultMessage='(Optional) The attribute in the AD/LDAP server that will be used to populate the position field in Mattermost.'
|
||||
/>
|
||||
}
|
||||
value={this.state.positionAttribute}
|
||||
onChange={this.handleChange}
|
||||
disabled={!this.state.enable}
|
||||
/>
|
||||
<TextSetting
|
||||
id='emailAttribute'
|
||||
label={
|
||||
|
||||
@@ -41,6 +41,7 @@ export default class SamlSettings extends AdminSettings {
|
||||
config.SamlSettings.EmailAttribute = this.state.emailAttribute;
|
||||
config.SamlSettings.UsernameAttribute = this.state.usernameAttribute;
|
||||
config.SamlSettings.NicknameAttribute = this.state.nicknameAttribute;
|
||||
config.SamlSettings.PositionAttribute = this.state.positionAttribute;
|
||||
config.SamlSettings.LocaleAttribute = this.state.localeAttribute;
|
||||
config.SamlSettings.LoginButtonText = this.state.loginButtonText;
|
||||
|
||||
@@ -65,6 +66,7 @@ export default class SamlSettings extends AdminSettings {
|
||||
emailAttribute: settings.EmailAttribute,
|
||||
usernameAttribute: settings.UsernameAttribute,
|
||||
nicknameAttribute: settings.NicknameAttribute,
|
||||
positionAttribute: settings.PositionAttribute,
|
||||
localeAttribute: settings.LocaleAttribute,
|
||||
loginButtonText: settings.LoginButtonText
|
||||
};
|
||||
@@ -508,6 +510,25 @@ export default class SamlSettings extends AdminSettings {
|
||||
onChange={this.handleChange}
|
||||
disabled={!this.state.enable}
|
||||
/>
|
||||
<TextSetting
|
||||
id='positionAttribute'
|
||||
label={
|
||||
<FormattedMessage
|
||||
id='admin.saml.positionAttrTitle'
|
||||
defaultMessage='Position Attribute:'
|
||||
/>
|
||||
}
|
||||
placeholder={Utils.localizeMessage('admin.saml.positionAttrEx', 'E.g.: "Role"')}
|
||||
helpText={
|
||||
<FormattedMessage
|
||||
id='admin.saml.positionAttrDesc'
|
||||
defaultMessage='(Optional) The attribute in the SAML Assertion that will be used to populate the position of users in Mattermost.'
|
||||
/>
|
||||
}
|
||||
value={this.state.positionAttribute}
|
||||
onChange={this.handleChange}
|
||||
disabled={!this.state.enable}
|
||||
/>
|
||||
<TextSetting
|
||||
id='localeAttribute'
|
||||
label={
|
||||
|
||||
Ссылка в новой задаче
Block a user