Return-Path: X-Original-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 697CD10ECA for ; Thu, 21 Nov 2013 15:15:37 +0000 (UTC) Received: (qmail 60082 invoked by uid 500); 21 Nov 2013 15:15:36 -0000 Delivered-To: apmail-incubator-ambari-commits-archive@incubator.apache.org Received: (qmail 60000 invoked by uid 500); 21 Nov 2013 15:15:32 -0000 Mailing-List: contact ambari-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@incubator.apache.org Delivered-To: mailing list ambari-commits@incubator.apache.org Received: (qmail 59993 invoked by uid 99); 21 Nov 2013 15:15:31 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Nov 2013 15:15:31 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id CFE7289B244; Thu, 21 Nov 2013 15:15:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: onechiporenko@apache.org To: ambari-commits@incubator.apache.org Message-Id: <7648664e7db24784a9dd51c69a614704@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: AMBARI-3843. "Customize Services" step. Services tabs. (onechiporenko) Date: Thu, 21 Nov 2013 15:15:30 +0000 (UTC) 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 Authored: Thu Nov 21 17:09:27 2013 +0200 Committer: Oleg Nechiporenko 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([ - '
{{view.message}}
', - '
', - '
', - '
    ', - '{{#each val in view.customConfig}}', - '{{#if val.siteProperties}}', - '
  • ', - '{{val.serviceName}}', - '
      ', - '{{#each item in val.siteProperties}}', - '
    • ', - '{{item.displayMsg}}', - '
    • ', - '{{/each}}', - '
    ', - '
  • ', - '{{/if}}', - '{{/each}}', - '
', - '
' - ].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}} - {{service.displayName}}{{#if service.errorCount}}{{service.errorCount}}{{/if}} 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. +}} + +
{{view.message}}
+
+
+
    + {{#each val in view.customConfig}} + {{#if val.siteProperties}} +
  • + {{val.serviceName}} +
      + {{#each item in val.siteProperties}} +
    • + {{item.displayMsg}} +
    • + {{/each}} +
    +
  • + {{/if}} + {{/each}} +
+
\ 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'); + }); + } });