You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2014/09/02 22:29:37 UTC

[03/15] git commit: AMBARI-7110 Customize Services page: spinner missing. (ababiichuk)

AMBARI-7110 Customize Services page: spinner missing. (ababiichuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f853f1c7
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f853f1c7
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f853f1c7

Branch: refs/heads/branch-alerts-dev
Commit: f853f1c76e2f4af5936f935735a7660010eccf0b
Parents: 6738d3d
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Tue Sep 2 16:09:50 2014 +0300
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Tue Sep 2 16:09:50 2014 +0300

----------------------------------------------------------------------
 .../controllers/main/service/info/configs.js    |  1 +
 .../app/controllers/wizard/step7_controller.js  | 28 ++++++---------
 .../common/configs/services_config.hbs          | 37 +++++++++++---------
 .../main/service/info/config_test.js            |  8 ++---
 4 files changed, 37 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f853f1c7/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index 4ffe244..e8cc813 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -25,6 +25,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
   name: 'mainServiceInfoConfigsController',
   isHostsConfigsPage: false,
   forceTransition: false,
+  isRecommendedLoaded: true,
   dataIsLoaded: false,
   stepConfigs: [], //contains all field properties that are viewed in this service
   selectedService: null,

http://git-wip-us.apache.org/repos/asf/ambari/blob/f853f1c7/ambari-web/app/controllers/wizard/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js
index 809a9ee..9ab5c5a 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -43,6 +43,7 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, {
 
   slaveHostToGroup: null,
 
+  isRecommendedLoaded: false,
   /**
    * used in services_config.js view to mark a config with security icon
    */
@@ -232,6 +233,8 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, {
    * @method clearStep
    */
   clearStep: function () {
+    this.set('isSubmitDisabled', true);
+    this.set('isRecommendedLoaded', false);
     this.get('stepConfigs').clear();
     this.set('filter', '');
     this.get('filterColumns').setEach('selected', false);
@@ -721,25 +724,16 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, {
     }
     //STEP 6: Distribute configs by service and wrap each one in App.ServiceConfigProperty (configs -> serviceConfigs)
     var self = this;
-    if (App.get('supports.serverRecommendValidate')) {
-      this.loadServerSideConfigsRecommendations().always(function() {
-        self.setStepConfigs(configs, storedConfigs);
-        self.checkHostOverrideInstaller();
-        self.activateSpecialConfigs();
-        self.selectProperService();
-        if (self.get('content.skipConfigStep')) {
-          App.router.send('next');
-        }
-      });
-    } else {
-      this.setStepConfigs(configs, storedConfigs);
-      this.checkHostOverrideInstaller();
-      this.activateSpecialConfigs();
-      this.selectProperService();
-      if (this.get('content.skipConfigStep')) {
+    this.loadServerSideConfigsRecommendations().always(function() {
+      self.set('isRecommendedLoaded', true);
+      self.setStepConfigs(configs, storedConfigs);
+      self.checkHostOverrideInstaller();
+      self.activateSpecialConfigs();
+      self.selectProperService();
+      if (self.get('content.skipConfigStep')) {
         App.router.send('next');
       }
-    }
+    });
   },
   /**
    * If <code>App.supports.hostOverridesInstaller</code> is enabled should load config groups

http://git-wip-us.apache.org/repos/asf/ambari/blob/f853f1c7/ambari-web/app/templates/common/configs/services_config.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/services_config.hbs b/ambari-web/app/templates/common/configs/services_config.hbs
index 5030566..67cef63 100644
--- a/ambari-web/app/templates/common/configs/services_config.hbs
+++ b/ambari-web/app/templates/common/configs/services_config.hbs
@@ -15,21 +15,26 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 }}
-
-<ul class="nav nav-tabs">
-  {{#each service in controller.stepConfigs}}
-    {{#if service.showConfig}}
-      {{#view App.ServiceConfigTab}}
-        <a href="#{{unbound service.serviceName}}" {{bindAttr class=":active service.selected:new"}}
-           data-toggle="tab" {{action selectService service target="view"}}>
-          {{service.displayName}}{{#if service.errorCount}}<span
-                class="badge badge-important">{{service.errorCount}}</span>{{/if}}</a>
-      {{/view}}
-    {{/if}}
-  {{/each}}
-</ul>
+{{#if controller.isRecommendedLoaded}}
+    <ul class="nav nav-tabs">
+      {{#each service in controller.stepConfigs}}
+        {{#if service.showConfig}}
+          {{#view App.ServiceConfigTab}}
+              <a href="#{{unbound service.serviceName}}" {{bindAttr class=":active service.selected:new"}}
+                 data-toggle="tab" {{action selectService service target="view"}}>
+                {{service.displayName}}{{#if service.errorCount}}<span
+                      class="badge badge-important">{{service.errorCount}}</span>{{/if}}</a>
+          {{/view}}
+        {{/if}}
+      {{/each}}
+    </ul>
+{{else}}
+    <div class="spinner"></div>
+{{/if}}
 {{view App.ServiceConfigContainerView}}
-<p class="loading align-center"></p>
-{{#if isSubmitDisabled}}
-  <div class="alert">{{t installer.step7.attentionNeeded}}</div>
+{{#if controller.isRecommendedLoaded}}
+    <p class="loading align-center"></p>
+    {{#if isSubmitDisabled}}
+        <div class="alert">{{t installer.step7.attentionNeeded}}</div>
+    {{/if}}
 {{/if}}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f853f1c7/ambari-web/test/controllers/main/service/info/config_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service/info/config_test.js b/ambari-web/test/controllers/main/service/info/config_test.js
index 600ae42..56f0aeb 100644
--- a/ambari-web/test/controllers/main/service/info/config_test.js
+++ b/ambari-web/test/controllers/main/service/info/config_test.js
@@ -382,14 +382,14 @@ describe("App.MainServiceInfoConfigsController", function () {
 
   describe("#doCancel", function () {
     beforeEach(function () {
-      sinon.stub(mainServiceInfoConfigsController, "loadStep", Em.K);
+      sinon.stub(Em.run, 'once', Em.K);
     });
     afterEach(function () {
-      mainServiceInfoConfigsController.loadStep.restore();
+      Em.run.once.restore();
     });
-    it("trigger loadStep", function () {
+    it("trigger onConfigGroupChange", function () {
       mainServiceInfoConfigsController.doCancel();
-      expect(mainServiceInfoConfigsController.loadStep.calledOnce).to.equal(true);
+      expect(Em.run.once.calledWith(mainServiceInfoConfigsController, "onConfigGroupChange")).to.equal(true);
     });
   });