Merge remote-tracking branch 'origin/netcore/dev' into netcore/feature/AB3970-membership-providers

# Conflicts:
#	src/Umbraco.Web/Editors/Filters/MemberSaveModelValidator.cs
#	src/Umbraco.Web/Editors/Filters/MemberSaveValidationAttribute.cs
This commit is contained in:
Bjarke Berg
2019-12-03 08:54:31 +01:00
164 changed files with 7437 additions and 6106 deletions

View File

@@ -11,10 +11,17 @@ namespace Umbraco.Web.Models.ContentEditing
internal class ContentPropertyDto : ContentPropertyBasic
{
public IDataType DataType { get; set; }
public string Label { get; set; }
public string Description { get; set; }
public bool IsRequired { get; set; }
public string IsRequiredMessage { get; set; }
public string ValidationRegExp { get; set; }
public string ValidationRegExpMessage { get; set; }
}
}

View File

@@ -11,7 +11,13 @@ namespace Umbraco.Web.Models.ContentEditing
[DataMember(Name = "mandatory")]
public bool Mandatory { get; set; }
[DataMember(Name = "mandatoryMessage")]
public string MandatoryMessage { get; set; }
[DataMember(Name = "pattern")]
public string Pattern { get; set; }
[DataMember(Name = "patternMessage")]
public string PatternMessage { get; set; }
}
}

View File

@@ -45,7 +45,9 @@ namespace Umbraco.Web.Models.Mapping
//add the validation information
dest.Validation.Mandatory = originalProp.PropertyType.Mandatory;
dest.Validation.MandatoryMessage = originalProp.PropertyType.MandatoryMessage;
dest.Validation.Pattern = originalProp.PropertyType.ValidationRegExp;
dest.Validation.PatternMessage = originalProp.PropertyType.ValidationRegExpMessage;
if (dest.PropertyEditor == null)
{

View File

@@ -21,7 +21,9 @@ namespace Umbraco.Web.Models.Mapping
base.Map(property, dest, context);
dest.IsRequired = property.PropertyType.Mandatory;
dest.IsRequiredMessage = property.PropertyType.MandatoryMessage;
dest.ValidationRegExp = property.PropertyType.ValidationRegExp;
dest.ValidationRegExpMessage = property.PropertyType.ValidationRegExpMessage;
dest.Description = property.PropertyType.Description;
dest.Label = property.PropertyType.Name;
dest.DataType = DataTypeService.GetDataType(property.PropertyType.DataTypeId);

View File

@@ -222,9 +222,13 @@ namespace Umbraco.Web.Models.Mapping
target.DataTypeId = source.DataTypeId;
target.DataTypeKey = source.DataTypeKey;
target.Mandatory = source.Validation.Mandatory;
target.MandatoryMessage = source.Validation.MandatoryMessage;
target.ValidationRegExp = source.Validation.Pattern;
target.Variations = source.AllowCultureVariant ? ContentVariation.Culture : ContentVariation.Nothing;
target.ValidationRegExpMessage = source.Validation.PatternMessage;
target.Variations = source.AllowCultureVariant
? target.Variations.SetFlag(ContentVariation.Culture)
: target.Variations.UnsetFlag(ContentVariation.Culture);
if (source.Id > 0)
target.Id = source.Id;
@@ -395,9 +399,9 @@ namespace Umbraco.Web.Models.Mapping
if (!(target is IMemberType))
{
target.Variations = ContentVariation.Nothing;
if (source.AllowCultureVariant)
target.Variations |= ContentVariation.Culture;
target.Variations = source.AllowCultureVariant
? target.Variations.SetFlag(ContentVariation.Culture)
: target.Variations.UnsetFlag(ContentVariation.Culture);
}
// handle property groups and property types

View File

@@ -223,7 +223,13 @@ namespace Umbraco.Web.Models.Mapping
Alias = p.Alias,
Description = p.Description,
Editor = p.PropertyEditorAlias,
Validation = new PropertyTypeValidation {Mandatory = p.Mandatory, Pattern = p.ValidationRegExp},
Validation = new PropertyTypeValidation
{
Mandatory = p.Mandatory,
MandatoryMessage = p.MandatoryMessage,
Pattern = p.ValidationRegExp,
PatternMessage = p.ValidationRegExpMessage,
},
Label = p.Name,
View = propertyEditor.GetValueEditor().View,
Config = config,

View File

@@ -1,10 +1,9 @@
using System.Runtime.Serialization;
using Umbraco.Core.IO;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Exceptions;
using Umbraco.Core.IO;
using Umbraco.Web.Models.ContentEditing;
namespace Umbraco.Web.Models.Trees
@@ -27,7 +26,8 @@ namespace Umbraco.Web.Models.Trees
/// <param name="menuUrl"></param>
internal TreeNode(string nodeId, string parentId, string getChildNodesUrl, string menuUrl)
{
if (string.IsNullOrWhiteSpace(nodeId)) throw new ArgumentNullOrEmptyException(nameof(nodeId));
if (nodeId == null) throw new ArgumentNullException(nameof(nodeId));
if (string.IsNullOrWhiteSpace(nodeId)) throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(nodeId));
Id = nodeId;
ParentId = parentId;