You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ha...@apache.org on 2017/09/30 23:50:26 UTC

[royale-asjs] branch feature/validation updated: Fixed up warnings in CurrencyValidator

This is an automated email from the ASF dual-hosted git repository.

harbs pushed a commit to branch feature/validation
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/feature/validation by this push:
     new 7508629  Fixed up warnings in CurrencyValidator
7508629 is described below

commit 75086291fb927a2ac0af4f25dac4a785fb603649
Author: Harbs <ha...@in-tools.com>
AuthorDate: Sun Oct 1 02:50:23 2017 +0300

    Fixed up warnings in CurrencyValidator
---
 .../flex/utils/validation/CurrencyValidator.as     | 73 +++++++++++++++-------
 1 file changed, 49 insertions(+), 24 deletions(-)

diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/validation/CurrencyValidator.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/validation/CurrencyValidator.as
index 9f6c861..a30ade0 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/validation/CurrencyValidator.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/validation/CurrencyValidator.as
@@ -468,9 +468,12 @@ package org.apache.flex.utils.validation
             alignSymbolOverride = value;
 
             _alignSymbol = value != null ?
-                        value :
-                        resourceManager.getString(
-                            "SharedResources", "alignSymbol");
+                        value : CurrencyValidatorAlignSymbol.LEFT;
+			// TODO get from resource bundle
+            // _alignSymbol = value != null ?
+            //             value :
+            //             resourceManager.getString(
+            //                 "SharedResources", "alignSymbol");
         }
 
         //----------------------------------
@@ -514,7 +517,7 @@ package org.apache.flex.utils.validation
             allowNegativeOverride = value;
 
             _allowNegative = value != null ?
-                            Boolean(value) : false;
+                            Boolean(value) : true;
             //TODO get the value based on locale
             // _allowNegative = value != null ?
             //                 Boolean(value) :
@@ -565,6 +568,9 @@ package org.apache.flex.utils.validation
             currencySymbolOverride = value;
 
             _currencySymbol = value != null ?
+                            value : "$";
+			// TODO get from resource bundle
+            _currencySymbol = value != null ?
                             value :
                             resourceManager.getString(
                                 "SharedResources", "currencySymbol");
@@ -613,9 +619,12 @@ package org.apache.flex.utils.validation
             decimalSeparatorOverride = value;
 
             _decimalSeparator = value != null ?
-                                value :
-                                resourceManager.getString(
-                                    "validators", "decimalSeparator");
+                                value : ".";
+			// TODO get from resource bundle
+            // _decimalSeparator = value != null ?
+            //                     value :
+            //                     resourceManager.getString(
+            //                         "validators", "decimalSeparator");
         }
 
         //----------------------------------
@@ -659,7 +668,7 @@ package org.apache.flex.utils.validation
             maxValueOverride = value;
 
             _maxValue = value != null ?
-                        Number(value) : Number.MAX_VALUE;
+                        Number(value) : NaN;
             // TODO get from resource bundle
             // _maxValue = value != null ?
             //             Number(value) :
@@ -708,7 +717,7 @@ package org.apache.flex.utils.validation
             minValueOverride = value;
 
             _minValue = value != null ?
-                        Number(value) : Number.MIN_VALUE;
+                        Number(value) : NaN;
             // TODO get from resource bundle
             // _minValue = value != null ?
             //             Number(value) :
@@ -866,9 +875,12 @@ package org.apache.flex.utils.validation
             currencySymbolErrorOverride = value;
 
             _currencySymbolError = value != null ?
-                                value :
-                                resourceManager.getString(
-                                    "validators", "currencySymbolError");
+                                value : "The currency symbol occurs in an invalid location.";
+			// TODO get from resource bundle
+            // _currencySymbolError = value != null ?
+            //                     value :
+            //                     resourceManager.getString(
+            //                         "validators", "currencySymbolError");
         }
 
         //----------------------------------
@@ -1106,9 +1118,12 @@ package org.apache.flex.utils.validation
             lowerThanMinErrorOverride = value;
 
             _lowerThanMinError = value != null ?
-                                value :
-                                resourceManager.getString(
-                                    "validators", "lowerThanMinError");
+                                value : "The amount entered is too small.";
+			// TODO get from resource bundle
+            // _lowerThanMinError = value != null ?
+            //                     value :
+            //                     resourceManager.getString(
+            //                         "validators", "lowerThanMinError");
         }
 
         //----------------------------------
@@ -1152,9 +1167,13 @@ package org.apache.flex.utils.validation
             negativeErrorOverride = value;
 
             _negativeError = value != null ?
-                            value :
-                            resourceManager.getString(
-                                "validators", "negativeError");
+                            value : "The amount may not be negative.";
+
+			// TODO get from resource bundle
+            // _negativeError = value != null ?
+            //                 value :
+            //                 resourceManager.getString(
+            //                     "validators", "negativeError");
         }
 
         //----------------------------------
@@ -1199,9 +1218,12 @@ package org.apache.flex.utils.validation
             precisionErrorOverride = value;
 
             _precisionError = value != null ?
-                            value :
-                            resourceManager.getString(
-                                "validators", "precisionError");
+                            value : "The amount entered has too many digits beyond the decimal point.";
+			// TODO get from resource bundle
+            // _precisionError = value != null ?
+            //                 value :
+            //                 resourceManager.getString(
+            //                     "validators", "precisionError");
         }
 
         //----------------------------------
@@ -1244,9 +1266,12 @@ package org.apache.flex.utils.validation
             separationErrorOverride = value;
 
             _separationError = value != null ?
-                            value :
-                            resourceManager.getString(
-                                "validators", "separationError");
+                            value : "The thousands separator must be followed by three digits.";
+			// TODO get from resource bundle
+            // _separationError = value != null ?
+            //                 value :
+            //                 resourceManager.getString(
+            //                     "validators", "separationError");
         }
 
         //--------------------------------------------------------------------------

-- 
To stop receiving notification emails like this one, please contact
['"commits@royale.apache.org" <co...@royale.apache.org>'].