incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From onechipore...@apache.org
Subject git commit: AMBARI-3843. "Customize Services" step. Services tabs. (onechiporenko)
Date Thu, 21 Nov 2013 15:15:30 GMT
Updated Branches:
  refs/heads/trunk 852b51c4b -> 3b784aba3


AMBARI-3843. "Customize Services" step. Services tabs. (onechiporenko)


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

Branch: refs/heads/trunk
Commit: 3b784aba365d4e952a26b0d231d66a78ab75058a
Parents: 852b51c
Author: Oleg Nechiporenko <cv_github@yahoo.com>
Authored: Thu Nov 21 17:09:27 2013 +0200
Committer: Oleg Nechiporenko <cv_github@yahoo.com>
Committed: Thu Nov 21 17:15:22 2013 +0200

----------------------------------------------------------------------
 .../app/controllers/wizard/step7_controller.js  | 31 +++++-----------
 ambari-web/app/styles/application.less          |  3 ++
 .../common/configs/services_config.hbs          |  2 +-
 .../wizard/step7_custom_config_error.hbs        | 38 ++++++++++++++++++++
 ambari-web/app/views/wizard/step7_view.js       | 18 +++++++++-
 5 files changed, 68 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/3b784aba/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 edee875..a0b5252 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -99,6 +99,14 @@ App.WizardStep7Controller = Em.Controller.extend({
     };
     //STEP 6: Distribute configs by service and wrap each one in App.ServiceConfigProperty
(configs -> serviceConfigs)
     var serviceConfigs = App.config.renderConfigs(configs, storedConfigs, this.get('allInstalledServiceNames'),
this.get('selectedServiceNames'), localDB);
+    if (this.get('wizardController.name') === 'addServiceController') {
+      serviceConfigs.setEach('showConfig', true);
+      serviceConfigs.setEach('selected', false);
+      this.get('selectedServiceNames').forEach(function(serviceName) {
+        serviceConfigs.findProperty('serviceName', serviceName).set('selected', true);
+      });
+    }
+
     this.set('stepConfigs', serviceConfigs);
     this.activateSpecialConfigs();
     this.set('selectedService', this.get('stepConfigs').filterProperty('showConfig', true).objectAt(0));
@@ -177,28 +185,7 @@ App.WizardStep7Controller = Em.Controller.extend({
 
         }.property('customConfig.@each.siteProperties.@each.siteProperty'),
         customConfig: customConfig,
-        template: Ember.Handlebars.compile([
-          '<h5>{{view.message}}</h5>',
-          '<br/>',
-          '<div class="pre-scrollable" style="max-height: 250px;">',
-          '<ul>',
-          '{{#each val in view.customConfig}}',
-          '{{#if val.siteProperties}}',
-          '<li>',
-          '{{val.serviceName}}',
-          '<ul>',
-          '{{#each item in  val.siteProperties}}',
-          '<li>',
-          '{{item.displayMsg}}',
-          '</li>',
-          '{{/each}}',
-          '</ul>',
-          '</li>',
-          '{{/if}}',
-          '{{/each}}',
-          '</ul>',
-          '</div>'
-        ].join('\n'))
+        templateName: require('templates/wizard/step7_custom_config_error')
       })
     });
   },

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/3b784aba/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 2542d5a..7e2c337 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -759,6 +759,9 @@ h1 {
   .nav-tabs > li > a {
     padding-left: 8px;
     padding-right: 8px;
+    &.new {
+      font-weight: 700;
+    }
   }
   .with-unit{
     input{

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/3b784aba/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 98992e3..790c6c4 100644
--- a/ambari-web/app/templates/common/configs/services_config.hbs
+++ b/ambari-web/app/templates/common/configs/services_config.hbs
@@ -20,7 +20,7 @@
   {{#each service in controller.stepConfigs}}
     {{#if service.showConfig}}
       {{#view App.ServiceConfigTab}}
-        <a class="active" href="#{{unbound service.serviceName}}"
+        <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>

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/3b784aba/ambari-web/app/templates/wizard/step7_custom_config_error.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step7_custom_config_error.hbs b/ambari-web/app/templates/wizard/step7_custom_config_error.hbs
new file mode 100644
index 0000000..085070c
--- /dev/null
+++ b/ambari-web/app/templates/wizard/step7_custom_config_error.hbs
@@ -0,0 +1,38 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+<h5>{{view.message}}</h5>
+<br />
+<div class="pre-scrollable" style="max-height: 250px;">
+  <ul>
+    {{#each val in view.customConfig}}
+      {{#if val.siteProperties}}
+        <li>
+          {{val.serviceName}}
+            <ul>
+              {{#each item in val.siteProperties}}
+                <li>
+                  {{item.displayMsg}}
+                </li>
+              {{/each}}
+            </ul>
+        </li>
+      {{/if}}
+    {{/each}}
+  </ul>
+</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/3b784aba/ambari-web/app/views/wizard/step7_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/wizard/step7_view.js b/ambari-web/app/views/wizard/step7_view.js
index a715912..326f441 100644
--- a/ambari-web/app/views/wizard/step7_view.js
+++ b/ambari-web/app/views/wizard/step7_view.js
@@ -21,6 +21,22 @@ var App = require('app');
 
 App.WizardStep7View = Em.View.extend({
 
-  templateName: require('templates/wizard/step7')
+  templateName: require('templates/wizard/step7'),
+
+  didInsertElement: function() {
+    var self = this;
+    Em.run.next(function() {
+      var tabs = self.get('controller.stepConfigs').filterProperty('showConfig', true).mapProperty('serviceName');
+      var selectedServiceNames = self.get('controller.selectedServiceNames');
+      var tabIndex = 0;
+      for (var i = 0; i < tabs.length; i++) {
+        if (selectedServiceNames.contains(tabs[i])) {
+          tabIndex = i;
+          break;
+        }
+      }
+      $('.nav-tabs li:eq(' + tabIndex + ') a').trigger('click');
+    });
+  }
 
 });


Mime
View raw message