Forráskód Böngészése

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

Xi Wang 11 éve
szülő
commit
b98d660ed3

+ 3 - 0
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 {

+ 7 - 1
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">

+ 16 - 4
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