Merged with v8/dev

This commit is contained in:
Kenn Jacobsen
2019-09-09 11:22:39 +02:00
350 changed files with 6043 additions and 2856 deletions

View File

@@ -16,5 +16,10 @@
/// along with any content types that have matching property types that are included in the filtered content types
/// </summary>
public string[] FilterContentTypes { get; set; }
/// <summary>
/// Wether the content type is currently marked as an element type
/// </summary>
public bool IsElement { get; set; }
}
}

View File

@@ -8,6 +8,7 @@ using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Core.Services;
using Umbraco.Core.Exceptions;
namespace Umbraco.Web.Models.Mapping
{
@@ -577,7 +578,7 @@ namespace Umbraco.Web.Models.Mapping
udiType = Constants.UdiEntityType.DocumentType;
break;
default:
throw new Exception("panic");
throw new PanicException($"Source is of type {source.GetType()} which isn't supported here");
}
return Udi.Create(udiType, source.Key);

View File

@@ -46,10 +46,19 @@ namespace Umbraco.Web.Models.Mapping
target.Icon = Constants.Icons.Member;
if (source is IContentEntitySlim contentSlim)
{
source.AdditionalData["ContentTypeAlias"] = contentSlim.ContentTypeAlias;
}
if (source is IDocumentEntitySlim documentSlim)
{
source.AdditionalData["IsPublished"] = documentSlim.Published;
}
if (source is IMediaEntitySlim mediaSlim)
{
source.AdditionalData["MediaPath"] = mediaSlim.MediaPath;
}
// NOTE: we're mapping the objects in AdditionalData by object reference here.
// it works fine for now, but it's something to keep in mind in the future

View File

@@ -301,7 +301,7 @@ namespace Umbraco.Web.Models.Mapping
target.Avatars = source.GetUserAvatarUrls(_appCaches.RuntimeCache);
target.Culture = source.GetUserCulture(_textService, _globalSettings).ToString();
target.Email = source.Email;
target.EmailHash = source.Email.ToLowerInvariant().Trim().ToMd5();
target.EmailHash = source.Email.ToLowerInvariant().Trim().GenerateHash();
target.Id = source.Id;
target.Key = source.Key;
target.LastLoginDate = source.LastLoginDate == default ? null : (DateTime?) source.LastLoginDate;