You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2013/04/25 01:41:10 UTC

svn commit: r1471780 - in /incubator/ambari/trunk: CHANGES.txt ambari-web/app/models/service.js ambari-web/app/templates/main/service/item.hbs ambari-web/app/views/main/service/item.js

Author: yusaku
Date: Wed Apr 24 23:41:07 2013
New Revision: 1471780

URL: http://svn.apache.org/r1471780
Log:
AMBARI-2016. Hide Maintenance pulldown if no operation can be performed. (yusaku)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/models/service.js
    incubator/ambari/trunk/ambari-web/app/templates/main/service/item.hbs
    incubator/ambari/trunk/ambari-web/app/views/main/service/item.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1471780&r1=1471779&r2=1471780&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Wed Apr 24 23:41:07 2013
@@ -789,6 +789,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-2016. Hide Maintenance pulldown if no operation can be performed.
+ (yusaku)
+
  AMBARI-2015. Host component start/stop causes "Uncaught TypeError: Cannot call
  method 'call' of undefined". (yusaku)
 

Modified: incubator/ambari/trunk/ambari-web/app/models/service.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/models/service.js?rev=1471780&r1=1471779&r2=1471780&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/models/service.js (original)
+++ incubator/ambari/trunk/ambari-web/app/models/service.js Wed Apr 24 23:41:07 2013
@@ -99,25 +99,6 @@ App.Service = DS.Model.extend({
       components.everyProperty('workStatus', App.HostComponentStatus.started)
     );
   },
-
-  isMaintained: function () {
-    var maintainedServices = [
-      "HDFS",
-      "MAPREDUCE",
-      "HBASE",
-      "OOZIE",
-      "GANGLIA",
-      "NAGIOS",
-      "HIVE",
-      "WEBHCAT",
-      "ZOOKEEPER",
-      "PIG",
-      "SQOOP",
-      "HUE"
-    ];
-    return maintainedServices.contains(this.get('serviceName'));
-  }.property('serviceName'),
-
   isConfigurable: function () {
     var configurableServices = [
       "HDFS",

Modified: incubator/ambari/trunk/ambari-web/app/templates/main/service/item.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/service/item.hbs?rev=1471780&r1=1471779&r2=1471780&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/service/item.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/service/item.hbs Wed Apr 24 23:41:07 2013
@@ -19,21 +19,21 @@
 {{view App.MainServiceInfoMenuView configTabBinding="view.hasConfigTab"}}
 {{#if App.isAdmin}}
 <div class="service-button">
-  {{#if view.hasMaintenanceControl}}
-  <div class="btn-group display-inline-block">
-    <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
-      {{t services.service.actions.maintenance}}
-      <span class="caret"></span>
-    </a>
-    <ul class="dropdown-menu">
-      <!-- dropdown menu links -->
-      {{#each option in view.maintenance}}
-      <li {{bindAttr class="controller.content.isStopDisabled:disabled"}}>
-        <a {{action "doAction" option target="controller" href=true}}>{{option.label}}</a>
-      </li>
-      {{/each}}
-    </ul>
-  </div>
+  {{#if view.isMaintenanceActive}}
+    <div class="btn-group display-inline-block">
+      <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+        {{t services.service.actions.maintenance}}
+        <span class="caret"></span>
+      </a>
+      <ul class="dropdown-menu">
+        <!-- dropdown menu links -->
+        {{#each option in view.maintenance}}
+        <li {{bindAttr class="controller.content.isStopDisabled:disabled"}}>
+          <a {{action "doAction" option target="controller" href=true}}>{{option.label}}</a>
+        </li>
+        {{/each}}
+      </ul>
+    </div>
   {{/if}}
   <a href="javascript:void(null)" {{bindAttr class=":btn controller.content.isStartDisabled:disabled:btn-success" }}
      data-toggle="modal" {{action "startService" target="controller"}}>

Modified: incubator/ambari/trunk/ambari-web/app/views/main/service/item.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/service/item.js?rev=1471780&r1=1471779&r2=1471780&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/service/item.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/service/item.js Wed Apr 24 23:41:07 2013
@@ -65,9 +65,9 @@ App.MainServiceItemView = Em.View.extend
     }
     return options;
   }.property('controller.content'),
-  hasMaintenanceControl: function(){
-    return this.get("controller.content.isMaintained");
-  }.property('controller.content.isMaintained'),
+  isMaintenanceActive: function() {
+    return this.get('maintenance').length !== 0;
+  }.property('maintenance'),
   hasConfigTab: function(){
     return this.get("controller.content.isConfigurable");
   }.property('controller.content.isConfigurable')