Merge remote-tracking branch 'origin/temp8' into temp8-3305-filter-for-current-culture-in-ipublishedcontent-linq

# Conflicts:
#	src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs
This commit is contained in:
Bjarke Berg
2019-01-15 15:20:56 +01:00
29 changed files with 1039 additions and 917 deletions
+1 -1
View File
@@ -22,7 +22,7 @@
not want this to happen as the alpha of the next major is, really, the next major already.
-->
<dependency id="Microsoft.AspNet.SignalR.Core" version="[2.2.3, 2.999999)" />
<dependency id="Umbraco.ModelsBuilder.Ui" version="[8.0.0-alpha.31]" />
<dependency id="Umbraco.ModelsBuilder.Ui" version="[8.0.0-alpha.32]" />
<dependency id="ImageProcessor.Web" version="[4.9.3.25,4.999999)" />
<dependency id="ImageProcessor.Web.Config" version="[2.4.1.19,2.999999)" />
<dependency id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="[2.0.1,2.999999)" />
@@ -121,6 +121,8 @@ namespace Umbraco.Core.Migrations.Upgrade
To<DropTaskTables>("{648A2D5F-7467-48F8-B309-E99CEEE00E2A}"); // fixed version
To<MakeTagsVariant>("{C39BF2A7-1454-4047-BBFE-89E40F66ED63}");
To<MakeRedirectUrlVariant>("{64EBCE53-E1F0-463A-B40B-E98EFCCA8AE2}");
To<AddContentTypeIsElementColumn>("{0009109C-A0B8-4F3F-8FEB-C137BBDDA268}");
//FINAL
@@ -0,0 +1,15 @@
using Umbraco.Core.Persistence.Dtos;
namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
{
public class AddContentTypeIsElementColumn : MigrationBase
{
public AddContentTypeIsElementColumn(IMigrationContext context) : base(context)
{ }
public override void Migrate()
{
AddColumn<ContentTypeDto>("isElement");
}
}
}
@@ -26,6 +26,7 @@ namespace Umbraco.Core.Models
private string _thumbnail = "folder.png";
private bool _allowedAsRoot; // note: only one that's not 'pure element type'
private bool _isContainer;
private bool _isElement;
private PropertyGroupCollection _propertyGroups;
private PropertyTypeCollection _noGroupPropertyTypes;
private IEnumerable<ContentTypeSort> _allowedContentTypes;
@@ -90,6 +91,7 @@ namespace Umbraco.Core.Models
public readonly PropertyInfo IconSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Icon);
public readonly PropertyInfo ThumbnailSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Thumbnail);
public readonly PropertyInfo AllowedAsRootSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.AllowedAsRoot);
public readonly PropertyInfo IsElementSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.IsElement);
public readonly PropertyInfo IsContainerSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.IsContainer);
public readonly PropertyInfo AllowedContentTypesSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, IEnumerable<ContentTypeSort>>(x => x.AllowedContentTypes);
public readonly PropertyInfo PropertyGroupsSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, PropertyGroupCollection>(x => x.PropertyGroups);
@@ -180,6 +182,14 @@ namespace Umbraco.Core.Models
set => SetPropertyValueAndDetectChanges(value, ref _isContainer, Ps.Value.IsContainerSelector);
}
/// <inheritdoc />
[DataMember]
public bool IsElement
{
get => _isElement;
set => SetPropertyValueAndDetectChanges(value, ref _isElement, Ps.Value.IsElementSelector);
}
/// <summary>
/// Gets or sets a list of integer Ids for allowed ContentTypes
/// </summary>
@@ -15,7 +15,8 @@ namespace Umbraco.Core.Models
{
var type = contentType.GetType();
var itemType = PublishedItemType.Unknown;
if (typeof(IContentType).IsAssignableFrom(type)) itemType = PublishedItemType.Content;
if (contentType.IsElement) itemType = PublishedItemType.Element;
else if (typeof(IContentType).IsAssignableFrom(type)) itemType = PublishedItemType.Content;
else if (typeof(IMediaType).IsAssignableFrom(type)) itemType = PublishedItemType.Media;
else if (typeof(IMemberType).IsAssignableFrom(type)) itemType = PublishedItemType.Member;
return itemType;
+11 -1
View File
@@ -25,7 +25,7 @@ namespace Umbraco.Core.Models
/// the icon (eg. <c>icon-home</c>) along with an optional CSS class name representing the
/// color (eg. <c>icon-blue</c>). Put together, the value for this scenario would be
/// <c>icon-home color-blue</c>.
///
///
/// If a class name for the color isn't specified, the icon color will default to black.
/// </summary>
string Icon { get; set; }
@@ -48,6 +48,16 @@ namespace Umbraco.Core.Models
/// </remarks>
bool IsContainer { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this content type is for an element.
/// </summary>
/// <remarks>
/// <para>By default a content type is for a true media, member or document, but
/// it can also be for an element, ie a subset that can for instance be used in
/// nested content.</para>
/// </remarks>
bool IsElement { get; set; }
/// <summary>
/// Gets or sets the content variation of the content type.
/// </summary>
@@ -4,13 +4,18 @@
/// The type of published element.
/// </summary>
/// <remarks>Can be a simple element, or a document, a media, a member.</remarks>
public enum PublishedItemType // fixme - need to rename to PublishedElementType but then conflicts?
public enum PublishedItemType
{
/// <summary>
/// Unknown.
/// </summary>
Unknown = 0,
/// <summary>
/// An element.
/// </summary>
Element,
/// <summary>
/// A document.
/// </summary>
@@ -41,6 +41,10 @@ namespace Umbraco.Core.Persistence.Dtos
[Constraint(Default = "0")]
public bool IsContainer { get; set; }
[Column("isElement")]
[Constraint(Default = "0")]
public bool IsElement { get; set; }
[Column("allowAtRoot")]
[Constraint(Default = "0")]
public bool AllowAtRoot { get; set; }
@@ -107,6 +107,7 @@ namespace Umbraco.Core.Persistence.Factories
entity.CreatorId = dto.NodeDto.UserId ?? Constants.Security.UnknownUserId;
entity.AllowedAsRoot = dto.AllowAtRoot;
entity.IsContainer = dto.IsContainer;
entity.IsElement = dto.IsElement;
entity.Trashed = dto.NodeDto.Trashed;
entity.Variations = (ContentVariation) dto.Variations;
}
@@ -132,6 +133,7 @@ namespace Umbraco.Core.Persistence.Factories
NodeId = entity.Id,
AllowAtRoot = entity.AllowedAsRoot,
IsContainer = entity.IsContainer,
IsElement = entity.IsElement,
Variations = (byte) entity.Variations,
NodeDto = BuildNodeDto(entity, nodeObjectType)
};
@@ -35,6 +35,7 @@ namespace Umbraco.Core.Persistence.Mappers
CacheMap<ContentType, ContentTypeDto>(src => src.Description, dto => dto.Description);
CacheMap<ContentType, ContentTypeDto>(src => src.Icon, dto => dto.Icon);
CacheMap<ContentType, ContentTypeDto>(src => src.IsContainer, dto => dto.IsContainer);
CacheMap<ContentType, ContentTypeDto>(src => src.IsElement, dto => dto.IsElement);
CacheMap<ContentType, ContentTypeDto>(src => src.Thumbnail, dto => dto.Thumbnail);
}
}
@@ -35,6 +35,7 @@ namespace Umbraco.Core.Persistence.Mappers
CacheMap<MediaType, ContentTypeDto>(src => src.Description, dto => dto.Description);
CacheMap<MediaType, ContentTypeDto>(src => src.Icon, dto => dto.Icon);
CacheMap<MediaType, ContentTypeDto>(src => src.IsContainer, dto => dto.IsContainer);
CacheMap<MediaType, ContentTypeDto>(src => src.IsElement, dto => dto.IsElement);
CacheMap<MediaType, ContentTypeDto>(src => src.Thumbnail, dto => dto.Thumbnail);
}
}
@@ -35,6 +35,7 @@ namespace Umbraco.Core.Persistence.Mappers
CacheMap<MemberType, ContentTypeDto>(src => src.Description, dto => dto.Description);
CacheMap<MemberType, ContentTypeDto>(src => src.Icon, dto => dto.Icon);
CacheMap<MemberType, ContentTypeDto>(src => src.IsContainer, dto => dto.IsContainer);
CacheMap<MemberType, ContentTypeDto>(src => src.IsElement, dto => dto.IsElement);
CacheMap<MemberType, ContentTypeDto>(src => src.Thumbnail, dto => dto.Thumbnail);
}
}
@@ -1283,7 +1283,7 @@ AND umbracoNode.id <> @id",
if (db == null) throw new ArgumentNullException(nameof(db));
var sql = @"SELECT cmsContentType.pk as ctPk, cmsContentType.alias as ctAlias, cmsContentType.allowAtRoot as ctAllowAtRoot, cmsContentType.description as ctDesc, cmsContentType.variations as ctVariations,
cmsContentType.icon as ctIcon, cmsContentType.isContainer as ctIsContainer, cmsContentType.nodeId as ctId, cmsContentType.thumbnail as ctThumb,
cmsContentType.icon as ctIcon, cmsContentType.isContainer as ctIsContainer, cmsContentType.IsElement as ctIsElement, cmsContentType.nodeId as ctId, cmsContentType.thumbnail as ctThumb,
AllowedTypes.AllowedId as ctaAllowedId, AllowedTypes.SortOrder as ctaSortOrder, AllowedTypes.alias as ctaAlias,
ParentTypes.parentContentTypeId as chtParentId, ParentTypes.parentContentTypeKey as chtParentKey,
umbracoNode.createDate as nCreateDate, umbracoNode." + sqlSyntax.GetQuotedColumnName("level") + @" as nLevel, umbracoNode.nodeObjectType as nObjectType, umbracoNode.nodeUser as nUser,
@@ -1384,6 +1384,7 @@ AND umbracoNode.id <> @id",
Description = currCt.ctDesc,
Icon = currCt.ctIcon,
IsContainer = currCt.ctIsContainer,
IsElement = currCt.ctIsElement,
NodeId = currCt.ctId,
PrimaryKey = currCt.ctPk,
Thumbnail = currCt.ctThumb,
@@ -1422,7 +1423,7 @@ AND umbracoNode.id <> @id",
var sql = @"SELECT cmsDocumentType.IsDefault as dtIsDefault, cmsDocumentType.templateNodeId as dtTemplateId,
cmsContentType.pk as ctPk, cmsContentType.alias as ctAlias, cmsContentType.allowAtRoot as ctAllowAtRoot, cmsContentType.description as ctDesc, cmsContentType.variations as ctVariations,
cmsContentType.icon as ctIcon, cmsContentType.isContainer as ctIsContainer, cmsContentType.nodeId as ctId, cmsContentType.thumbnail as ctThumb,
cmsContentType.icon as ctIcon, cmsContentType.isContainer as ctIsContainer, cmsContentType.IsElement as ctIsElement, cmsContentType.nodeId as ctId, cmsContentType.thumbnail as ctThumb,
AllowedTypes.AllowedId as ctaAllowedId, AllowedTypes.SortOrder as ctaSortOrder, AllowedTypes.alias as ctaAlias,
ParentTypes.parentContentTypeId as chtParentId,ParentTypes.parentContentTypeKey as chtParentKey,
umbracoNode.createDate as nCreateDate, umbracoNode." + sqlSyntax.GetQuotedColumnName("level") + @" as nLevel, umbracoNode.nodeObjectType as nObjectType, umbracoNode.nodeUser as nUser,
@@ -1559,6 +1560,7 @@ AND umbracoNode.id <> @id",
Description = currCt.ctDesc,
Icon = currCt.ctIcon,
IsContainer = currCt.ctIsContainer,
IsElement = currCt.ctIsElement,
NodeId = currCt.ctId,
PrimaryKey = currCt.ctPk,
Thumbnail = currCt.ctThumb,
@@ -337,7 +337,8 @@ namespace Umbraco.Core.Services
new XElement("Thumbnail", contentType.Thumbnail),
new XElement("Description", contentType.Description),
new XElement("AllowAtRoot", contentType.AllowedAsRoot.ToString()),
new XElement("IsListView", contentType.IsContainer.ToString()));
new XElement("IsListView", contentType.IsContainer.ToString()),
new XElement("IsElement", contentType.IsElement.ToString()));
var masterContentType = contentType.ContentTypeComposition.FirstOrDefault(x => x.Id == contentType.ParentId);
if(masterContentType != null)
@@ -578,6 +578,10 @@ namespace Umbraco.Core.Services.Implement
if (isListView != null)
contentType.IsContainer = isListView.Value.InvariantEquals("true");
var isElement = infoElement.Element("IsElement");
if (isListView != null)
contentType.IsElement = isElement.Value.InvariantEquals("true");
//Name of the master corresponds to the parent and we need to ensure that the Parent Id is set
var masterElement = infoElement.Element("Master");
if (masterElement != null)
+1
View File
@@ -377,6 +377,7 @@
<Compile Include="Migrations\Upgrade\V_7_9_0\AddUmbracoAuditTable.cs" />
<Compile Include="Migrations\Upgrade\V_7_9_0\AddUmbracoConsentTable.cs" />
<Compile Include="Migrations\Upgrade\V_7_9_0\CreateSensitiveDataUserGroup.cs" />
<Compile Include="Migrations\Upgrade\V_8_0_0\AddContentTypeIsElementColumn.cs" />
<Compile Include="Migrations\Upgrade\V_8_0_0\AddLogTableColumns.cs" />
<Compile Include="Migrations\Upgrade\V_8_0_0\AddTypedLabels.cs" />
<Compile Include="Migrations\Upgrade\V_8_0_0\AddVariationTables1A.cs" />
File diff suppressed because it is too large Load Diff
@@ -22,6 +22,36 @@ namespace Umbraco.Tests.Services
[UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, PublishedRepositoryEvents = true)]
public class ContentTypeServiceTests : TestWithSomeContentBase
{
[Test]
public void CanSaveAndGetIsElement()
{
//create content type with a property type that varies by culture
IContentType contentType = MockedContentTypes.CreateBasicContentType();
contentType.Variations = ContentVariation.Nothing;
var contentCollection = new PropertyTypeCollection(true);
contentCollection.Add(new PropertyType("test", ValueStorageType.Ntext)
{
Alias = "title",
Name = "Title",
Description = "",
Mandatory = false,
SortOrder = 1,
DataTypeId = -88,
Variations = ContentVariation.Nothing
});
contentType.PropertyGroups.Add(new PropertyGroup(contentCollection) { Name = "Content", SortOrder = 1 });
ServiceContext.ContentTypeService.Save(contentType);
contentType = ServiceContext.ContentTypeService.Get(contentType.Id);
Assert.IsFalse(contentType.IsElement);
contentType.IsElement = true;
ServiceContext.ContentTypeService.Save(contentType);
contentType = ServiceContext.ContentTypeService.Get(contentType.Id);
Assert.IsTrue(contentType.IsElement);
}
[Test]
public void Change_Content_Type_Variation_Clears_Redirects()
{
@@ -130,8 +130,7 @@
if (!changes.value.isFirstChange() && changes.value.currentValue !== changes.value.previousValue) {
configureViewModel();
//this is required to re-validate
vm.tagEditorForm.tagCount.$setViewValue(vm.viewModel.length);
reValidate()
}
}
@@ -182,6 +181,8 @@
else {
vm.onValueChanged({ value: [] });
}
reValidate();
}
/**
@@ -189,7 +190,7 @@
*/
function validateMandatory() {
return {
isValid: !vm.validation.mandatory || (vm.viewModel != null && vm.viewModel.length > 0),
isValid: !vm.validation.mandatory || (vm.viewModel != null && vm.viewModel.length > 0)|| (vm.value != null && vm.value.length > 0),
errorMsg: "Value cannot be empty",
errorKey: "required"
};
@@ -271,6 +272,10 @@
});
}
function reValidate() {
//this is required to re-validate
vm.tagEditorForm.tagCount.$setViewValue(vm.viewModel.length);
}
}
@@ -64,7 +64,7 @@
var saveModel = _.pick(displayModel,
'compositeContentTypes', 'isContainer', 'allowAsRoot', 'allowedTemplates', 'allowedContentTypes',
'alias', 'description', 'thumbnail', 'name', 'id', 'icon', 'trashed',
'key', 'parentId', 'alias', 'path', 'allowCultureVariant');
'key', 'parentId', 'alias', 'path', 'allowCultureVariant', 'isElement');
//TODO: Map these
saveModel.allowedTemplates = _.map(displayModel.allowedTemplates, function (t) { return t.alias; });
@@ -262,7 +262,7 @@
saveModel[props[m]] = startId.id;
}
saveModel.parentId = -1;
saveModel.parentId = -1;
return saveModel;
},
@@ -293,7 +293,7 @@
});
saveModel.email = propEmail.value.trim();
saveModel.username = propLogin.value.trim();
saveModel.password = this.formatChangePasswordModel(propPass.value);
var selectedGroups = [];
@@ -336,7 +336,7 @@
/** formats the display model used to display the media to the model used to save the media */
formatMediaPostData: function (displayModel, action) {
//NOTE: the display model inherits from the save model so we can in theory just post up the display model but
//NOTE: the display model inherits from the save model so we can in theory just post up the display model but
// we don't want to post all of the data as it is unecessary.
var saveModel = {
id: displayModel.id,
@@ -354,7 +354,7 @@
/** formats the display model used to display the content to the model used to save the content */
formatContentPostData: function (displayModel, action) {
//NOTE: the display model inherits from the save model so we can in theory just post up the display model but
//NOTE: the display model inherits from the save model so we can in theory just post up the display model but
// we don't want to post all of the data as it is unecessary.
var saveModel = {
id: displayModel.id,
@@ -379,7 +379,7 @@
var propExpireDate = displayModel.removeDate;
var propReleaseDate = displayModel.releaseDate;
var propTemplate = displayModel.template;
saveModel.expireDate = propExpireDate ? propExpireDate : null;
saveModel.releaseDate = propReleaseDate ? propReleaseDate : null;
saveModel.templateAlias = propTemplate ? propTemplate : null;
@@ -389,8 +389,8 @@
/**
* This formats the server GET response for a content display item
* @param {} displayModel
* @returns {}
* @param {} displayModel
* @returns {}
*/
formatContentGetData: function(displayModel) {
@@ -418,7 +418,7 @@
}
});
});
//now assign this same invariant property instance to the same index of the other variants property array
for (var j = 1; j < displayModel.variants.length; j++) {
@@ -25,6 +25,7 @@
vm.removeChild = removeChild;
vm.toggleAllowAsRoot = toggleAllowAsRoot;
vm.toggleAllowCultureVariants = toggleAllowCultureVariants;
vm.toggleIsElement = toggleIsElement;
/* ---------- INIT ---------- */
@@ -84,25 +85,18 @@
$scope.model.allowedContentTypes.splice(selectedChildIndex, 1);
}
/**
* Toggle the $scope.model.allowAsRoot value to either true or false
*/
function toggleAllowAsRoot(){
if($scope.model.allowAsRoot){
$scope.model.allowAsRoot = false;
return;
}
// note: "safe toggling" here ie handling cases where the value is undefined, etc
$scope.model.allowAsRoot = true;
function toggleAllowAsRoot() {
$scope.model.allowAsRoot = $scope.model.allowAsRoot ? false : true;
}
function toggleAllowCultureVariants() {
if ($scope.model.allowCultureVariant) {
$scope.model.allowCultureVariant = false;
return;
}
$scope.model.allowCultureVariant = $scope.model.allowCultureVariant ? false : true;
}
$scope.model.allowCultureVariant = true;
function toggleIsElement() {
$scope.model.isElement = $scope.model.isElement ? false : true;
}
}
@@ -53,9 +53,25 @@
hotkey="alt+shift+v">
</umb-toggle>
</div>
</div>
</umb-box-content>
<div class="sub-view-columns">
<div class="sub-view-column-left">
<h5><localize key="contentTypeEditor_elementHeading" /></h5>
<small><localize key="contentTypeEditor_elementDescription" /></small>
</div>
<div class="sub-view-column-right">
<umb-toggle data-element="permissions-is-element"
checked="model.isElement"
on-click="vm.toggleIsElement()">
</umb-toggle>
</div>
</div>
</umb-box-content>
</umb-box>
</div>
+1 -1
View File
@@ -107,7 +107,7 @@
<PackageReference Include="MySql.Data" Version="6.10.7" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Umbraco.ModelsBuilder.Ui">
<Version>8.0.0-alpha.31</Version>
<Version>8.0.0-alpha.32</Version>
</PackageReference>
<PackageReference Include="Umbraco.SqlServerCE" Version="4.0.0.1" />
</ItemGroup>
@@ -1518,6 +1518,8 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="variantsHeading">Allow varying by culture</key>
<key alias="variantsDescription">Allow editors to create content of this type in different languages</key>
<key alias="allowVaryByCulture">Allow varying by culture</key>
<key alias="elementHeading">Is an Element type</key>
<key alias="elementDescription">An Element type is meant to be used for instance in Nested Content, and not in the tree</key>
</area>
<area alias="modelsBuilder">
<key alias="buildingModels">Building models</key>
@@ -1559,6 +1559,8 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="variantsHeading">Allow varying by culture</key>
<key alias="variantsDescription">Allow editors to create content of this type in different languages</key>
<key alias="allowVaryByCulture">Allow varying by culture</key>
<key alias="elementHeading">Is an Element type</key>
<key alias="elementDescription">An Element type is meant to be used for instance in Nested Content, and not in the tree</key>
</area>
<area alias="languages">
<key alias="addLanguage">Add language</key>
@@ -86,6 +86,12 @@ namespace Umbraco.Web.Models.ContentEditing
[DataMember(Name = "isContainer")]
public bool IsContainer { get; set; }
/// <summary>
/// Indicates if the content is configured as an element
/// </summary>
[DataMember(Name = "isElement")]
public bool IsElement { get; set; }
/// <summary>
/// Property indicating if this item is part of a list view parent
/// </summary>
@@ -117,7 +123,7 @@ namespace Umbraco.Web.Models.ContentEditing
/// </remarks>
[DataMember(Name = "updateDate")]
public DateTime UpdateDate { get; set; }
[DataMember(Name = "template")]
public string TemplateAlias { get; set; }
@@ -26,6 +26,10 @@ namespace Umbraco.Web.Models.ContentEditing
[DataMember(Name = "isContainer")]
public bool IsContainer { get; set; }
//Element
[DataMember(Name = "isElement")]
public bool IsElement { get; set; }
[DataMember(Name = "listViewEditorName")]
[ReadOnly(true)]
public string ListViewEditorName { get; set; }
@@ -25,6 +25,9 @@ namespace Umbraco.Web.Models.ContentEditing
[DataMember(Name = "isContainer")]
public bool IsContainer { get; set; }
[DataMember(Name = "isElement")]
public bool IsElement { get; set; }
[DataMember(Name = "allowAsRoot")]
public bool AllowAsRoot { get; set; }
@@ -46,6 +46,7 @@ namespace Umbraco.Web.Models.Mapping
.ForMember(dest => dest.ContentTypeAlias, opt => opt.MapFrom(src => src.ContentType.Alias))
.ForMember(dest => dest.ContentTypeName, opt => opt.MapFrom(src => src.ContentType.Name))
.ForMember(dest => dest.IsContainer, opt => opt.MapFrom(src => src.ContentType.IsContainer))
.ForMember(dest => dest.IsElement, opt => opt.MapFrom(src => src.ContentType.IsElement))
.ForMember(dest => dest.IsBlueprint, opt => opt.MapFrom(src => src.Blueprint))
.ForMember(dest => dest.IsChildOfListView, opt => opt.ResolveUsing(childOfListViewResolver))
.ForMember(dest => dest.Trashed, opt => opt.MapFrom(src => src.Trashed))
@@ -59,7 +60,7 @@ namespace Umbraco.Web.Models.Mapping
.ForMember(dest => dest.AllowedTemplates, opt =>
opt.MapFrom(content => content.ContentType.AllowedTemplates
.Where(t => t.Alias.IsNullOrWhiteSpace() == false && t.Name.IsNullOrWhiteSpace() == false)
.ToDictionary(t => t.Alias, t => t.Name)))
.ToDictionary(t => t.Alias, t => t.Name)))
.ForMember(dest => dest.AllowedActions, opt => opt.ResolveUsing(src => actionButtonsResolver.Resolve(src)))
.ForMember(dest => dest.AdditionalData, opt => opt.Ignore());
@@ -140,5 +141,5 @@ namespace Umbraco.Web.Models.Mapping
return source.CultureInfos.TryGetValue(culture, out var name) && !name.Name.IsNullOrWhiteSpace() ? name.Name : $"(({source.Name}))";
}
}
}
}
}