ソースを参照

AMBARI-15394. Add second parameter to App.format.role. (Joe Wang via xiwang)

Xi Wang 9 年 前
コミット
c17e227cb6
58 ファイル変更124 行追加112 行削除
  1. 2 2
      ambari-web/app/controllers/global/background_operations_controller.js
  2. 1 1
      ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/step3_controller.js
  3. 1 1
      ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step4_controller.js
  4. 1 1
      ambari-web/app/controllers/main/admin/highAvailability/hawq/removeStandby/step3_controller.js
  5. 1 1
      ambari-web/app/controllers/main/admin/highAvailability/nameNode/step5_controller.js
  6. 3 3
      ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
  7. 1 1
      ambari-web/app/controllers/main/admin/highAvailability/rangerAdmin/step4_controller.js
  8. 1 1
      ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js
  9. 1 1
      ambari-web/app/controllers/main/admin/kerberos/step3_controller.js
  10. 2 2
      ambari-web/app/controllers/main/admin/service_auto_start.js
  11. 2 2
      ambari-web/app/controllers/main/alerts/manage_alert_groups_controller.js
  12. 1 1
      ambari-web/app/controllers/main/charts/heatmap.js
  13. 1 1
      ambari-web/app/controllers/main/host.js
  14. 3 3
      ambari-web/app/controllers/main/host/details.js
  15. 1 1
      ambari-web/app/controllers/main/service/add_controller.js
  16. 6 6
      ambari-web/app/controllers/main/service/item.js
  17. 2 2
      ambari-web/app/controllers/main/service/manage_config_groups_controller.js
  18. 2 2
      ambari-web/app/controllers/main/service/reassign/step4_controller.js
  19. 1 1
      ambari-web/app/controllers/main/service/reassign/step6_controller.js
  20. 3 3
      ambari-web/app/controllers/wizard.js
  21. 1 1
      ambari-web/app/controllers/wizard/step10_controller.js
  22. 2 2
      ambari-web/app/controllers/wizard/step6_controller.js
  23. 1 1
      ambari-web/app/controllers/wizard/step8_controller.js
  24. 2 2
      ambari-web/app/controllers/wizard/step9_controller.js
  25. 1 1
      ambari-web/app/mappers/configs/config_groups_mapper.js
  26. 1 1
      ambari-web/app/mappers/service_metrics_mapper.js
  27. 1 1
      ambari-web/app/mixins/common/configs/configs_saver.js
  28. 1 1
      ambari-web/app/mixins/main/host/details/host_components/decommissionable.js
  29. 1 1
      ambari-web/app/mixins/main/service/configs/config_overridable.js
  30. 1 1
      ambari-web/app/mixins/wizard/assign_master_components.js
  31. 1 1
      ambari-web/app/mixins/wizard/wizardProgressPageController.js
  32. 1 1
      ambari-web/app/models/alerts/alert_definition.js
  33. 1 1
      ambari-web/app/models/configs/service_config_version.js
  34. 2 2
      ambari-web/app/models/root_service.js
  35. 1 1
      ambari-web/app/models/service.js
  36. 1 1
      ambari-web/app/models/stack_service.js
  37. 2 2
      ambari-web/app/utils/batch_scheduled_requests.js
  38. 4 3
      ambari-web/app/utils/ember_computed.js
  39. 29 22
      ambari-web/app/utils/helper.js
  40. 1 1
      ambari-web/app/utils/host_progress_popup.js
  41. 1 1
      ambari-web/app/views/common/rolling_restart_view.js
  42. 2 2
      ambari-web/app/views/main/admin/stack_upgrade/failed_hosts_modal_view.js
  43. 1 1
      ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js
  44. 1 1
      ambari-web/app/views/main/charts/heatmap/heatmap_host.js
  45. 1 1
      ambari-web/app/views/main/host.js
  46. 2 2
      ambari-web/app/views/main/host/combo_search_box.js
  47. 1 1
      ambari-web/app/views/main/host/hosts_table_menu_view.js
  48. 1 1
      ambari-web/app/views/main/host/summary.js
  49. 1 1
      ambari-web/app/views/main/service/info/configs.js
  50. 1 1
      ambari-web/app/views/main/service/info/summary.js
  51. 5 5
      ambari-web/app/views/main/service/item.js
  52. 1 1
      ambari-web/app/views/main/service/reassign/step4_view.js
  53. 1 1
      ambari-web/app/views/main/service/reassign/step6_view.js
  54. 1 1
      ambari-web/app/views/wizard/step6_view.js
  55. 1 1
      ambari-web/app/views/wizard/step9/hostLogPopupBody_view.js
  56. 1 1
      ambari-web/test/controllers/wizard/step4_test.js
  57. 5 3
      ambari-web/test/utils/ember_computed_test.js
  58. 6 4
      ambari-web/test/utils/helper_test.js

+ 2 - 2
ambari-web/app/controllers/global/background_operations_controller.js

@@ -338,11 +338,11 @@ App.BackgroundOperationsController = Em.Controller.extend({
           if (service === 'ALL_SERVICES') {
             parsedRequestContext = Em.I18n.t("requestInfo." + contextCommand.toLowerCase()).format(Em.I18n.t('common.allServices'));
           } else {
-            parsedRequestContext = Em.I18n.t("requestInfo." + contextCommand.toLowerCase()).format(App.format.role(service));
+            parsedRequestContext = Em.I18n.t("requestInfo." + contextCommand.toLowerCase()).format(App.format.role(service, true));
           }
           break;
         case "ROLLING-RESTART":
-          parsedRequestContext = Em.I18n.t("rollingrestart.rest.context").format(App.format.role(service), contextSplits[3], contextSplits[4]);
+          parsedRequestContext = Em.I18n.t("rollingrestart.rest.context").format(App.format.role(service, true), contextSplits[3], contextSplits[4]);
           break;
         }
       } else {

+ 1 - 1
ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/step3_controller.js

@@ -88,7 +88,7 @@ App.ActivateHawqStandbyWizardStep3Controller = App.HighAvailabilityProgressPageC
       data.items[0].properties[property.name] = property.value;
     });
 
-    var configData = this.reconfigureSites([params.type], data, Em.I18n.t('admin.addHawqStandby.step4.save.configuration.note').format(App.format.role('HAWQSTANDBY')));
+    var configData = this.reconfigureSites([params.type], data, Em.I18n.t('admin.addHawqStandby.step4.save.configuration.note').format(App.format.role('HAWQSTANDBY', false)));
 
     App.ajax.send({
       name: 'common.service.configurations',

+ 1 - 1
ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step4_controller.js

@@ -67,7 +67,7 @@ App.AddHawqStandbyWizardStep4Controller = App.HighAvailabilityProgressPageContro
       data.items[0].properties[property.name] = property.value;
     });
 
