You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by xi...@apache.org on 2013/11/11 22:57:46 UTC

[3/5] git commit: AMBARI-3710. Can't tell repo error when collapsed in wizard step 1(xiwang)

AMBARI-3710. Can't tell repo error when collapsed in wizard step 1(xiwang)


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

Branch: refs/heads/trunk
Commit: b98d660ed3d3ab34f726589aca02fb92423bccff
Parents: 3ab690f
Author: Xi Wang <xi...@apache.org>
Authored: Wed Nov 6 18:35:12 2013 -0800
Committer: Xi Wang <xi...@apache.org>
Committed: Mon Nov 11 13:57:24 2013 -0800

----------------------------------------------------------------------
 ambari-web/app/styles/application.less    |  3 +++
 ambari-web/app/templates/wizard/step1.hbs |  8 +++++++-
 ambari-web/app/views/wizard/step1_view.js | 20 ++++++++++++++++----
 3 files changed, 26 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/b98d660e/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 45edd97..3566da1 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -4767,6 +4767,9 @@ i.icon-asterisks {
 #advancedRepoAccordion{
   .accordion-heading {
     background-color: #f0f0f0;
+    a:hover {
+      text-decoration: none;;
+    }
   }
   .accordion-body {
     .table thead {

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/b98d660e/ambari-web/app/templates/wizard/step1.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step1.hbs b/ambari-web/app/templates/wizard/step1.hbs
index 4b038e7..32c644a 100644
--- a/ambari-web/app/templates/wizard/step1.hbs
+++ b/ambari-web/app/templates/wizard/step1.hbs
@@ -31,7 +31,13 @@
   <div class="accordion-group">
     <div class="accordion-heading" {{action "onToggleBlock" target="view"}}>
       <i {{bindAttr class=":pull-left :accordion-toggle view.isRLCollapsed:icon-caret-right:icon-caret-down"}}></i>
-      <a class="accordion-toggle">{{t installer.step1.advancedRepo.title}}</a>
+      <a class="accordion-toggle">
+        {{t installer.step1.advancedRepo.title}}
+        {{#if view.isSubmitDisabled}}
+          <span class="badge badge-important">{{view.totalErrorCnt}}</span>
+        {{/if}}
+      </a>
+
     </div>
       <div  class="accordion-body collapse in">
         <div class="accordion-inner">

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/b98d660e/ambari-web/app/views/wizard/step1_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/wizard/step1_view.js b/ambari-web/app/views/wizard/step1_view.js
index 5ffbdb6..6000428 100644
--- a/ambari-web/app/views/wizard/step1_view.js
+++ b/ambari-web/app/views/wizard/step1_view.js
@@ -50,15 +50,27 @@ App.WizardStep1View = Em.View.extend({
     return (this.get('allRepositoriesGroup').filterProperty('empty-error', true).length != 0);
   }.property('allRepositoriesGroup.@each.empty-error'),
   isSubmitDisabled: function() {
-    return this.get('emptyRepoExist') || this.get('allRepoUnchecked') ;
-  }.property('emptyRepoExist', 'allRepoUnchecked'),
+    return this.get('emptyRepoExist') || this.get('allRepoUnchecked') || this.get('invalidUrlExist') ;
+  }.property('emptyRepoExist', 'allRepoUnchecked', 'invalidUrlExist'),
   invalidUrlExist: function () {
     var selectedStack = this.get('controller.content.stacks').findProperty('isSelected', true);
-    return (selectedStack.get('invalidCnt') > 0);
-  }.property('controller.content.stacks.@each.invalidCnt'),
+    var invalidExist = this.get('allRepositoriesGroup').filterProperty('validation', 'icon-remove').length != 0;
+    return (selectedStack.get('invalidCnt') > 0) && invalidExist;
+  }.property('controller.content.stacks.@each.invalidCnt', 'allRepositoriesGroup.@each.validation'),
   allRepoUnchecked: function () {
     return (!this.get('allRepositoriesGroup').filterProperty('checked', true).length);
   }.property('allRepositoriesGroup.@each.checked'),
+  totalErrorCnt: function () {
+    var emptyCnt = this.get('allRepositoriesGroup').filterProperty('empty-error', true).length;
+    var invalidCnt = this.get('allRepositoriesGroup').filterProperty('validation', 'icon-remove').length;
+    if (this.get('allRepoUnchecked')) {
+      return 1;
+    } else if ( emptyCnt || invalidCnt) {
+      return emptyCnt + invalidCnt;
+    } else {
+      return 0;
+    }
+  }.property('allRepositoriesGroup.@each.empty-error', 'allRepoUnchecked', 'allRepositoriesGroup.@each.validation'),
 
   /**
    * Onclick handler for Config Group Header. Used to show/hide block