summaryrefslogtreecommitdiffstats
path: root/webapp/components/admin_console
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2016-12-14 11:11:51 +0000
committerenahum <nahumhbl@gmail.com>2016-12-14 08:11:51 -0300
commit8406e854aa912f3d7f9179b10356444f07e25223 (patch)
tree353294a5ae87cf0c0cf3e675f32073fff1988d16 /webapp/components/admin_console
parent973585450378a457a94824b7852c7ab7194e2b3e (diff)
downloadchat-8406e854aa912f3d7f9179b10356444f07e25223.tar.gz
chat-8406e854aa912f3d7f9179b10356444f07e25223.tar.bz2
chat-8406e854aa912f3d7f9179b10356444f07e25223.zip
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.
Diffstat (limited to 'webapp/components/admin_console')
-rw-r--r--webapp/components/admin_console/ldap_settings.jsx21
-rw-r--r--webapp/components/admin_console/saml_settings.jsx21
2 files changed, 42 insertions, 0 deletions
diff --git a/webapp/components/admin_console/ldap_settings.jsx b/webapp/components/admin_console/ldap_settings.jsx
index 5aa23fde6..b774d34f3 100644
--- a/webapp/components/admin_console/ldap_settings.jsx
+++ b/webapp/components/admin_console/ldap_settings.jsx
@@ -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,
@@ -300,6 +302,25 @@ export default class LdapSettings extends AdminSettings {
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={
<FormattedMessage
diff --git a/webapp/components/admin_console/saml_settings.jsx b/webapp/components/admin_console/saml_settings.jsx
index c7cd73399..1391df0b6 100644
--- a/webapp/components/admin_console/saml_settings.jsx
+++ b/webapp/components/admin_console/saml_settings.jsx
@@ -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
};
@@ -509,6 +511,25 @@ export default class SamlSettings extends AdminSettings {
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={
<FormattedMessage