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/11 20:14:20 UTC

svn commit: r1467028 - in /incubator/ambari/trunk: CHANGES.txt ambari-web/app/messages.js ambari-web/app/views/common/quick_view_link_view.js

Author: yusaku
Date: Thu Apr 11 18:14:20 2013
New Revision: 1467028

URL: http://svn.apache.org/r1467028
Log:
AMBARI-1879. Show error message when hostname is undefined for quick_links. (yusaku)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/messages.js
    incubator/ambari/trunk/ambari-web/app/views/common/quick_view_link_view.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1467028&r1=1467027&r2=1467028&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Thu Apr 11 18:14:20 2013
@@ -241,6 +241,9 @@ Trunk (unreleased changes):
 
  IMPROVEMENTS
 
+ AMBARI-1879. Show error message when hostname is undefined for quick_links.
+ (yusaku)
+
  AMBARI-1877. Reassign Master Wizard, Step 2: prevent proceed next without
  changing target host. (yusaku)
 

Modified: incubator/ambari/trunk/ambari-web/app/messages.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/messages.js?rev=1467028&r1=1467027&r2=1467028&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/messages.js (original)
+++ incubator/ambari/trunk/ambari-web/app/messages.js Thu Apr 11 18:14:20 2013
@@ -1091,6 +1091,10 @@ Em.I18n.translations = {
   'common.combobox.placeholder': 'Filter...',
   'common.combobox.dropdown.1': 'Overridden properties',
   'common.combobox.dropdown.2': 'Modified properties',
-  'common.combobox.dropdown.3': 'Properties needing restart'
+  'common.combobox.dropdown.3': 'Properties needing restart',
+
+  'quick.links.error.label': 'Hostname is undefined',
+
+  'contact.administrator': 'Contact System Administrator for more information!'
 
 };
\ No newline at end of file

Modified: incubator/ambari/trunk/ambari-web/app/views/common/quick_view_link_view.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/common/quick_view_link_view.js?rev=1467028&r1=1467027&r2=1467028&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/common/quick_view_link_view.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/common/quick_view_link_view.js Thu Apr 11 18:14:20 2013
@@ -23,8 +23,6 @@ App.QuickViewLinks = Em.View.extend({
   /**
    * Updated quick links. Here we put correct hostname to url
    */
-  errorFlag: false,
-
   quickLinks: function () {
     var serviceName = this.get('content.serviceName');
     var components = this.get('content.hostComponents');
@@ -35,15 +33,18 @@ App.QuickViewLinks = Em.View.extend({
     } else if (serviceName === 'MAPREDUCE') {
       host = components.findProperty('componentName', 'JOBTRACKER').get('host.publicHostName');
     } else if (serviceName === 'HBASE') {
-      if (components.filterProperty('componentName', 'HBASE_MASTER').someProperty('haStatus', 'active')) {
-        host = components.filterProperty('componentName', 'HBASE_MASTER').findProperty('haStatus', 'active').get('host.publicHostName');
-      }
-      else {
-        this.set('errorFlag', true);
+      var component = components.filterProperty('componentName', 'HBASE_MASTER').findProperty('haStatus', 'active');
+      if(component){
+        host = component.get('host.publicHostName');
       }
     }
     if (!host) {
-      return [];
+      return [
+        {
+          label: this.t('quick.links.error.label'),
+          url: 'javascript:alert("' + this.t('contact.administrator') + '");return false;'
+        }
+      ];
     }
     return this.get('content.quickLinks').map(function (item) {
       if (item.get('url')) {