().Object);
+ Assert.AreEqual(string.Empty, result);
+ }
+
[Test]
public void Value_Editor_Can_Serialize_Date_Value()
{
diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/validation/valregex.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/validation/valregex.directive.js
index 651c0a54c7..0f3372eecb 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/validation/valregex.directive.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/validation/valregex.directive.js
@@ -40,7 +40,7 @@ function valRegex() {
var patternValidator = function (viewValue) {
//NOTE: we don't validate on empty values, use required validator for that
- if (!viewValue || regex.test(viewValue)) {
+ if (!viewValue || regex.test(viewValue.toString())) {
// it is valid
ctrl.$setValidity('valRegex', true);
//assign a message to the validator
diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/decimal.html b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/decimal.html
new file mode 100644
index 0000000000..c4e4c95e39
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/decimal.html
@@ -0,0 +1,11 @@
+
+
+
+ Not a number
+ {{propertyForm.requiredField.errorMsg}}
+
+
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/number.html b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/number.html
index 6d7b8c4c78..e7490e2703 100644
--- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/number.html
+++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/number.html
@@ -3,7 +3,7 @@
type="number"
ng-model="model.value"
val-server="value"
- fix-number />
+ fix-number />
Not a number
{{propertyForm.requiredField.errorMsg}}
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/decimal/decimal.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/decimal/decimal.html
new file mode 100644
index 0000000000..113148c3c6
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/decimal/decimal.html
@@ -0,0 +1,11 @@
+
+
+
+ Not a number
+ {{propertyForm.requiredField.errorMsg}}
+
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/integer/integer.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/integer/integer.html
index 251a6066d8..6245805bec 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/integer/integer.html
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/integer/integer.html
@@ -1,10 +1,11 @@
-
+
Not a number
{{propertyForm.requiredField.errorMsg}}
-
\ No newline at end of file
diff --git a/src/Umbraco.Web/PropertyEditors/DecimalPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/DecimalPropertyEditor.cs
new file mode 100644
index 0000000000..f636e8cdb2
--- /dev/null
+++ b/src/Umbraco.Web/PropertyEditors/DecimalPropertyEditor.cs
@@ -0,0 +1,57 @@
+using Umbraco.Core;
+using Umbraco.Core.PropertyEditors;
+
+namespace Umbraco.Web.PropertyEditors
+{
+ [PropertyEditor(Constants.PropertyEditors.DecimalAlias, "Decimal", "decimal", "decimal", IsParameterEditor = true)]
+ public class DecimalPropertyEditor : PropertyEditor
+ {
+ ///
+ /// Overridden to ensure that the value is validated
+ ///
+ ///
+ protected override PropertyValueEditor CreateValueEditor()
+ {
+ var editor = base.CreateValueEditor();
+ editor.Validators.Add(new DecimalValidator());
+ return editor;
+ }
+
+ protected override PreValueEditor CreatePreValueEditor()
+ {
+ return new DecimalPreValueEditor();
+ }
+
+ ///
+ /// A custom pre-value editor class to deal with the legacy way that the pre-value data is stored.
+ ///
+ internal class DecimalPreValueEditor : PreValueEditor
+ {
+ public DecimalPreValueEditor()
+ {
+ //create the fields
+ Fields.Add(new PreValueField(new DecimalValidator())
+ {
+ Description = "Enter the minimum amount of number to be entered",
+ Key = "min",
+ View = "decimal",
+ Name = "Minimum"
+ });
+ Fields.Add(new PreValueField(new DecimalValidator())
+ {
+ Description = "Enter the intervals amount between each step of number to be entered",
+ Key = "step",
+ View = "decimal",
+ Name = "Step Size"
+ });
+ Fields.Add(new PreValueField(new DecimalValidator())
+ {
+ Description = "Enter the maximum amount of number to be entered",
+ Key = "max",
+ View = "decimal",
+ Name = "Maximum"
+ });
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Umbraco.Web/PropertyEditors/IntegerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/IntegerPropertyEditor.cs
index e93f16d7e8..7e0ac8443f 100644
--- a/src/Umbraco.Web/PropertyEditors/IntegerPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/IntegerPropertyEditor.cs
@@ -3,7 +3,7 @@ using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors
{
- [PropertyEditor(Constants.PropertyEditors.IntegerAlias, "Numeric", "integer", IsParameterEditor = true)]
+ [PropertyEditor(Constants.PropertyEditors.IntegerAlias, "Numeric", "integer", IsParameterEditor = true, ValueType = "integer")]
public class IntegerPropertyEditor : PropertyEditor
{
///
diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj
index f8744e58c2..07c378714b 100644
--- a/src/Umbraco.Web/Umbraco.Web.csproj
+++ b/src/Umbraco.Web/Umbraco.Web.csproj
@@ -307,6 +307,7 @@
+