diff --git a/src/Umbraco.Abstractions/CompositionExtensions.cs b/src/Umbraco.Abstractions/CompositionExtensions.cs index c65cff50d6..67f277734b 100644 --- a/src/Umbraco.Abstractions/CompositionExtensions.cs +++ b/src/Umbraco.Abstractions/CompositionExtensions.cs @@ -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(); + + /// + /// Gets the backoffice dashboards collection builder. + /// + /// The composition. + public static DashboardCollectionBuilder Dashboards(this Composition composition) + => composition.WithCollectionBuilder(); + #endregion } } diff --git a/src/Umbraco.Web.BackOffice/Dashboards/DashboardCollectionBuilder.cs b/src/Umbraco.Abstractions/Dashboards/DashboardCollectionBuilder.cs similarity index 100% rename from src/Umbraco.Web.BackOffice/Dashboards/DashboardCollectionBuilder.cs rename to src/Umbraco.Abstractions/Dashboards/DashboardCollectionBuilder.cs diff --git a/src/Umbraco.Infrastructure/Runtime/CoreInitialComposer.cs b/src/Umbraco.Infrastructure/Runtime/CoreInitialComposer.cs index 30c88452a7..cb81db4766 100644 --- a/src/Umbraco.Infrastructure/Runtime/CoreInitialComposer.cs +++ b/src/Umbraco.Infrastructure/Runtime/CoreInitialComposer.cs @@ -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; @@ -21,6 +22,7 @@ using Umbraco.Core.Services; using Umbraco.Core.Strings; using Umbraco.Core.Sync; using Umbraco.Web; +using Umbraco.Web.Services; using IntegerValidator = Umbraco.Core.PropertyEditors.Validators.IntegerValidator; namespace Umbraco.Core.Runtime @@ -139,6 +141,12 @@ namespace Umbraco.Core.Runtime composition.SetCultureDictionaryFactory(); composition.Register(f => f.GetInstance().CreateDictionary(), Lifetime.Singleton); composition.RegisterUnique(); + + composition.RegisterUnique(); + + // 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()); } } } diff --git a/src/Umbraco.Web.BackOffice/Compose/BackOfficeComponent.cs b/src/Umbraco.Web.BackOffice/Compose/BackOfficeComponent.cs deleted file mode 100644 index 53dd8c2327..0000000000 --- a/src/Umbraco.Web.BackOffice/Compose/BackOfficeComponent.cs +++ /dev/null @@ -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() - { - - } - - } -} diff --git a/src/Umbraco.Web.BackOffice/Compose/BackOfficeComposer.cs b/src/Umbraco.Web.BackOffice/Compose/BackOfficeComposer.cs deleted file mode 100644 index 5ccb96ea71..0000000000 --- a/src/Umbraco.Web.BackOffice/Compose/BackOfficeComposer.cs +++ /dev/null @@ -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 - { - public override void Compose(Composition composition) - { - base.Compose(composition); - - composition.RegisterUnique(); - - // 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()); - } - } -} - diff --git a/src/Umbraco.Web.BackOffice/CompositionExtensions.cs b/src/Umbraco.Web.BackOffice/CompositionExtensions.cs deleted file mode 100644 index eaf75bd7e5..0000000000 --- a/src/Umbraco.Web.BackOffice/CompositionExtensions.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Umbraco.Core.Composing; -using Umbraco.Web.Dashboards; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Web -{ - /// - /// Provides extension methods to the class. - /// - public static class WebCompositionExtensions - { - #region Collection Builders - - /// - /// Gets the backoffice dashboards collection builder. - /// - /// The composition. - public static DashboardCollectionBuilder Dashboards(this Composition composition) - => composition.WithCollectionBuilder(); - - #endregion - - } -}