Repository: ambari
Updated Branches:
  refs/heads/trunk 7ac9c5483 -> 5f079eb32


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/5f079eb3
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5f079eb3
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5f079eb3

Branch: refs/heads/trunk
Commit: 5f079eb32cd752a260290310c74efe7a0d9592d7
Parents: 7ac9c54
Author: Richard Zang <[email protected]>
Authored: Wed Jul 20 16:35:56 2016 -0700
Committer: Richard Zang <[email protected]>
Committed: Wed Jul 20 16:35:56 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/5f079eb3/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/5f079eb3/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);
     });

Reply via email to