-    var configData = this.reconfigureSites([params.type], data, Em.I18n.t('admin.addHawqStandby.step4.save.configuration.note').format(App.format.role('HAWQSTANDBY')));
+    var configData = this.reconfigureSites([params.type], data, Em.I18n.t('admin.addHawqStandby.step4.save.configuration.note').format(App.format.role('HAWQSTANDBY', false)));
 
     App.ajax.send({
       name: 'common.service.configurations',

+ 1 - 1
ambari-web/app/controllers/main/admin/highAvailability/hawq/removeStandby/step3_controller.js

@@ -82,7 +82,7 @@ App.RemoveHawqStandbyWizardStep3Controller = App.HighAvailabilityProgressPageCon
   onLoadConfigs: function (data, opt, params) {
     delete data.items[0].properties['hawq_standby_address_host'];
 
-    var configData = this.reconfigureSites([params.type], data, Em.I18n.t('admin.removeHawqStandby.wizard.step3.save.configuration.note').format(App.format.role('HAWQSTANDBY')));
+    var configData = this.reconfigureSites([params.type], data, Em.I18n.t('admin.removeHawqStandby.wizard.step3.save.configuration.note').format(App.format.role('HAWQSTANDBY', false)));
 
     App.ajax.send({
       name: 'common.service.configurations',

+ 1 - 1
ambari-web/app/controllers/main/admin/highAvailability/nameNode/step5_controller.js

@@ -72,7 +72,7 @@ App.HighAvailabilityWizardStep5Controller = App.HighAvailabilityProgressPageCont
    */
   updateConfigProperties: function(data) {
     var siteNames = ['hdfs-site','core-site'];
-    var configData = this.reconfigureSites(siteNames, data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE')));
+    var configData = this.reconfigureSites(siteNames, data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE', false)));
     App.ajax.send({
       name: 'common.service.configurations',
       sender: this,

+ 3 - 3
ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js

@@ -90,7 +90,7 @@ App.HighAvailabilityWizardStep9Controller = App.HighAvailabilityProgressPageCont
 
   reconfigureHBase: function () {
     var data = this.get('content.serviceConfigProperties');
-    var configData = this.reconfigureSites(['hbase-site'], data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE')));
+    var configData = this.reconfigureSites(['hbase-site'], data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE', false)));
     App.ajax.send({
       name: 'common.service.configurations',
       sender: this,
@@ -104,7 +104,7 @@ App.HighAvailabilityWizardStep9Controller = App.HighAvailabilityProgressPageCont
 
   reconfigureAccumulo: function () {
     var data = this.get('content.serviceConfigProperties');
-    var configData = this.reconfigureSites(['accumulo-site'], data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE')));
+    var configData = this.reconfigureSites(['accumulo-site'], data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE', false)));
     App.ajax.send({
       name: 'common.service.configurations',
       sender: this,
@@ -120,7 +120,7 @@ App.HighAvailabilityWizardStep9Controller = App.HighAvailabilityProgressPageCont
     var data = this.get('content.serviceConfigProperties');
     var reconfigureFiles = ['hawq-site', 'hdfs-client'];
     reconfigureFiles.forEach(function (fileName) {
-      var configData = this.reconfigureSites([fileName], data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE')));
+      var configData = this.reconfigureSites([fileName], data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE', false)));
       App.ajax.send({
         name: 'common.service.configurations',
         sender: this,

+ 1 - 1
ambari-web/app/controllers/main/admin/highAvailability/rangerAdmin/step4_controller.js

@@ -64,7 +64,7 @@ App.RAHighAvailabilityWizardStep4Controller = App.HighAvailabilityProgressPageCo
 
   onLoadConfigs: function (data) {
     data.items.findProperty('type', 'admin-properties').properties['policymgr_external_url'] = this.get('content.loadBalancerURL');
-    var configData = this.reconfigureSites(['admin-properties'], data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('RANGER_ADMIN')));
+    var configData = this.reconfigureSites(['admin-properties'], data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('RANGER_ADMIN', false)));
 
     App.ajax.send({
       name: 'common.service.configurations',

+ 1 - 1
ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js

@@ -114,7 +114,7 @@ App.RMHighAvailabilityWizardStep4Controller = App.HighAvailabilityProgressPageCo
       data.items[0].properties[property.name] = property.value;
     });
 
-    var configData = this.reconfigureSites([params.type], data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('RESOURCEMANAGER')));
+    var configData = this.reconfigureSites([params.type], data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('RESOURCEMANAGER', false)));
 
     App.ajax.send({
       name: 'common.service.configurations',

+ 1 - 1
ambari-web/app/controllers/main/admin/kerberos/step3_controller.js

@@ -77,7 +77,7 @@ App.KerberosWizardStep3Controller = App.KerberosProgressPageController.extend({
       },
       'data': {
         'serviceName': this.serviceName,
-        'displayName': App.format.role(this.serviceName),
+        'displayName': App.format.role(this.serviceName, true),
         'actionName': this.serviceName + '_SERVICE_CHECK',
         'operationLevel': {
           "level": "CLUSTER",

+ 2 - 2
ambari-web/app/controllers/main/admin/service_auto_start.js

@@ -56,7 +56,7 @@ App.MainAdminServiceAutoStartController = Em.Controller.extend({
       if (serviceComponentInfo.total_count) {
         if (serviceComponentInfo.category === "MASTER" || serviceComponentInfo.category === "SLAVE") {
           var componentRecovery = Ember.Object.create({
-            display_name: App.format.role(serviceComponentInfo.component_name),
+            display_name: App.format.role(serviceComponentInfo.component_name, false),
             component_name: serviceComponentInfo.component_name,
             recovery_enabled: serviceComponentInfo.recovery_enabled === 'true',
             valueChanged: false,
@@ -69,7 +69,7 @@ App.MainAdminServiceAutoStartController = Em.Controller.extend({
           } else {
             services[serviceComponentInfo.service_name] = Ember.Object.create({
               service_name: serviceComponentInfo.service_name,
-              display_name: App.format.role(serviceComponentInfo.service_name),
+              display_name: App.format.role(serviceComponentInfo.service_name, true),
               headingClass: "." + serviceComponentInfo.service_name,
               isActive: false,
               tooltip: function () {

+ 2 - 2
ambari-web/app/controllers/main/alerts/manage_alert_groups_controller.js

@@ -373,14 +373,14 @@ App.ManageAlertGroupsController = Em.Controller.extend({
     var validComponents = App.StackServiceComponent.find().map(function (component) {
       return Em.Object.create({
         componentName: component.get('componentName'),
-        displayName: App.format.role(component.get('componentName')),
+        displayName: App.format.role(component.get('componentName'), false),
         selected: false
       });
     });
     var validServices = App.Service.find().map(function (service) {
       return Em.Object.create({
         serviceName: service.get('serviceName'),
-        displayName: App.format.role(service.get('serviceName')),
+        displayName: App.format.role(service.get('serviceName'), true),
         selected: false
       });
     });

+ 1 - 1
ambari-web/app/controllers/main/charts/heatmap.js

@@ -99,7 +99,7 @@ App.MainChartsHeatmapController = Em.Controller.extend(App.WidgetSectionMixin, {
         if (!category) {
           categories.pushObject(Em.Object.create({
             serviceName: _serviceName,
-            displayName: _serviceName === 'STACK' ? 'Host' : App.format.role(_serviceName),
+            displayName: _serviceName === 'STACK' ? 'Host' : App.format.role(_serviceName, true),
             heatmaps: [_heatmap]
           }));
         } else {

+ 1 - 1
ambari-web/app/controllers/main/host.js

@@ -503,7 +503,7 @@ App.MainHostController = Em.ArrayController.extend(App.TableServerMixin, {
   filterByComponent: function (component) {
     if (!component) return;
     var componentName = component.get('componentName');
-    var displayName = App.format.role(componentName);
+    var displayName = App.format.role(componentName, false);
     var colPropAssoc = this.get('colPropAssoc');
     var map = this.get('labelValueMap');
 

+ 3 - 3
ambari-web/app/controllers/main/host/details.js

@@ -643,7 +643,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
     if (subComponentNames && subComponentNames.length > 0) {
       var dns = [];
       subComponentNames.forEach(function (scn) {
-        dns.push(App.format.role(scn));
+        dns.push(App.format.role(scn, false));
       });
       displayName += " (" + dns.join(", ") + ")";
     }
@@ -993,7 +993,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
           "tag": tag,
           "properties": properties[site],
           "properties_attributes": group.properties_attributes[site],
-          "service_config_version_note": Em.I18n.t('hosts.host.configs.save.note').format(App.format.role(componentName))
+          "service_config_version_note": Em.I18n.t('hosts.host.configs.save.note').format(App.format.role(componentName, false))
         });
       }
       if (desiredConfigs.length > 0) {
@@ -2158,7 +2158,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
       componentsBody: Em.computed.i18nFormat('hosts.cant.do.popup.' + type + '.body', 'components.length'),
       componentsBodyEnd: function () {
         if (this.get('showBodyEnd')) {
-          return Em.I18n.t('hosts.cant.do.popup.' + type + '.body.end').format(App.get('components.decommissionAllowed').map(function(c){return App.format.role(c)}).join(", "));
+          return Em.I18n.t('hosts.cant.do.popup.' + type + '.body.end').format(App.get('components.decommissionAllowed').map(function(c){return App.format.role(c, false)}).join(", "));
         }
         return '';
       }.property(),

+ 1 - 1
ambari-web/app/controllers/main/service/add_controller.js

@@ -454,7 +454,7 @@ App.AddServiceController = App.WizardController.extend(App.AddSecurityConfigs, {
             sender: this,
             data: {
               query: queryStr,
-              context: 'Install ' + App.format.role(c.componentName),
+              context: 'Install ' + App.format.role(c.componentName, false),
               HostRoles: {
                 state: 'INSTALLED'
               },

+ 6 - 6
ambari-web/app/controllers/main/service/item.js

@@ -1073,7 +1073,7 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
    */
   servicesDisplayNames: function(serviceNames) {
     return serviceNames.map(function(serviceName) {
-      return App.format.role(serviceName);
+      return App.format.role(serviceName, true);
     }).join(',');
   },
 
@@ -1098,7 +1098,7 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
       interDependentServices = this.get('interDependentServices'),
       serviceNamesToDelete = this.get('serviceNamesToDelete'),
       dependentServices = this.findDependentServices(serviceNamesToDelete),
-      displayName = App.format.role(serviceName),
+      displayName = App.format.role(serviceName, true),
       popupHeader = Em.I18n.t('services.service.delete.popup.header'),
       dependentServicesToDeleteFmt = this.servicesDisplayNames(interDependentServices);
 
@@ -1143,11 +1143,11 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
    * @returns {App.ModalPopup}
    */
   dependentServicesWarning: function(origin, dependent) {
-    var body = Em.I18n.t('services.service.delete.popup.dependentServices').format(App.format.role(origin));
+    var body = Em.I18n.t('services.service.delete.popup.dependentServices').format(App.format.role(origin, true));
 
     body += '<ul>';
     dependent.forEach(function(serviceName) {
-      body += '<li>' + App.format.role(serviceName) + '</li>';
+      body += '<li>' + App.format.role(serviceName, true) + '</li>';
     });
     body += '</ul>';
 
@@ -1169,11 +1169,11 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
   confirmDeleteService: function (serviceName, dependentServiceNames, servicesToDeleteFmt) {
     var confirmKey = 'delete',
         self = this,
-        message = Em.I18n.t('services.service.confirmDelete.popup.body').format(App.format.role(serviceName), confirmKey);
+        message = Em.I18n.t('services.service.confirmDelete.popup.body').format(App.format.role(serviceName, true), confirmKey);
 
     if (dependentServiceNames.length > 0) {
       message = Em.I18n.t('services.service.confirmDelete.popup.body.dependent')
-                .format(App.format.role(serviceName), servicesToDeleteFmt, confirmKey);
+                .format(App.format.role(serviceName, true), servicesToDeleteFmt, confirmKey);
     }
 
     App.ModalPopup.show({

+ 2 - 2
ambari-web/app/controllers/main/service/manage_config_groups_controller.js

@@ -108,7 +108,7 @@ App.ManageConfigGroupsController = Em.Controller.extend(App.ConfigOverridable, {
     return App.StackServiceComponent.find().filterProperty('serviceName', this.get('serviceName')).map(function (component) {
       return Em.Object.create({
         componentName: component.get('componentName'),
-        displayName: App.format.role(component.get('componentName')),
+        displayName: App.format.role(component.get('componentName'), false),
         selected: false
       });
     });
@@ -306,7 +306,7 @@ App.ManageConfigGroupsController = Em.Controller.extend(App.ConfigOverridable, {
       host.host_components.forEach(function (hostComponent) {
         hostComponents.push(Em.Object.create({
           componentName: hostComponent.HostRoles.component_name,
-          displayName: App.format.role(hostComponent.HostRoles.component_name)
+          displayName: App.format.role(hostComponent.HostRoles.component_name, false)
         }));
       }, this);
       wrappedHosts.pushObject(Em.Object.create({

+ 2 - 2
ambari-web/app/controllers/main/service/reassign/step4_controller.js

@@ -351,7 +351,7 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
     var hostComponentsNames = '';
     this.get('hostComponents').forEach(function (comp, index) {
       hostComponentsNames += index ? '+' : '';
-      hostComponentsNames += comp === 'ZKFC' ? comp : App.format.role(comp);
+      hostComponentsNames += comp === 'ZKFC' ? comp : App.format.role(comp, false);
     }, this);
     return hostComponentsNames;
   },
@@ -791,7 +791,7 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
         type: _siteName,
         tag: tagName,
         properties: configs[_siteName],
-        service_config_version_note: Em.I18n.t('services.reassign.step4.save.configuration.note').format(App.format.role(componentName))
+        service_config_version_note: Em.I18n.t('services.reassign.step4.save.configuration.note').format(App.format.role(componentName, false))
       }
     });
     var allConfigData = [];

+ 1 - 1
ambari-web/app/controllers/main/service/reassign/step6_controller.js

@@ -44,7 +44,7 @@ App.ReassignMasterWizardStep6Controller = App.HighAvailabilityProgressPageContro
     var hostComponentsNames = '';
     this.get('hostComponents').forEach(function (comp, index) {
       hostComponentsNames += index ? '+' : '';
-      hostComponentsNames += comp === 'ZKFC' ? comp : App.format.role(comp);
+      hostComponentsNames += comp === 'ZKFC' ? comp : App.format.role(comp, false);
     }, this);
     var currentStep = App.router.get('reassignMasterController.currentStep');
     for (var i = 0; i < commands.length; i++) {

+ 3 - 3
ambari-web/app/controllers/wizard.js

@@ -119,7 +119,7 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, App.ThemesMappingM
       dbHosts[hostName].hostComponents.forEach(function (componentName) {
         hostComponents.push(Em.Object.create({
           componentName: componentName,
-          displayName: App.format.role(componentName)
+          displayName: App.format.role(componentName, false)
         }));
       });
       dbHosts[hostName].disk_info.forEach(function (disk) {
@@ -1033,7 +1033,7 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, App.ThemesMappingM
       var name = (componentName === 'HDFS_CLIENT') ? 'CLIENT' : componentName;
       var component = {
         componentName: name,
-        displayName: App.format.role(name),
+        displayName: App.format.role(name, false),
         hosts: [],
         isInstalled: true
       };
@@ -1052,7 +1052,7 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, App.ThemesMappingM
       hosts.setEach('isInstalled', false);
       result.push({
         componentName: component.get('componentName'),
-        displayName: App.format.role(component.get('componentName')),
+        displayName: App.format.role(component.get('componentName'), false),
         hosts: hosts,
         isInstalled: false
       })

+ 1 - 1
ambari-web/app/controllers/wizard/step10_controller.js

@@ -138,7 +138,7 @@ App.WizardStep10Controller = Em.Controller.extend({
             {Tst: 'TIMEDOUT', st: 'timedout'}
           ]).forEach(function (s) {
             _host.tasks.filterProperty('Tasks.status', s.Tst).forEach(function (_task) {
-              var statement = clusterState + App.format.role(_task.Tasks.role) + Em.I18n.t('installer.step10.taskStatus.failed') + _host.name;
+              var statement = clusterState + App.format.role(_task.Tasks.role, false) + Em.I18n.t('installer.step10.taskStatus.failed') + _host.name;
               self.get('clusterInfo').findProperty('id', 1).get('status').findProperty('id', 2).get('statements').pushObject(Em.Object.create({
                 status: s.st,
                 color: 'text-info',

+ 2 - 2
ambari-web/app/controllers/wizard/step6_controller.js

@@ -314,7 +314,7 @@ App.WizardStep6Controller = Em.Controller.extend(App.BlueprintMixin, {
         if (serviceComponent.get('isShownOnInstallerSlaveClientPage')) {
           headers.pushObject(Em.Object.create({
             name: serviceComponent.get('componentName'),
-            label: App.format.role(serviceComponent.get('componentName')),
+            label: App.format.role(serviceComponent.get('componentName'), false),
             allChecked: false,
             isRequired: serviceComponent.get('isRequired'),
             noChecked: true,
@@ -328,7 +328,7 @@ App.WizardStep6Controller = Em.Controller.extend(App.BlueprintMixin, {
     if (this.get('content.clients') && !!this.get('content.clients').length) {
       headers.pushObject(Em.Object.create({
         name: 'CLIENT',
-        label: App.format.role('CLIENT'),
+        label: App.format.role('CLIENT', false),
         allChecked: false,
         noChecked: true,
         isDisabled: false,

+ 1 - 1
ambari-web/app/controllers/wizard/step8_controller.js

@@ -446,7 +446,7 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz
           displayName = Em.I18n.t('common.clients')
         } else {
           // remove service name from component display name
-          displayName = App.format.role(component.get('componentName')).replace(new RegExp('^' + service.get('serviceName') + '\\s', 'i'), '');
+          displayName = App.format.role(component.get('componentName'), false).replace(new RegExp('^' + service.get('serviceName') + '\\s', 'i'), '');
         }
 
         var componentName = component.get('componentName');

+ 2 - 2
ambari-web/app/controllers/wizard/step9_controller.js

@@ -362,7 +362,7 @@ App.WizardStep9Controller = Em.Controller.extend(App.ReloadPopupMixin, {
    * @method displayMessage
    */
   displayMessage: function (task) {
-    var role = App.format.role(task.role);
+    var role = App.format.role(task.role, false);
     /* istanbul ignore next */
     switch (task.command) {
       case 'INSTALL':
@@ -1144,7 +1144,7 @@ App.WizardStep9Controller = Em.Controller.extend(App.ReloadPopupMixin, {
       var hostComponentObj = {hostName: host.Hosts.host_name};
       var componentArr = [];
       host.host_components.forEach(function (_hostComponent) {
-        var componentName = App.format.role(_hostComponent.HostRoles.component_name);
+        var componentName = App.format.role(_hostComponent.HostRoles.component_name, false);
         componentArr.pushObject(componentName);
       }, this);
       hostComponentObj.componentNames = stringUtils.getFormattedStringFromArray(componentArr);

+ 1 - 1
ambari-web/app/mappers/configs/config_groups_mapper.js

@@ -129,7 +129,7 @@ App.configGroupsMapper = App.QuickDataMapper.create({
       config_group_id: -1,
       name: 'Default',
       service_name: serviceName,
-      description: 'Default cluster level ' + App.format.role(serviceName) + ' configuration',
+      description: 'Default cluster level ' + App.format.role(serviceName, true) + ' configuration',
       hosts: hostNames ? hostNames.slice() : App.get('allHostNames').slice(),
       child_config_groups: childConfigGroups ? childConfigGroups.uniq() : [],
       service_id: serviceName,

+ 1 - 1
ambari-web/app/mappers/service_metrics_mapper.js

@@ -367,7 +367,7 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
           if (hostComponent.display_name_advanced) {
             service.tool_tip_content += hostComponent.display_name_advanced + " " + App.HostComponentStatus.getTextStatus(hostComponent.work_status) + "<br/>";
           } else {
-            service.tool_tip_content += App.format.role(hostComponent.component_name) + " " + App.HostComponentStatus.getTextStatus(hostComponent.work_status) + "<br/>";
+            service.tool_tip_content += App.format.role(hostComponent.component_name, false) + " " + App.HostComponentStatus.getTextStatus(hostComponent.work_status) + "<br/>";
           }
         }
       }

+ 1 - 1
ambari-web/app/mixins/common/configs/configs_saver.js

@@ -744,7 +744,7 @@ App.ConfigsSaverMixin = Em.Mixin.create({
                 if (!components[name]) {
                   components[name] = [];
                 }
-                components[name].push(App.format.role(item.ServiceComponentInfo.component_name));
+                components[name].push(App.format.role(item.ServiceComponentInfo.component_name, false));
               });
               return components;
             },

+ 1 - 1
ambari-web/app/mixins/main/host/details/host_components/decommissionable.js

@@ -75,7 +75,7 @@ App.Decommissionable = Em.Mixin.create({
   decommissionTooltipMessage: function () {
     if (this.get('isComponentDecommissionDisable') && (this.get('isComponentRecommissionAvailable') || this.get('isComponentDecommissionAvailable'))) {
       var decom = this.get('isComponentRecommissionAvailable') ? Em.I18n.t('common.recommission') : Em.I18n.t('common.decommission');
-      return Em.I18n.t('hosts.decommission.tooltip.warning').format(decom, App.format.role(this.get('componentForCheckDecommission')));
+      return Em.I18n.t('hosts.decommission.tooltip.warning').format(decom, App.format.role(this.get('componentForCheckDecommission'), false));
     }
     return '';
   }.property('isComponentDecommissionDisable', 'isComponentRecommissionAvailable', 'isComponentDecommissionAvailable', 'componentForCheckDecommission'),

+ 1 - 1
ambari-web/app/mixins/main/service/configs/config_overridable.js

@@ -99,7 +99,7 @@ App.ConfigOverridable = Em.Mixin.create({
     availableConfigGroups = result;
     var selectedConfigGroup = availableConfigGroups && availableConfigGroups.length > 0 ?
       availableConfigGroups[0] : null;
-    var serviceName = App.format.role(serviceId);
+    var serviceName = App.format.role(serviceId, true);
 
     return App.ModalPopup.show({
       classNames: ['sixty-percent-width-modal'],

+ 1 - 1
ambari-web/app/mixins/wizard/assign_master_components.js

@@ -741,7 +741,7 @@ App.AssignMasterComponents = Em.Mixin.create({
 
     var componentObj = {};
     componentObj.component_name = componentName;
-    componentObj.display_name = App.format.role(fullComponent.get('componentName'));
+    componentObj.display_name = App.format.role(fullComponent.get('componentName'), false);
     componentObj.serviceId = fullComponent.get('serviceName');
     componentObj.isServiceCoHost = App.StackServiceComponent.find().findProperty('componentName', componentName).get('isCoHostedComponent') && !this.get('mastersToMove').contains(componentName);
     componentObj.selectedHost = savedComponent ? savedComponent.hostName : hostName;

+ 1 - 1
ambari-web/app/mixins/wizard/wizardProgressPageController.js

@@ -598,7 +598,7 @@ App.wizardProgressPageControllerMixin = Em.Mixin.create(App.InstallComponent, {
           state: state
         },
         query: 'HostRoles/component_name=' + componentName + '&HostRoles/host_name.in(' + hostName.join(',') + ')&HostRoles/maintenance_state=OFF',
-        context: context + " " + App.format.role(componentName),
+        context: context + " " + App.format.role(componentName, false),
         hostName: hostName,
         taskNum: taskNum || 1,
         componentName: componentName,

+ 1 - 1
ambari-web/app/models/alerts/alert_definition.js

@@ -133,7 +133,7 @@ App.AlertDefinition = DS.Model.extend({
    * Formatted displayName for <code>componentName</code>
    * @type {String}
    */
-  componentNameFormatted: Em.computed.formatRole('componentName'),
+  componentNameFormatted: Em.computed.formatRole('componentName', false),
 
   /**
    * Status generates from child-alerts

+ 1 - 1
ambari-web/app/models/configs/service_config_version.js

@@ -25,7 +25,7 @@ App.ServiceConfigVersion = DS.Model.extend({
   MAX_AUTHOR_LENGTH: 20,
   MAX_NOTES_LENGTH: 80,
   serviceName: DS.attr('string'),
-  displayName: Em.computed.formatRole('serviceName'),
+  displayName: Em.computed.formatRole('serviceName', true),
   groupName: DS.attr('string'),
   groupId: DS.attr('number'),
   version: DS.attr('number'),

+ 2 - 2
ambari-web/app/models/root_service.js

@@ -25,7 +25,7 @@ var App = require('app');
  */
 App.RootService = DS.Model.extend({
   serviceName: DS.attr('string'),
-  displayName: Em.computed.formatRole('serviceName'),
+  displayName: Em.computed.formatRole('serviceName', true),
   components: DS.hasMany('App.RootServiceComponents')
 });
 
@@ -33,7 +33,7 @@ App.RootService.FIXTURES = [];
 
 App.RootServiceComponents =   DS.Model.extend({
   componentName: DS.attr('string'),
-  displayName: Em.computed.formatRole('componentName'),
+  displayName: Em.computed.formatRole('componentName', false),
   componentVersion: DS.attr('string'),
   serverClock: DS.attr('number'),
   serviceName: DS.attr('string'),

+ 1 - 1
ambari-web/app/models/service.js

@@ -22,7 +22,7 @@ require('utils/config');
 
 App.Service = DS.Model.extend({
   serviceName: DS.attr('string'),
-  displayName: Em.computed.formatRole('serviceName', 'SERVICE'),
+  displayName: Em.computed.formatRole('serviceName', true),
   passiveState: DS.attr('string'),
   workStatus: DS.attr('string'),
   rand: DS.attr('string'),

+ 1 - 1
ambari-web/app/models/stack_service.js

@@ -89,7 +89,7 @@ App.StackService = DS.Model.extend({
     var displayName = this.get('displayName');
     var services = this.get('coSelectedServices').slice();
     var serviceDisplayNames = services.map(function (item) {
-      return App.format.role(item);
+      return App.format.role(item, true);
     }, this);
     if (!!serviceDisplayNames.length) {
       serviceDisplayNames.unshift(displayName);

+ 2 - 2
ambari-web/app/utils/batch_scheduled_requests.js

@@ -394,7 +394,7 @@ module.exports = {
    */
   showRollingRestartPopup: function(hostComponentName, serviceName, isMaintenanceModeOn, staleConfigsOnly, hostComponents, skipMaintenance) {
     hostComponents = hostComponents || [];
-    var componentDisplayName = App.format.role(hostComponentName);
+    var componentDisplayName = App.format.role(hostComponentName, false);
     var self = this;
     if (!componentDisplayName) {
       componentDisplayName = hostComponentName;
@@ -481,7 +481,7 @@ module.exports = {
    * @param {String} hostComponentName
    */
   showWarningRollingRestartPopup: function(hostComponentName) {
-    var componentDisplayName = App.format.role(hostComponentName) || hostComponentName;
+    var componentDisplayName = App.format.role(hostComponentName, false) || hostComponentName;
     var title = Em.I18n.t('rollingrestart.dialog.title').format(componentDisplayName);
     var msg = Em.I18n.t('rollingrestart.notsupported.hostComponent').format(componentDisplayName);
 

+ 4 - 3
ambari-web/app/utils/ember_computed.js

@@ -876,7 +876,7 @@ computed.percents = function (dependentKey1, dependentKey2, accuracy) {
  * <pre>
  * var o = Em.Object.create({
  *  p1: 'SECONDARY_NAMENODE',
- *  p3: Em.computed.formatRole('p1')
+ *  p3: Em.computed.formatRole('p1', false)
  * });
  * console.log(o.get('p2')); // 'SNameNode'
  * o.set('p1', 'FLUME_HANDLER);
@@ -885,12 +885,13 @@ computed.percents = function (dependentKey1, dependentKey2, accuracy) {
  *
  * @method formatRole
  * @param {string} dependentKey
+ * @param {boolean} isServiceRole
  * @returns {Ember.ComputedProperty}
  */
-computed.formatRole = function (dependentKey, level) {
+computed.formatRole = function (dependentKey, isServiceRole) {
   return computed(dependentKey, function () {
     var value = get(this, dependentKey);
-    return App.format.role(value, level);
+    return App.format.role(value, isServiceRole);
   });
 };
 

+ 29 - 22
ambari-web/app/utils/helper.js

@@ -522,10 +522,16 @@ App.format = {
   },
 
   /**
-   * cached map of service and component names
+   * cached map of service names
    * @type {object}
    */
-  stackRolesMap: {},
+  stackServiceRolesMap: {},
+
+  /**
+   * cached map of component names
+   * @type {object}
+   */
+  stackComponentRolesMap: {},
 
   /**
    * convert role to readable string
@@ -533,34 +539,35 @@ App.format = {
    * @memberof App.format
    * @method role
    * @param {string} role
+   * @param {boolean} isServiceRole
    * return {string}
    */
-  role: function (role, level) {
-    switch (level) {
-      case 'SERVICE':
-        var models = [App.StackService];
-        break;
-      case 'COMPONENT':
-        var models = [App.StackServiceComponent];
-        break;
-      default:
-        var models = [App.StackService, App.StackServiceComponent];
-    }
+  role: function (role, isServiceRole) {
 
-    if (App.isEmptyObject(this.stackRolesMap)) {
-      models.forEach(function (model) {
-        model.find().forEach(function (item) {
-          this.stackRolesMap[item.get('id')] = item.get('displayName');
-        }, this);
-      }, this);
+    if (isServiceRole) {
+      var model = App.StackService;
+      var map = this.stackServiceRolesMap;
+    } else {
+      var model = App.StackServiceComponent;
+      var map = this.stackComponentRolesMap;
     }
 
-    if (this.stackRolesMap[role]) {
-      return this.stackRolesMap[role];
+    this.initializeStackRolesMap(map, model);
+
+    if (map[role]) {
+      return map[role];
     }
     return this.normalizeName(role);
   },
 
+  initializeStackRolesMap: function (map, model) {
+    if (App.isEmptyObject(map)) {
+      model.find().forEach(function (item) {
+        map[item.get('id')] = item.get('displayName');
+      });
+    }
+  },
+
   /**
    * Try to format non predefined names to readable format.
    *
@@ -641,7 +648,7 @@ App.format = {
       } else if (self.command[item]) {
         result = result + ' ' + self.command[item];
       } else {
-        result = result + ' ' + self.role(item);
+        result = result + ' ' + self.role(item, false);
       }
     });
 

+ 1 - 1
ambari-web/app/utils/host_progress_popup.js

@@ -546,7 +546,7 @@ App.HostPopup = Em.Object.create({
       command: _task.Tasks.command.toLowerCase() == 'service_check' ? '' : _task.Tasks.command.toLowerCase(),
       commandDetail: App.format.commandDetail(_task.Tasks.command_detail, _task.Tasks.request_inputs),
       status: App.format.taskStatus(_task.Tasks.status),
-      role: App.format.role(_task.Tasks.role),
+      role: App.format.role(_task.Tasks.role, false),
       stderr: _task.Tasks.stderr,
       stdout: _task.Tasks.stdout,
       request_id: _task.Tasks.request_id,

+ 1 - 1
ambari-web/app/views/common/rolling_restart_view.js

@@ -160,7 +160,7 @@ App.RollingRestartView = Em.View.extend({
    * Formatted <code>hostComponentName</code>
    * @type {String}
    */
-  hostComponentDisplayName: Em.computed.formatRole('hostComponentName'),
+  hostComponentDisplayName: Em.computed.formatRole('hostComponentName', false),
 
   /**
    * List of all host components

+ 2 - 2
ambari-web/app/views/main/admin/stack_upgrade/failed_hosts_modal_view.js

@@ -54,8 +54,8 @@ App.FailedHostsPopupBodyView = Em.View.extend({
       if (content.host_detail[hostName]) {
         content.host_detail[hostName].forEach(function (details) {
           hostComponents.push(Em.Object.create({
-            componentName: App.format.role(details.component),
-            serviceName: App.format.role(details.service)
+            componentName: App.format.role(details.component, false),
+            serviceName: App.format.role(details.service, true)
           }))
         }, this);
       }

+ 1 - 1
ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js

@@ -294,7 +294,7 @@ App.upgradeWizardView = Em.View.extend({
             item.tasks.forEach(function (task) {
               var detail = Em.get(task, 'Tasks.command_detail');
               if (detail && detail.startsWith('SERVICE_CHECK ')) {
-                skippedServiceChecks.push(App.format.role(detail.replace('SERVICE_CHECK ', '')));
+                skippedServiceChecks.push(App.format.role(detail.replace('SERVICE_CHECK ', ''), true));
               }
             });
           }

+ 1 - 1
ambari-web/app/views/main/charts/heatmap/heatmap_host.js

@@ -110,7 +110,7 @@ App.MainChartsHeatmapHostView = Em.View.extend({
 
     components.forEach(function (componentName) {
       if (nonClientComponents.contains(componentName)) {
-        result.push(App.format.role(componentName));
+        result.push(App.format.role(componentName, false));
       }
     }, this);
     return result.join(', ')

+ 1 - 1
ambari-web/app/views/main/host.js

@@ -378,7 +378,7 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
         items = this.get('content.stackVersions').filterProperty('isVisible').map(function (stackVersion) {
           return {
             name: stackVersion.get('displayName'),
-            status: App.format.role(stackVersion.get('status'))
+            status: App.format.role(stackVersion.get('status'), false)
           };
         });
       App.showHostsTableListPopup(header, hostName, items);

+ 2 - 2
ambari-web/app/views/main/host/combo_search_box.js

@@ -157,8 +157,8 @@ App.MainHostComboSearchBoxView = Em.View.extend({
               break;
             case 'services':
               callback(App.Service.find().toArray().map(function (service) {
-                map[App.format.role(service.get('serviceName'))] = service.get('serviceName');
-                return App.format.role(service.get('serviceName'));
+                map[App.format.role(service.get('serviceName'), true)] = service.get('serviceName');
+                return App.format.role(service.get('serviceName'), true);
               }).reject(function (item) {
                 return visualSearch.searchQuery.values(facet).indexOf(item.value) >= 0;
               }), {preserveOrder: true});

+ 1 - 1
ambari-web/app/views/main/host/hosts_table_menu_view.js

@@ -207,7 +207,7 @@ App.HostTableMenuView = Em.View.extend({
 
       tooltipMsg: function () {
         return (this.get('disabledElement') == 'disabled') ?
-          Em.I18n.t('hosts.decommission.tooltip.warning').format(this.get('content.message'), App.format.role(this.get('content.componentName'))) : '';
+          Em.I18n.t('hosts.decommission.tooltip.warning').format(this.get('content.message'), App.format.role(this.get('content.componentName'), false)) : '';
       }.property('disabledElement', 'content.componentName'),
 
       disabledElement: function () {

+ 1 - 1
ambari-web/app/views/main/host/summary.js

@@ -216,7 +216,7 @@ App.MainHostSummaryView = Em.View.extend(App.TimeRangeMixin, {
       if (this.get('componentName') === 'CLIENTS') {
         return this.t('common.clients');
       }
-      return App.format.role(this.get('componentName'));
+      return App.format.role(this.get('componentName'), false);
     }.property('componentName')
   }),
 

+ 1 - 1
ambari-web/app/views/main/service/info/configs.js

@@ -87,7 +87,7 @@ App.MainServiceInfoConfigsView = Em.View.extend({
    */
   rollingRestartActionName : function() {
     var componentName = this.get('rollingRestartSlaveComponentName');
-    return componentName ? Em.I18n.t('rollingrestart.dialog.title').format(App.format.role(componentName)) : '';
+    return componentName ? Em.I18n.t('rollingrestart.dialog.title').format(App.format.role(componentName, false)) : '';
   }.property('rollingRestartSlaveComponentName'),
 
   /**

+ 1 - 1
ambari-web/app/views/main/service/info/summary.js

@@ -305,7 +305,7 @@ App.MainServiceInfoSummaryView = Em.View.extend(App.UserPref, App.TimeRangeMixin
     var label = null;
     var componentName = this.get('rollingRestartSlaveComponentName');
     if (componentName) {
-      label = Em.I18n.t('rollingrestart.dialog.title').format(App.format.role(componentName));
+      label = Em.I18n.t('rollingrestart.dialog.title').format(App.format.role(componentName, false));
     }
     return label;
   }.property('rollingRestartSlaveComponentName'),

+ 5 - 5
ambari-web/app/views/main/service/item.js

@@ -76,19 +76,19 @@ App.MainServiceItemView = Em.View.extend({
        },
        {
          cssClass: 'icon-plus',
-         'label': '{0} {1}'.format(Em.I18n.t('add'), App.format.role('RANGER_KMS_SERVER')),
+         'label': '{0} {1}'.format(Em.I18n.t('add'), App.format.role('RANGER_KMS_SERVER', false)),
          service: 'RANGER_KMS',
          component: 'RANGER_KMS_SERVER'
        },
        {
          cssClass: 'icon-plus',
-         'label': '{0} {1}'.format(Em.I18n.t('add'), App.format.role('NIMBUS')),
+         'label': '{0} {1}'.format(Em.I18n.t('add'), App.format.role('NIMBUS', false)),
          service: 'STORM',
          component: 'NIMBUS'
        },
        {
          cssClass: 'icon-plus',
-         'label': '{0} {1}'.format(Em.I18n.t('add'), App.format.role('OOZIE_SERVER')),
+         'label': '{0} {1}'.format(Em.I18n.t('add'), App.format.role('OOZIE_SERVER', false)),
          service: 'OOZIE',
          component: 'OOZIE_SERVER'
        }
@@ -147,7 +147,7 @@ App.MainServiceItemView = Em.View.extend({
       }).forEach(function(_component) {
         options.push(self.createOption(actionMap.ROLLING_RESTART, {
           context: _component,
-          label: actionMap.ROLLING_RESTART.label.format(App.format.role(_component))
+          label: actionMap.ROLLING_RESTART.label.format(App.format.role(_component, false))
         }));
       });
       allMasters.filter(function(master) {
@@ -155,7 +155,7 @@ App.MainServiceItemView = Em.View.extend({
       }).forEach(function(master) {
         options.push(self.createOption(actionMap.MOVE_COMPONENT, {
           context: master,
-          label: actionMap.MOVE_COMPONENT.label.format(App.format.role(master)),
+          label: actionMap.MOVE_COMPONENT.label.format(App.format.role(master, false)),
           disabled: App.allHostNames.length === App.HostComponent.find().filterProperty('componentName', master).mapProperty('hostName').length
         }));
       });

+ 1 - 1
ambari-web/app/views/main/service/reassign/step4_view.js

@@ -23,7 +23,7 @@ App.ReassignMasterWizardStep4View = App.HighAvailabilityProgressPageView.extend(
 
   headerTitle: Em.I18n.t('services.reassign.step4.header'),
 
-  formattedComponentName: Em.computed.formatRole('controller.content.reassign.component_name'),
+  formattedComponentName: Em.computed.formatRole('controller.content.reassign.component_name', false),
 
   noticeInProgress: Em.computed.i18nFormat('services.reassign.step4.status.info', 'formattedComponentName'),
 

+ 1 - 1
ambari-web/app/views/main/service/reassign/step6_view.js

@@ -23,7 +23,7 @@ App.ReassignMasterWizardStep6View = App.HighAvailabilityProgressPageView.extend(
 
   headerTitle: Em.I18n.t('services.reassign.step6.header'),
 
-  formattedComponentName: Em.computed.formatRole('controller.content.reassign.component_name'),
+  formattedComponentName: Em.computed.formatRole('controller.content.reassign.component_name', false),
 
   noticeInProgress: Em.computed.i18nFormat('services.reassign.step6.status.info', 'formattedComponentName'),
 

+ 1 - 1
ambari-web/app/views/wizard/step6_view.js

@@ -109,7 +109,7 @@ App.WizardStep6HostView = Em.View.extend({
     App.popover(this.$(), {
       title: Em.I18n.t('installer.step6.wizardStep6Host.title').format(this.get('host.hostName')),
       content: this.get('controller').getMasterComponentsForHost(this.get('host.hostName')).map(function (_component) {
-        return App.format.role(_component);
+        return App.format.role(_component, false);
       }).join("<br />"),
       placement: 'right',
       trigger: 'hover'

+ 1 - 1
ambari-web/app/views/wizard/step9/hostLogPopupBody_view.js

@@ -136,7 +136,7 @@ App.WizardStep9HostLogPopupBodyView = Em.View.extend({
         taskInfo.set('command', _task.Tasks.command.toLowerCase() === 'service_check' ? '' : _task.Tasks.command.toLowerCase());
         taskInfo.set('commandDetail', App.format.commandDetail(_task.Tasks.command_detail, _task.Tasks.request_inputs));
         taskInfo.set('status', App.format.taskStatus(_task.Tasks.status));
-        taskInfo.set('role', App.format.role(_task.Tasks.role));
+        taskInfo.set('role', App.format.role(_task.Tasks.role, false));
         taskInfo.set('stderr', _task.Tasks.stderr);
         taskInfo.set('stdout', _task.Tasks.stdout);
         taskInfo.set('outputLog', _task.Tasks.output_log);

+ 1 - 1
ambari-web/test/controllers/wizard/step4_test.js

@@ -44,7 +44,7 @@ describe('App.WizardStep4Controller', function () {
         isDFS: ['HDFS','GLUSTERFS'].contains(serviceName),
         isMonitoringService: ['GANGLIA'].contains(serviceName),
         requiredServices: App.StackService.find(serviceName).get('requiredServices'),
-        displayNameOnSelectServicePage: App.format.role(serviceName),
+        displayNameOnSelectServicePage: App.format.role(serviceName, true),
         coSelectedServices: function() {
           return App.StackService.coSelected[this.get('serviceName')] || [];
         }.property('serviceName')

+ 5 - 3
ambari-web/test/utils/ember_computed_test.js

@@ -1091,7 +1091,8 @@ describe('Ember.computed macros', function () {
     beforeEach(function () {
       this.obj = Em.Object.create({
         prop1: 'NAMENODE',
-        prop2: Em.computed.formatRole('prop1')
+        prop2: false,
+        prop3: Em.computed.formatRole('prop1', 'prop2')
       });
       sinon.stub(App.StackServiceComponent, 'find', function () {
         return [
@@ -1113,12 +1114,13 @@ describe('Ember.computed macros', function () {
     });
 
     it('should format as role', function () {
-      expect(this.obj.get('prop2')).to.equal('NameNode');
+      expect(this.obj.get('prop3')).to.equal('NameNode');
     });
 
     it('should format as role (2)', function () {
       this.obj.set('prop1', 'HIVE');
-      expect(this.obj.get('prop2')).to.equal('Hive');
+      this.obj.set('prop2', true);
+      expect(this.obj.get('prop3')).to.equal('Hive');
     });
 
   });

+ 6 - 4
ambari-web/test/utils/helper_test.js

@@ -423,7 +423,8 @@ describe('utils/helper', function() {
 
       describe("#role()", function() {
         before(function () {
-          App.format.stackRolesMap = {};
+          App.format.stackServiceRolesMap = {};
+          App.format.stackComponentRolesMap = {};
         });
         beforeEach(function () {
           sinon.stub(App.StackService, 'find').returns([Em.Object.create({
@@ -440,13 +441,14 @@ describe('utils/helper', function() {
           App.StackServiceComponent.find.restore();
         });
         it("S1 -> s1", function() {
-          expect(App.format.role('S1')).to.equal('s1');
+          expect(App.format.role('S1', true)).to.equal('s1');
         });
         it("C1 -> c1", function() {
-          expect(App.format.role('C1')).to.equal('c1');
+          expect(App.format.role('C1', false)).to.equal('c1');
         });
         it("stackRolesMap is not empty", function() {
-          expect(App.format.stackRolesMap).to.not.be.empty;
+          expect(App.format.stackServiceRolesMap).to.not.be.empty;
+          expect(App.format.stackComponentRolesMap).to.not.be.empty;
         });
       });
     });