Adds 'VariesByCulture` property to ContentItemBasic model & its mapping - so that the GetChildren API call for list view can know if each child item varies by culture or not

This commit is contained in:
Warren Buckley
2018-11-01 11:29:16 +00:00
parent 828c915691
commit e07e12092c
2 changed files with 5 additions and 1 deletions

View File

@@ -55,6 +55,9 @@ namespace Umbraco.Web.Models.ContentEditing
[JsonConverter(typeof(StringEnumConverter))]
public ContentSavedState? State { get; set; }
[DataMember(Name = "variesByCulture")]
public bool VariesByCulture { get; set; }
protected bool Equals(ContentItemBasic other)
{
return Id == other.Id;

View File

@@ -82,7 +82,8 @@ namespace Umbraco.Web.Models.Mapping
.ForMember(dest => dest.AdditionalData, opt => opt.Ignore())
.ForMember(dest => dest.UpdateDate, opt => opt.ResolveUsing<UpdateDateResolver>())
.ForMember(dest => dest.Name, opt => opt.ResolveUsing<NameResolver>())
.ForMember(dest => dest.State, opt => opt.ResolveUsing<ContentBasicSavedStateResolver<ContentPropertyBasic>>());
.ForMember(dest => dest.State, opt => opt.ResolveUsing<ContentBasicSavedStateResolver<ContentPropertyBasic>>())
.ForMember(dest => dest.VariesByCulture, opt => opt.MapFrom(src => src.ContentType.VariesByCulture()));
//FROM IContent TO ContentPropertyCollectionDto
//NOTE: the property mapping for cultures relies on a culture being set in the mapping context