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

Add AddSiteDisplayDriver extension #16617

Merged
merged 3 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/OrchardCore.Modules/OrchardCore.Admin/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
using OrchardCore.Mvc.Routing;
using OrchardCore.Navigation;
using OrchardCore.Security.Permissions;
using OrchardCore.Settings;
using OrchardCore.Settings.Deployment;

namespace OrchardCore.Admin;
Expand Down Expand Up @@ -55,7 +54,7 @@ public override void ConfigureServices(IServiceCollection services)
services.AddScoped<IPermissionProvider, Permissions>();
services.AddScoped<IThemeSelector, AdminThemeSelector>();
services.AddScoped<IAdminThemeService, AdminThemeService>();
services.AddScoped<IDisplayDriver<ISite>, AdminSiteSettingsDisplayDriver>();
services.AddSiteDisplayDriver<AdminSiteSettingsDisplayDriver>();
services.AddScoped<IPermissionProvider, PermissionsAdminSettings>();
services.AddScoped<INavigationProvider, AdminMenu>();
services.AddSingleton<IPageRouteModelProvider, AdminPageRouteModelProvider>();
Expand Down
5 changes: 2 additions & 3 deletions src/OrchardCore.Modules/OrchardCore.AuditTrail/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
using OrchardCore.Modules;
using OrchardCore.Navigation;
using OrchardCore.Security.Permissions;
using OrchardCore.Settings;
using OrchardCore.Settings.Deployment;
using YesSql.Filters.Query;

Expand Down Expand Up @@ -47,8 +46,8 @@ public override void ConfigureServices(IServiceCollection services)
services.AddScoped<INavigationProvider, AuditTrailAdminMenu>();
services.AddScoped<INavigationProvider, AuditTrailSettingsAdminMenu>();

services.AddScoped<IDisplayDriver<ISite>, AuditTrailSettingsDisplayDriver>();
services.AddScoped<IDisplayDriver<ISite>, AuditTrailTrimmingSettingsDisplayDriver>();
services.AddSiteDisplayDriver<AuditTrailSettingsDisplayDriver>();
services.AddSiteDisplayDriver<AuditTrailTrimmingSettingsDisplayDriver>();
MikeAlhayek marked this conversation as resolved.
Show resolved Hide resolved

services.AddScoped<IDisplayDriver<AuditTrailIndexOptions>, AuditTrailOptionsDisplayDriver>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
using OrchardCore.Modules;
using OrchardCore.Navigation;
using OrchardCore.Security.Permissions;
using OrchardCore.Settings;
using OrchardCore.Sitemaps.Builders;

