ATLAS-1817 : UI : n+1 pages are created, even though only n*25 instances are retrieved
Signed-off-by: nixonrodrigues <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/a2d1d86e Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/a2d1d86e Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/a2d1d86e Branch: refs/heads/0.8-incubating Commit: a2d1d86ea5c918838ee685ab4d81025fdf7e4903 Parents: a51b9ab Author: Kalyani <[email protected]> Authored: Tue May 23 18:38:55 2017 +0530 Committer: nixonrodrigues <[email protected]> Committed: Sun May 28 10:58:17 2017 +0530 ---------------------------------------------------------------------- .../public/js/views/search/SearchResultLayoutView.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a2d1d86e/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 25df9b5..1c9320c 100644 --- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js +++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js @@ -255,7 +255,12 @@ define(['require', if (!(that.ui.pageRecordText instanceof jQuery)) { return; } - + if (that.searchCollection.models.length === 0) { + that.ui.nextData.attr('disabled', true); + that.offset = that.offset - that.limit; + that.hideLoader(); + return; + } if (that.searchCollection.models.length < that.limit) { that.ui.nextData.attr('disabled', true); } else { @@ -272,7 +277,7 @@ define(['require', that.pageTo = that.pageTo - that.limit; that.pageFrom = (that.pageTo - that.limit) + 1; } - that.ui.pageRecordText.html("Showing <u>" + that.searchCollection.models.length + " records</u>, from " + that.pageFrom + " - " + that.pageTo); + that.ui.pageRecordText.html("Showing <u>" + that.searchCollection.models.length + " records</u> From " + that.pageFrom + " - " + that.pageTo); if (that.offset < that.limit && that.pageFrom < 26) { that.ui.previousData.attr('disabled', true); }
