Merge remote-tracking branch 'origin/netcore/dev' into netcore/feature/move-mappings-after-httpcontext

# Conflicts:
#	src/Umbraco.Infrastructure/Runtime/CoreInitialComposer.cs
This commit is contained in:
Bjarke Berg
2020-02-18 11:38:51 +01:00
6 changed files with 18 additions and 77 deletions

View File

@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Text;
using Umbraco.Core.Composing;
using Umbraco.Core.Composing;
using Umbraco.Web.Dashboards;
namespace Umbraco.Core
{
@@ -16,6 +14,14 @@ namespace Umbraco.Core
public static ComponentCollectionBuilder Components(this Composition composition)
=> composition.WithCollectionBuilder<ComponentCollectionBuilder>();
/// <summary>
/// Gets the backoffice dashboards collection builder.
/// </summary>
/// <param name="composition">The composition.</param>
public static DashboardCollectionBuilder Dashboards(this Composition composition)
=> composition.WithCollectionBuilder<DashboardCollectionBuilder>();
#endregion
}
}

View File

@@ -4,6 +4,7 @@ using Umbraco.Core.Composing;
using Umbraco.Core.Composing.CompositionExtensions;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.Dashboards;
using Umbraco.Core.Hosting;
using Umbraco.Core.Dictionary;
using Umbraco.Core.Logging;
@@ -25,6 +26,7 @@ using Umbraco.Web.PublishedCache;
using Umbraco.Web;
using Umbraco.Web.Install;
using Umbraco.Web.Trees;
using Umbraco.Web.Services;
using IntegerValidator = Umbraco.Core.PropertyEditors.Validators.IntegerValidator;
namespace Umbraco.Core.Runtime
@@ -150,6 +152,12 @@ namespace Umbraco.Core.Runtime
composition.RegisterUnique<IPublishedSnapshotAccessor, UmbracoContextPublishedSnapshotAccessor>();
composition.RegisterUnique<IVariationContextAccessor, HybridVariationContextAccessor>();
composition.RegisterUnique<IDashboardService, DashboardService>();
// register core CMS dashboards and 3rd party types - will be ordered by weight attribute & merged with package.manifest dashboards
composition.Dashboards()
.Add(composition.TypeLoader.GetTypes<IDashboard>());
}
}
}

View File

@@ -1,23 +0,0 @@
using Umbraco.Core.Composing;
namespace Umbraco.Web.Runtime
{
public sealed class BackOfficeComponent : IComponent
{
public BackOfficeComponent()
{
}
public void Initialize()
{
}
public void Terminate()
{
}
}
}

View File

@@ -1,26 +0,0 @@
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Dashboards;
using Umbraco.Core.Runtime;
using Umbraco.Web.Services;
namespace Umbraco.Web.Runtime
{
// web's initial composer composes after core's, and before all core composers
[ComposeAfter(typeof(CoreInitialComposer))]
[ComposeBefore(typeof(ICoreComposer))]
public sealed class BackOfficeComposer : ComponentComposer<BackOfficeComponent>
{
public override void Compose(Composition composition)
{
base.Compose(composition);
composition.RegisterUnique<IDashboardService, DashboardService>();
// register core CMS dashboards and 3rd party types - will be ordered by weight attribute & merged with package.manifest dashboards
composition.Dashboards()
.Add(composition.TypeLoader.GetTypes<IDashboard>());
}
}
}

View File

@@ -1,24 +0,0 @@
using Umbraco.Core.Composing;
using Umbraco.Web.Dashboards;
// ReSharper disable once CheckNamespace
namespace Umbraco.Web
{
/// <summary>
/// Provides extension methods to the <see cref="Composition"/> class.
/// </summary>
public static class WebCompositionExtensions
{
#region Collection Builders
/// <summary>
/// Gets the backoffice dashboards collection builder.
/// </summary>
/// <param name="composition">The composition.</param>
public static DashboardCollectionBuilder Dashboards(this Composition composition)
=> composition.WithCollectionBuilder<DashboardCollectionBuilder>();
#endregion
}
}