AMBARI-20271 Call to fetch Quick Links host fails. (atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/843c5f97 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/843c5f97 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/843c5f97 Branch: refs/heads/branch-feature-AMBARI-12556 Commit: 843c5f97c16a0adbca9ec2ce9c5d112acce89334 Parents: e1e28c6 Author: Andrii Tkach <atk...@apache.org> Authored: Thu Mar 2 18:15:40 2017 +0200 Committer: Andrii Tkach <atk...@apache.org> Committed: Thu Mar 2 18:18:49 2017 +0200 ---------------------------------------------------------------------- ambari-web/app/mappers/hosts_mapper.js | 2 +- ambari-web/app/views/common/quick_view_link_view.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/843c5f97/ambari-web/app/mappers/hosts_mapper.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mappers/hosts_mapper.js b/ambari-web/app/mappers/hosts_mapper.js index b64bd8d..e4dd08f 100644 --- a/ambari-web/app/mappers/hosts_mapper.js +++ b/ambari-web/app/mappers/hosts_mapper.js @@ -216,7 +216,7 @@ App.hostsMapper = App.QuickDataMapper.create({ //"itemTotal" present only for Hosts page request if (!Em.isNone(json.itemTotal)) { App.Host.find().clear(); - App.HostComponent.find().clear(); + //App.HostComponent.find contains master components which requested across the app hence it should not be cleared } App.store.safeLoadMany(App.HostStackVersion, stackVersions); App.store.safeLoadMany(App.HostComponentLog, hostComponentLogs); http://git-wip-us.apache.org/repos/asf/ambari/blob/843c5f97/ambari-web/app/views/common/quick_view_link_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/quick_view_link_view.js b/ambari-web/app/views/common/quick_view_link_view.js index d551357..3f3a3a3 100644 --- a/ambari-web/app/views/common/quick_view_link_view.js +++ b/ambari-web/app/views/common/quick_view_link_view.js @@ -225,6 +225,10 @@ App.QuickLinksView = Em.View.extend({ getQuickLinksHosts: function () { var masterHosts = App.HostComponent.find().filterProperty('isMaster').mapProperty('hostName').uniq(); + if (masterHosts.length === 0) { + return $.Deferred().reject().promise(); + } + return App.ajax.send({ name: 'hosts.for_quick_links', sender: this,