Merge branch 'release-3.2' into 'master'

This commit is contained in:
Harrison Healey
2016-07-15 12:26:32 -04:00
9 changed files with 33 additions and 32 deletions

View File

@@ -455,8 +455,8 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) {
if result := <-Srv.Store.User().Get(id); result.Err != nil {
c.LogAuditWithUserId(user.Id, "failure")
//c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, result.Err.Error())
c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "")
c.Err = result.Err
c.Err.StatusCode = http.StatusBadRequest
return
} else {
user = result.Data.(*model.User)
@@ -466,8 +466,7 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) {
if user, err = getUserForLogin(loginId, ldapOnly); err != nil {
c.LogAudit("failure")
//c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, err.Error())
c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "")
c.Err = err
return
}
@@ -477,12 +476,7 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) {
// and then authenticate them
if user, err = authenticateUser(user, password, mfaToken); err != nil {
c.LogAuditWithUserId(user.Id, "failure")
//c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, err.Error())
if err.Id == "api.user.login.not_verified.app_error" {
c.Err = err
} else {
c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "")
}
c.Err = err
return
}

View File

@@ -165,7 +165,7 @@
},
{
"id": "api.channel.add_user.to.channel.failed.deleted.app_error",
"translation": "Failed to add user to channel because they have been removed from the team."
"translation": "Fehler beim Hinzufügen des Benutzers zum Kanal, da dieser aus dem Team entfernt worden ist."
},
{
"id": "api.channel.add_user_to_channel.deleted.app_error",

View File

@@ -1761,7 +1761,7 @@
},
{
"id": "api.user.login.invalid_credentials",
"translation": "Your login credentials are incorrect."
"translation": "User ID or password incorrect."
},
{
"id": "api.user.login.not_provided.app_error",

View File

@@ -165,7 +165,7 @@
},
{
"id": "api.channel.add_user.to.channel.failed.deleted.app_error",
"translation": "Failed to add user to channel because they have been removed from the team."
"translation": "Error al agregar el usuario al canal porque ha sido removido del equipo."
},
{
"id": "api.channel.add_user_to_channel.deleted.app_error",

View File

@@ -18,7 +18,8 @@ export default class FileUploadSetting extends Setting {
uploadingText: React.PropTypes.node,
onSubmit: React.PropTypes.func.isRequired,
disabled: React.PropTypes.bool,
fileType: React.PropTypes.string.isRequired
fileType: React.PropTypes.string.isRequired,
error: React.PropTypes.string
};
}
@@ -29,7 +30,8 @@ export default class FileUploadSetting extends Setting {
this.handleSubmit = this.handleSubmit.bind(this);
this.state = {
fileName: null
fileName: null,
serverError: props.error
};
}

View File

@@ -23,28 +23,18 @@ export default class RemoveFileSetting extends Setting {
constructor(props) {
super(props);
this.handleRemove = this.handleRemove.bind(this);
this.state = {
serverError: null
};
}
handleRemove(e) {
e.preventDefault();
$(this.refs.remove_button).button('loading');
this.props.onSubmit(this.props.id, (error) => {
this.props.onSubmit(this.props.id, () => {
$(this.refs.remove_button).button('reset');
this.setState({serverError: error});
});
}
render() {
let serverError;
if (this.state.serverError) {
serverError = <div className='form-group has-error'><label className='control-label'>{this.state.serverError}</label></div>;
}
return (
<Setting
label={this.props.label}
@@ -64,7 +54,6 @@ export default class RemoveFileSetting extends Setting {
>
{this.props.removeButtonText}
</button>
{serverError}
</div>
</Setting>
);

View File

@@ -76,7 +76,7 @@ export default class SamlSettings extends AdminSettings {
() => {
const fileName = file.name;
this.handleChange(id, fileName);
this.setState({[id]: fileName});
this.setState({[id]: fileName, [`${id}Error`]: null});
if (callback && typeof callback === 'function') {
callback();
}
@@ -94,12 +94,13 @@ export default class SamlSettings extends AdminSettings {
this.state[id],
() => {
this.handleChange(id, '');
this.setState({[id]: null});
this.setState({[id]: null, [`${id}Error`]: null});
},
(error) => {
if (callback && typeof callback === 'function') {
callback(error.message);
callback();
}
this.setState({[id]: null, [`${id}Error`]: error.message});
}
);
}
@@ -168,6 +169,7 @@ export default class SamlSettings extends AdminSettings {
disabled={!this.state.enable}
fileType='.crt,.cer'
onSubmit={this.uploadCertificate}
error={this.state.idpCertificateFileError}
/>
);
}
@@ -215,6 +217,7 @@ export default class SamlSettings extends AdminSettings {
disabled={!this.state.enable || !this.state.encrypt}
fileType='.key'
onSubmit={this.uploadCertificate}
error={this.state.privateKeyFileError}
/>
);
}
@@ -262,6 +265,7 @@ export default class SamlSettings extends AdminSettings {
disabled={!this.state.enable || !this.state.encrypt}
fileType='.crt,.cer'
onSubmit={this.uploadCertificate}
error={this.state.publicCertificateFileError}
/>
);
}

View File

@@ -260,6 +260,10 @@ export default class PostViewController extends React.Component {
return true;
}
if (nextState.emojis !== this.state.emojis) {
return true;
}
return false;
}

View File

@@ -54,12 +54,13 @@ class EmojiStore extends EventEmitter {
this.addCustomEmoji(emoji);
}
// add custom emojis to the map first so that they can't override system ones
this.emojis = new Map([...this.customEmojis, ...this.systemEmojis]);
this.updateEmojiMap();
}
addCustomEmoji(emoji) {
this.customEmojis.set(emoji.name, emoji);
// this doesn't update this.emojis, but it's only called by setCustomEmojis which does that afterwards
}
removeCustomEmoji(id) {
@@ -69,6 +70,13 @@ class EmojiStore extends EventEmitter {
break;
}
}
this.updateEmojiMap();
}
updateEmojiMap() {
// add custom emojis to the map first so that they can't override system ones
this.emojis = new Map([...this.customEmojis, ...this.systemEmojis]);
}
getSystemEmojis() {