Browse Source

AMBARI-3955. "Default" config group should be "<Service-name> Default". (Denis Buzhor via onechiporenko)

Oleg Nechiporenko 11 years ago
parent
commit
6bf9136f12

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

@@ -318,6 +318,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
       hosts: defaultConfigGroupHosts,
       hosts: defaultConfigGroupHosts,
       parentConfigGroup: null,
       parentConfigGroup: null,
       service: this.get('content'),
       service: this.get('content'),
+      serviceName: serviceName,
       configSiteTags: []
       configSiteTags: []
     });
     });
     if (!selectedConfigGroup) {
     if (!selectedConfigGroup) {

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

@@ -75,7 +75,8 @@ App.ManageConfigGroupsController = Em.Controller.extend({
       isDefault: true,
       isDefault: true,
       parentConfigGroup: null,
       parentConfigGroup: null,
       service: this.get('content'),
       service: this.get('content'),
-      configSiteTags: []
+      configSiteTags: [],
+      serviceName: this.get('serviceName')
     });
     });
     if (data && data.items) {
     if (data && data.items) {
       var groupToTypeToTagMap = {};
       var groupToTypeToTagMap = {};

+ 2 - 1
ambari-web/app/controllers/wizard/step7_controller.js

@@ -173,7 +173,8 @@ App.WizardStep7Controller = Em.Controller.extend({
             hosts: Em.copy(hosts),
             hosts: Em.copy(hosts),
             service: Em.Object.create({
             service: Em.Object.create({
               id: service.serviceName
               id: service.serviceName
-            })
+            }),
+            serviceName: service.serviceName
           })
           })
         ]);
         ]);
       } else {
       } else {

+ 6 - 0
ambari-web/app/models/config_group.js

@@ -38,6 +38,7 @@ App.ConfigGroup = Ember.Object.extend({
   name: null,
   name: null,
   description: null,
   description: null,
   isDefault: null,
   isDefault: null,
+  serviceName: null,
 
 
   /**
   /**
    * Parent configuration group for this group.
    * Parent configuration group for this group.
@@ -82,6 +83,11 @@ App.ConfigGroup = Ember.Object.extend({
    */
    */
   displayName: function () {
   displayName: function () {
     var name = this.get('name');
     var name = this.get('name');
+    if (name && name == "Default") {
+      if (this.get('serviceName')) {
+        name = this.get('serviceName') + " Default";
+      }
+    }
     if (name && name.length>App.config.CONFIG_GROUP_NAME_MAX_LENGTH) {
     if (name && name.length>App.config.CONFIG_GROUP_NAME_MAX_LENGTH) {
       var middle = Math.floor(App.config.CONFIG_GROUP_NAME_MAX_LENGTH / 2);
       var middle = Math.floor(App.config.CONFIG_GROUP_NAME_MAX_LENGTH / 2);
       name = name.substring(0, middle) + "..." + name.substring(name.length-middle);
       name = name.substring(0, middle) + "..." + name.substring(name.length-middle);

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

@@ -1128,7 +1128,7 @@ App.config = Em.Object.create({
       },
       },
       bodyClass: Ember.View.extend({
       bodyClass: Ember.View.extend({
         template: Em.Handlebars.compile('{{t installer.controls.slaveComponentGroups}}&#58;&nbsp;' +
         template: Em.Handlebars.compile('{{t installer.controls.slaveComponentGroups}}&#58;&nbsp;' +
-          '{{view Em.Select contentBinding="view.parentView.configGroups" optionLabelPath="content.name" selectionBinding="view.parentView.selectedConfigGroup"}}')
+          '{{view Em.Select contentBinding="view.parentView.configGroups" optionLabelPath="content.displayName" selectionBinding="view.parentView.selectedConfigGroup"}}')
       })
       })
     });
     });
   },
   },