Repository: atlas Updated Branches: refs/heads/branch-0.8 3d2bda3a0 -> 561dd80cc
ATLAS-2350: UI - after error notification during search, there is an icon buffering forever Signed-off-by: Madhan Neethiraj <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/561dd80c Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/561dd80c Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/561dd80c Branch: refs/heads/branch-0.8 Commit: 561dd80cc5db4a40578c3b8ef9073660155e72bb Parents: 3d2bda3 Author: pratik24mac <[email protected]> Authored: Wed Jan 10 17:45:04 2018 +0530 Committer: kevalbhatt <[email protected]> Committed: Tue Jul 31 14:30:53 2018 +0530 ---------------------------------------------------------------------- .../js/views/search/SearchResultLayoutView.js | 21 ++++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/atlas/blob/561dd80c/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 d3ad022..3448fa6 100644 --- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js +++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js @@ -218,19 +218,14 @@ define(['require', } }); this.listenTo(this.searchCollection, "error", function(model, response) { - this.$('.fontLoader').hide(); - this.$('.tableOverlay').hide(); - var responseJSON = response && response.responseJSON ? response.responseJSON : null; - if (responseJSON && (responseJSON.errorMessage || responseJSON.message || responseJSON.error)) { + this.hideLoader({ type: 'error' }); + var responseJSON = response && response.responseJSON ? response.responseJSON : null, + errorText = (responseJSON && (responseJSON.errorMessage || responseJSON.message || responseJSON.error ))|| 'Invalid Expression'; + if (errorText) { Utils.notifyError({ - content: responseJSON.errorMessage || responseJSON.message || responseJSON.error + content: errorText }); - } else { - if (response.statusText !== "abort") { - Utils.notifyError({ - content: "Invalid Expression" - }); - } + this.$('.searchTable > .well').html('<center>' + errorText + '</center>') } }, this); this.listenTo(this.searchCollection, "state-changed", function(state) { @@ -918,9 +913,9 @@ define(['require', this.$('.fontLoader:not(.for-ignore)').addClass('show'); this.$('.tableOverlay').addClass('show'); }, - hideLoader: function() { + hideLoader: function(options) { this.$('.fontLoader:not(.for-ignore)').removeClass('show'); - this.$('.ellipsis,.pagination-box').show(); // only for first time + options && options.type === 'error' ? this.$('.ellipsis,.pagination-box').hide() : this.$('.ellipsis,.pagination-box').show(); // only show for first time and hide when type is error this.$('.tableOverlay').removeClass('show'); }, checkedValue: function(e) {
