From 345af818469a46b28eb2904b5456f9f81ede2d9f Mon Sep 17 00:00:00 2001 From: Giovane Date: Fri, 13 Nov 2015 14:45:03 -0200 Subject: Remove search engine query lookups when showing no mails available #503 --- web-ui/app/js/mail_view/ui/no_mails_available_pane.js | 4 +++- web-ui/app/js/services/mail_service.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/web-ui/app/js/mail_view/ui/no_mails_available_pane.js b/web-ui/app/js/mail_view/ui/no_mails_available_pane.js index baa54fe3..7025dca6 100644 --- a/web-ui/app/js/mail_view/ui/no_mails_available_pane.js +++ b/web-ui/app/js/mail_view/ui/no_mails_available_pane.js @@ -34,9 +34,11 @@ define( forSearch: '' }); + var mailsQueryMatch = /-?in:"[\w]+"|tag:"[\w]+"/g; + this.render = function() { this.attr.tag = this.attr.tag.toUpperCase(); - this.attr.forSearch = this.attr.forSearch.toUpperCase(); + this.attr.forSearch = this.attr.forSearch.replace(mailsQueryMatch, '').trim(); this.$node.html(templates.noMailsAvailable(this.attr)); }; diff --git a/web-ui/app/js/services/mail_service.js b/web-ui/app/js/services/mail_service.js index 3dae9df8..e655bb7e 100644 --- a/web-ui/app/js/services/mail_service.js +++ b/web-ui/app/js/services/mail_service.js @@ -222,7 +222,7 @@ define( monitoredAjax(this, url, { dataType: 'json' }) .done(function (data) { this.attr.numPages = Math.ceil(data.stats.total / this.attr.pageSize); - this.trigger(document, events.mails.available, _.merge(_.merge({tag: this.attr.currentTag, forSearch: this.attr.lastQuery }), this.parseMails(data))); + this.trigger(document, events.mails.available, _.merge({tag: this.attr.currentTag, forSearch: this.attr.lastQuery }, this.parseMails(data))); }.bind(this)) .fail(function () { this.trigger(document, events.ui.userAlerts.displayMessage, { message: i18n('Could not fetch messages') }); -- cgit v1.2.3