AMBARI-3843. "Customize Services" step. Services tabs. (onechiporenko)
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 @@
     };
     //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 @@
 
         }.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')
       })
     });
   },
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 @@
   .nav-tabs > li > a {
     padding-left: 8px;
     padding-right: 8px;
+    &.new {
+      font-weight: 700;
+    }
   }
   .with-unit{
     input{
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>
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
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 @@
 
 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');
+    });
+  }
 
 });