diff options
author | =Corey Hulen <corey@hulen.com> | 2016-03-14 10:23:51 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2016-03-14 10:23:51 -0700 |
commit | ea3f25924ea64a2dd1e73624c0d30824e1efb240 (patch) | |
tree | a4a2b2bdc37bd675fb89837713995ad44a27427b /web/react/components/user_settings/user_settings_security.jsx | |
parent | 397ebec88c2db3569efd77238bf877e976492d34 (diff) | |
parent | bf7ae0711743926cfbb031675cc3320d7a942465 (diff) | |
download | chat-ea3f25924ea64a2dd1e73624c0d30824e1efb240.tar.gz chat-ea3f25924ea64a2dd1e73624c0d30824e1efb240.tar.bz2 chat-ea3f25924ea64a2dd1e73624c0d30824e1efb240.zip |
Merge branch 'master' into PLT-2115
Diffstat (limited to 'web/react/components/user_settings/user_settings_security.jsx')
-rw-r--r-- | web/react/components/user_settings/user_settings_security.jsx | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/web/react/components/user_settings/user_settings_security.jsx b/web/react/components/user_settings/user_settings_security.jsx index cba7ffdea..0b6b6c398 100644 --- a/web/react/components/user_settings/user_settings_security.jsx +++ b/web/react/components/user_settings/user_settings_security.jsx @@ -14,7 +14,7 @@ import * as AsyncClient from '../../utils/async_client.jsx'; import * as Utils from '../../utils/utils.jsx'; import Constants from '../../utils/constants.jsx'; -import {intlShape, injectIntl, defineMessages, FormattedMessage} from 'mm-intl'; +import {intlShape, injectIntl, defineMessages, FormattedMessage, FormattedTime, FormattedDate} from 'mm-intl'; const holders = defineMessages({ currentPasswordError: { @@ -218,11 +218,24 @@ class SecurityTab extends React.Component { var describe; var d = new Date(this.props.user.last_password_update); - const locale = global.window.mm_locale; const hours12 = !Utils.isMilitaryTime(); describe = formatMessage(holders.lastUpdated, { - date: d.toLocaleDateString(locale, {month: 'short', day: '2-digit', year: 'numeric'}), - time: d.toLocaleTimeString(locale, {hour12: hours12, hour: '2-digit', minute: '2-digit'}) + date: ( + <FormattedDate + value={d} + day='2-digit' + month='short' + year='numeric' + /> + ), + time: ( + <FormattedTime + value={d} + hour12={hours12} + hour='2-digit' + minute='2-digit' + /> + ) }); updateSectionStatus = function updateSection() { @@ -251,7 +264,7 @@ class SecurityTab extends React.Component { <div> <a className='btn btn-primary' - href={'/' + teamName + '/claim?email=' + encodeURIComponent(user.email)} + href={'/' + teamName + '/claim?email=' + encodeURIComponent(user.email) + '&old_type=' + user.auth_service} > <FormattedMessage id='user.settings.security.switchEmail' @@ -269,7 +282,7 @@ class SecurityTab extends React.Component { <div> <a className='btn btn-primary' - href={'/' + teamName + '/claim?email=' + encodeURIComponent(user.email) + '&new_type=' + Constants.GITLAB_SERVICE} + href={'/' + teamName + '/claim?email=' + encodeURIComponent(user.email) + '&old_type=' + user.auth_service + '&new_type=' + Constants.GITLAB_SERVICE} > <FormattedMessage id='user.settings.security.switchGitlab' @@ -287,7 +300,7 @@ class SecurityTab extends React.Component { <div> <a className='btn btn-primary' - href={'/' + teamName + '/claim?email=' + encodeURIComponent(user.email) + '&new_type=' + Constants.GOOGLE_SERVICE} + href={'/' + teamName + '/claim?email=' + encodeURIComponent(user.email) + '&old_type=' + user.auth_service + '&new_type=' + Constants.GOOGLE_SERVICE} > <FormattedMessage id='user.settings.security.switchGoogle' @@ -456,4 +469,4 @@ SecurityTab.propTypes = { setEnforceFocus: React.PropTypes.func.isRequired }; -export default injectIntl(SecurityTab);
\ No newline at end of file +export default injectIntl(SecurityTab); |