Merge remote-tracking branch 'origin/v8/dev' into v8/feature/media-tracking

# Conflicts:
#	src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs
#	src/Umbraco.Core/Models/RelationType.cs
#	src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs
#	src/Umbraco.Web/UmbracoComponentRenderer.cs
This commit is contained in:
Shannon
2019-12-18 15:28:27 +11:00
275 changed files with 4520 additions and 3266 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

@@ -42,7 +42,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

@@ -177,6 +177,14 @@ namespace Umbraco.Web.Models.Mapping
target.Name = source.Values.ContainsKey("nodeName") ? source.Values["nodeName"] : "[no name]";
if (source.Values.TryGetValue(UmbracoExamineIndex.UmbracoFileFieldName, out var umbracoFile))
{
if (umbracoFile != null)
{
target.Name = $"{target.Name} ({umbracoFile})";
}
}
if (source.Values.ContainsKey(UmbracoExamineIndex.NodeKeyFieldName))
{
if (Guid.TryParse(source.Values[UmbracoExamineIndex.NodeKeyFieldName], out var key))

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;