You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ma...@apache.org on 2017/09/13 03:26:17 UTC

atlas git commit: ATLAS-2128 : UI Regression : DSL Results pagination doesn't spawn more than 2 pages

Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 5ca7955a1 -> 0225cad56


ATLAS-2128 : UI Regression : DSL Results pagination doesn't spawn more than 2 pages

Signed-off-by: Madhan Neethiraj <ma...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/0225cad5
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/0225cad5
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/0225cad5

Branch: refs/heads/branch-0.8
Commit: 0225cad56934d072eaaddb40d18bcbbc77fea476
Parents: 5ca7955
Author: kevalbhatt <kb...@apache.org>
Authored: Mon Sep 11 17:02:46 2017 +0530
Committer: Madhan Neethiraj <ma...@apache.org>
Committed: Tue Sep 12 20:19:27 2017 -0700

----------------------------------------------------------------------
 .../js/views/search/SearchResultLayoutView.js   | 22 ++++++++++----------
 1 file changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/0225cad5/dashboardv2/public/js/views/search/SearchResultLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/search/SearchResultLayoutView.js b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
index 970d6a3..5be5f00 100644
--- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
@@ -358,20 +358,20 @@ define(['require',
                 var apiObj = {
                     skipDefaultError: true,
                     sort: false,
-                    success: function(model, response) {
+                    success: function(dataOrCollection, response) {
                         Globals.searchApiCallRef = undefined;
                         if (!(that.ui.pageRecordText instanceof jQuery)) {
                             return;
                         }
-                        if (!model.entities && that.offset > that.limit) {
+                        if ((isPostMethod ? !dataOrCollection.entities : !dataOrCollection.length) && that.offset >= that.limit) {
                             that.ui.nextData.attr('disabled', true);
                             that.offset = that.offset - that.limit;
                             that.hideLoader();
                             return;
                         }
                         if (isPostMethod) {
-                            that.searchCollection.referredEntities = model.referredEntities;
-                            that.searchCollection.reset(model.entities);
+                            that.searchCollection.referredEntities = dataOrCollection.referredEntities;
+                            that.searchCollection.reset(dataOrCollection.entities);
                         }
                         if (that.searchCollection.models.length < that.limit) {
                             that.ui.nextData.attr('disabled', true);
@@ -407,11 +407,10 @@ define(['require',
                     reset: true
                 }
                 if (value) {
-                    $.extend(this.searchCollection.queryParams, { limit: this.limit, excludeDeletedEntities: (value.includeDE ? false : true) });
                     if (value.searchType) {
                         this.searchCollection.url = UrlLinks.searchApiUrl(value.searchType);
                     }
-                    _.extend(this.searchCollection.queryParams, { 'query': (value.query ? value.query.trim() : null), 'typeName': value.type || null, 'classification': value.tag || null });
+                    _.extend(this.searchCollection.queryParams, { 'limit': this.limit, 'query': (value.query ? value.query.trim() : null), 'typeName': value.type || null, 'classification': value.tag || null });
                     if (value.profileDBView && value.guid) {
                         var profileParam = {};
                         profileParam['guid'] = value.guid;
@@ -422,7 +421,9 @@ define(['require',
                     }
                     if (isPostMethod) {
                         this.searchCollection.filterObj = _.extend({}, filterObj);
-                        apiObj['data'] = _.extend({}, filterObj, _.pick(this.searchCollection.queryParams, 'query', 'excludeDeletedEntities', 'limit', 'offset', 'typeName', 'classification'))
+                        apiObj['data'] = _.extend({
+                            'excludeDeletedEntities': (this.value && this.value.includeDE ? false : true)
+                        }, filterObj, _.pick(this.searchCollection.queryParams, 'query', 'limit', 'offset', 'typeName', 'classification'))
                         Globals.searchApiCallRef = this.searchCollection.getBasicRearchResult(apiObj);
                     } else {
                         apiObj.data = null;
@@ -431,7 +432,9 @@ define(['require',
                     }
                 } else {
                     if (isPostMethod) {
-                        apiObj['data'] = _.extend({}, filterObj, _.pick(this.searchCollection.queryParams, 'query', 'excludeDeletedEntities', 'limit', 'offset', 'typeName', 'classification'));
+                        apiObj['data'] = _.extend({
+                            'excludeDeletedEntities': (this.value && this.value.includeDE ? false : true)
+                        }, filterObj, _.pick(this.searchCollection.queryParams, 'query', 'limit', 'offset', 'typeName', 'classification'));
                         Globals.searchApiCallRef = this.searchCollection.getBasicRearchResult(apiObj);
                     } else {
                         apiObj.data = null;
@@ -900,9 +903,6 @@ define(['require',
                 var includeDE = false;
                 if (e.target.checked) {
                     includeDE = true;
-                    $.extend(this.searchCollection.queryParams, { limit: this.limit, excludeDeletedEntities: false });
-                } else {
-                    $.extend(this.searchCollection.queryParams, { limit: this.limit, excludeDeletedEntities: true });
                 }
                 if (this.value) {
                     this.value.includeDE = includeDE;