AB4950 - Created new Umbraco.Web.BackOffice project. Moved dashboards into this new project (#7615)

This commit is contained in:
Bjarke Berg
2020-02-10 09:06:29 +01:00
committed by GitHub
parent 99e011dc01
commit b850b3c8fe
21 changed files with 100 additions and 25 deletions

View File

@@ -109,6 +109,10 @@
<Project>{3ae7bf57-966b-45a5-910a-954d7c554441}</Project>
<Name>Umbraco.Infrastructure</Name>
</ProjectReference>
<ProjectReference Include="..\Umbraco.Web.BackOffice\Umbraco.Web.BackOffice.csproj">
<Project>{9b95eef7-63fe-4432-8c63-166be9c1a929}</Project>
<Name>Umbraco.Web.BackOffice</Name>
</ProjectReference>
<ProjectReference Include="..\Umbraco.Web\Umbraco.Web.csproj">
<Project>{651e1350-91b6-44b7-bd60-7207006d7003}</Project>
<Name>Umbraco.Web</Name>

View File

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

View File

@@ -0,0 +1,26 @@
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

@@ -0,0 +1,24 @@
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
}
}

View File

@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Umbraco.Abstractions\Umbraco.Abstractions.csproj" />
<ProjectReference Include="..\Umbraco.Infrastructure\Umbraco.Infrastructure.csproj" />
</ItemGroup>
</Project>

View File

@@ -128,6 +128,10 @@
<Project>{f6de8da0-07cc-4ef2-8a59-2bc81dbb3830}</Project>
<Name>Umbraco.PublishedCache.NuCache</Name>
</ProjectReference>
<ProjectReference Include="..\Umbraco.Web.BackOffice\Umbraco.Web.BackOffice.csproj">
<Project>{9b95eef7-63fe-4432-8c63-166be9c1a929}</Project>
<Name>Umbraco.Web.BackOffice</Name>
</ProjectReference>
<ProjectReference Include="..\Umbraco.Web\Umbraco.Web.csproj">
<Project>{651e1350-91b6-44b7-bd60-7207006d7003}</Project>
<Name>Umbraco.Web</Name>

View File

@@ -104,13 +104,6 @@ namespace Umbraco.Web
public static SectionCollectionBuilder Sections(this Composition composition)
=> composition.WithCollectionBuilder<SectionCollectionBuilder>();
/// <summary>
/// Gets the backoffice dashboards collection builder.
/// </summary>
/// <param name="composition">The composition.</param>
public static DashboardCollectionBuilder Dashboards(this Composition composition)
=> composition.WithCollectionBuilder<DashboardCollectionBuilder>();
/// <summary>
/// Gets the backoffice OEmbed Providers collection builder.
/// </summary>

View File

@@ -149,9 +149,7 @@ namespace Umbraco.Web.Runtime
composition.RegisterUnique<IEventMessagesFactory, DefaultEventMessagesFactory>();
composition.RegisterUnique<IEventMessagesAccessor, HybridEventMessagesAccessor>();
composition.RegisterUnique<ITreeService, TreeService>();
composition.RegisterUnique<ISectionService, SectionService>();
composition.RegisterUnique<IDashboardService, DashboardService>();
composition.RegisterUnique<ISectionService, SectionService>();
composition.RegisterUnique<IExamineManager, ExamineManager>();
@@ -257,10 +255,6 @@ namespace Umbraco.Web.Runtime
.Append<FormsSection>()
.Append<TranslationSection>();
// 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>());
// register back office trees
// the collection builder only accepts types inheriting from TreeControllerBase
// and will filter out those that are not attributed with TreeAttribute

View File

@@ -145,17 +145,6 @@
<Compile Include="Composing\CompositionExtensions\Installer.cs" />
<Compile Include="Composing\LightInject\LightInjectContainer.cs" />
<Compile Include="Compose\BackOfficeUserAuditEventsComponent.cs" />
<Compile Include="Dashboards\ContentDashboard.cs" />
<Compile Include="Dashboards\DashboardCollectionBuilder.cs" />
<Compile Include="Dashboards\ExamineDashboard.cs" />
<Compile Include="Dashboards\FormsDashboard.cs" />
<Compile Include="Dashboards\HealthCheckDashboard.cs" />
<Compile Include="Dashboards\MediaDashboard.cs" />
<Compile Include="Dashboards\MembersDashboard.cs" />
<Compile Include="Dashboards\ProfilerDashboard.cs" />
<Compile Include="Dashboards\PublishedStatusDashboard.cs" />
<Compile Include="Dashboards\RedirectUrlDashboard.cs" />
<Compile Include="Dashboards\SettingsDashboards.cs" />
<Compile Include="Editors\BackOfficePreviewModel.cs" />
<Compile Include="Editors\Filters\ContentSaveModelValidator.cs" />
<Compile Include="Editors\Filters\MediaSaveModelValidator.cs" />

View File

@@ -117,6 +117,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.Examine", "Umbraco.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Examine.Lucene", "Umbraco.Examine.Lucene\Umbraco.Examine.Lucene.csproj", "{0FAD7D2A-D7DD-45B1-91FD-488BB6CDACEA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Web.BackOffice", "Umbraco.Web.BackOffice\Umbraco.Web.BackOffice.csproj", "{9B95EEF7-63FE-4432-8C63-166BE9C1A929}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -177,6 +179,10 @@ Global
{0FAD7D2A-D7DD-45B1-91FD-488BB6CDACEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0FAD7D2A-D7DD-45B1-91FD-488BB6CDACEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0FAD7D2A-D7DD-45B1-91FD-488BB6CDACEA}.Release|Any CPU.Build.0 = Release|Any CPU
{9B95EEF7-63FE-4432-8C63-166BE9C1A929}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9B95EEF7-63FE-4432-8C63-166BE9C1A929}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9B95EEF7-63FE-4432-8C63-166BE9C1A929}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9B95EEF7-63FE-4432-8C63-166BE9C1A929}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE