Repository: ambari Updated Branches: refs/heads/branch-2.5 e020fb817 -> 6da1c530e
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/6da1c530 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6da1c530 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6da1c530 Branch: refs/heads/branch-2.5 Commit: 6da1c530e11be3eea6e38cabc27f355626738707 Parents: e020fb8 Author: Andrii Tkach <[email protected]> Authored: Thu Mar 2 18:15:40 2017 +0200 Committer: Andrii Tkach <[email protected]> Committed: Thu Mar 2 18:55:13 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/6da1c530/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/6da1c530/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 bb21b9f..efb3274 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,
