You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by sh...@apache.org on 2016/07/28 10:58:14 UTC

incubator-atlas git commit: ATLAS-1064 UI: Pagination for full text search results (Kalyanikashikar via shwethags)

Repository: incubator-atlas
Updated Branches:
  refs/heads/master 4bc3e738e -> 05277c27d


ATLAS-1064 UI: Pagination for full text search results (Kalyanikashikar via shwethags)


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

Branch: refs/heads/master
Commit: 05277c27db46dec01727be798f99a7964cdba15f
Parents: 4bc3e73
Author: Shwetha GS <ss...@hortonworks.com>
Authored: Thu Jul 28 16:28:06 2016 +0530
Committer: Shwetha GS <ss...@hortonworks.com>
Committed: Thu Jul 28 16:28:06 2016 +0530

----------------------------------------------------------------------
 .../search/SearchResultLayoutView_tmpl.html     |  2 +-
 dashboardv2/public/js/utils/TableLayout.js      |  4 +--
 .../js/views/search/SearchResultLayoutView.js   | 35 +++++---------------
 release-log.txt                                 |  1 +
 4 files changed, 13 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/05277c27/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html b/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
index 609ec23..1ea6189 100644
--- a/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
@@ -21,7 +21,7 @@
     <div class="ellipsis"><span class="searchResult" style=" font-size: 16px;"></span></div>
     <div class="searchTable">
         <span class="labelShowRecord pull-left" data-id="pageRecordText"></span>
-        <div data-id="paginationDiv" style="display:none">
+        <div data-id="paginationDiv">
             <ul class="pager pull-right">
                 <li>
                     <button class="btn" data-id="previousData" disabled=true>Previous</button>

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/05277c27/dashboardv2/public/js/utils/TableLayout.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/TableLayout.js b/dashboardv2/public/js/utils/TableLayout.js
index c83cf76..96251a2 100644
--- a/dashboardv2/public/js/utils/TableLayout.js
+++ b/dashboardv2/public/js/utils/TableLayout.js
@@ -308,9 +308,9 @@ define(['require',
             renderFooterRecords: function(collectionState) {
                 var collState = collectionState;
                 var totalRecords = collState.totalRecords || 0;
-                var pageStartIndex = totalRecords ? (collState.currentPage * collState.pageSize) : 1;
+                var pageStartIndex = totalRecords ? (collState.currentPage * collState.pageSize) : 0;
                 var pageEndIndex = pageStartIndex + this.collection.length;
-                this.$('[data-id="r_footerRecords"]').html('<h5>Showing ' + (totalRecords ? pageStartIndex + 1 : 0) + ' - ' + pageEndIndex + '</h5>');
+                this.$('[data-id="r_footerRecords"]').html('<h5>Showing ' + (totalRecords ? pageStartIndex + 1 : 1) + ' - ' + pageEndIndex + '</h5>');
                 return this;
             },
             /**

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/05277c27/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 f9f82f4..0e62873 100644
--- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
@@ -117,18 +117,13 @@ define(['require',
                 this.limit = 25;
                 this.firstFetch = true;
                 this.fetchList = 0;
-                if (options.value.searchType === "dsl" || options.value.type === "dsl") {
-                    pagination = false;
-                    this.offset = 0;
-                } else {
-                    pagination = true;
-                }
+                this.offset = 0;
                 this.commonTableOptions = {
                     collection: this.searchCollection,
                     includeFilter: false,
-                    includePagination: pagination,
+                    includePagination: false,
                     includePageSize: false,
-                    includeFooterRecords: pagination,
+                    includeFooterRecords: false,
                     includeSizeAbleColumns: false,
                     gridOpts: {
                         emptyText: 'No Record found!',
@@ -210,10 +205,8 @@ define(['require',
                 if (value) {
                     if (value.searchType) {
                         this.searchCollection.url = "/api/atlas/discovery/search/" + value.searchType;
-                        if (value.searchType === "dsl") {
-                            $.extend(this.searchCollection.queryParams, { limit: this.limit });
-                            this.offset = 0;
-                        }
+                        $.extend(this.searchCollection.queryParams, { limit: this.limit });
+                        this.offset = 0;
                     }
                     _.extend(this.searchCollection.queryParams, { 'query': value.query });
                 }
@@ -246,7 +239,6 @@ define(['require',
                             that.checkTableFetch();
                             that.offset = that.offset - that.limit;
                             if (that.firstFetch) {
-                                that.ui.paginationDiv.hide();
                                 that.renderTableLayoutView();
                             }
                         }
@@ -318,11 +310,6 @@ define(['require',
                     this.$('.fontLoader').hide();
                     this.$('.searchTable').show();
                     this.$('.searchResult').show();
-                    if (this.value.searchType == "dsl" || this.value.type === "dsl") {
-                        this.ui.paginationDiv.show();
-                    } else {
-                        this.ui.paginationDiv.hide();
-                    }
                 }
             },
             getEntityTableColumns: function() {
@@ -621,11 +608,9 @@ define(['require',
             onClicknextData: function() {
                 var that = this;
                 this.ui.previousData.removeAttr("disabled");
+                that.offset = that.offset + that.limit;
                 $.extend(this.searchCollection.queryParams, {
-                    offset: function() {
-                        that.offset = that.offset + that.limit;
-                        return that.offset;
-                    }
+                    offset: that.offset
                 });
                 this.previousClick = false;
                 this.fetchCollection();
@@ -633,11 +618,9 @@ define(['require',
             onClickpreviousData: function() {
                 var that = this;
                 this.ui.nextData.removeAttr("disabled");
+                that.offset = that.offset - that.limit;
                 $.extend(this.searchCollection.queryParams, {
-                    offset: function() {
-                        that.offset = that.offset - that.limit;
-                        return that.offset;
-                    }
+                    offset: that.offset
                 });
                 this.previousClick = true;
                 this.fetchCollection();

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/05277c27/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 52fd857..5b22771 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -6,6 +6,7 @@ INCOMPATIBLE CHANGES:
 
 
 ALL CHANGES:
+ATLAS-1064 UI: Pagination for full text search results (Kalyanikashikar via shwethags)
 ATLAS-1006 Paginate full text search results (shwethags)
 ATLAS-1046 UI: Search pagination refinements (Kalyanikashikar via sumasai)
 ATLAS-1056 Differentiate between tag and term using attribute "taxonomy.namespace" (kevalbhat18 via sumasai)