Browse Source

AMBARI-2313. UI allows adding already existing properties to custom core-site.xml /hdfs-site.xml settings and creates confusion. (Oleg Nechiporenko via yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1490773 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 years ago
parent
commit
2857e042bb
1 changed files with 2 additions and 2 deletions
  1. 2 2
      ambari-web/app/views/common/configs/services_config.js

+ 2 - 2
ambari-web/app/views/common/configs/services_config.js

@@ -178,7 +178,7 @@ App.ServiceConfigsByCategoryView = Ember.View.extend({
     return category.indexOf("Advanced") != -1;
   },
   showAddPropertyWindow: function (event) {
-    var serviceConfigNames = this.get('categoryConfigs').mapProperty('name');
+    var allConfigs = this.get('service.configs').filterProperty('serviceName',this.get('service.serviceName'));
     var serviceConfigObj = Ember.Object.create({
       name: '',
       value: '',
@@ -192,7 +192,7 @@ App.ServiceConfigsByCategoryView = Ember.View.extend({
         if(name.trim() != ""){
           if(validator.isValidConfigKey(name)){
             var configMappingProperty = App.config.get('configMapping').all().findProperty('name', name);
-            if((configMappingProperty == null) && (!serviceConfigNames.contains(name))){
+            if((configMappingProperty == null) && (!allConfigs.findProperty('name',name))){
               this.set("isKeyError", false);
               this.set("errorMessage", "");
             } else {