From 712f9a0b8c13f2d97a26b9030f215161f9b09511 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Wed, 15 Jul 2015 17:50:07 -0400 Subject: removed change password UI for oauth accounts --- web/react/components/login.jsx | 3 ++ web/react/components/setting_item_max.jsx | 2 +- web/react/components/user_settings.jsx | 74 +++++++++++++++++++------------ 3 files changed, 49 insertions(+), 30 deletions(-) (limited to 'web/react/components') diff --git a/web/react/components/login.jsx b/web/react/components/login.jsx index 71fefff5b..3fdaac32b 100644 --- a/web/react/components/login.jsx +++ b/web/react/components/login.jsx @@ -112,6 +112,9 @@ module.exports = React.createClass({
+
+ {"Log in with GitLab"} +
{"Find other " + strings.TeamPlural}
diff --git a/web/react/components/setting_item_max.jsx b/web/react/components/setting_item_max.jsx index b8b667e1a..49eb58773 100644 --- a/web/react/components/setting_item_max.jsx +++ b/web/react/components/setting_item_max.jsx @@ -20,7 +20,7 @@ module.exports = React.createClass({
{ server_error } { client_error } - Submit + { this.props.submit ? Submit : "" } Cancel diff --git a/web/react/components/user_settings.jsx b/web/react/components/user_settings.jsx index 59c97c309..0d3349dbc 100644 --- a/web/react/components/user_settings.jsx +++ b/web/react/components/user_settings.jsx @@ -590,7 +590,7 @@ var SecurityTab = React.createClass({ submitPassword: function(e) { e.preventDefault(); - var user = UserStore.getCurrentUser(); + var user = this.props.user; var currentPassword = this.state.current_password; var newPassword = this.state.new_password; var confirmPassword = this.state.confirm_password; @@ -648,53 +648,69 @@ var SecurityTab = React.createClass({ var self = this; if (this.props.activeSection === 'password') { var inputs = []; + var submit = null; - inputs.push( -
- -
- + if (this.props.user.auth_service === "") { + inputs.push( +
+ +
+ +
-
- ); - inputs.push( -
- -
- + ); + inputs.push( +
+ +
+ +
-
- ); - inputs.push( -
- -
- + ); + inputs.push( +
+ +
+ +
-
- ); + ); + + submit = this.submitPassword; + } else { + inputs.push( +
+ +
+ ); + } passwordSection = ( ); } else { - var d = new Date(this.props.user.last_password_update); - var hour = d.getHours() % 12 ? String(d.getHours() % 12) : "12"; - var min = d.getMinutes() < 10 ? "0" + d.getMinutes() : String(d.getMinutes()); - var timeOfDay = d.getHours() >= 12 ? " pm" : " am"; - var dateStr = "Last updated " + Constants.MONTHS[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear() + " at " + hour + ":" + min + timeOfDay; + var describe; + if (this.props.user.auth_service === "") { + var d = new Date(this.props.user.last_password_update); + var hour = d.getHours() % 12 ? String(d.getHours() % 12) : "12"; + var min = d.getMinutes() < 10 ? "0" + d.getMinutes() : String(d.getMinutes()); + var timeOfDay = d.getHours() >= 12 ? " pm" : " am"; + describe = "Last updated " + Constants.MONTHS[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear() + " at " + hour + ":" + min + timeOfDay; + } else { + describe = "Log in done through GitLab" + } passwordSection = ( ); -- cgit v1.2.3-1-g7c22