You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2013/05/07 20:12:26 UTC

svn commit: r1479998 - in /incubator/ambari/trunk: CHANGES.txt ambari-web/app/models/service_config.js ambari-web/app/utils/config.js

Author: jaimin
Date: Tue May  7 18:12:26 2013
New Revision: 1479998

URL: http://svn.apache.org/r1479998
Log:
AMBARI-2085. UI allows user to set empty value for configs in Advanced category. (jaimin)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/models/service_config.js
    incubator/ambari/trunk/ambari-web/app/utils/config.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1479998&r1=1479997&r2=1479998&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Tue May  7 18:12:26 2013
@@ -830,6 +830,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-2085. UI allows user to set empty value for configs in
+ Advanced category. (jaimin)
+
  AMBARI-2087. Tasks are not filtered by parent request id. (smohanty)
 
  AMBARI-2086. Agent on host with clients and DATANODE only seems to schedule 

Modified: incubator/ambari/trunk/ambari-web/app/models/service_config.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/models/service_config.js?rev=1479998&r1=1479997&r2=1479998&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/models/service_config.js (original)
+++ incubator/ambari/trunk/ambari-web/app/models/service_config.js Tue May  7 18:12:26 2013
@@ -439,14 +439,13 @@ App.ServiceConfigProperty = Ember.Object
   }.property('displayType'),
 
   validate: function () {
-
     var value = this.get('value');
     var valueRange = this.get('valueRange');
     var values = [];//value split by "," to check UNIX users, groups list
 
     var isError = false;
 
-    if (typeof value === 'string' && value.trim().length === 0) {
+    if (typeof value === 'string' && value.length === 0) {
       if (this.get('isRequired')) {
         this.set('errorMessage', 'This is required');
         isError = true;

Modified: incubator/ambari/trunk/ambari-web/app/utils/config.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/utils/config.js?rev=1479998&r1=1479997&r2=1479998&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/utils/config.js (original)
+++ incubator/ambari/trunk/ambari-web/app/utils/config.js Tue May  7 18:12:26 2013
@@ -103,7 +103,7 @@ App.config = Em.Object.create({
     } else {
       config.category = 'Advanced';
       config.filename = isAdvanced && advancedConfigs.findProperty('name', config.name).filename;
-      config.isRequired = false;
+      config.isRequired = true;
     }
   },
   /**
@@ -227,7 +227,7 @@ App.config = Em.Object.create({
           isUserProperty: stored.isUserProperty === true,
           isOverridable: true,
           overrides: stored.overrides,
-          isRequired: !isAdvanced
+          isRequired: true
         };
         this.calculateConfigProperties(configData, isAdvanced, advancedConfigs);
       } else if (preDefined && !stored) {
@@ -272,7 +272,7 @@ App.config = Em.Object.create({
            * false; _config.value = ''; } else if
            * (/^\s+$/.test(_config.value)) { _config.isRequired = false; }
            */
-          _config.isRequired = false;
+          _config.isRequired = true;
           _config.isVisible = true;
           _config.displayType = 'advanced';
           serviceConfigs.push(_config);