Ver Fonte

AMBARI-4817 It is possible to create config group with the name of existing group. (atkach)

atkach há 11 anos atrás
pai
commit
4737319e01

+ 22 - 0
ambari-web/app/assets/data/configurations/config_group.json

@@ -0,0 +1,22 @@
+{
+  "href" : "http://192.168.56.101:8080/api/v1/clusters/cl/config_groups?ConfigGroup/tag=HDFS&fields=*&_=1393334422559",
+  "items" : [
+    {
+      "href" : "http://192.168.56.101:8080/api/v1/clusters/cl/config_groups/2",
+      "ConfigGroup" : {
+        "cluster_name" : "cl",
+        "description" : "testmode group",
+        "desired_configs" : [ ],
+        "group_name" : "test",
+        "hosts" : [
+          {
+            "host_name" : "dev01.hortonworks.com",
+            "href" : "http://192.168.56.101:8080/api/v1/clusters/cl/hosts/dev01.hortonworks.com"
+          }
+        ],
+        "id" : 2,
+        "tag" : "HDFS"
+      }
+    }
+  ]
+}

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

@@ -308,7 +308,7 @@ App.ManageConfigGroupsController = Em.Controller.extend({
             warningMessage = Em.I18n.t("config.group.selection.dialog.err.name.exists");
           }
         } else {
-          if (self.get('configGroups').mapProperty('name').contains(this.get('configGroupName'))) {
+          if (self.get('configGroups').mapProperty('name').contains(this.get('configGroupName').trim())) {
             warningMessage = Em.I18n.t("config.group.selection.dialog.err.name.exists");
           }
         }

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

@@ -139,7 +139,7 @@ var urls = {
   },
   'service.load_config_groups': {
     'real': '/clusters/{clusterName}/config_groups?ConfigGroup/tag={serviceName}&fields=*',
-    'mock': ''
+    'mock': '/data/configurations/config_group.json'
   },
   'reassign.stop_services': {
     'real': '/clusters/{clusterName}/services',

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

@@ -1234,7 +1234,7 @@ App.config = Em.Object.create({
         var optionSelect = this.get('optionSelectConfigGroup');
         if (!optionSelect) {
           var nn = this.get('newConfigGroupName');
-          if (nn && configGroups.mapProperty('name').contains(nn)) {
+          if (nn && configGroups.mapProperty('name').contains(nn.trim())) {
             msg = Em.I18n.t("config.group.selection.dialog.err.name.exists");
             isWarning = true;
           }