removed change password UI for oauth accounts

Этот коммит содержится в:
JoramWilander
2015-07-15 17:50:07 -04:00
родитель c39e95c7cb
Коммит 712f9a0b8c
3 изменённых файлов: 49 добавлений и 30 удалений

Просмотреть файл

@@ -112,6 +112,9 @@ module.exports = React.createClass({
<div className="form-group"> <div className="form-group">
<button type="submit" className="btn btn-primary">Sign in</button> <button type="submit" className="btn btn-primary">Sign in</button>
</div> </div>
<div className="form-group form-group--small">
<span><a href="#">{"Log in with GitLab"}</a></span>
</div>
<div className="form-group form-group--small"> <div className="form-group form-group--small">
<span><a href="/find_team">{"Find other " + strings.TeamPlural}</a></span> <span><a href="/find_team">{"Find other " + strings.TeamPlural}</a></span>
</div> </div>

Просмотреть файл

@@ -20,7 +20,7 @@ module.exports = React.createClass({
<hr /> <hr />
{ server_error } { server_error }
{ client_error } { client_error }
<a className="btn btn-sm btn-primary" onClick={this.props.submit}>Submit</a> { this.props.submit ? <a className="btn btn-sm btn-primary" onClick={this.props.submit}>Submit</a> : "" }
<a className="btn btn-sm theme" href="#" onClick={this.props.updateSection}>Cancel</a> <a className="btn btn-sm theme" href="#" onClick={this.props.updateSection}>Cancel</a>
</li> </li>
</ul> </ul>

Просмотреть файл

@@ -590,7 +590,7 @@ var SecurityTab = React.createClass({
submitPassword: function(e) { submitPassword: function(e) {
e.preventDefault(); e.preventDefault();
var user = UserStore.getCurrentUser(); var user = this.props.user;
var currentPassword = this.state.current_password; var currentPassword = this.state.current_password;
var newPassword = this.state.new_password; var newPassword = this.state.new_password;
var confirmPassword = this.state.confirm_password; var confirmPassword = this.state.confirm_password;
@@ -648,53 +648,69 @@ var SecurityTab = React.createClass({
var self = this; var self = this;
if (this.props.activeSection === 'password') { if (this.props.activeSection === 'password') {
var inputs = []; var inputs = [];
var submit = null;
inputs.push( if (this.props.user.auth_service === "") {
<div className="form-group"> inputs.push(
<label className="col-sm-5 control-label">Current Password</label> <div className="form-group">
<div className="col-sm-7"> <label className="col-sm-5 control-label">Current Password</label>
<input className="form-control" type="password" onChange={this.updateCurrentPassword} value={this.state.current_password}/> <div className="col-sm-7">
<input className="form-control" type="password" onChange={this.updateCurrentPassword} value={this.state.current_password}/>
</div>
</div> </div>
</div> );
); inputs.push(
inputs.push( <div className="form-group">
<div className="form-group"> <label className="col-sm-5 control-label">New Password</label>
<label className="col-sm-5 control-label">New Password</label> <div className="col-sm-7">
<div className="col-sm-7"> <input className="form-control" type="password" onChange={this.updateNewPassword} value={this.state.new_password}/>
<input className="form-control" type="password" onChange={this.updateNewPassword} value={this.state.new_password}/> </div>
</div> </div>
</div> );
); inputs.push(
inputs.push( <div className="form-group">
<div className="form-group"> <label className="col-sm-5 control-label">Retype New Password</label>
<label className="col-sm-5 control-label">Retype New Password</label> <div className="col-sm-7">
<div className="col-sm-7"> <input className="form-control" type="password" onChange={this.updateConfirmPassword} value={this.state.confirm_password}/>
<input className="form-control" type="password" onChange={this.updateConfirmPassword} value={this.state.confirm_password}/> </div>
</div> </div>
</div> );
);
submit = this.submitPassword;
} else {
inputs.push(
<div className="form-group">
<label className="col-sm-12">Log in occurs through GitLab. Please see your GitLab account settings page to update your password.</label>
</div>
);
}
passwordSection = ( passwordSection = (
<SettingItemMax <SettingItemMax
title="Password" title="Password"
inputs={inputs} inputs={inputs}
submit={this.submitPassword} submit={submit}
server_error={server_error} server_error={server_error}
client_error={password_error} client_error={password_error}
updateSection={function(e){self.props.updateSection("");e.preventDefault();}} updateSection={function(e){self.props.updateSection("");e.preventDefault();}}
/> />
); );
} else { } else {
var d = new Date(this.props.user.last_password_update); var describe;
var hour = d.getHours() % 12 ? String(d.getHours() % 12) : "12"; if (this.props.user.auth_service === "") {
var min = d.getMinutes() < 10 ? "0" + d.getMinutes() : String(d.getMinutes()); var d = new Date(this.props.user.last_password_update);
var timeOfDay = d.getHours() >= 12 ? " pm" : " am"; var hour = d.getHours() % 12 ? String(d.getHours() % 12) : "12";
var dateStr = "Last updated " + Constants.MONTHS[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear() + " at " + hour + ":" + min + timeOfDay; 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 = ( passwordSection = (
<SettingItemMin <SettingItemMin
title="Password" title="Password"
describe={dateStr} describe={describe}
updateSection={function(){self.props.updateSection("password");}} updateSection={function(){self.props.updateSection("password");}}
/> />
); );