From 8406e854aa912f3d7f9179b10356444f07e25223 Mon Sep 17 00:00:00 2001 From: George Goldberg 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/admin_console/ldap_settings.jsx | 21 +++++++++++++++++++++ webapp/components/admin_console/saml_settings.jsx | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) (limited to 'webapp/components/admin_console') 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, @@ -299,6 +301,25 @@ export default class LdapSettings extends AdminSettings { onChange={this.handleChange} disabled={!this.state.enable} /> + + } + placeholder={Utils.localizeMessage('admin.ldap.positionAttrEx', 'E.g.: "title"')} + helpText={ + + } + value={this.state.positionAttribute} + onChange={this.handleChange} + disabled={!this.state.enable} + /> + + } + placeholder={Utils.localizeMessage('admin.saml.positionAttrEx', 'E.g.: "Role"')} + helpText={ + + } + value={this.state.positionAttribute} + onChange={this.handleChange} + disabled={!this.state.enable} + />