Repository: ambari Updated Branches: refs/heads/branch-2.4 2d9a27245 -> 76aa496c4
AMBARI-17821 Atlas: Add Service Customize Services Page Issues (rzang) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/76aa496c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/76aa496c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/76aa496c Branch: refs/heads/branch-2.4 Commit: 76aa496c47ea25b8b4ce2641d94dcba32e23ee21 Parents: 2d9a272 Author: Richard Zang <[email protected]> Authored: Wed Jul 20 16:35:56 2016 -0700 Committer: Richard Zang <[email protected]> Committed: Thu Jul 21 13:06:54 2016 -0700 ---------------------------------------------------------------------- .../common/configs/service_config_container_view.js | 12 ++++++++++-- .../configs/service_config_container_view_test.js | 9 ++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/76aa496c/ambari-web/app/views/common/configs/service_config_container_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/service_config_container_view.js b/ambari-web/app/views/common/configs/service_config_container_view.js index 8b6a9ce..a7cee0c 100644 --- a/ambari-web/app/views/common/configs/service_config_container_view.js +++ b/ambari-web/app/views/common/configs/service_config_container_view.js @@ -96,7 +96,15 @@ App.ServiceConfigContainerView = Em.ContainerView.extend({ } //terminate lazy loading when switch service if (this.get('lazyLoading')) lazyLoading.terminate(this.get('lazyLoading')); - this.pushView(); - }.observes('controller.selectedService') + this.pushViewAfterRecommendation(); + }.observes('controller.selectedService'), + + pushViewAfterRecommendation: function() { + if (this.get('controller.isRecommendedLoaded')) { + this.pushView(); + } else { + Em.run.later(this.pushViewAfterRecommendation.bind(this), 300); + } + } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/76aa496c/ambari-web/test/views/common/configs/service_config_container_view_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/views/common/configs/service_config_container_view_test.js b/ambari-web/test/views/common/configs/service_config_container_view_test.js index e7aaa62..c5fe88a 100644 --- a/ambari-web/test/views/common/configs/service_config_container_view_test.js +++ b/ambari-web/test/views/common/configs/service_config_container_view_test.js @@ -45,7 +45,8 @@ describe('App.ServiceConfigContainerView', function () { selectedService: { configCategories: [], configs: [] - } + }, + isRecommendedLoaded: true })); expect(view.get('childViews')).to.have.length(1); }); @@ -56,7 +57,8 @@ describe('App.ServiceConfigContainerView', function () { selectedService: { configCategories: [], configs: [] - } + }, + isRecommendedLoaded: true })); expect(view.get('childViews.firstObject.controller.name')).to.equal('controller'); }); @@ -66,7 +68,8 @@ describe('App.ServiceConfigContainerView', function () { selectedService: { configCategories: [Em.Object.create(), Em.Object.create()], configs: [] - } + }, + isRecommendedLoaded: true })); expect(view.get('childViews.firstObject.serviceConfigsByCategoryView.childViews')).to.have.length(2); });
