Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes more old backoffice files + Smidge! #15788

Merged
merged 2 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@
<PackageVersion Include="Serilog.Sinks.Map" Version="1.0.2" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.2" />
<PackageVersion Include="SixLabors.ImageSharp.Web" Version="3.1.0" />
<PackageVersion Include="Smidge.InMemory" Version="4.3.0" />
<PackageVersion Include="Smidge.Nuglify" Version="4.3.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup>
<!-- Transitive pinned versions (only required because our direct dependencies have vulnerable versions of transitive dependencies) -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public static IUmbracoBuilder
.AddConfiguration()
.AddUmbracoCore()
.AddWebComponents()
.AddRuntimeMinifier()
.AddBackOfficeCore()
.AddBackOfficeIdentity()
.AddBackOfficeAuthentication()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public static IUmbracoEndpointBuilderContext UseBackOfficeEndpoints(this IUmbrac
BackOfficeAreaRoutes backOfficeRoutes = app.ApplicationServices.GetRequiredService<BackOfficeAreaRoutes>();
backOfficeRoutes.CreateRoutes(app.EndpointRouteBuilder);

app.UseUmbracoRuntimeMinificationEndpoints();
app.UseUmbracoPreviewEndpoints();

return app;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Text;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Extensions;
using Newtonsoft.Json;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Serialization;
using Umbraco.Extensions;

namespace Umbraco.Cms.Api.Management.Middleware;
Expand All @@ -18,6 +18,13 @@ namespace Umbraco.Cms.Api.Management.Middleware;
/// </remarks>
public class BackOfficeExternalLoginProviderErrorMiddleware : IMiddleware
{
private readonly IJsonSerializer _jsonSerializer;

public BackOfficeExternalLoginProviderErrorMiddleware(IJsonSerializer jsonSerializer)
{
_jsonSerializer = jsonSerializer;
}

public async Task InvokeAsync(HttpContext context, RequestDelegate next)
{
var shortCircuit = false;
Expand All @@ -29,7 +36,7 @@ public async Task InvokeAsync(HttpContext context, RequestDelegate next)
{
shortCircuit = true;

var serialized = Convert.ToBase64String(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(errors)));
var serialized = Convert.ToBase64String(Encoding.UTF8.GetBytes(_jsonSerializer.Serialize(errors)));

context.Response.Cookies.Append(
ViewDataExtensions.TokenExternalSignInError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
using Umbraco.Cms.Core.Snippets;
using Umbraco.Cms.Core.Strings;
using Umbraco.Cms.Core.Tour;
using Umbraco.Cms.Core.Trees;
using Umbraco.Cms.Core.WebAssets;
using Umbraco.Cms.Core.Webhooks;
using Umbraco.Extensions;

Expand Down Expand Up @@ -97,7 +95,6 @@ internal static void AddAllCoreCollectionBuilders(this IUmbracoBuilder builder)
.Append<Hulu>()
.Append<Giphy>()
.Append<LottieFiles>();
builder.BackOfficeAssets();
builder.SelectorHandlers().Add(() => builder.TypeLoader.GetTypes<ISelectorHandler>());
builder.FilterHandlers().Add(() => builder.TypeLoader.GetTypes<IFilterHandler>());
builder.SortHandlers().Add(() => builder.TypeLoader.GetTypes<ISortHandler>());
Expand Down Expand Up @@ -244,12 +241,6 @@ public static MediaUrlGeneratorCollectionBuilder MediaUrlGenerators(this IUmbrac
public static EmbedProvidersCollectionBuilder EmbedProviders(this IUmbracoBuilder builder)
=> builder.WithCollectionBuilder<EmbedProvidersCollectionBuilder>();

/// <summary>
/// Gets the back office custom assets collection builder
/// </summary>
public static CustomBackOfficeAssetsCollectionBuilder BackOfficeAssets(this IUmbracoBuilder builder)
=> builder.WithCollectionBuilder<CustomBackOfficeAssetsCollectionBuilder>();

/// <summary>
/// Gets the Delivery API selector handler collection builder
/// </summary>
Expand Down
3 changes: 0 additions & 3 deletions src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
using Umbraco.Cms.Core.Features;
using Umbraco.Cms.Core.Handlers;
using Umbraco.Cms.Core.Hosting;
using Umbraco.Cms.Core.Install;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.Core.Logging;
using Umbraco.Cms.Core.Mail;
Expand Down Expand Up @@ -186,9 +185,7 @@
this.AddNotificationHandler<UmbracoApplicationStartingNotification, EssentialDirectoryCreator>();

Services.AddSingleton<UmbracoRequestPaths>();

Check notice on line 188 in src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (v14/dev)

✅ Getting better: Large Method

AddCoreServices decreases from 172 to 171 lines of code, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.
Services.AddSingleton<InstallStatusTracker>();

Services.AddUnique<ICultureDictionaryFactory, DefaultCultureDictionaryFactory>();
Services.AddSingleton(f => f.GetRequiredService<ICultureDictionaryFactory>().CreateDictionary());

Expand Down
157 changes: 0 additions & 157 deletions src/Umbraco.Core/Install/InstallStatusTracker.cs

This file was deleted.

56 changes: 0 additions & 56 deletions src/Umbraco.Core/Install/InstallSteps/FilePermissionsStep.cs

This file was deleted.

47 changes: 0 additions & 47 deletions src/Umbraco.Core/Install/InstallSteps/TelemetryIdentifierStep.cs

This file was deleted.