Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 871E4200D18 for ; Tue, 26 Sep 2017 14:55:47 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 85C951609B4; Tue, 26 Sep 2017 12:55:47 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id DCEDF1609C1 for ; Tue, 26 Sep 2017 14:55:46 +0200 (CEST) Received: (qmail 2812 invoked by uid 500); 26 Sep 2017 12:55:46 -0000 Mailing-List: contact commits-help@atlas.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@atlas.apache.org Delivered-To: mailing list commits@atlas.apache.org Received: (qmail 2716 invoked by uid 99); 26 Sep 2017 12:55:46 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Sep 2017 12:55:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DB6ABF325E; Tue, 26 Sep 2017 12:55:45 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kbhatt@apache.org To: commits@atlas.apache.org Date: Tue, 26 Sep 2017 12:55:45 -0000 Message-Id: <360a91bb25764bdebe5095111e104fc9@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/3] atlas git commit: ATLAS-2168 : When a second search is fired in between the pages of the first search results , offset is not reset to 0 archived-at: Tue, 26 Sep 2017 12:55:47 -0000 Repository: atlas Updated Branches: refs/heads/branch-0.8 82dbf3adc -> 36c2e3c09 ATLAS-2168 : When a second search is fired in between the pages of the first search results , offset is not reset to 0 Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/a918714b Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/a918714b Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/a918714b Branch: refs/heads/branch-0.8 Commit: a918714bb635f749cb2d1e696762e17e2e27f7cb Parents: 82dbf3a Author: kevalbhatt Authored: Tue Sep 26 12:36:21 2017 +0530 Committer: kevalbhatt Committed: Tue Sep 26 18:22:41 2017 +0530 ---------------------------------------------------------------------- .../public/js/views/search/SearchLayoutView.js | 21 ++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/atlas/blob/a918714b/dashboardv2/public/js/views/search/SearchLayoutView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/search/SearchLayoutView.js b/dashboardv2/public/js/views/search/SearchLayoutView.js index b032ea9..df50800 100644 --- a/dashboardv2/public/js/views/search/SearchLayoutView.js +++ b/dashboardv2/public/js/views/search/SearchLayoutView.js @@ -61,7 +61,6 @@ define(['require', events["keyup " + this.ui.searchInput] = function(e) { var code = e.which; this.value.query = e.currentTarget.value; - this.query[this.type].query = this.value.query; if (code == 13) { that.findSearchResult(); } @@ -244,7 +243,7 @@ define(['require', } }); }, - checkForButtonVisiblity: function(e) { + checkForButtonVisiblity: function(e, options) { if (this.type == "basic" && e && e.currentTarget) { var $el = $(e.currentTarget), isTagEl = $el.data('id') == "tagLOV" ? true : false; @@ -260,7 +259,9 @@ define(['require', temp[key] = value; _.extend(this.value, temp); // on change of type/tag change the offset. - this.query[this.type].pageOffset = 0; + if (_.isUndefined(options)) { + this.value.pageOffset = 0; + } _.extend(this.query[this.type], temp); } else { // Initial loading handle. @@ -458,9 +459,9 @@ define(['require', if (this.ui.typeLov.data('select2')) { if (this.ui.typeLov.val() !== this.value.type) { this.value.type = null; - this.ui.typeLov.val("").trigger("change"); + this.ui.typeLov.val("").trigger("change", { 'manual': true }); } else { - this.ui.typeLov.trigger("change"); + this.ui.typeLov.trigger("change", { 'manual': true }); } } @@ -470,9 +471,9 @@ define(['require', // To handle delete scenario. if (this.ui.tagLov.val() !== this.value.tag) { this.value.tag = null; - this.ui.tagLov.val("").trigger("change"); + this.ui.tagLov.val("").trigger("change", { 'manual': true }); } else { - this.ui.tagLov.trigger("change"); + this.ui.tagLov.trigger("change", { 'manual': true }); } } } @@ -510,11 +511,11 @@ define(['require', params['includeDE'] = this.value.includeDE; } } - if (this.value.pageLimit) { + if (!_.isUndefinedNull(this.value.pageLimit)) { params['pageLimit'] = this.value.pageLimit; } - if (this.value.pageOffset) { - if (this.query[this.type].query && this.query[this.type].query != value) { + if (!_.isUndefinedNull(this.value.pageOffset)) { + if (!_.isUndefinedNull(this.query[this.type]) && this.query[this.type].query != value) { params['pageOffset'] = 0; } else { params['pageOffset'] = this.value.pageOffset;