atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kbh...@apache.org
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
Date Tue, 26 Sep 2017 12:55:45 GMT
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 <kbhatt@apache.org>
Authored: Tue Sep 26 12:36:21 2017 +0530
Committer: kevalbhatt <kbhatt@apache.org>
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;


Mime
View raw message