Просмотр исходного кода

AMBARI-2692. Disable Show report for 0 issues. (Aleksandr Kovalenko via yusaku)

Yusaku Sako 12 лет назад
Родитель
Сommit
960e23825a

+ 4 - 1
ambari-web/app/controllers/wizard/step3_controller.js

@@ -932,8 +932,11 @@ App.WizardStep3Controller = Em.Controller.extend({
           return this.get('warningsByHost').mapProperty('name');
         }.property('warningsByHost'),
         category: 'All Hosts',
+        categoryWarnings: function () {
+          return this.get('warningsByHost').findProperty('name', this.get('category')).warnings
+        }.property('warningsByHost', 'category'),
         content: function () {
-          var categoryWarnings = this.get('warningsByHost').findProperty('name', this.get('category')).warnings;
+          var categoryWarnings = this.get('categoryWarnings');
           return [
             Ember.Object.create({
               warnings: categoryWarnings.filterProperty('category', 'processes'),

+ 2 - 0
ambari-web/app/templates/wizard/step3_host_warnings_popup.hbs

@@ -31,11 +31,13 @@
               selectionBinding="view.category"
               }}
     </div>
+    {{#if view.categoryWarnings.length}}
     <div class="span3 offset2">
       <a href="javascript.void(0)" title="Show Details" {{action openWarningsInDialog target="view"}}
          class="task-detail-open-dialog"><i
               class="icon-external-link"></i> {{t installer.step3.hostWarningsPopup.report}}</a>
     </div>
+    {{/if}}
   </div>
   <div class="accordion warnings-list" id="accordion2">
     {{#each category in view.content}}