You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by at...@apache.org on 2014/02/25 14:25:54 UTC

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

Repository: ambari
Updated Branches:
  refs/heads/trunk be70f78c4 -> 4737319e0


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


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4737319e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4737319e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4737319e

Branch: refs/heads/trunk
Commit: 4737319e01c634ac354a12a6f4dd2d49556e0253
Parents: be70f78
Author: atkach <at...@hortonworks.com>
Authored: Tue Feb 25 15:23:18 2014 +0200
Committer: atkach <at...@hortonworks.com>
Committed: Tue Feb 25 15:23:18 2014 +0200

----------------------------------------------------------------------
 .../data/configurations/config_group.json       | 22 ++++++++++++++++++++
 .../service/manage_config_groups_controller.js  |  2 +-
 ambari-web/app/utils/ajax.js                    |  2 +-
 ambari-web/app/utils/config.js                  |  2 +-
 4 files changed, 25 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4737319e/ambari-web/app/assets/data/configurations/config_group.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/configurations/config_group.json b/ambari-web/app/assets/data/configurations/config_group.json
new file mode 100644
index 0000000..15d13d3
--- /dev/null
+++ b/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"
+      }
+    }
+  ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/4737319e/ambari-web/app/controllers/main/service/manage_config_groups_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/manage_config_groups_controller.js b/ambari-web/app/controllers/main/service/manage_config_groups_controller.js
index f1677f7..dbcec89 100644
--- a/ambari-web/app/controllers/main/service/manage_config_groups_controller.js
+++ b/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");
           }
         }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4737319e/ambari-web/app/utils/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax.js b/ambari-web/app/utils/ajax.js
index f7ea0f8..b722fc4 100644
--- a/ambari-web/app/utils/ajax.js
+++ b/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',

http://git-wip-us.apache.org/repos/asf/ambari/blob/4737319e/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index 5c8d1f3..0f372f6 100644
--- a/ambari-web/app/utils/config.js
+++ b/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;
           }