namespace OrchardCore.ContentLocalization;
Expand Down Expand Up @@ -64,8 +63,8 @@ public override void ConfigureServices(IServiceCollection services)
services.AddLiquidFilter<SwitchCultureUrlFilter>("switch_culture_url");
services.AddScoped<INavigationProvider, AdminMenu>();
services.AddScoped<IContentCulturePickerService, ContentCulturePickerService>();
services.AddScoped<IDisplayDriver<ISite>, ContentCulturePickerSettingsDriver>();
services.AddScoped<IDisplayDriver<ISite>, ContentRequestCultureProviderSettingsDriver>();
services.AddSiteDisplayDriver<ContentCulturePickerSettingsDriver>();
services.AddSiteDisplayDriver<ContentRequestCultureProviderSettingsDriver>();
MikeAlhayek marked this conversation as resolved.
Show resolved Hide resolved
services.Configure<RequestLocalizationOptions>(options => options.AddInitialRequestCultureProvider(new ContentRequestCultureProvider()));
services.Configure<CulturePickerOptions>(_shellConfiguration.GetSection("OrchardCore_ContentLocalization_CulturePickerOptions"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using OrchardCore.Data.Migration;
using OrchardCore.DisplayManagement.Handlers;
using OrchardCore.Modules;
using OrchardCore.Settings;

namespace OrchardCore.Contents.AuditTrail;

Expand All @@ -32,7 +31,7 @@ public override void ConfigureServices(IServiceCollection services)

services.AddTransient<IConfigureOptions<AuditTrailOptions>, ContentAuditTrailEventConfiguration>();
services.AddScoped<IAuditTrailEventHandler, ContentAuditTrailEventHandler>();
services.AddScoped<IDisplayDriver<ISite>, ContentAuditTrailSettingsDisplayDriver>();
services.AddSiteDisplayDriver<ContentAuditTrailSettingsDisplayDriver>();

services.AddScoped<IDisplayDriver<AuditTrailEvent>, AuditTrailContentEventDisplayDriver>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using OrchardCore.DisplayManagement.Handlers;
using OrchardCore.Modules;
using OrchardCore.Navigation;
using OrchardCore.Settings;
using OrchardCore.Settings.Deployment;

namespace OrchardCore.Contents.Deployment.ExportContentToDeploymentTarget;
Expand All @@ -18,7 +17,7 @@ public override void ConfigureServices(IServiceCollection services)
{
services.AddScoped<INavigationProvider, ExportContentToDeploymentTargetAdminMenu>();

services.AddScoped<IDisplayDriver<ISite>, ExportContentToDeploymentTargetSettingsDisplayDriver>();
services.AddSiteDisplayDriver<ExportContentToDeploymentTargetSettingsDisplayDriver>();

services.AddDeployment<ExportContentToDeploymentTargetDeploymentSource, ExportContentToDeploymentTargetDeploymentStep, ExportContentToDeploymentTargetDeploymentStepDriver>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using OrchardCore.Navigation;
using OrchardCore.Recipes;
using OrchardCore.Security.Permissions;
using OrchardCore.Settings;

namespace OrchardCore.CustomSettings;

Expand All @@ -21,7 +20,7 @@ public sealed class Startup : StartupBase
public override void ConfigureServices(IServiceCollection services)
{
services.AddScoped<INavigationProvider, AdminMenu>();
services.AddScoped<IDisplayDriver<ISite>, CustomSettingsDisplayDriver>();
services.AddSiteDisplayDriver<CustomSettingsDisplayDriver>();
services.AddScoped<CustomSettingsService>();
services.AddScoped<IStereotypesProvider, CustomSettingsStereotypesProvider>();
// Permissions
Expand Down
3 changes: 1 addition & 2 deletions src/OrchardCore.Modules/OrchardCore.Email.Azure/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using OrchardCore.Email.Core;
using OrchardCore.Email.Services;
using OrchardCore.Environment.Shell.Configuration;
using OrchardCore.Settings;

namespace OrchardCore.Email.Azure;

Expand All @@ -26,7 +25,7 @@ public void ConfigureServices(IServiceCollection services)
services.AddTransient<IConfigureOptions<AzureEmailOptions>, AzureEmailOptionsConfiguration>();

services.AddEmailProviderOptionsConfiguration<AzureEmailProviderOptionsConfigurations>()
.AddScoped<IDisplayDriver<ISite>, AzureEmailSettingsDisplayDriver>();
.AddSiteDisplayDriver<AzureEmailSettingsDisplayDriver>();

services.Configure<DefaultAzureEmailOptions>(options =>
{
Expand Down
3 changes: 1 addition & 2 deletions src/OrchardCore.Modules/OrchardCore.Email.Smtp/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using OrchardCore.Email.Smtp.Extensions;
using OrchardCore.Email.Smtp.Services;
using OrchardCore.Environment.Shell.Configuration;
using OrchardCore.Settings;

namespace OrchardCore.Email.Smtp;

Expand All @@ -22,7 +21,7 @@ public Startup(IShellConfiguration shellConfiguration)
public void ConfigureServices(IServiceCollection services)
{
services.AddSmtpEmailProvider()
.AddScoped<IDisplayDriver<ISite>, SmtpSettingsDisplayDriver>()
.AddSiteDisplayDriver<SmtpSettingsDisplayDriver>()
.AddTransient<IConfigureOptions<SmtpOptions>, SmtpOptionsConfiguration>();

services.Configure<DefaultSmtpOptions>(options =>
Expand Down
3 changes: 1 addition & 2 deletions src/OrchardCore.Modules/OrchardCore.Email/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using OrchardCore.Modules;
using OrchardCore.Navigation;
using OrchardCore.Security.Permissions;
using OrchardCore.Settings;

namespace OrchardCore.Email;

Expand All @@ -16,7 +15,7 @@ public sealed class Startup : StartupBase
public override void ConfigureServices(IServiceCollection services)
{
services.AddEmailServices()
.AddScoped<IDisplayDriver<ISite>, EmailSettingsDisplayDriver>()
.AddSiteDisplayDriver<EmailSettingsDisplayDriver>()
.AddScoped<IPermissionProvider, Permissions>()
.AddScoped<INavigationProvider, AdminMenu>();

Expand Down
3 changes: 1 addition & 2 deletions src/OrchardCore.Modules/OrchardCore.Facebook/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using OrchardCore.Recipes;
using OrchardCore.ResourceManagement;
using OrchardCore.Security.Permissions;
using OrchardCore.Settings;

namespace OrchardCore.Facebook;

Expand All @@ -31,7 +30,7 @@ public override void ConfigureServices(IServiceCollection services)
services.AddScoped<INavigationProvider, AdminMenu>();

services.AddSingleton<IFacebookService, FacebookService>();
services.AddScoped<IDisplayDriver<ISite>, FacebookSettingsDisplayDriver>();
services.AddSiteDisplayDriver<FacebookSettingsDisplayDriver>();
services.AddRecipeExecutionStep<FacebookSettingsStep>();

services.AddTransient<IConfigureOptions<ResourceManagementOptions>, ResourceManagementOptionsConfiguration>();
Expand Down
3 changes: 1 addition & 2 deletions src/OrchardCore.Modules/OrchardCore.Facebook/StartupLogin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using OrchardCore.Modules;
using OrchardCore.Navigation;
using OrchardCore.Recipes;
using OrchardCore.Settings;

namespace OrchardCore.Facebook;

Expand All @@ -25,7 +24,7 @@ public override void ConfigureServices(IServiceCollection services)
services.AddScoped<INavigationProvider, AdminMenuLogin>();

services.AddSingleton<IFacebookLoginService, FacebookLoginService>();
services.AddScoped<IDisplayDriver<ISite>, FacebookLoginSettingsDisplayDriver>();
services.AddSiteDisplayDriver<FacebookLoginSettingsDisplayDriver>();
services.AddRecipeExecutionStep<FacebookLoginSettingsStep>();

// Register the options initializers required by the Facebook handler.
Expand Down
3 changes: 1 addition & 2 deletions src/OrchardCore.Modules/OrchardCore.Facebook/StartupPixel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using OrchardCore.Modules;
using OrchardCore.Navigation;
using OrchardCore.Security.Permissions;
using OrchardCore.Settings;

namespace OrchardCore.Facebook;

Expand All @@ -15,7 +14,7 @@ public sealed class StartupPixel : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddScoped<IDisplayDriver<ISite>, FacebookPixelSettingsDisplayDriver>();
services.AddSiteDisplayDriver<FacebookPixelSettingsDisplayDriver>();
services.AddScoped<IPermissionProvider, PixelPermissionProvider>();
services.AddScoped<INavigationProvider, AdminMenuPixel>();

Expand Down
3 changes: 1 addition & 2 deletions src/OrchardCore.Modules/OrchardCore.GitHub/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using OrchardCore.Navigation;
using OrchardCore.Recipes;
using OrchardCore.Security.Permissions;
using OrchardCore.Settings;

namespace OrchardCore.GitHub;

Expand All @@ -30,7 +29,7 @@ public sealed class GitHubLoginStartup : StartupBase
public override void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<IGitHubAuthenticationService, GitHubAuthenticationService>();
services.AddScoped<IDisplayDriver<ISite>, GitHubAuthenticationSettingsDisplayDriver>();
services.AddSiteDisplayDriver<GitHubAuthenticationSettingsDisplayDriver>();
services.AddScoped<INavigationProvider, AdminMenuGitHubLogin>();
services.AddRecipeExecutionStep<GitHubAuthenticationSettingsStep>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
using OrchardCore.Modules;
using OrchardCore.Navigation;
using OrchardCore.Security.Permissions;
using OrchardCore.Settings;
using OrchardCore.Settings.Deployment;

namespace OrchardCore.Google;
Expand All @@ -32,7 +31,7 @@ public override void ConfigureServices(IServiceCollection services)
{
services.AddScoped<IPermissionProvider, GoogleAuthenticationPermissionProvider>();
services.AddSingleton<GoogleAuthenticationService, GoogleAuthenticationService>();
services.AddScoped<IDisplayDriver<ISite>, GoogleAuthenticationSettingsDisplayDriver>();
services.AddSiteDisplayDriver<GoogleAuthenticationSettingsDisplayDriver>();
services.AddScoped<INavigationProvider, GoogleAuthenticationAdminMenu>();
// Register the options initializers required by the Google Handler.
services.TryAddEnumerable(new[]
Expand All @@ -56,7 +55,7 @@ public override void ConfigureServices(IServiceCollection services)
services.AddScoped<IPermissionProvider, GoogleAnalyticsPermissionsProvider>();
services.AddSingleton<IGoogleAnalyticsService, GoogleAnalyticsService>();

services.AddScoped<IDisplayDriver<ISite>, GoogleAnalyticsSettingsDisplayDriver>();
services.AddSiteDisplayDriver<GoogleAnalyticsSettingsDisplayDriver>();
services.AddScoped<INavigationProvider, GoogleAnalyticsAdminMenu>();
services.Configure<MvcOptions>((options) =>
{
Expand All @@ -73,7 +72,7 @@ public override void ConfigureServices(IServiceCollection services)
services.AddScoped<IPermissionProvider, GoogleTagManagerPermissionProvider>();
services.AddSingleton<IGoogleTagManagerService, GoogleTagManagerService>();

services.AddScoped<IDisplayDriver<ISite>, GoogleTagManagerSettingsDisplayDriver>();
services.AddSiteDisplayDriver<GoogleTagManagerSettingsDisplayDriver>();
services.AddScoped<INavigationProvider, GoogleTagManagerAdminMenu>();
services.Configure<MvcOptions>((options) =>
{
Expand Down
3 changes: 1 addition & 2 deletions src/OrchardCore.Modules/OrchardCore.Https/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using OrchardCore.Modules;
using OrchardCore.Navigation;
using OrchardCore.Security.Permissions;
using OrchardCore.Settings;
using OrchardCore.Settings.Deployment;

namespace OrchardCore.Https;
Expand All @@ -35,7 +34,7 @@ public override async ValueTask ConfigureAsync(IApplicationBuilder app, IEndpoin
public override void ConfigureServices(IServiceCollection services)
{
services.AddScoped<INavigationProvider, AdminMenu>();
services.AddScoped<IDisplayDriver<ISite>, HttpsSettingsDisplayDriver>();
services.AddSiteDisplayDriver<HttpsSettingsDisplayDriver>();
services.AddSingleton<IHttpsService, HttpsService>();

services.AddScoped<IPermissionProvider, Permissions>();
Expand Down
3 changes: 1 addition & 2 deletions src/OrchardCore.Modules/OrchardCore.Layers/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
using OrchardCore.Recipes;
using OrchardCore.Scripting;
using OrchardCore.Security.Permissions;
using OrchardCore.Settings;

namespace OrchardCore.Layers;

Expand All @@ -39,7 +38,7 @@ public override void ConfigureServices(IServiceCollection services)
options.Filters.Add<LayerFilter>();
});

services.AddScoped<IDisplayDriver<ISite>, LayerSiteSettingsDisplayDriver>();
services.AddSiteDisplayDriver<LayerSiteSettingsDisplayDriver>();
services.AddContentPart<LayerMetadata>();
services.AddScoped<IContentDisplayDriver, LayerMetadataWelder>();
services.AddScoped<INavigationProvider, AdminMenu>();
Expand Down
3 changes: 1 addition & 2 deletions src/OrchardCore.Modules/OrchardCore.Localization/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using OrchardCore.Modules;
using OrchardCore.Navigation;
using OrchardCore.Security.Permissions;
using OrchardCore.Settings;
using OrchardCore.Settings.Deployment;

namespace OrchardCore.Localization;
Expand All @@ -28,7 +27,7 @@ public sealed class Startup : StartupBase
/// <inheritdocs />
public override void ConfigureServices(IServiceCollection services)
{
services.AddScoped<IDisplayDriver<ISite>, LocalizationSettingsDisplayDriver>();
services.AddSiteDisplayDriver<LocalizationSettingsDisplayDriver>();
services.AddScoped<INavigationProvider, AdminMenu>();
services.AddScoped<IPermissionProvider, Permissions>();
services.AddScoped<ILocalizationService, LocalizationService>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
using OrchardCore.Navigation;
using OrchardCore.Recipes;
using OrchardCore.Security.Permissions;
using OrchardCore.Settings;

namespace OrchardCore.Microsoft.Authentication;

Expand All @@ -29,7 +28,7 @@ public override void ConfigureServices(IServiceCollection services)
services.TryAddEnumerable(new ServiceDescriptor(typeof(IPermissionProvider), typeof(Permissions), ServiceLifetime.Scoped));

services.AddSingleton<IMicrosoftAccountService, MicrosoftAccountService>();
services.AddScoped<IDisplayDriver<ISite>, MicrosoftAccountSettingsDisplayDriver>();
services.AddSiteDisplayDriver<MicrosoftAccountSettingsDisplayDriver>();
services.AddScoped<INavigationProvider, AdminMenuMicrosoftAccount>();
services.AddRecipeExecutionStep<MicrosoftAccountSettingsStep>();

Expand Down Expand Up @@ -57,7 +56,7 @@ public override void ConfigureServices(IServiceCollection services)
services.AddSingleton<IAzureADService, AzureADService>();
services.AddRecipeExecutionStep<AzureADSettingsStep>();

services.AddScoped<IDisplayDriver<ISite>, AzureADSettingsDisplayDriver>();
services.AddSiteDisplayDriver<AzureADSettingsDisplayDriver>();
services.AddScoped<INavigationProvider, AdminMenuAAD>();

services.AddTransient<IConfigureOptions<AzureADSettings>, AzureADSettingsConfiguration>();
Expand Down
3 changes: 1 addition & 2 deletions src/OrchardCore.Modules/OrchardCore.ReCaptcha/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using OrchardCore.ReCaptcha.Drivers;
using OrchardCore.ReCaptcha.Users.Handlers;
using OrchardCore.Security.Permissions;
using OrchardCore.Settings;
using OrchardCore.Settings.Deployment;
using OrchardCore.Users;
using OrchardCore.Users.Events;
Expand All @@ -22,7 +21,7 @@ public override void ConfigureServices(IServiceCollection services)
{
services.AddReCaptcha();

services.AddScoped<IDisplayDriver<ISite>, ReCaptchaSettingsDisplayDriver>();
services.AddSiteDisplayDriver<ReCaptchaSettingsDisplayDriver>();
services.AddScoped<INavigationProvider, AdminMenu>();
services.AddScoped<IPermissionProvider, Permissions>();
}
Expand Down
3 changes: 1 addition & 2 deletions src/OrchardCore.Modules/OrchardCore.ReverseProxy/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using OrchardCore.ReverseProxy.Services;
using OrchardCore.ReverseProxy.Settings;
using OrchardCore.Security.Permissions;
using OrchardCore.Settings;
using OrchardCore.Settings.Deployment;

namespace OrchardCore.ReverseProxy;
Expand All @@ -29,7 +28,7 @@ public override void ConfigureServices(IServiceCollection services)
{
services.AddScoped<INavigationProvider, AdminMenu>();
services.AddScoped<IPermissionProvider, Permissions>();
services.AddScoped<IDisplayDriver<ISite>, ReverseProxySettingsDisplayDriver>();
services.AddSiteDisplayDriver<ReverseProxySettingsDisplayDriver>();

services.AddSingleton<ReverseProxyService>();

Expand Down
5 changes: 2 additions & 3 deletions src/OrchardCore.Modules/OrchardCore.Search.AzureAI/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using OrchardCore.Search.AzureAI.Drivers;
using OrchardCore.Search.AzureAI.Handlers;
using OrchardCore.Search.AzureAI.Services;
using OrchardCore.Settings;

namespace OrchardCore.Search.AzureAI;

Expand All @@ -20,7 +19,7 @@ public override void ConfigureServices(IServiceCollection services)
{
services.AddAzureAISearchServices();
services.AddScoped<INavigationProvider, AdminMenu>();
services.AddScoped<IDisplayDriver<ISite>, AzureAISearchDefaultSettingsDisplayDriver>();
services.AddSiteDisplayDriver<AzureAISearchDefaultSettingsDisplayDriver>();
}
}

Expand All @@ -29,7 +28,7 @@ public sealed class SearchStartup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddScoped<IDisplayDriver<ISite>, AzureAISearchSettingsDisplayDriver>();
services.AddSiteDisplayDriver<AzureAISearchSettingsDisplayDriver>();
services.AddScoped<ISearchService, AzureAISearchService>();
services.AddScoped<IAuthorizationHandler, AzureAISearchAuthorizationHandler>();
}
Expand Down
Loading