Merge remote-tracking branch 'origin/v8/dev' into netcore/dev

Signed-off-by: Bjarke Berg <mail@bergmania.dk>

# Conflicts:
#	src/Umbraco.Core/Models/PublishedContent/IndexedArrayItem.cs
#	src/Umbraco.Infrastructure/Models/Mapping/CommonMapper.cs
#	src/Umbraco.Web.UI/web.Template.Debug.config
#	src/Umbraco.Web/Compose/AuditEventsComponent.cs
#	src/Umbraco.Web/HtmlHelperRenderExtensions.cs
#	src/Umbraco.Web/HtmlStringUtilities.cs
#	src/Umbraco.Web/PublishedContentExtensions.cs
#	src/Umbraco.Web/Runtime/WebInitialComposer.cs
This commit is contained in:
Bjarke Berg
2020-06-28 12:35:20 +02:00
85 changed files with 1243 additions and 474 deletions

View File

@@ -30,9 +30,6 @@ namespace Umbraco.Web.ContentApps
Weight = Weight
});
case IContent _:
return null;
case IMedia media when !media.ContentType.IsContainer || media.Properties.Count > 0:
return _mediaApp ?? (_mediaApp = new ContentApp
{
@@ -43,9 +40,6 @@ namespace Umbraco.Web.ContentApps
Weight = Weight
});
case IMedia _:
return null;
case IMember _:
return _memberApp ?? (_memberApp = new ContentApp
{
@@ -57,7 +51,7 @@ namespace Umbraco.Web.ContentApps
});
default:
throw new NotSupportedException($"Object type {o.GetType()} is not supported here.");
return null;
}
}
}

View File

@@ -49,7 +49,7 @@ namespace Umbraco.Web.ContentApps
});
default:
throw new NotSupportedException($"Object type {o.GetType()} is not supported here.");
return null;
}
}
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using Umbraco.Core.Models;
using Umbraco.Core.Models.ContentEditing;
using Umbraco.Core.Models.Membership;
namespace Umbraco.Web.ContentApps
{
public class ContentTypeDesignContentAppFactory : IContentAppFactory
{
private const int Weight = -200;
private ContentApp _contentTypeApp;
public ContentApp GetContentAppFor(object source, IEnumerable<IReadOnlyUserGroup> userGroups)
{
switch (source)
{
case IContentType _:
return _contentTypeApp ?? (_contentTypeApp = new ContentApp()
{
Alias = "design",
Name = "Design",
Icon = "icon-document-dashed-line",
View = "views/documenttypes/views/design/design.html",
Weight = Weight
});
default:
return null;
}
}
}
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using Umbraco.Core.Models;
using Umbraco.Core.Models.ContentEditing;
using Umbraco.Core.Models.Membership;
namespace Umbraco.Web.ContentApps
{
public class ContentTypeListViewContentAppFactory : IContentAppFactory
{
private const int Weight = -180;
private ContentApp _contentTypeApp;
public ContentApp GetContentAppFor(object source, IEnumerable<IReadOnlyUserGroup> userGroups)
{
switch (source)
{
case IContentType _:
return _contentTypeApp ?? (_contentTypeApp = new ContentApp()
{
Alias = "listView",
Name = "List view",
Icon = "icon-list",
View = "views/documenttypes/views/listview/listview.html",
Weight = Weight
});
default:
return null;
}
}
}
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using Umbraco.Core.Models;
using Umbraco.Core.Models.ContentEditing;
using Umbraco.Core.Models.Membership;
namespace Umbraco.Web.ContentApps
{
public class ContentTypePermissionsContentAppFactory : IContentAppFactory
{
private const int Weight = -160;
private ContentApp _contentTypeApp;
public ContentApp GetContentAppFor(object source, IEnumerable<IReadOnlyUserGroup> userGroups)
{
switch (source)
{
case IContentType _:
return _contentTypeApp ?? (_contentTypeApp = new ContentApp()
{
Alias = "permissions",
Name = "Permissions",
Icon = "icon-keychain",
View = "views/documenttypes/views/permissions/permissions.html",
Weight = Weight
});
default:
return null;
}
}
}
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using Umbraco.Core.Models;
using Umbraco.Core.Models.ContentEditing;
using Umbraco.Core.Models.Membership;
namespace Umbraco.Web.ContentApps
{
public class ContentTypeTemplatesContentAppFactory : IContentAppFactory
{
private const int Weight = -140;
private ContentApp _contentTypeApp;
public ContentApp GetContentAppFor(object source, IEnumerable<IReadOnlyUserGroup> userGroups)
{
switch (source)
{
case IContentType _:
return _contentTypeApp ?? (_contentTypeApp = new ContentApp()
{
Alias = "templates",
Name = "Templates",
Icon = "icon-layout",
View = "views/documenttypes/views/templates/templates.html",
Weight = Weight
});
default:
return null;
}
}
}
}

View File

@@ -45,10 +45,8 @@ namespace Umbraco.Web.ContentApps
entityType = "media";
dtdId = Core.Constants.DataTypes.DefaultMediaListView;
break;
case IMember member:
return null;
default:
throw new NotSupportedException($"Object type {o.GetType()} is not supported here.");
return null;
}
return CreateContentApp(_dataTypeService, _propertyEditors, entityType, contentTypeAlias, dtdId);