summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/user.go14
-rw-r--r--i18n/de.json2
-rw-r--r--i18n/en.json2
-rw-r--r--i18n/es.json2
-rw-r--r--webapp/components/admin_console/file_upload_setting.jsx6
-rw-r--r--webapp/components/admin_console/remove_file_setting.jsx13
-rw-r--r--webapp/components/admin_console/saml_settings.jsx10
-rw-r--r--webapp/components/post_view/post_view_controller.jsx4
-rw-r--r--webapp/stores/emoji_store.jsx12
9 files changed, 33 insertions, 32 deletions
diff --git a/api/user.go b/api/user.go
index 513c39b96..7d2eb85bf 100644
--- a/api/user.go
+++ b/api/user.go
@@ -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
}
diff --git a/i18n/de.json b/i18n/de.json
index 289cec3b6..17691b02b 100644
--- a/i18n/de.json
+++ b/i18n/de.json
@@ -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",
diff --git a/i18n/en.json b/i18n/en.json
index f8dddfc0b..245ae8d83 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -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",
diff --git a/i18n/es.json b/i18n/es.json
index 30ea90ad5..9ea63a7d0 100644
--- a/i18n/es.json
+++ b/i18n/es.json
@@ -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",
diff --git a/webapp/components/admin_console/file_upload_setting.jsx b/webapp/components/admin_console/file_upload_setting.jsx
index e7cb387ee..a7df16c0a 100644
--- a/webapp/components/admin_console/file_upload_setting.jsx
+++ b/webapp/components/admin_console/file_upload_setting.jsx
@@ -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
};
}
diff --git a/webapp/components/admin_console/remove_file_setting.jsx b/webapp/components/admin_console/remove_file_setting.jsx
index 5a76faae2..9a6266a62 100644
--- a/webapp/components/admin_console/remove_file_setting.jsx
+++ b/webapp/components/admin_console/remove_file_setting.jsx
@@ -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>
);
diff --git a/webapp/components/admin_console/saml_settings.jsx b/webapp/components/admin_console/saml_settings.jsx
index 611c37192..5fba78b75 100644
--- a/webapp/components/admin_console/saml_settings.jsx
+++ b/webapp/components/admin_console/saml_settings.jsx
@@ -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}
/>
);
}
diff --git a/webapp/components/post_view/post_view_controller.jsx b/webapp/components/post_view/post_view_controller.jsx
index 3aba569fe..a7583fa38 100644
--- a/webapp/components/post_view/post_view_controller.jsx
+++ b/webapp/components/post_view/post_view_controller.jsx
@@ -260,6 +260,10 @@ export default class PostViewController extends React.Component {
return true;
}
+ if (nextState.emojis !== this.state.emojis) {
+ return true;
+ }
+
return false;
}
diff --git a/webapp/stores/emoji_store.jsx b/webapp/stores/emoji_store.jsx
index 5e1d81dd3..e369885b4 100644
--- a/webapp/stores/emoji_store.jsx
+++ b/webapp/stores/emoji_store.jsx
@@ -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() {