diff options
Diffstat (limited to 'webapp/components/claim/components/email_to_ldap.jsx')
-rw-r--r-- | webapp/components/claim/components/email_to_ldap.jsx | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/webapp/components/claim/components/email_to_ldap.jsx b/webapp/components/claim/components/email_to_ldap.jsx index 1ceb42a27..fbf26cade 100644 --- a/webapp/components/claim/components/email_to_ldap.jsx +++ b/webapp/components/claim/components/email_to_ldap.jsx @@ -2,12 +2,11 @@ // See License.txt for license information. import * as Utils from 'utils/utils.jsx'; -import * as Client from 'utils/client.jsx'; +import Client from 'utils/web_client.jsx'; import React from 'react'; import ReactDOM from 'react-dom'; import {FormattedMessage} from 'react-intl'; -import {browserHistory} from 'react-router'; export default class EmailToLDAP extends React.Component { constructor(props) { @@ -45,17 +44,14 @@ export default class EmailToLDAP extends React.Component { state.error = null; this.setState(state); - var postData = {}; - postData.email_password = password; - postData.ldap_id = ldapId; - postData.ldap_password = ldapPassword; - postData.email = this.props.email; - postData.team_name = this.props.teamName; - - Client.emailToLDAP(postData, + Client.emailToLdap( + this.props.email, + password, + ldapId, + ldapPassword, (data) => { if (data.follow_link) { - browserHistory.push(data.follow_link); + window.location.href = data.follow_link; } }, (error) => { @@ -74,6 +70,20 @@ export default class EmailToLDAP extends React.Component { formClass += ' has-error'; } + let loginPlaceholder; + if (global.window.mm_config.LdapLoginFieldName) { + loginPlaceholder = global.window.mm_config.LdapLoginFieldName; + } else { + loginPlaceholder = Utils.localizeMessage('claim.email_to_ldap.ldapId', 'LDAP ID'); + } + + let passwordPlaceholder; + if (global.window.mm_config.LdapPasswordFieldName) { + passwordPlaceholder = global.window.mm_config.LdapPasswordFieldName; + } else { + passwordPlaceholder = Utils.localizeMessage('claim.email_to_ldap.ldapPwd', 'LDAP Password'); + } + return ( <div> <h3> @@ -98,9 +108,8 @@ export default class EmailToLDAP extends React.Component { <p> <FormattedMessage id='claim.email_to_ldap.enterPwd' - defaultMessage='Enter the password for your {team} {site} email account' + defaultMessage='Enter the password for your {site} email account' values={{ - team: this.props.teamDisplayName, site: global.window.mm_config.SiteName }} /> @@ -125,10 +134,6 @@ export default class EmailToLDAP extends React.Component { <FormattedMessage id='claim.email_to_ldap.enterLdapPwd' defaultMessage='Enter the ID and password for your LDAP account' - values={{ - team: this.props.teamDisplayName, - site: global.window.mm_config.SiteName - }} /> </p> <div className={formClass}> @@ -138,7 +143,7 @@ export default class EmailToLDAP extends React.Component { name='ldapId' ref='ldapid' autoComplete='off' - placeholder={Utils.localizeMessage('claim.email_to_ldap.ldapId', 'LDAP ID')} + placeholder={loginPlaceholder} spellCheck='false' /> </div> @@ -149,7 +154,7 @@ export default class EmailToLDAP extends React.Component { name='ldapPassword' ref='ldappassword' autoComplete='off' - placeholder={Utils.localizeMessage('claim.email_to_ldap.ldapPwd', 'LDAP Password')} + placeholder={passwordPlaceholder} spellCheck='false' /> </div> @@ -172,7 +177,5 @@ export default class EmailToLDAP extends React.Component { EmailToLDAP.defaultProps = { }; EmailToLDAP.propTypes = { - email: React.PropTypes.string, - teamName: React.PropTypes.string, - teamDisplayName: React.PropTypes.string + email: React.PropTypes.string }; |