From 7c8654171e893d827fcfdbe7864ab1712888b46a Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Tue, 12 Jul 2016 15:17:46 -0400 Subject: Revert "Letting email not validated error message through login. Changing invalid credentials error. (#3546)" This reverts commit 128e4f984ad565297ab1c7b8921d877d3a9c8f03. --- api/user.go | 6 +----- i18n/en.json | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/api/user.go b/api/user.go index 7dd26efd6..6ed2939d1 100644 --- a/api/user.go +++ b/api/user.go @@ -472,11 +472,7 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) { 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 = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "") return } diff --git a/i18n/en.json b/i18n/en.json index 19c97bc95..04305774a 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1781,7 +1781,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", -- cgit v1.2.3-1-g7c22 From 4775631ed4ef679d1b25a75e5f345aa5fbfabe80 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Tue, 12 Jul 2016 15:18:25 -0400 Subject: Revert "Login error messages fix (#3525)" This reverts commit 2e513c8fd4c6b1b428b83044c017836b0011d32b. --- api/user.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/api/user.go b/api/user.go index 6ed2939d1..a3c2faf6a 100644 --- a/api/user.go +++ b/api/user.go @@ -449,8 +449,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) @@ -460,8 +460,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 } @@ -471,8 +470,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()) - c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "") + c.Err = err return } -- cgit v1.2.3-1-g7c22 From 34ec30e80605e5285cd398be55318cc27d83939a Mon Sep 17 00:00:00 2001 From: enahum Date: Tue, 12 Jul 2016 16:05:54 -0400 Subject: daily translations 20160712 (#3557) --- i18n/de.json | 2 +- i18n/es.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/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", -- cgit v1.2.3-1-g7c22 From caef414abea77bf0576aef927c9eaf0f205f9b6f Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Tue, 12 Jul 2016 16:06:03 -0400 Subject: PLT-3631 Properly update PostViewController when emojis change (#3565) * Properly remove custom emojis from clientside store * Properly update PostViewController when emojis change --- webapp/components/post_view/post_view_controller.jsx | 4 ++++ webapp/stores/emoji_store.jsx | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/webapp/components/post_view/post_view_controller.jsx b/webapp/components/post_view/post_view_controller.jsx index 17c3e94ae..e5743e657 100644 --- a/webapp/components/post_view/post_view_controller.jsx +++ b/webapp/components/post_view/post_view_controller.jsx @@ -247,6 +247,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() { -- cgit v1.2.3-1-g7c22 From ab52700aaa76a5623de23cd0156f5dbd9a24e264 Mon Sep 17 00:00:00 2001 From: enahum Date: Tue, 12 Jul 2016 16:10:04 -0400 Subject: PLT-3624 quick fix remove SAML certificates without saving (#3555) --- webapp/components/admin_console/file_upload_setting.jsx | 6 ++++-- webapp/components/admin_console/remove_file_setting.jsx | 13 +------------ webapp/components/admin_console/saml_settings.jsx | 10 +++++++--- 3 files changed, 12 insertions(+), 17 deletions(-) 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 =
; - } - return ( {this.props.removeButtonText} - {serverError} ); 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} /> ); } -- cgit v1.2.3-1-g7c22