From 0e6dd1155b1387eecb8e0a9b760394f3de25e300 Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Thu, 5 Sep 2024 08:34:05 -0700 Subject: [PATCH 1/8] Add AdminNavigationProvider to cleanup AdminMenu --- .../OrchardCore.Admin/AdminMenu.cs | 15 +-- .../OrchardCore.AdminMenu/AdminMenu.cs | 20 ++-- .../OrchardCore.Apis.GraphQL/AdminMenu.cs | 15 +-- .../Navigation/AuditTrailAdminMenu.cs | 11 +- .../Navigation/AuditTrailSettingsAdminMenu.cs | 11 +- .../OrchardCore.BackgroundTasks/AdminMenu.cs | 16 +-- .../AdminMenu.cs | 15 +-- .../OrchardCore.ContentTypes/AdminMenu.cs | 15 +-- .../OrchardCore.Contents/AdminMenu.cs | 13 +- ...xportContentToDeploymentTargetAdminMenu.cs | 15 +-- .../OrchardCore.Cors/AdminMenu.cs | 11 +- .../OrchardCore.CustomSettings/AdminMenu.cs | 9 +- .../OrchardCore.Demo/AdminMenu.cs | 15 +-- .../AdminMenu.cs | 11 +- .../OrchardCore.Deployment/AdminMenu.cs | 15 +-- .../OrchardCore.Email/AdminMenu.cs | 15 +-- .../OrchardCore.Facebook/AdminMenu.cs | 55 +-------- .../OrchardCore.Facebook/AdminMenuLogin.cs | 38 ++++++ .../OrchardCore.Facebook/AdminMenuPixel.cs | 13 +- .../OrchardCore.Features/AdminMenu.cs | 15 +-- .../AdminMenuGitHubLogin.cs | 15 +-- .../GoogleAnalyticsAdminMenu.cs | 17 +-- .../GoogleAuthenticationAdminMenu.cs | 15 +-- .../GoogleTagManagerAdminMenu.cs | 17 +-- .../OrchardCore.Https/AdminMenu.cs | 15 +-- .../OrchardCore.Layers/AdminMenu.cs | 15 +-- .../OrchardCore.Localization/AdminMenu.cs | 17 +-- .../OrchardCore.Media.AmazonS3/AdminMenu.cs | 15 +-- .../OrchardCore.Media.Azure/AdminMenu.cs | 15 +-- .../OrchardCore.Media/AdminMenu.cs | 15 +-- .../OrchardCore.Media/MediaCacheAdminMenu.cs | 17 +-- .../OrchardCore.Menu/AdminMenu.cs | 15 +-- .../AdminMenuAAD.cs | 26 ++-- .../AdminMenuMicrosoftAccount.cs | 15 +-- .../OrchardCore.OpenId/AdminMenu.cs | 111 +++++++++--------- .../OrchardCore.Placements/AdminMenu.cs | 15 +-- .../OrchardCore.Queries/AdminMenu.cs | 19 +-- .../OrchardCore.Queries/Sql/AdminMenu.cs | 15 +-- .../OrchardCore.ReCaptcha/AdminMenu.cs | 15 +-- .../OrchardCore.Recipes/AdminMenu.cs | 15 +-- .../OrchardCore.ReverseProxy/AdminMenu.cs | 15 +-- .../OrchardCore.Roles/AdminMenu.cs | 15 +-- .../OrchardCore.Search.AzureAI/AdminMenu.cs | 24 ++-- .../AdminMenu.cs | 16 ++- .../OrchardCore.Search.Lucene/AdminMenu.cs | 16 ++- .../OrchardCore.Search/AdminMenu.cs | 15 +-- .../OrchardCore.Security/AdminMenu.cs | 15 +-- .../OrchardCore.Seo/AdminMenu.cs | 15 +-- .../OrchardCore.Settings/AdminMenu.cs | 15 +-- .../OrchardCore.Shortcodes/AdminMenu.cs | 15 +-- .../OrchardCore.Sitemaps/AdminMenu.cs | 15 +-- .../OrchardCore.Sms/AdminMenu.cs | 11 +- .../OrchardCore.Taxonomies/AdminMenu.cs | 15 +-- .../OrchardCore.Templates/AdminMenu.cs | 15 +-- .../AdminTemplatesAdminMenu.cs | 15 +-- .../OrchardCore.Tenants/AdminMenu.cs | 21 ++-- .../FeatureProfilesAdminMenu.cs | 20 ++-- .../OrchardCore.Themes/AdminMenu.cs | 15 +-- .../OrchardCore.Twitter/AdminMenu.cs | 17 +-- .../OrchardCore.Twitter/AdminMenuSignin.cs | 15 +-- .../OrchardCore.Users/AdminMenu.cs | 15 +-- .../OrchardCore.Users/ChangeEmailAdminMenu.cs | 17 +-- .../RegistrationAdminMenu.cs | 17 +-- .../ResetPasswordAdminMenu.cs | 17 +-- .../OrchardCore.Workflows/AdminMenu.cs | 15 +-- .../Trimming/AdminMenu.cs | 11 +- .../AdminNavigationProvider.cs | 7 ++ .../INavigationProvider.cs | 1 - .../NavigationHelper.cs | 8 -- .../NavigationProviderBase.cs | 38 ++++++ .../.template.config/dotnetcli.host.json | 4 +- .../.template.config/template.json | 4 +- .../.template.config/dotnetcli.host.json | 2 +- .../.template.config/template.json | 4 +- .../.template.config/dotnetcli.host.json | 4 +- .../.template.config/template.json | 4 +- .../.template.config/dotnetcli.host.json | 4 +- .../.template.config/template.json | 4 +- .../.template.config/template.json | 4 +- src/docs/releases/2.0.0.md | 13 +- 80 files changed, 442 insertions(+), 833 deletions(-) create mode 100644 src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs create mode 100644 src/OrchardCore/OrchardCore.Navigation.Core/AdminNavigationProvider.cs create mode 100644 src/OrchardCore/OrchardCore.Navigation.Core/NavigationProviderBase.cs diff --git a/src/OrchardCore.Modules/OrchardCore.Admin/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Admin/AdminMenu.cs index f6ece6ee3c7..88e12997ff2 100644 --- a/src/OrchardCore.Modules/OrchardCore.Admin/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Admin/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Admin; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -15,18 +15,13 @@ public sealed class AdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -38,7 +33,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.AdminMenu/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.AdminMenu/AdminMenu.cs index ddf50366eb7..9a60dc21942 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminMenu/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.AdminMenu/AdminMenu.cs @@ -4,27 +4,23 @@ namespace OrchardCore.AdminMenu; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private readonly AdminMenuNavigationProvidersCoordinator _adminMenuNavigationProviderCoordinator; internal readonly IStringLocalizer S; - public AdminMenu(AdminMenuNavigationProvidersCoordinator adminMenuNavigationProviderCoordinator, - IStringLocalizer localizer) + public AdminMenu( + AdminMenuNavigationProvidersCoordinator adminMenuNavigationProviderCoordinator, + IStringLocalizer stringLocalizer) { _adminMenuNavigationProviderCoordinator = adminMenuNavigationProviderCoordinator; - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - - // Configuration and settings menus for the AdminMenu module + // Configuration and settings menus for the AdminMenu module. builder .Add(S["Configuration"], configuration => configuration .Add(S["Admin Menus"], S["Admin Menus"].PrefixPosition(), adminMenu => adminMenu @@ -34,7 +30,7 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ); - // This is the entry point for the adminMenu: dynamically generated custom admin menus + // This is the entry point for the adminMenu: dynamically generated custom admin menus. return _adminMenuNavigationProviderCoordinator.BuildNavigationAsync(NavigationConstants.AdminMenuId, builder); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/AdminMenu.cs index 2eb5ce08cfc..870a3d6706d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/AdminMenu.cs @@ -3,22 +3,17 @@ namespace OrchardCore.Apis.GraphQL; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["GraphiQL"], S["GraphiQL"].PrefixPosition(), graphiQL => graphiQL @@ -27,7 +22,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) .LocalNav() ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailAdminMenu.cs index 420287ba525..6c181724066 100644 --- a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailAdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.AuditTrail.Navigation; -public sealed class AuditTrailAdminMenu : INavigationProvider +public sealed class AuditTrailAdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -20,13 +20,8 @@ public AuditTrailAdminMenu(IStringLocalizer stringLocalizer S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Audit Trail"], NavigationConstants.AdminMenuAuditTrailPosition, configuration => configuration .AddClass("audittrail") @@ -35,7 +30,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) .Permission(AuditTrailPermissions.ViewAuditTrail) .LocalNav() ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailSettingsAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailSettingsAdminMenu.cs index de27939f74d..c04e994183f 100644 --- a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailSettingsAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailSettingsAdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.AuditTrail.Navigation; -public sealed class AuditTrailSettingsAdminMenu : INavigationProvider +public sealed class AuditTrailSettingsAdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -20,13 +20,8 @@ public AuditTrailSettingsAdminMenu(IStringLocalizer S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -39,7 +34,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/AdminMenu.cs index 5dd1dc28b35..4f58686b61c 100644 --- a/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/AdminMenu.cs @@ -3,19 +3,17 @@ namespace OrchardCore.BackgroundTasks; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) => S = localizer; - - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + public AdminMenu(IStringLocalizer stringLocalizer) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } + S = stringLocalizer; + } + protected override void Build(NavigationBuilder builder) + { builder .Add(S["Configuration"], configuration => configuration .Add(S["Tasks"], S["Tasks"].PrefixPosition(), tasks => tasks @@ -26,7 +24,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/AdminMenu.cs index 732a2901c74..bd77bfc8752 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.ContentLocalization; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _providersRouteValues = new() { @@ -21,18 +21,13 @@ public sealed class AdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -54,7 +49,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/AdminMenu.cs index 9652f9f20c5..00a7de1e69a 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/AdminMenu.cs @@ -5,24 +5,19 @@ namespace OrchardCore.ContentTypes; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly string _adminControllerName = typeof(AdminController).ControllerName(); internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Content"], content => content .Add(S["Content Definition"], S["Content Definition"].PrefixPosition("9"), contentDefinition => contentDefinition @@ -38,7 +33,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Contents/AdminMenu.cs index 88a98cd5c12..8c0b556131f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/AdminMenu.cs @@ -14,7 +14,7 @@ namespace OrchardCore.Contents; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -45,7 +45,7 @@ public AdminMenu( LinkGenerator linkGenerator, IAuthorizationService authorizationService, ISiteService siteService, - IStringLocalizer localizer) + IStringLocalizer stringLocalizer) { _contentDefinitionManager = contentDefinitionManager; _contentManager = contentManager; @@ -53,16 +53,11 @@ public AdminMenu( _linkGenerator = linkGenerator; _authorizationService = authorizationService; _siteService = siteService; - S = localizer; + S = stringLocalizer; } - public async ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override async ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return; - } - var context = _httpContextAccessor.HttpContext; var contentTypeDefinitions = await _contentDefinitionManager.ListTypeDefinitionsAsync(); diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetAdminMenu.cs index 92c7a706b10..58a9bcd02ef 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetAdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Contents.Deployment.ExportContentToDeploymentTarget; -public sealed class ExportContentToDeploymentTargetAdminMenu : INavigationProvider +public sealed class ExportContentToDeploymentTargetAdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -14,18 +14,13 @@ public sealed class ExportContentToDeploymentTargetAdminMenu : INavigationProvid internal readonly IStringLocalizer S; - public ExportContentToDeploymentTargetAdminMenu(IStringLocalizer localizer) + public ExportContentToDeploymentTargetAdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Import/Export"], S["Import/Export"].PrefixPosition(), import => import @@ -38,7 +33,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs index c017468e4db..092b471df52 100644 --- a/src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Cors; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; @@ -12,13 +12,8 @@ public AdminMenu(IStringLocalizer localizer) S = localizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -31,7 +26,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.CustomSettings/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.CustomSettings/AdminMenu.cs index a6ccb4bf96b..f49eaef5c30 100644 --- a/src/OrchardCore.Modules/OrchardCore.CustomSettings/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.CustomSettings/AdminMenu.cs @@ -7,7 +7,7 @@ namespace OrchardCore.CustomSettings; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly ConcurrentDictionary _routeValues = []; @@ -23,13 +23,8 @@ public AdminMenu( _customSettingsService = customSettingsService; } - public async ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override async ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return; - } - foreach (var type in await _customSettingsService.GetAllSettingsTypesAsync()) { if (!_routeValues.TryGetValue(type.Name, out var routeValues)) diff --git a/src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs index bdb37147b18..6775cabdeba 100644 --- a/src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs @@ -3,22 +3,17 @@ namespace OrchardCore.Demo; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Demo"], "10", demo => demo .AddClass("demo").Id("demo") @@ -49,7 +44,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) .Action("Index", "Todo", "OrchardCore.Demo") ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/AdminMenu.cs index 2a6d094a38a..f4243f7c7f0 100644 --- a/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Deployment.Remote; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; @@ -12,13 +12,8 @@ public AdminMenu(IStringLocalizer localizer) S = localizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Import/Export"], import => import @@ -34,7 +29,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Deployment/AdminMenu.cs index 91712c8aa6f..128e1d22129 100644 --- a/src/OrchardCore.Modules/OrchardCore.Deployment/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Deployment/AdminMenu.cs @@ -3,22 +3,17 @@ namespace OrchardCore.Deployment; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Import/Export"], S["Import/Export"].PrefixPosition(), import => import @@ -39,7 +34,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Email/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Email/AdminMenu.cs index 785376bb588..e8c05c55207 100644 --- a/src/OrchardCore.Modules/OrchardCore.Email/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Email/AdminMenu.cs @@ -7,7 +7,7 @@ namespace OrchardCore.Email; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -17,18 +17,13 @@ public sealed class AdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -48,7 +43,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenu.cs index 1ed131cd81e..b94a7e3028f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Facebook; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -14,18 +14,13 @@ public sealed class AdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer sttringLocalizer) { - S = localizer; + S = sttringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -38,47 +33,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; - } -} - -public sealed class AdminMenuLogin : INavigationProvider -{ - private static readonly RouteValueDictionary _routeValues = new() - { - { "area", "OrchardCore.Settings" }, - { "groupId", FacebookConstants.Features.Login }, - }; - - internal readonly IStringLocalizer S; - - public AdminMenuLogin( - IStringLocalizer localizer) - { - S = localizer; - } - - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) - { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - - builder - .Add(S["Security"], security => security - .Add(S["Authentication"], authentication => authentication - .Add(S["Meta"], S["Meta"].PrefixPosition(), meta => meta - .AddClass("facebook") - .Id("facebook") - .Action("Index", "Admin", _routeValues) - .Permission(Permissions.ManageFacebookApp) - .LocalNav() - ) - ) - ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs new file mode 100644 index 00000000000..852d47fc42b --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs @@ -0,0 +1,38 @@ +using Microsoft.AspNetCore.Routing; +using Microsoft.Extensions.Localization; +using OrchardCore.Navigation; + +namespace OrchardCore.Facebook; + +public sealed class AdminMenuLogin : AdminNavigationProvider +{ + private static readonly RouteValueDictionary _routeValues = new() + { + { "area", "OrchardCore.Settings" }, + { "groupId", FacebookConstants.Features.Login }, + }; + + internal readonly IStringLocalizer S; + + public AdminMenuLogin( + IStringLocalizer stringLocalizer) + { + S = stringLocalizer; + } + + protected override void Build(NavigationBuilder builder) + { + builder + .Add(S["Security"], security => security + .Add(S["Authentication"], authentication => authentication + .Add(S["Meta"], S["Meta"].PrefixPosition(), meta => meta + .AddClass("facebook") + .Id("facebook") + .Action("Index", "Admin", _routeValues) + .Permission(Permissions.ManageFacebookApp) + .LocalNav() + ) + ) + ); + } +} diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuPixel.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuPixel.cs index 130b0ea0600..f0c1d965e9c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuPixel.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuPixel.cs @@ -1,10 +1,10 @@ -using Microsoft.AspNetCore.Routing; +using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Localization; using OrchardCore.Navigation; namespace OrchardCore.Facebook; -public sealed class AdminMenuPixel : INavigationProvider +public sealed class AdminMenuPixel : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -20,13 +20,8 @@ public AdminMenuPixel( S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -39,7 +34,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Features/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Features/AdminMenu.cs index 76f77253851..60a3d0a7abd 100644 --- a/src/OrchardCore.Modules/OrchardCore.Features/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Features/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Features; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -15,18 +15,13 @@ public sealed class AdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Features"], S["Features"].PrefixPosition(), deployment => deployment @@ -35,7 +30,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) .LocalNav() ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.GitHub/AdminMenuGitHubLogin.cs b/src/OrchardCore.Modules/OrchardCore.GitHub/AdminMenuGitHubLogin.cs index 7e408ae2c46..2c815138ef1 100644 --- a/src/OrchardCore.Modules/OrchardCore.GitHub/AdminMenuGitHubLogin.cs +++ b/src/OrchardCore.Modules/OrchardCore.GitHub/AdminMenuGitHubLogin.cs @@ -4,7 +4,7 @@ namespace OrchardCore.GitHub; -public sealed class AdminMenuGitHubLogin : INavigationProvider +public sealed class AdminMenuGitHubLogin : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -14,18 +14,13 @@ public sealed class AdminMenuGitHubLogin : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenuGitHubLogin(IStringLocalizer localizer) + public AdminMenuGitHubLogin(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Security"], security => security .Add(S["Authentication"], authentication => authentication @@ -38,7 +33,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsAdminMenu.cs index ea2061cebca..6641e92f57b 100644 --- a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsAdminMenu.cs @@ -1,10 +1,10 @@ -using Microsoft.AspNetCore.Routing; +using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Localization; using OrchardCore.Navigation; namespace OrchardCore.Google; -public sealed class GoogleAnalyticsAdminMenu : INavigationProvider +public sealed class GoogleAnalyticsAdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -14,18 +14,13 @@ public sealed class GoogleAnalyticsAdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public GoogleAnalyticsAdminMenu(IStringLocalizer localizer) + public GoogleAnalyticsAdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -37,7 +32,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationAdminMenu.cs index 5ad2818c51b..6bbe63cfc44 100644 --- a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationAdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Google; -public sealed class GoogleAuthenticationAdminMenu : INavigationProvider +public sealed class GoogleAuthenticationAdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -14,18 +14,13 @@ public sealed class GoogleAuthenticationAdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public GoogleAuthenticationAdminMenu(IStringLocalizer localizer) + public GoogleAuthenticationAdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Security"], security => security .Add(S["Authentication"], authentication => authentication @@ -38,7 +33,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerAdminMenu.cs index f488e8027c9..db0c0aa111d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerAdminMenu.cs @@ -1,10 +1,10 @@ -using Microsoft.AspNetCore.Routing; +using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Localization; using OrchardCore.Navigation; namespace OrchardCore.Google; -public sealed class GoogleTagManagerAdminMenu : INavigationProvider +public sealed class GoogleTagManagerAdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -14,18 +14,13 @@ public sealed class GoogleTagManagerAdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public GoogleTagManagerAdminMenu(IStringLocalizer localizer) + public GoogleTagManagerAdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -38,7 +33,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Https/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Https/AdminMenu.cs index 601b14b7ec7..0d3e4d78c56 100644 --- a/src/OrchardCore.Modules/OrchardCore.Https/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Https/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Https; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -15,18 +15,13 @@ public sealed class AdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Security"], security => security .Add(S["Settings"], settings => settings @@ -37,7 +32,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Layers/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Layers/AdminMenu.cs index 54567183d8a..2633a9c949b 100644 --- a/src/OrchardCore.Modules/OrchardCore.Layers/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Layers/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Layers; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -15,18 +15,13 @@ public sealed class AdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Design"], design => design .Add(S["Settings"], settings => settings @@ -42,7 +37,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) .LocalNav() ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Localization/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Localization/AdminMenu.cs index 7bab7a7751f..4b4f833bbdf 100644 --- a/src/OrchardCore.Modules/OrchardCore.Localization/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Localization/AdminMenu.cs @@ -8,7 +8,7 @@ namespace OrchardCore.Localization; /// /// Represents a localization menu in the admin site. /// -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -21,20 +21,15 @@ public sealed class AdminMenu : INavigationProvider /// /// Creates a new instance of the . /// - /// The . - public AdminMenu(IStringLocalizer localizer) + /// The . + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } /// - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -51,7 +46,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Media.AmazonS3/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Media.AmazonS3/AdminMenu.cs index 00a388c18ee..ff1463d9f25 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media.AmazonS3/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media.AmazonS3/AdminMenu.cs @@ -3,22 +3,17 @@ namespace OrchardCore.Media.AmazonS3; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder.Add(S["Configuration"], configuration => configuration .Add(S["Media"], S["Media"].PrefixPosition(), media => media .Add(S["Amazon S3 Options"], S["Amazon S3 Options"].PrefixPosition(), options => options @@ -28,7 +23,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Media.Azure/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Media.Azure/AdminMenu.cs index 6f0741f505b..0a08058374f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media.Azure/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media.Azure/AdminMenu.cs @@ -3,22 +3,17 @@ namespace OrchardCore.Media.Azure; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder.Add(S["Configuration"], configuration => configuration .Add(S["Media"], S["Media"].PrefixPosition(), media => media .Add(S["Azure Blob Options"], S["Azure Blob Options"].PrefixPosition(), options => options @@ -28,7 +23,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Media/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Media/AdminMenu.cs index 731430c6ce7..c3d00040746 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media/AdminMenu.cs @@ -3,22 +3,17 @@ namespace OrchardCore.Media; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Content"], content => content .AddClass("media") @@ -44,7 +39,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Media/MediaCacheAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Media/MediaCacheAdminMenu.cs index f44a5bbde92..7675ad21f00 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/MediaCacheAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media/MediaCacheAdminMenu.cs @@ -1,24 +1,19 @@ -using Microsoft.Extensions.Localization; +using Microsoft.Extensions.Localization; using OrchardCore.Navigation; namespace OrchardCore.Media; -public sealed class MediaCacheAdminMenu : INavigationProvider +public sealed class MediaCacheAdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; - public MediaCacheAdminMenu(IStringLocalizer localizer) + public MediaCacheAdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder.Add(S["Configuration"], configuration => configuration .Add(S["Media"], S["Media"].PrefixPosition(), media => media .Add(S["Media Cache"], S["Media Cache"].PrefixPosition(), cache => cache @@ -28,7 +23,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Menu/AdminMenu.cs index 9bed18a2a08..e0bb5a3f1af 100644 --- a/src/OrchardCore.Modules/OrchardCore.Menu/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Menu/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Menu; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -16,18 +16,13 @@ public sealed class AdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Content"], design => design .Add(S["Menus"], S["Menus"].PrefixPosition(), menus => menus @@ -36,7 +31,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) .LocalNav() ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuAAD.cs b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuAAD.cs index 8731c5ef14b..db083b7958d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuAAD.cs +++ b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuAAD.cs @@ -1,10 +1,10 @@ -using Microsoft.AspNetCore.Routing; +using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Localization; using OrchardCore.Navigation; namespace OrchardCore.Microsoft.Authentication; -public sealed class AdminMenuAAD : INavigationProvider +public sealed class AdminMenuAAD : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -14,25 +14,23 @@ public sealed class AdminMenuAAD : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenuAAD(IStringLocalizer localizer) => S = localizer; - - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + public AdminMenuAAD(IStringLocalizer stringLocalizer) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } + S = stringLocalizer; + } + protected override void Build(NavigationBuilder builder) + { builder .Add(S["Security"], security => security .Add(S["Authentication"], authentication => authentication - .Add(S["Microsoft Entra ID"], S["Microsoft Entra ID"].PrefixPosition(), client => client - .AddClass("microsoft-entra-id").Id("microsoft-entra-id") + .Add(S["Microsoft Entra ID"], S["Microsoft Entra ID"].PrefixPosition(), entraId => entraId + .AddClass("microsoft-entra-id") + .Id("microsoft-entra-id") .Action("Index", "Admin", _routeValues) .Permission(Permissions.ManageMicrosoftAuthentication) .LocalNav()) - )); - - return ValueTask.CompletedTask; + ) + ); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuMicrosoftAccount.cs b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuMicrosoftAccount.cs index f317da4c8d1..9c762ec5fa1 100644 --- a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuMicrosoftAccount.cs +++ b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuMicrosoftAccount.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Microsoft.Authentication; -public sealed class AdminMenuMicrosoftAccount : INavigationProvider +public sealed class AdminMenuMicrosoftAccount : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -14,18 +14,13 @@ public sealed class AdminMenuMicrosoftAccount : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenuMicrosoftAccount(IStringLocalizer localizer) + public AdminMenuMicrosoftAccount(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Security"], security => security .Add(S["Authentication"], authentication => authentication @@ -38,7 +33,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.OpenId/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.OpenId/AdminMenu.cs index a39f986d647..203419de33d 100644 --- a/src/OrchardCore.Modules/OrchardCore.OpenId/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.OpenId/AdminMenu.cs @@ -6,7 +6,7 @@ namespace OrchardCore.OpenId; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _clientRouteValues = new() { @@ -19,75 +19,70 @@ public sealed class AdminMenu : INavigationProvider internal readonly IStringLocalizer S; public AdminMenu( - IStringLocalizer localizer, + IStringLocalizer stringLocalizer, ShellDescriptor shellDescriptor) { - S = localizer; + S = stringLocalizer; _shellDescriptor = shellDescriptor; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - - builder.Add(S["Security"], security => security - .Add(S["OpenID Connect"], S["OpenID Connect"].PrefixPosition(), category => - { - category.AddClass("openid").Id("openid"); - - var features = _shellDescriptor.Features.Select(feature => feature.Id).ToImmutableArray(); - if (features.Contains(OpenIdConstants.Features.Client) || - features.Contains(OpenIdConstants.Features.Server) || - features.Contains(OpenIdConstants.Features.Validation)) - { - category.Add(S["Settings"], "1", settings => + builder + .Add(S["Security"], security => security + .Add(S["OpenID Connect"], S["OpenID Connect"].PrefixPosition(), category => { - if (features.Contains(OpenIdConstants.Features.Client)) - { - settings.Add(S["Authentication client"], "1", client => client - .Action("Index", "Admin", _clientRouteValues) - .Permission(Permissions.ManageClientSettings) - .LocalNav()); - } + category.AddClass("openid").Id("openid"); - if (features.Contains(OpenIdConstants.Features.Server)) + var features = _shellDescriptor.Features.Select(feature => feature.Id).ToImmutableArray(); + if (features.Contains(OpenIdConstants.Features.Client) || + features.Contains(OpenIdConstants.Features.Server) || + features.Contains(OpenIdConstants.Features.Validation)) { - settings.Add(S["Authorization server"], "2", server => server - .Action("Index", "ServerConfiguration", "OrchardCore.OpenId") - .Permission(Permissions.ManageServerSettings) - .LocalNav()); - } + category.Add(S["Settings"], "1", settings => + { + if (features.Contains(OpenIdConstants.Features.Client)) + { + settings.Add(S["Authentication client"], "1", client => client + .Action("Index", "Admin", _clientRouteValues) + .Permission(Permissions.ManageClientSettings) + .LocalNav()); + } - if (features.Contains(OpenIdConstants.Features.Validation)) - { - settings.Add(S["Token validation"], "3", validation => validation - .Action("Index", "ValidationConfiguration", "OrchardCore.OpenId") - .Permission(Permissions.ManageValidationSettings) - .LocalNav()); - } - }); - } + if (features.Contains(OpenIdConstants.Features.Server)) + { + settings.Add(S["Authorization server"], "2", server => server + .Action("Index", "ServerConfiguration", "OrchardCore.OpenId") + .Permission(Permissions.ManageServerSettings) + .LocalNav()); + } - if (features.Contains(OpenIdConstants.Features.Management)) - { - category.Add(S["Management"], "2", management => - { - management.Add(S["Applications"], "1", applications => applications - .Action("Index", "Application", "OrchardCore.OpenId") - .Permission(Permissions.ManageApplications) - .LocalNav()); + if (features.Contains(OpenIdConstants.Features.Validation)) + { + settings.Add(S["Token validation"], "3", validation => validation + .Action("Index", "ValidationConfiguration", "OrchardCore.OpenId") + .Permission(Permissions.ManageValidationSettings) + .LocalNav()); + } + }); + } - management.Add(S["Scopes"], "2", applications => applications - .Action("Index", "Scope", "OrchardCore.OpenId") - .Permission(Permissions.ManageScopes) - .LocalNav()); - }); - } - })); + if (features.Contains(OpenIdConstants.Features.Management)) + { + category.Add(S["Management"], "2", management => + { + management.Add(S["Applications"], "1", applications => applications + .Action("Index", "Application", "OrchardCore.OpenId") + .Permission(Permissions.ManageApplications) + .LocalNav()); - return ValueTask.CompletedTask; + management.Add(S["Scopes"], "2", applications => applications + .Action("Index", "Scope", "OrchardCore.OpenId") + .Permission(Permissions.ManageScopes) + .LocalNav()); + }); + } + }) + ); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Placements/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Placements/AdminMenu.cs index cf5b653050f..8dd7e9cca9c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Placements/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Placements/AdminMenu.cs @@ -3,22 +3,17 @@ namespace OrchardCore.Placements; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Design"], design => design .Add(S["Placements"], S["Placements"].PrefixPosition(), import => import @@ -27,7 +22,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) .LocalNav() ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Queries/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Queries/AdminMenu.cs index 2b68f863033..abb92f087d9 100644 --- a/src/OrchardCore.Modules/OrchardCore.Queries/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Queries/AdminMenu.cs @@ -3,22 +3,17 @@ namespace OrchardCore.Queries; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Search"], NavigationConstants.AdminMenuSearchPosition, search => search .AddClass("search") @@ -30,10 +25,8 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) .Id("searchallqueries") .Permission(Permissions.ManageQueries) .LocalNav() + ) ) - ) - ); - - return ValueTask.CompletedTask; + ); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Queries/Sql/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Queries/Sql/AdminMenu.cs index c4532e21cad..ae8f073871f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Queries/Sql/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Queries/Sql/AdminMenu.cs @@ -3,22 +3,17 @@ namespace OrchardCore.Queries.Sql; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Search"], search => search .Add(S["Queries"], S["Queries"].PrefixPosition(), queries => queries @@ -29,7 +24,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ReCaptcha/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.ReCaptcha/AdminMenu.cs index 5750dc38b9e..44a9a6ee86f 100644 --- a/src/OrchardCore.Modules/OrchardCore.ReCaptcha/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.ReCaptcha/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.ReCaptcha; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -15,18 +15,13 @@ public sealed class AdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Security"], security => security .Add(S["Settings"], settings => settings @@ -37,7 +32,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Recipes/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Recipes/AdminMenu.cs index ecee693eab4..658c39f8dc0 100644 --- a/src/OrchardCore.Modules/OrchardCore.Recipes/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Recipes/AdminMenu.cs @@ -4,22 +4,17 @@ namespace OrchardCore.Recipes; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Recipes"], S["Recipes"].PrefixPosition(), recipes => recipes @@ -30,7 +25,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) .LocalNav() ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ReverseProxy/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.ReverseProxy/AdminMenu.cs index 4920b5f1037..324c28a27a2 100644 --- a/src/OrchardCore.Modules/OrchardCore.ReverseProxy/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.ReverseProxy/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.ReverseProxy; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -15,18 +15,13 @@ public sealed class AdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -39,7 +34,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Roles/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Roles/AdminMenu.cs index 4170f21efa6..d221bd42a86 100644 --- a/src/OrchardCore.Modules/OrchardCore.Roles/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Roles/AdminMenu.cs @@ -3,22 +3,17 @@ namespace OrchardCore.Roles; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Security"], security => security .Add(S["Roles"], S["Roles"].PrefixPosition(), roles => roles @@ -28,7 +23,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) .LocalNav() ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Search.AzureAI/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Search.AzureAI/AdminMenu.cs index b50b61278e6..f9fed1876df 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search.AzureAI/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search.AzureAI/AdminMenu.cs @@ -6,20 +6,22 @@ namespace OrchardCore.Search.AzureAI; -public sealed class AdminMenu( - IStringLocalizer stringLocalizer, - IOptions azureAISearchSettings) : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { - internal readonly IStringLocalizer S = stringLocalizer; - private readonly AzureAISearchDefaultOptions _azureAISearchSettings = azureAISearchSettings.Value; + private readonly AzureAISearchDefaultOptions _azureAISearchSettings; - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + internal readonly IStringLocalizer S; + + public AdminMenu( + IOptions azureAISearchSettings, + IStringLocalizer stringLocalizer) { - if (!string.Equals(name, "admin", StringComparison.OrdinalIgnoreCase)) - { - return ValueTask.CompletedTask; - } + _azureAISearchSettings = azureAISearchSettings.Value; + S = stringLocalizer; + } + protected override void Build(NavigationBuilder builder) + { builder .Add(S["Search"], NavigationConstants.AdminMenuSearchPosition, search => search .AddClass("search") @@ -50,7 +52,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ); } - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/AdminMenu.cs index 0fdbfb8a77b..13b2d8a183b 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/AdminMenu.cs @@ -3,17 +3,17 @@ namespace OrchardCore.Search.Elasticsearch; -public sealed class AdminMenu(IStringLocalizer localizer) : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { - internal readonly IStringLocalizer S = localizer; + internal readonly IStringLocalizer S; - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + public AdminMenu(IStringLocalizer stringLocalizer) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } + S = stringLocalizer; + } + protected override void Build(NavigationBuilder builder) + { builder .Add(S["Search"], NavigationConstants.AdminMenuSearchPosition, search => search .AddClass("search") @@ -37,7 +37,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Search.Lucene/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Search.Lucene/AdminMenu.cs index 90538bf755d..97f87331223 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search.Lucene/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search.Lucene/AdminMenu.cs @@ -3,17 +3,17 @@ namespace OrchardCore.Search.Lucene; -public sealed class AdminMenu(IStringLocalizer localizer) : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { - internal readonly IStringLocalizer S = localizer; + internal readonly IStringLocalizer S; - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + public AdminMenu(IStringLocalizer stringLocalizer) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } + S = stringLocalizer; + } + protected override void Build(NavigationBuilder builder) + { builder .Add(S["Search"], NavigationConstants.AdminMenuSearchPosition, search => search .AddClass("search") @@ -37,7 +37,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Search/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Search/AdminMenu.cs index a9dfe5388ed..07d62894622 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Search; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -14,18 +14,13 @@ public sealed class AdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Search"], NavigationConstants.AdminMenuSearchPosition, search => search .AddClass("search") @@ -38,7 +33,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) .LocalNav() ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Security/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Security/AdminMenu.cs index 10e52b21a6d..b430d80577a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Security/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Security/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Security; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -16,18 +16,13 @@ public sealed class AdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Security"], NavigationConstants.AdminMenuSecurityPosition, security => security .AddClass("security") @@ -40,7 +35,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Seo/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Seo/AdminMenu.cs index ab641c3bbe6..234881eec97 100644 --- a/src/OrchardCore.Modules/OrchardCore.Seo/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Seo/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Seo; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -14,18 +14,13 @@ public sealed class AdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -38,7 +33,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Settings/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Settings/AdminMenu.cs index 1f646c33939..2210b4080bb 100644 --- a/src/OrchardCore.Modules/OrchardCore.Settings/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Settings/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Settings; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -15,18 +15,13 @@ public sealed class AdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], NavigationConstants.AdminMenuConfigurationPosition, configuration => configuration .AddClass("menu-configuration") @@ -41,7 +36,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ), priority: 1) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Shortcodes/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Shortcodes/AdminMenu.cs index 3f9eccf8a62..a1b2651512b 100644 --- a/src/OrchardCore.Modules/OrchardCore.Shortcodes/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Shortcodes/AdminMenu.cs @@ -3,22 +3,17 @@ namespace OrchardCore.Shortcodes; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Design"], design => design .Add(S["Shortcodes"], S["Shortcodes"].PrefixPosition(), import => import @@ -27,7 +22,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) .LocalNav() ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Sitemaps/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Sitemaps/AdminMenu.cs index 38dc624db8e..9041625726f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Sitemaps/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Sitemaps/AdminMenu.cs @@ -3,22 +3,17 @@ namespace OrchardCore.Sitemaps; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["SEO"], S["SEO"].PrefixPosition(), seo => seo @@ -37,7 +32,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Sms/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Sms/AdminMenu.cs index cd716d610b4..e6011b6a3d5 100644 --- a/src/OrchardCore.Modules/OrchardCore.Sms/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Sms/AdminMenu.cs @@ -6,7 +6,7 @@ namespace OrchardCore.Sms; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -21,13 +21,8 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -47,7 +42,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Taxonomies/AdminMenu.cs index 72779f3ae02..70bcf09021b 100644 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Taxonomies; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -15,18 +15,13 @@ public sealed class AdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], "1", settings => settings @@ -39,7 +34,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Templates/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Templates/AdminMenu.cs index 31fd6bb4029..59693c56560 100644 --- a/src/OrchardCore.Modules/OrchardCore.Templates/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Templates/AdminMenu.cs @@ -3,22 +3,17 @@ namespace OrchardCore.Templates; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Design"], design => design .Add(S["Templates"], S["Templates"].PrefixPosition(), import => import @@ -27,7 +22,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) .LocalNav() ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Templates/AdminTemplatesAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Templates/AdminTemplatesAdminMenu.cs index bc6d01e2b06..8f2d475a41d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Templates/AdminTemplatesAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Templates/AdminTemplatesAdminMenu.cs @@ -3,22 +3,17 @@ namespace OrchardCore.Templates; -public sealed class AdminTemplatesAdminMenu : INavigationProvider +public sealed class AdminTemplatesAdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; - public AdminTemplatesAdminMenu(IStringLocalizer localizer) + public AdminTemplatesAdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Design"], design => design .Add(S["Admin Templates"], S["Admin Templates"].PrefixPosition(), import => import @@ -27,7 +22,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) .LocalNav() ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Tenants/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Tenants/AdminMenu.cs index d18f0bc28db..28f6f647f7e 100644 --- a/src/OrchardCore.Modules/OrchardCore.Tenants/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Tenants/AdminMenu.cs @@ -4,29 +4,26 @@ namespace OrchardCore.Tenants; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private readonly ShellSettings _shellSettings; internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer, ShellSettings shellSettings) + public AdminMenu( + ShellSettings shellSettings, + IStringLocalizer stringLocalizer) { _shellSettings = shellSettings; - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - - // Don't add the menu item on non-default tenants + // Don't add the menu item on non-default tenants. if (!_shellSettings.IsDefaultShell()) { - return ValueTask.CompletedTask; + return; } builder @@ -39,7 +36,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) .LocalNav() ), priority: 1); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Tenants/FeatureProfilesAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Tenants/FeatureProfilesAdminMenu.cs index 114eb2049e1..58909205a6a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Tenants/FeatureProfilesAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Tenants/FeatureProfilesAdminMenu.cs @@ -4,31 +4,27 @@ namespace OrchardCore.Tenants; -public sealed class FeatureProfilesAdminMenu : INavigationProvider +public sealed class FeatureProfilesAdminMenu : AdminNavigationProvider { private readonly ShellSettings _shellSettings; internal readonly IStringLocalizer S; public FeatureProfilesAdminMenu( - IStringLocalizer localizer, - ShellSettings shellSettings) + ShellSettings shellSettings, + IStringLocalizer stringLocalizer) { _shellSettings = shellSettings; - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) - { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } + protected override void Build(NavigationBuilder builder) + { // Don't add the menu item on non-default tenants. if (!_shellSettings.IsDefaultShell()) { - return ValueTask.CompletedTask; + return; } builder @@ -40,7 +36,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) .LocalNav() ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Themes/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Themes/AdminMenu.cs index 5d799b679ef..60b821e3eb1 100644 --- a/src/OrchardCore.Modules/OrchardCore.Themes/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Themes/AdminMenu.cs @@ -3,22 +3,17 @@ namespace OrchardCore.Themes; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Design"], NavigationConstants.AdminMenuDesignPosition, design => design .AddClass("themes").Id("themes") @@ -28,7 +23,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) .LocalNav() ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenu.cs index 7b5344f8c25..8f1903ff13f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenu.cs @@ -1,10 +1,10 @@ -using Microsoft.AspNetCore.Routing; +using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Localization; using OrchardCore.Navigation; namespace OrchardCore.Twitter; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -14,18 +14,13 @@ public sealed class AdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -37,7 +32,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenuSignin.cs b/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenuSignin.cs index 4b64b669bad..7404cf43328 100644 --- a/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenuSignin.cs +++ b/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenuSignin.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Twitter; -public sealed class AdminMenuSignin : INavigationProvider +public sealed class AdminMenuSignin : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -14,18 +14,13 @@ public sealed class AdminMenuSignin : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenuSignin(IStringLocalizer localizer) + public AdminMenuSignin(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Security"], security => security .Add(S["Authentication"], authentication => authentication @@ -37,7 +32,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) .LocalNav()) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Users/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Users/AdminMenu.cs index 9c2a4159813..f37d15feb51 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/AdminMenu.cs @@ -6,7 +6,7 @@ namespace OrchardCore.Users; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -16,18 +16,13 @@ public sealed class AdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Security"], NavigationConstants.AdminMenuSecurityPosition, security => security .AddClass("security") @@ -48,7 +43,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Users/ChangeEmailAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Users/ChangeEmailAdminMenu.cs index b6a9cc6c54b..6a4326396d8 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/ChangeEmailAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/ChangeEmailAdminMenu.cs @@ -1,11 +1,11 @@ -using Microsoft.AspNetCore.Routing; +using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Localization; using OrchardCore.Navigation; using OrchardCore.Users.Drivers; namespace OrchardCore.Users; -public sealed class ChangeEmailAdminMenu : INavigationProvider +public sealed class ChangeEmailAdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -15,18 +15,13 @@ public sealed class ChangeEmailAdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public ChangeEmailAdminMenu(IStringLocalizer localizer) + public ChangeEmailAdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Security"], security => security .Add(S["Settings"], settings => settings @@ -37,7 +32,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Users/RegistrationAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Users/RegistrationAdminMenu.cs index cffef43f061..a5faac5388e 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/RegistrationAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/RegistrationAdminMenu.cs @@ -1,11 +1,11 @@ -using Microsoft.AspNetCore.Routing; +using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Localization; using OrchardCore.Navigation; using OrchardCore.Users.Drivers; namespace OrchardCore.Users; -public sealed class RegistrationAdminMenu : INavigationProvider +public sealed class RegistrationAdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -15,18 +15,13 @@ public sealed class RegistrationAdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public RegistrationAdminMenu(IStringLocalizer localizer) + public RegistrationAdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Security"], security => security .Add(S["Settings"], settings => settings @@ -37,7 +32,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Users/ResetPasswordAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Users/ResetPasswordAdminMenu.cs index 7b609d1606f..116d245069b 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/ResetPasswordAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/ResetPasswordAdminMenu.cs @@ -1,11 +1,11 @@ -using Microsoft.AspNetCore.Routing; +using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Localization; using OrchardCore.Navigation; using OrchardCore.Users.Drivers; namespace OrchardCore.Users; -public sealed class ResetPasswordAdminMenu : INavigationProvider +public sealed class ResetPasswordAdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -15,18 +15,13 @@ public sealed class ResetPasswordAdminMenu : INavigationProvider internal readonly IStringLocalizer S; - public ResetPasswordAdminMenu(IStringLocalizer localizer) + public ResetPasswordAdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Security"], security => security .Add(S["Settings"], settings => settings @@ -37,7 +32,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Workflows/AdminMenu.cs index b598e86535e..c08407fc2f7 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/AdminMenu.cs @@ -3,22 +3,17 @@ namespace OrchardCore.Workflows; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer localizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = localizer; + S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Workflows"], NavigationConstants.AdminMenuWorkflowsPosition, workflow => workflow .AddClass("workflows") @@ -27,7 +22,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) .Permission(Permissions.ManageWorkflows) .LocalNav() ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/Trimming/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Workflows/Trimming/AdminMenu.cs index 48a90aeb162..3b44540e51f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/Trimming/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/Trimming/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Workflows.Trimming; -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -20,13 +20,8 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder.Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings .Add(S["Workflow Trimming"], S["Workflow Trimming"], trimming => trimming @@ -36,7 +31,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) ) ) ); - - return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore/OrchardCore.Navigation.Core/AdminNavigationProvider.cs b/src/OrchardCore/OrchardCore.Navigation.Core/AdminNavigationProvider.cs new file mode 100644 index 00000000000..fd38129885c --- /dev/null +++ b/src/OrchardCore/OrchardCore.Navigation.Core/AdminNavigationProvider.cs @@ -0,0 +1,7 @@ +namespace OrchardCore.Navigation; + +public abstract class AdminNavigationProvider : NavigationProviderBase +{ + protected sealed override string Name + => NavigationConstants.AdminId; +} diff --git a/src/OrchardCore/OrchardCore.Navigation.Core/INavigationProvider.cs b/src/OrchardCore/OrchardCore.Navigation.Core/INavigationProvider.cs index 27352c60ad9..4b2358228a7 100644 --- a/src/OrchardCore/OrchardCore.Navigation.Core/INavigationProvider.cs +++ b/src/OrchardCore/OrchardCore.Navigation.Core/INavigationProvider.cs @@ -1,6 +1,5 @@ namespace OrchardCore.Navigation; - public interface INavigationProvider { ValueTask BuildNavigationAsync(string name, NavigationBuilder builder); diff --git a/src/OrchardCore/OrchardCore.Navigation.Core/NavigationHelper.cs b/src/OrchardCore/OrchardCore.Navigation.Core/NavigationHelper.cs index cf16b920d0f..ea67b5f8d0d 100644 --- a/src/OrchardCore/OrchardCore.Navigation.Core/NavigationHelper.cs +++ b/src/OrchardCore/OrchardCore.Navigation.Core/NavigationHelper.cs @@ -7,14 +7,6 @@ namespace OrchardCore.Navigation; public static class NavigationHelper { - /// - /// Checks if the given name matches the value . - /// - /// - /// boolean. - public static bool IsAdminMenu(string name) - => NavigationConstants.AdminId == name; - /// /// Populates the menu shapes. /// diff --git a/src/OrchardCore/OrchardCore.Navigation.Core/NavigationProviderBase.cs b/src/OrchardCore/OrchardCore.Navigation.Core/NavigationProviderBase.cs new file mode 100644 index 00000000000..adc15f59aa9 --- /dev/null +++ b/src/OrchardCore/OrchardCore.Navigation.Core/NavigationProviderBase.cs @@ -0,0 +1,38 @@ +namespace OrchardCore.Navigation; + +public abstract class NavigationProviderBase : INavigationProvider +{ + /// + /// The name of the navigation menu. + /// + protected abstract string Name { get; } + + public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + { + if (name != Name) + { + return ValueTask.CompletedTask; + } + + return BuildAsync(builder); + } + + /// + /// Asynchronously builds the navigations menu. + /// + /// + protected virtual ValueTask BuildAsync(NavigationBuilder builder) + { + Build(builder); + + return ValueTask.CompletedTask; + } + + /// + /// Synchronously builds the navigations menu. + /// + /// + protected virtual void Build(NavigationBuilder builder) + { + } +} diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/dotnetcli.host.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/dotnetcli.host.json index 083436a5e7f..0985e309cd1 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/dotnetcli.host.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/dotnetcli.host.json @@ -12,6 +12,6 @@ }, "usageExamples": [ "--framework net8.0", - "--orchard-version 1.8.4" + "--orchard-version 1.8.3" ] -} +} \ No newline at end of file diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/template.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/template.json index 8bd50a5fd70..7649ce2ad25 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/template.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/template.json @@ -45,7 +45,7 @@ "datatype": "string", "description": "Specifies which version of Orchard Core packages to use.", "replaces": "$(TemplateOrchardPackageVersion)", - "defaultValue": "1.8.4" + "defaultValue": "2.0.0-preview" } }, "sources": [ @@ -76,4 +76,4 @@ "language": "C#", "type": "project" } -} +} \ No newline at end of file diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Web/.template.config/dotnetcli.host.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Web/.template.config/dotnetcli.host.json index bb51792d075..154ec41ee08 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Web/.template.config/dotnetcli.host.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Web/.template.config/dotnetcli.host.json @@ -17,6 +17,6 @@ "usageExamples": [ "--framework net8.0", "--logger none", - "--orchard-version 1.8.4" + "--orchard-version 1.8.3" ] } diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Web/.template.config/template.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Web/.template.config/template.json index 29542d256ba..92925f28646 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Web/.template.config/template.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Web/.template.config/template.json @@ -51,7 +51,7 @@ "datatype": "string", "description": "Specifies which version of Orchard Core packages to use.", "replaces": "$(TemplateOrchardPackageVersion)", - "defaultValue": "1.8.4" + "defaultValue": "2.0.0-preview" }, "UseNLog": { "type": "computed", @@ -78,4 +78,4 @@ "language": "C#", "type": "project" } -} +} \ No newline at end of file diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/dotnetcli.host.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/dotnetcli.host.json index 083436a5e7f..0985e309cd1 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/dotnetcli.host.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/dotnetcli.host.json @@ -12,6 +12,6 @@ }, "usageExamples": [ "--framework net8.0", - "--orchard-version 1.8.4" + "--orchard-version 1.8.3" ] -} +} \ No newline at end of file diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/template.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/template.json index d181bddfca6..d16daea16d0 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/template.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/template.json @@ -31,7 +31,7 @@ "datatype": "string", "description": "Specifies which version of Orchard Core packages to use.", "replaces": "$(TemplateOrchardPackageVersion)", - "defaultValue": "1.8.4" + "defaultValue": "2.0.0-preview" } }, "sources": [ @@ -43,4 +43,4 @@ "language": "C#", "type": "project" } -} +} \ No newline at end of file diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/dotnetcli.host.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/dotnetcli.host.json index 083436a5e7f..0985e309cd1 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/dotnetcli.host.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/dotnetcli.host.json @@ -12,6 +12,6 @@ }, "usageExamples": [ "--framework net8.0", - "--orchard-version 1.8.4" + "--orchard-version 1.8.3" ] -} +} \ No newline at end of file diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/template.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/template.json index ab818dcccab..4d1422fba2b 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/template.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/template.json @@ -31,7 +31,7 @@ "datatype": "string", "description": "Specifies which version of Orchard Core packages to use.", "replaces": "$(TemplateOrchardPackageVersion)", - "defaultValue": "1.8.4" + "defaultValue": "2.0.0-preview" } }, "sources": [], @@ -39,4 +39,4 @@ "language": "C#", "type": "project" } -} +} \ No newline at end of file diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Theme/.template.config/template.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Theme/.template.config/template.json index 5a043c1f757..3f315f1c7db 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Theme/.template.config/template.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Theme/.template.config/template.json @@ -37,7 +37,7 @@ "datatype": "string", "description": "Specifies which version of Orchard Core packages to use.", "replaces": "$(TemplateOrchardPackageVersion)", - "defaultValue": "1.8.4" + "defaultValue": "2.0.0-preview" } }, "sources": [ @@ -59,4 +59,4 @@ "language": "C#", "type": "project" } -} +} \ No newline at end of file diff --git a/src/docs/releases/2.0.0.md b/src/docs/releases/2.0.0.md index 56b18c24407..6245984b649 100644 --- a/src/docs/releases/2.0.0.md +++ b/src/docs/releases/2.0.0.md @@ -485,10 +485,10 @@ The `OrchardCore.Email` module has undergone a refactoring process with no break ### Admin Menu -The admin menu has undergone performance enhancements, and new helpers have been added. When incorporating `INavigationProvider` in your project, you can now utilize `NavigationHelper.IsAdminMenu(name)` instead of the previous approach using `string.Equals(name, "admin", StringComparison.OrdinalIgnoreCase)`. Moreover, when passing route values to an action, it is advised to store them in a constant variable. An illustrative example is provided below. +The admin menu has received performance improvements and enhancements. When adding an admin menu navigation provider, it is now recommended to use the new `AdminNavigationProvider` class instead of directly implementing the `INavigationProvider` interface in your project. Additionally, when passing route values to actions, it's best practice to store them in constant variables. Below is an illustrative example. ```csharp -public sealed class AdminMenu : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -503,13 +503,8 @@ public sealed class AdminMenu : INavigationProvider S = stringLocalizer; } - public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) + protected override void Build(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return ValueTask.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -522,8 +517,6 @@ public sealed class AdminMenu : INavigationProvider ) ) ); - - return ValueTask.CompletedTask; } } ``` From 387f5d8ba5662ab58c2a3fda49254cafea0b0b03 Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Thu, 5 Sep 2024 08:57:01 -0700 Subject: [PATCH 2/8] improve the release notes --- src/docs/releases/2.0.0.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/docs/releases/2.0.0.md b/src/docs/releases/2.0.0.md index 6245984b649..f44f616686e 100644 --- a/src/docs/releases/2.0.0.md +++ b/src/docs/releases/2.0.0.md @@ -485,7 +485,11 @@ The `OrchardCore.Email` module has undergone a refactoring process with no break ### Admin Menu -The admin menu has received performance improvements and enhancements. When adding an admin menu navigation provider, it is now recommended to use the new `AdminNavigationProvider` class instead of directly implementing the `INavigationProvider` interface in your project. Additionally, when passing route values to actions, it's best practice to store them in constant variables. Below is an illustrative example. +The admin menu has been optimized with significant performance improvements and code enhancements. When adding a navigation provider to the admin menu, it is now recommended to use the new `AdminNavigationProvider` class rather than directly implementing the `INavigationProvider` interface in your project. + +By inheriting from `AdminNavigationProvider`, you can choose to implement either the `Build(NavigationBuilder builder)` method for synchronous operations or the `BuildAsync(NavigationBuilder builder)` method for asynchronous operations, depending on your needs. + +Furthermore, when passing route values to actions, it's a best practice to store these values in constant variables for maintainability and clarity. Below is an example demonstrating this approach: ```csharp public sealed class AdminMenu : AdminNavigationProvider From 679d139134ea2a812c9e90e2406c46e651437bef Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Thu, 5 Sep 2024 09:03:50 -0700 Subject: [PATCH 3/8] cleanup --- .../OrchardCore.Facebook/AdminMenuLogin.cs | 5 ++--- .../.template.config/dotnetcli.host.json | 2 +- .../.template.config/template.json | 2 +- .../.template.config/dotnetcli.host.json | 2 +- .../.template.config/template.json | 2 +- .../.template.config/dotnetcli.host.json | 2 +- .../.template.config/template.json | 2 +- .../.template.config/dotnetcli.host.json | 2 +- .../.template.config/template.json | 2 +- .../.template.config/template.json | 2 +- 10 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs index 852d47fc42b..09c79fbb042 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Routing; +using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Localization; using OrchardCore.Navigation; @@ -14,8 +14,7 @@ public sealed class AdminMenuLogin : AdminNavigationProvider internal readonly IStringLocalizer S; - public AdminMenuLogin( - IStringLocalizer stringLocalizer) + public AdminMenuLogin(IStringLocalizer stringLocalizer) { S = stringLocalizer; } diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/dotnetcli.host.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/dotnetcli.host.json index 0985e309cd1..8b1f7b621d8 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/dotnetcli.host.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/dotnetcli.host.json @@ -12,6 +12,6 @@ }, "usageExamples": [ "--framework net8.0", - "--orchard-version 1.8.3" + "--orchard-version 1.8.4" ] } \ No newline at end of file diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/template.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/template.json index 7649ce2ad25..47a89e45aff 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/template.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/template.json @@ -45,7 +45,7 @@ "datatype": "string", "description": "Specifies which version of Orchard Core packages to use.", "replaces": "$(TemplateOrchardPackageVersion)", - "defaultValue": "2.0.0-preview" + "defaultValue": "1.8.4" } }, "sources": [ diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Web/.template.config/dotnetcli.host.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Web/.template.config/dotnetcli.host.json index 154ec41ee08..bb51792d075 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Web/.template.config/dotnetcli.host.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Web/.template.config/dotnetcli.host.json @@ -17,6 +17,6 @@ "usageExamples": [ "--framework net8.0", "--logger none", - "--orchard-version 1.8.3" + "--orchard-version 1.8.4" ] } diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Web/.template.config/template.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Web/.template.config/template.json index 92925f28646..39161ad4fe8 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Web/.template.config/template.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Web/.template.config/template.json @@ -51,7 +51,7 @@ "datatype": "string", "description": "Specifies which version of Orchard Core packages to use.", "replaces": "$(TemplateOrchardPackageVersion)", - "defaultValue": "2.0.0-preview" + "defaultValue": "1.8.4" }, "UseNLog": { "type": "computed", diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/dotnetcli.host.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/dotnetcli.host.json index 0985e309cd1..8b1f7b621d8 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/dotnetcli.host.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/dotnetcli.host.json @@ -12,6 +12,6 @@ }, "usageExamples": [ "--framework net8.0", - "--orchard-version 1.8.3" + "--orchard-version 1.8.4" ] } \ No newline at end of file diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/template.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/template.json index d16daea16d0..112ebedf1fb 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/template.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/template.json @@ -31,7 +31,7 @@ "datatype": "string", "description": "Specifies which version of Orchard Core packages to use.", "replaces": "$(TemplateOrchardPackageVersion)", - "defaultValue": "2.0.0-preview" + "defaultValue": "1.8.4" } }, "sources": [ diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/dotnetcli.host.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/dotnetcli.host.json index 0985e309cd1..8b1f7b621d8 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/dotnetcli.host.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/dotnetcli.host.json @@ -12,6 +12,6 @@ }, "usageExamples": [ "--framework net8.0", - "--orchard-version 1.8.3" + "--orchard-version 1.8.4" ] } \ No newline at end of file diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/template.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/template.json index 4d1422fba2b..08a9aeda8fc 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/template.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/template.json @@ -31,7 +31,7 @@ "datatype": "string", "description": "Specifies which version of Orchard Core packages to use.", "replaces": "$(TemplateOrchardPackageVersion)", - "defaultValue": "2.0.0-preview" + "defaultValue": "1.8.4" } }, "sources": [], diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Theme/.template.config/template.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Theme/.template.config/template.json index 3f315f1c7db..077f241ee38 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Theme/.template.config/template.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Theme/.template.config/template.json @@ -37,7 +37,7 @@ "datatype": "string", "description": "Specifies which version of Orchard Core packages to use.", "replaces": "$(TemplateOrchardPackageVersion)", - "defaultValue": "2.0.0-preview" + "defaultValue": "1.8.4" } }, "sources": [ From 38d2726b4b65bc4a276e00c695fbddb9af1cb17f Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Thu, 5 Sep 2024 09:05:01 -0700 Subject: [PATCH 4/8] undo changes to config files --- .../.template.config/dotnetcli.host.json | 2 +- .../.template.config/template.json | 2 +- .../.template.config/template.json | 2 +- .../.template.config/dotnetcli.host.json | 2 +- .../.template.config/template.json | 2 +- .../.template.config/dotnetcli.host.json | 2 +- .../.template.config/template.json | 2 +- .../OrchardCore.Templates.Theme/.template.config/template.json | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/dotnetcli.host.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/dotnetcli.host.json index 8b1f7b621d8..083436a5e7f 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/dotnetcli.host.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/dotnetcli.host.json @@ -14,4 +14,4 @@ "--framework net8.0", "--orchard-version 1.8.4" ] -} \ No newline at end of file +} diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/template.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/template.json index 47a89e45aff..8bd50a5fd70 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/template.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Module/.template.config/template.json @@ -76,4 +76,4 @@ "language": "C#", "type": "project" } -} \ No newline at end of file +} diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Web/.template.config/template.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Web/.template.config/template.json index 39161ad4fe8..29542d256ba 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Web/.template.config/template.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Cms.Web/.template.config/template.json @@ -78,4 +78,4 @@ "language": "C#", "type": "project" } -} \ No newline at end of file +} diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/dotnetcli.host.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/dotnetcli.host.json index 8b1f7b621d8..083436a5e7f 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/dotnetcli.host.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/dotnetcli.host.json @@ -14,4 +14,4 @@ "--framework net8.0", "--orchard-version 1.8.4" ] -} \ No newline at end of file +} diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/template.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/template.json index 112ebedf1fb..d181bddfca6 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/template.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Module/.template.config/template.json @@ -43,4 +43,4 @@ "language": "C#", "type": "project" } -} \ No newline at end of file +} diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/dotnetcli.host.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/dotnetcli.host.json index 8b1f7b621d8..083436a5e7f 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/dotnetcli.host.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/dotnetcli.host.json @@ -14,4 +14,4 @@ "--framework net8.0", "--orchard-version 1.8.4" ] -} \ No newline at end of file +} diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/template.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/template.json index 08a9aeda8fc..ab818dcccab 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/template.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Mvc.Web/.template.config/template.json @@ -39,4 +39,4 @@ "language": "C#", "type": "project" } -} \ No newline at end of file +} diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Theme/.template.config/template.json b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Theme/.template.config/template.json index 077f241ee38..5a043c1f757 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Theme/.template.config/template.json +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Theme/.template.config/template.json @@ -59,4 +59,4 @@ "language": "C#", "type": "project" } -} \ No newline at end of file +} From 4eb5548afa1c8f9c3f488fab8a25c473a1c1c4a0 Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Fri, 6 Sep 2024 09:55:59 -0700 Subject: [PATCH 5/8] address feedback --- .../OrchardCore.Admin/AdminMenu.cs | 2 +- .../OrchardCore.AdminMenu/AdminMenu.cs | 2 +- .../OrchardCore.Apis.GraphQL/AdminMenu.cs | 2 +- .../Navigation/AuditTrailAdminMenu.cs | 2 +- .../Navigation/AuditTrailSettingsAdminMenu.cs | 2 +- .../OrchardCore.BackgroundTasks/AdminMenu.cs | 2 +- .../OrchardCore.ContentLocalization/AdminMenu.cs | 2 +- .../OrchardCore.ContentTypes/AdminMenu.cs | 2 +- .../OrchardCore.Contents/AdminMenu.cs | 2 +- .../ExportContentToDeploymentTargetAdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs | 2 +- .../OrchardCore.CustomSettings/AdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs | 2 +- .../OrchardCore.Deployment.Remote/AdminMenu.cs | 2 +- .../OrchardCore.Deployment/AdminMenu.cs | 2 +- .../OrchardCore.Email/AdminMenu.cs | 2 +- .../OrchardCore.Facebook/AdminMenu.cs | 2 +- .../OrchardCore.Facebook/AdminMenuLogin.cs | 2 +- .../OrchardCore.Facebook/AdminMenuPixel.cs | 2 +- .../OrchardCore.Features/AdminMenu.cs | 2 +- .../OrchardCore.GitHub/AdminMenuGitHubLogin.cs | 2 +- .../OrchardCore.Google/GoogleAnalyticsAdminMenu.cs | 2 +- .../GoogleAuthenticationAdminMenu.cs | 2 +- .../OrchardCore.Google/GoogleTagManagerAdminMenu.cs | 2 +- .../OrchardCore.Https/AdminMenu.cs | 2 +- .../OrchardCore.Layers/AdminMenu.cs | 2 +- .../OrchardCore.Localization/AdminMenu.cs | 2 +- .../OrchardCore.Media.AmazonS3/AdminMenu.cs | 2 +- .../OrchardCore.Media.Azure/AdminMenu.cs | 2 +- .../OrchardCore.Media/AdminMenu.cs | 2 +- .../OrchardCore.Media/MediaCacheAdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Menu/AdminMenu.cs | 2 +- .../AdminMenuAAD.cs | 2 +- .../AdminMenuMicrosoftAccount.cs | 2 +- .../OrchardCore.OpenId/AdminMenu.cs | 2 +- .../OrchardCore.Placements/AdminMenu.cs | 2 +- .../OrchardCore.Queries/AdminMenu.cs | 2 +- .../OrchardCore.Queries/Sql/AdminMenu.cs | 2 +- .../OrchardCore.ReCaptcha/AdminMenu.cs | 2 +- .../OrchardCore.Recipes/AdminMenu.cs | 2 +- .../OrchardCore.ReverseProxy/AdminMenu.cs | 2 +- .../OrchardCore.Roles/AdminMenu.cs | 2 +- .../OrchardCore.Search.AzureAI/AdminMenu.cs | 2 +- .../OrchardCore.Search.Elasticsearch/AdminMenu.cs | 2 +- .../OrchardCore.Search.Lucene/AdminMenu.cs | 2 +- .../OrchardCore.Search/AdminMenu.cs | 2 +- .../OrchardCore.Security/AdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Seo/AdminMenu.cs | 2 +- .../OrchardCore.Settings/AdminMenu.cs | 2 +- .../OrchardCore.Shortcodes/AdminMenu.cs | 2 +- .../OrchardCore.Sitemaps/AdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Sms/AdminMenu.cs | 2 +- .../OrchardCore.Taxonomies/AdminMenu.cs | 2 +- .../OrchardCore.Templates/AdminMenu.cs | 2 +- .../OrchardCore.Templates/AdminTemplatesAdminMenu.cs | 2 +- .../OrchardCore.Tenants/AdminMenu.cs | 2 +- .../OrchardCore.Tenants/FeatureProfilesAdminMenu.cs | 2 +- .../OrchardCore.Themes/AdminMenu.cs | 2 +- .../OrchardCore.Twitter/AdminMenu.cs | 2 +- .../OrchardCore.Twitter/AdminMenuSignin.cs | 2 +- .../OrchardCore.Users/AdminMenu.cs | 2 +- .../OrchardCore.Users/ChangeEmailAdminMenu.cs | 2 +- .../OrchardCore.Users/RegistrationAdminMenu.cs | 2 +- .../OrchardCore.Users/ResetPasswordAdminMenu.cs | 2 +- .../OrchardCore.Workflows/AdminMenu.cs | 2 +- .../OrchardCore.Workflows/Trimming/AdminMenu.cs | 2 +- .../AdminMenuNavigationProvider.cs | 9 +++++++++ .../AdminNavigationProvider.cs | 7 ------- ...tionProviderBase.cs => NamedNavigationProvider.cs} | 9 +++++++-- src/docs/reference/modules/Navigation/README.md | 11 +++++++++++ 70 files changed, 93 insertions(+), 75 deletions(-) create mode 100644 src/OrchardCore/OrchardCore.Navigation.Core/AdminMenuNavigationProvider.cs delete mode 100644 src/OrchardCore/OrchardCore.Navigation.Core/AdminNavigationProvider.cs rename src/OrchardCore/OrchardCore.Navigation.Core/{NavigationProviderBase.cs => NamedNavigationProvider.cs} (81%) diff --git a/src/OrchardCore.Modules/OrchardCore.Admin/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Admin/AdminMenu.cs index 88e12997ff2..5a65e073743 100644 --- a/src/OrchardCore.Modules/OrchardCore.Admin/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Admin/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Admin; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.AdminMenu/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.AdminMenu/AdminMenu.cs index 9a60dc21942..75185ddc454 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminMenu/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.AdminMenu/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.AdminMenu; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private readonly AdminMenuNavigationProvidersCoordinator _adminMenuNavigationProviderCoordinator; diff --git a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/AdminMenu.cs index 870a3d6706d..c70d11316e0 100644 --- a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Apis.GraphQL; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailAdminMenu.cs index 6c181724066..d1e4eb30b3e 100644 --- a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailAdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.AuditTrail.Navigation; -public sealed class AuditTrailAdminMenu : AdminNavigationProvider +public sealed class AuditTrailAdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailSettingsAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailSettingsAdminMenu.cs index c04e994183f..570516f1ef5 100644 --- a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailSettingsAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailSettingsAdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.AuditTrail.Navigation; -public sealed class AuditTrailSettingsAdminMenu : AdminNavigationProvider +public sealed class AuditTrailSettingsAdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/AdminMenu.cs index 4f58686b61c..041b22136df 100644 --- a/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.BackgroundTasks; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/AdminMenu.cs index bd77bfc8752..d8741dc7ef8 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.ContentLocalization; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _providersRouteValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/AdminMenu.cs index 00a7de1e69a..4e068409fd3 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.ContentTypes; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly string _adminControllerName = typeof(AdminController).ControllerName(); diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Contents/AdminMenu.cs index 8c0b556131f..ea910d16820 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/AdminMenu.cs @@ -14,7 +14,7 @@ namespace OrchardCore.Contents; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetAdminMenu.cs index 58a9bcd02ef..402359857b1 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetAdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Contents.Deployment.ExportContentToDeploymentTarget; -public sealed class ExportContentToDeploymentTargetAdminMenu : AdminNavigationProvider +public sealed class ExportContentToDeploymentTargetAdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs index 092b471df52..a2e233b4e98 100644 --- a/src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Cors; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.CustomSettings/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.CustomSettings/AdminMenu.cs index f49eaef5c30..e3fd46a33ff 100644 --- a/src/OrchardCore.Modules/OrchardCore.CustomSettings/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.CustomSettings/AdminMenu.cs @@ -7,7 +7,7 @@ namespace OrchardCore.CustomSettings; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly ConcurrentDictionary _routeValues = []; diff --git a/src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs index 6775cabdeba..56cea27e1f3 100644 --- a/src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Demo; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/AdminMenu.cs index f4243f7c7f0..daa4b1d3581 100644 --- a/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Deployment.Remote; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Deployment/AdminMenu.cs index 128e1d22129..4b0a65b20f9 100644 --- a/src/OrchardCore.Modules/OrchardCore.Deployment/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Deployment/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Deployment; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Email/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Email/AdminMenu.cs index e8c05c55207..9f32a9c714c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Email/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Email/AdminMenu.cs @@ -7,7 +7,7 @@ namespace OrchardCore.Email; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenu.cs index b94a7e3028f..5938e8e0a9b 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Facebook; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs index 09c79fbb042..e3d19e1a8fc 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Facebook; -public sealed class AdminMenuLogin : AdminNavigationProvider +public sealed class AdminMenuLogin : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuPixel.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuPixel.cs index f0c1d965e9c..938697830ff 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuPixel.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuPixel.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Facebook; -public sealed class AdminMenuPixel : AdminNavigationProvider +public sealed class AdminMenuPixel : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Features/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Features/AdminMenu.cs index 60a3d0a7abd..8deede7ff6a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Features/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Features/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Features; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.GitHub/AdminMenuGitHubLogin.cs b/src/OrchardCore.Modules/OrchardCore.GitHub/AdminMenuGitHubLogin.cs index 2c815138ef1..a364c3f6211 100644 --- a/src/OrchardCore.Modules/OrchardCore.GitHub/AdminMenuGitHubLogin.cs +++ b/src/OrchardCore.Modules/OrchardCore.GitHub/AdminMenuGitHubLogin.cs @@ -4,7 +4,7 @@ namespace OrchardCore.GitHub; -public sealed class AdminMenuGitHubLogin : AdminNavigationProvider +public sealed class AdminMenuGitHubLogin : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsAdminMenu.cs index 6641e92f57b..14f673281fd 100644 --- a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsAdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Google; -public sealed class GoogleAnalyticsAdminMenu : AdminNavigationProvider +public sealed class GoogleAnalyticsAdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationAdminMenu.cs index 6bbe63cfc44..dd785ee9839 100644 --- a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationAdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Google; -public sealed class GoogleAuthenticationAdminMenu : AdminNavigationProvider +public sealed class GoogleAuthenticationAdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerAdminMenu.cs index db0c0aa111d..b5c360e5c93 100644 --- a/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerAdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Google; -public sealed class GoogleTagManagerAdminMenu : AdminNavigationProvider +public sealed class GoogleTagManagerAdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Https/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Https/AdminMenu.cs index 0d3e4d78c56..9713243ced6 100644 --- a/src/OrchardCore.Modules/OrchardCore.Https/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Https/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Https; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Layers/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Layers/AdminMenu.cs index 2633a9c949b..5251bea4c35 100644 --- a/src/OrchardCore.Modules/OrchardCore.Layers/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Layers/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Layers; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Localization/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Localization/AdminMenu.cs index 4b4f833bbdf..b749fbde383 100644 --- a/src/OrchardCore.Modules/OrchardCore.Localization/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Localization/AdminMenu.cs @@ -8,7 +8,7 @@ namespace OrchardCore.Localization; /// /// Represents a localization menu in the admin site. /// -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Media.AmazonS3/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Media.AmazonS3/AdminMenu.cs index ff1463d9f25..e30747d8ef5 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media.AmazonS3/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media.AmazonS3/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Media.AmazonS3; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Media.Azure/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Media.Azure/AdminMenu.cs index 0a08058374f..f92833e33df 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media.Azure/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media.Azure/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Media.Azure; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Media/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Media/AdminMenu.cs index c3d00040746..8e708d8a5c1 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Media; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Media/MediaCacheAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Media/MediaCacheAdminMenu.cs index 7675ad21f00..32d62d62e74 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/MediaCacheAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media/MediaCacheAdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Media; -public sealed class MediaCacheAdminMenu : AdminNavigationProvider +public sealed class MediaCacheAdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Menu/AdminMenu.cs index e0bb5a3f1af..8795dea304f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Menu/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Menu/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Menu; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuAAD.cs b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuAAD.cs index db083b7958d..81bafdee390 100644 --- a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuAAD.cs +++ b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuAAD.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Microsoft.Authentication; -public sealed class AdminMenuAAD : AdminNavigationProvider +public sealed class AdminMenuAAD : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuMicrosoftAccount.cs b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuMicrosoftAccount.cs index 9c762ec5fa1..f9b23257f33 100644 --- a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuMicrosoftAccount.cs +++ b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuMicrosoftAccount.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Microsoft.Authentication; -public sealed class AdminMenuMicrosoftAccount : AdminNavigationProvider +public sealed class AdminMenuMicrosoftAccount : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.OpenId/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.OpenId/AdminMenu.cs index 203419de33d..511de70a72c 100644 --- a/src/OrchardCore.Modules/OrchardCore.OpenId/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.OpenId/AdminMenu.cs @@ -6,7 +6,7 @@ namespace OrchardCore.OpenId; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _clientRouteValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Placements/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Placements/AdminMenu.cs index 8dd7e9cca9c..8c49082b185 100644 --- a/src/OrchardCore.Modules/OrchardCore.Placements/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Placements/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Placements; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Queries/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Queries/AdminMenu.cs index abb92f087d9..56186d2a48e 100644 --- a/src/OrchardCore.Modules/OrchardCore.Queries/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Queries/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Queries; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Queries/Sql/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Queries/Sql/AdminMenu.cs index ae8f073871f..9b697e1b3d7 100644 --- a/src/OrchardCore.Modules/OrchardCore.Queries/Sql/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Queries/Sql/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Queries.Sql; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.ReCaptcha/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.ReCaptcha/AdminMenu.cs index 44a9a6ee86f..934fa5d5677 100644 --- a/src/OrchardCore.Modules/OrchardCore.ReCaptcha/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.ReCaptcha/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.ReCaptcha; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Recipes/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Recipes/AdminMenu.cs index 658c39f8dc0..965aa4ca299 100644 --- a/src/OrchardCore.Modules/OrchardCore.Recipes/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Recipes/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Recipes; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.ReverseProxy/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.ReverseProxy/AdminMenu.cs index 324c28a27a2..5ef5e78283a 100644 --- a/src/OrchardCore.Modules/OrchardCore.ReverseProxy/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.ReverseProxy/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.ReverseProxy; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Roles/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Roles/AdminMenu.cs index d221bd42a86..4c742283694 100644 --- a/src/OrchardCore.Modules/OrchardCore.Roles/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Roles/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Roles; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Search.AzureAI/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Search.AzureAI/AdminMenu.cs index f9fed1876df..6b7bd4dbb36 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search.AzureAI/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search.AzureAI/AdminMenu.cs @@ -6,7 +6,7 @@ namespace OrchardCore.Search.AzureAI; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private readonly AzureAISearchDefaultOptions _azureAISearchSettings; diff --git a/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/AdminMenu.cs index 13b2d8a183b..47b8867b48a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Search.Elasticsearch; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Search.Lucene/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Search.Lucene/AdminMenu.cs index 97f87331223..d95f981642e 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search.Lucene/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search.Lucene/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Search.Lucene; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Search/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Search/AdminMenu.cs index 07d62894622..0f91b8a89ac 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Search; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Security/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Security/AdminMenu.cs index b430d80577a..e4191c954ca 100644 --- a/src/OrchardCore.Modules/OrchardCore.Security/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Security/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Security; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Seo/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Seo/AdminMenu.cs index 234881eec97..7693d188fb1 100644 --- a/src/OrchardCore.Modules/OrchardCore.Seo/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Seo/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Seo; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Settings/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Settings/AdminMenu.cs index 2210b4080bb..7dd6d361541 100644 --- a/src/OrchardCore.Modules/OrchardCore.Settings/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Settings/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Settings; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Shortcodes/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Shortcodes/AdminMenu.cs index a1b2651512b..8702c8ebe53 100644 --- a/src/OrchardCore.Modules/OrchardCore.Shortcodes/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Shortcodes/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Shortcodes; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Sitemaps/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Sitemaps/AdminMenu.cs index 9041625726f..bd24ea63854 100644 --- a/src/OrchardCore.Modules/OrchardCore.Sitemaps/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Sitemaps/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Sitemaps; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Sms/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Sms/AdminMenu.cs index e6011b6a3d5..eed965a4631 100644 --- a/src/OrchardCore.Modules/OrchardCore.Sms/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Sms/AdminMenu.cs @@ -6,7 +6,7 @@ namespace OrchardCore.Sms; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Taxonomies/AdminMenu.cs index 70bcf09021b..970c73a464d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Taxonomies; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Templates/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Templates/AdminMenu.cs index 59693c56560..252936acc68 100644 --- a/src/OrchardCore.Modules/OrchardCore.Templates/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Templates/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Templates; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Templates/AdminTemplatesAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Templates/AdminTemplatesAdminMenu.cs index 8f2d475a41d..40a123a137d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Templates/AdminTemplatesAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Templates/AdminTemplatesAdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Templates; -public sealed class AdminTemplatesAdminMenu : AdminNavigationProvider +public sealed class AdminTemplatesAdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Tenants/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Tenants/AdminMenu.cs index 28f6f647f7e..c05ba31865a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Tenants/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Tenants/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Tenants; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private readonly ShellSettings _shellSettings; diff --git a/src/OrchardCore.Modules/OrchardCore.Tenants/FeatureProfilesAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Tenants/FeatureProfilesAdminMenu.cs index 58909205a6a..e39a9ecb5f9 100644 --- a/src/OrchardCore.Modules/OrchardCore.Tenants/FeatureProfilesAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Tenants/FeatureProfilesAdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Tenants; -public sealed class FeatureProfilesAdminMenu : AdminNavigationProvider +public sealed class FeatureProfilesAdminMenu : AdminMenuNavigationProvider { private readonly ShellSettings _shellSettings; diff --git a/src/OrchardCore.Modules/OrchardCore.Themes/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Themes/AdminMenu.cs index 60b821e3eb1..eb64279d631 100644 --- a/src/OrchardCore.Modules/OrchardCore.Themes/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Themes/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Themes; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenu.cs index 8f1903ff13f..e1d8c7195a3 100644 --- a/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Twitter; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenuSignin.cs b/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenuSignin.cs index 7404cf43328..0c2f4756e1a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenuSignin.cs +++ b/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenuSignin.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Twitter; -public sealed class AdminMenuSignin : AdminNavigationProvider +public sealed class AdminMenuSignin : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Users/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Users/AdminMenu.cs index f37d15feb51..028441d1801 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/AdminMenu.cs @@ -6,7 +6,7 @@ namespace OrchardCore.Users; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Users/ChangeEmailAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Users/ChangeEmailAdminMenu.cs index 6a4326396d8..2fef8302bc8 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/ChangeEmailAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/ChangeEmailAdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Users; -public sealed class ChangeEmailAdminMenu : AdminNavigationProvider +public sealed class ChangeEmailAdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Users/RegistrationAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Users/RegistrationAdminMenu.cs index a5faac5388e..08e0c0e2a42 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/RegistrationAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/RegistrationAdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Users; -public sealed class RegistrationAdminMenu : AdminNavigationProvider +public sealed class RegistrationAdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Users/ResetPasswordAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Users/ResetPasswordAdminMenu.cs index 116d245069b..12b8dc82c88 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/ResetPasswordAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/ResetPasswordAdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Users; -public sealed class ResetPasswordAdminMenu : AdminNavigationProvider +public sealed class ResetPasswordAdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Workflows/AdminMenu.cs index c08407fc2f7..a8d648d9340 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Workflows; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/Trimming/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Workflows/Trimming/AdminMenu.cs index 3b44540e51f..a9f1168e952 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/Trimming/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/Trimming/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Workflows.Trimming; -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore/OrchardCore.Navigation.Core/AdminMenuNavigationProvider.cs b/src/OrchardCore/OrchardCore.Navigation.Core/AdminMenuNavigationProvider.cs new file mode 100644 index 00000000000..56d6fb9171a --- /dev/null +++ b/src/OrchardCore/OrchardCore.Navigation.Core/AdminMenuNavigationProvider.cs @@ -0,0 +1,9 @@ +namespace OrchardCore.Navigation; + +public abstract class AdminMenuNavigationProvider : NamedNavigationProvider +{ + public AdminMenuNavigationProvider() + : base(NavigationConstants.AdminId) + { + } +} diff --git a/src/OrchardCore/OrchardCore.Navigation.Core/AdminNavigationProvider.cs b/src/OrchardCore/OrchardCore.Navigation.Core/AdminNavigationProvider.cs deleted file mode 100644 index fd38129885c..00000000000 --- a/src/OrchardCore/OrchardCore.Navigation.Core/AdminNavigationProvider.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace OrchardCore.Navigation; - -public abstract class AdminNavigationProvider : NavigationProviderBase -{ - protected sealed override string Name - => NavigationConstants.AdminId; -} diff --git a/src/OrchardCore/OrchardCore.Navigation.Core/NavigationProviderBase.cs b/src/OrchardCore/OrchardCore.Navigation.Core/NamedNavigationProvider.cs similarity index 81% rename from src/OrchardCore/OrchardCore.Navigation.Core/NavigationProviderBase.cs rename to src/OrchardCore/OrchardCore.Navigation.Core/NamedNavigationProvider.cs index adc15f59aa9..951d8bae9c1 100644 --- a/src/OrchardCore/OrchardCore.Navigation.Core/NavigationProviderBase.cs +++ b/src/OrchardCore/OrchardCore.Navigation.Core/NamedNavigationProvider.cs @@ -1,11 +1,16 @@ namespace OrchardCore.Navigation; -public abstract class NavigationProviderBase : INavigationProvider +public abstract class NamedNavigationProvider : INavigationProvider { /// /// The name of the navigation menu. /// - protected abstract string Name { get; } + protected readonly string Name; + + protected NamedNavigationProvider(string name) + { + Name = name; + } public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) { diff --git a/src/docs/reference/modules/Navigation/README.md b/src/docs/reference/modules/Navigation/README.md index 2c3bbcb45e2..a54b0be6f20 100644 --- a/src/docs/reference/modules/Navigation/README.md +++ b/src/docs/reference/modules/Navigation/README.md @@ -174,6 +174,17 @@ public sealed class MainMenu : INavigationProvider } ``` +### Implementing `INavigationProvider` to Add Menu Items + +As mentioned about, you can implement the `INavigationProvider` interface to add menu items to any menu in your application. Below are specific implementations to guide you: + +| **Class Name** | **Description** | +| ----------------------------- | -------------------------------------------------------------------------------- | +| `NamedNavigationProvider` | Inherit from this class to add menu items to a menu with a specific name. | +| `AdminMenuNavigationProvider` | Inherit from this class to add menu items that will only appear in the admin menu. | + + + This provider will be called as long as the site is using a theme that includes a line similar to the following, which causes the navigation menu to be rendered by your theme at the location specified: `@await DisplayAsync(await New.Navigation(MenuName: "main", RouteData: @ViewContext.RouteData))` From 96bfdfa10707db4b45b84120399207b4e47b2db8 Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Fri, 6 Sep 2024 10:02:53 -0700 Subject: [PATCH 6/8] fix docs --- src/docs/releases/2.0.0.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/docs/releases/2.0.0.md b/src/docs/releases/2.0.0.md index f44f616686e..d2fa11a9498 100644 --- a/src/docs/releases/2.0.0.md +++ b/src/docs/releases/2.0.0.md @@ -485,14 +485,14 @@ The `OrchardCore.Email` module has undergone a refactoring process with no break ### Admin Menu -The admin menu has been optimized with significant performance improvements and code enhancements. When adding a navigation provider to the admin menu, it is now recommended to use the new `AdminNavigationProvider` class rather than directly implementing the `INavigationProvider` interface in your project. +The admin menu has been optimized with significant performance improvements and code enhancements. When adding a navigation provider to the admin menu, it is now recommended to use the new `AdminMenuNavigationProvider` class rather than directly implementing the `INavigationProvider` interface in your project. -By inheriting from `AdminNavigationProvider`, you can choose to implement either the `Build(NavigationBuilder builder)` method for synchronous operations or the `BuildAsync(NavigationBuilder builder)` method for asynchronous operations, depending on your needs. +By inheriting from `AdminMenuNavigationProvider`, you can choose to implement either the `Build(NavigationBuilder builder)` method for synchronous operations or the `BuildAsync(NavigationBuilder builder)` method for asynchronous operations, depending on your needs. Furthermore, when passing route values to actions, it's a best practice to store these values in constant variables for maintainability and clarity. Below is an example demonstrating this approach: ```csharp -public sealed class AdminMenu : AdminNavigationProvider +public sealed class AdminMenu : AdminMenuNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { From e6d8b929c8b5f02f26ac6f5946dbaa41deb55fbf Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Fri, 6 Sep 2024 10:23:00 -0700 Subject: [PATCH 7/8] remove the sync method --- .../OrchardCore.Admin/AdminMenu.cs | 4 ++- .../OrchardCore.Apis.GraphQL/AdminMenu.cs | 4 ++- .../Navigation/AuditTrailAdminMenu.cs | 4 ++- .../Navigation/AuditTrailSettingsAdminMenu.cs | 4 ++- .../OrchardCore.BackgroundTasks/AdminMenu.cs | 4 ++- .../AdminMenu.cs | 4 ++- .../OrchardCore.ContentTypes/AdminMenu.cs | 4 ++- ...xportContentToDeploymentTargetAdminMenu.cs | 4 ++- .../OrchardCore.Cors/AdminMenu.cs | 4 ++- .../OrchardCore.Demo/AdminMenu.cs | 4 ++- .../AdminMenu.cs | 4 ++- .../OrchardCore.Deployment/AdminMenu.cs | 4 ++- .../OrchardCore.Email/AdminMenu.cs | 4 ++- .../OrchardCore.Facebook/AdminMenu.cs | 8 +++-- .../OrchardCore.Facebook/AdminMenuLogin.cs | 4 ++- .../OrchardCore.Facebook/AdminMenuPixel.cs | 4 ++- .../OrchardCore.Features/AdminMenu.cs | 4 ++- .../AdminMenuGitHubLogin.cs | 4 ++- .../GoogleAnalyticsAdminMenu.cs | 4 ++- .../GoogleAuthenticationAdminMenu.cs | 4 ++- .../GoogleTagManagerAdminMenu.cs | 5 ++- .../OrchardCore.Https/AdminMenu.cs | 4 ++- .../OrchardCore.Layers/AdminMenu.cs | 4 ++- .../OrchardCore.Localization/AdminMenu.cs | 4 ++- .../OrchardCore.Media.AmazonS3/AdminMenu.cs | 4 ++- .../OrchardCore.Media.Azure/AdminMenu.cs | 21 +++++++------ .../OrchardCore.Media/AdminMenu.cs | 31 ++++++++++--------- .../OrchardCore.Media/MediaCacheAdminMenu.cs | 21 +++++++------ .../OrchardCore.Menu/AdminMenu.cs | 4 ++- .../AdminMenuAAD.cs | 4 ++- .../AdminMenuMicrosoftAccount.cs | 4 ++- .../OrchardCore.OpenId/AdminMenu.cs | 4 ++- .../OrchardCore.Placements/AdminMenu.cs | 4 ++- .../OrchardCore.Queries/AdminMenu.cs | 4 ++- .../OrchardCore.Queries/Sql/AdminMenu.cs | 4 ++- .../OrchardCore.ReCaptcha/AdminMenu.cs | 4 ++- .../OrchardCore.Recipes/AdminMenu.cs | 4 ++- .../OrchardCore.ReverseProxy/AdminMenu.cs | 4 ++- .../OrchardCore.Roles/AdminMenu.cs | 4 ++- .../OrchardCore.Search.AzureAI/AdminMenu.cs | 4 ++- .../AdminMenu.cs | 4 ++- .../OrchardCore.Search.Lucene/AdminMenu.cs | 4 ++- .../OrchardCore.Search/AdminMenu.cs | 4 ++- .../OrchardCore.Security/AdminMenu.cs | 4 ++- .../OrchardCore.Seo/AdminMenu.cs | 4 ++- .../OrchardCore.Settings/AdminMenu.cs | 4 ++- .../OrchardCore.Shortcodes/AdminMenu.cs | 4 ++- .../OrchardCore.Sitemaps/AdminMenu.cs | 4 ++- .../OrchardCore.Sms/AdminMenu.cs | 4 ++- .../OrchardCore.Taxonomies/AdminMenu.cs | 4 ++- .../OrchardCore.Templates/AdminMenu.cs | 4 ++- .../AdminTemplatesAdminMenu.cs | 4 ++- .../OrchardCore.Tenants/AdminMenu.cs | 6 ++-- .../FeatureProfilesAdminMenu.cs | 6 ++-- .../OrchardCore.Themes/AdminMenu.cs | 4 ++- .../OrchardCore.Twitter/AdminMenu.cs | 4 ++- .../OrchardCore.Twitter/AdminMenuSignin.cs | 4 ++- .../OrchardCore.Users/AdminMenu.cs | 4 ++- .../OrchardCore.Users/ChangeEmailAdminMenu.cs | 4 ++- .../RegistrationAdminMenu.cs | 4 ++- .../ResetPasswordAdminMenu.cs | 4 ++- .../OrchardCore.Workflows/AdminMenu.cs | 4 ++- .../Trimming/AdminMenu.cs | 21 +++++++------ .../NamedNavigationProvider.cs | 15 +-------- src/docs/releases/2.0.0.md | 6 ++-- 65 files changed, 239 insertions(+), 121 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.Admin/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Admin/AdminMenu.cs index 5a65e073743..9120f4df404 100644 --- a/src/OrchardCore.Modules/OrchardCore.Admin/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Admin/AdminMenu.cs @@ -20,7 +20,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -33,5 +33,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/AdminMenu.cs index c70d11316e0..8e52cf3985b 100644 --- a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/AdminMenu.cs @@ -12,7 +12,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -22,5 +22,7 @@ protected override void Build(NavigationBuilder builder) .LocalNav() ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailAdminMenu.cs index d1e4eb30b3e..3fbddffef3e 100644 --- a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailAdminMenu.cs @@ -20,7 +20,7 @@ public AuditTrailAdminMenu(IStringLocalizer stringLocalizer S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Audit Trail"], NavigationConstants.AdminMenuAuditTrailPosition, configuration => configuration @@ -30,5 +30,7 @@ protected override void Build(NavigationBuilder builder) .Permission(AuditTrailPermissions.ViewAuditTrail) .LocalNav() ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailSettingsAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailSettingsAdminMenu.cs index 570516f1ef5..f31da61b267 100644 --- a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailSettingsAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailSettingsAdminMenu.cs @@ -20,7 +20,7 @@ public AuditTrailSettingsAdminMenu(IStringLocalizer S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -34,5 +34,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/AdminMenu.cs index 041b22136df..69029a9e525 100644 --- a/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/AdminMenu.cs @@ -12,7 +12,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -24,5 +24,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/AdminMenu.cs index d8741dc7ef8..7d89c341c9a 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/AdminMenu.cs @@ -26,7 +26,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -49,5 +49,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/AdminMenu.cs index 4e068409fd3..912f7d3787d 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/AdminMenu.cs @@ -16,7 +16,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Content"], content => content @@ -33,5 +33,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetAdminMenu.cs index 402359857b1..b5b1f8b0259 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetAdminMenu.cs @@ -19,7 +19,7 @@ public ExportContentToDeploymentTargetAdminMenu(IStringLocalizer stri S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -33,5 +33,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs index a2e233b4e98..0bee452dd01 100644 --- a/src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs @@ -12,7 +12,7 @@ public AdminMenu(IStringLocalizer localizer) S = localizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -26,5 +26,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs index 56cea27e1f3..8d74ea20688 100644 --- a/src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs @@ -12,7 +12,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Demo"], "10", demo => demo @@ -44,5 +44,7 @@ protected override void Build(NavigationBuilder builder) .Action("Index", "Todo", "OrchardCore.Demo") ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/AdminMenu.cs index daa4b1d3581..be549e5df84 100644 --- a/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/AdminMenu.cs @@ -12,7 +12,7 @@ public AdminMenu(IStringLocalizer localizer) S = localizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -29,5 +29,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Deployment/AdminMenu.cs index 4b0a65b20f9..7adf3da5115 100644 --- a/src/OrchardCore.Modules/OrchardCore.Deployment/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Deployment/AdminMenu.cs @@ -12,7 +12,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -34,5 +34,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Email/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Email/AdminMenu.cs index 9f32a9c714c..634e1b106ed 100644 --- a/src/OrchardCore.Modules/OrchardCore.Email/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Email/AdminMenu.cs @@ -22,7 +22,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -43,5 +43,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenu.cs index 5938e8e0a9b..6cd6bcbad01 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenu.cs @@ -14,12 +14,12 @@ public sealed class AdminMenu : AdminMenuNavigationProvider internal readonly IStringLocalizer S; - public AdminMenu(IStringLocalizer sttringLocalizer) + public AdminMenu(IStringLocalizer stringLocalizer) { - S = sttringLocalizer; + S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -33,5 +33,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs index e3d19e1a8fc..3d522a1663d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs @@ -19,7 +19,7 @@ public AdminMenuLogin(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Security"], security => security @@ -33,5 +33,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuPixel.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuPixel.cs index 938697830ff..b5ba709da27 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuPixel.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuPixel.cs @@ -20,7 +20,7 @@ public AdminMenuPixel( S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -34,5 +34,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Features/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Features/AdminMenu.cs index 8deede7ff6a..f1f2c8a0dce 100644 --- a/src/OrchardCore.Modules/OrchardCore.Features/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Features/AdminMenu.cs @@ -20,7 +20,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -30,5 +30,7 @@ protected override void Build(NavigationBuilder builder) .LocalNav() ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.GitHub/AdminMenuGitHubLogin.cs b/src/OrchardCore.Modules/OrchardCore.GitHub/AdminMenuGitHubLogin.cs index a364c3f6211..9117a0b7113 100644 --- a/src/OrchardCore.Modules/OrchardCore.GitHub/AdminMenuGitHubLogin.cs +++ b/src/OrchardCore.Modules/OrchardCore.GitHub/AdminMenuGitHubLogin.cs @@ -19,7 +19,7 @@ public AdminMenuGitHubLogin(IStringLocalizer stringLocaliz S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Security"], security => security @@ -33,5 +33,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsAdminMenu.cs index 14f673281fd..d35181e8ecd 100644 --- a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsAdminMenu.cs @@ -19,7 +19,7 @@ public GoogleAnalyticsAdminMenu(IStringLocalizer strin S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -32,5 +32,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationAdminMenu.cs index dd785ee9839..3fb2c197e8c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationAdminMenu.cs @@ -19,7 +19,7 @@ public GoogleAuthenticationAdminMenu(IStringLocalizer security @@ -33,5 +33,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerAdminMenu.cs index b5c360e5c93..136a8b66d23 100644 --- a/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerAdminMenu.cs @@ -19,7 +19,7 @@ public GoogleTagManagerAdminMenu(IStringLocalizer str S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -33,5 +33,8 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Https/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Https/AdminMenu.cs index 9713243ced6..ff55aa671a6 100644 --- a/src/OrchardCore.Modules/OrchardCore.Https/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Https/AdminMenu.cs @@ -20,7 +20,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Security"], security => security @@ -32,5 +32,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Layers/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Layers/AdminMenu.cs index 5251bea4c35..45afa426ccc 100644 --- a/src/OrchardCore.Modules/OrchardCore.Layers/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Layers/AdminMenu.cs @@ -20,7 +20,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Design"], design => design @@ -37,5 +37,7 @@ protected override void Build(NavigationBuilder builder) .LocalNav() ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Localization/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Localization/AdminMenu.cs index b749fbde383..6426551a2f4 100644 --- a/src/OrchardCore.Modules/OrchardCore.Localization/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Localization/AdminMenu.cs @@ -28,7 +28,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) } /// - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -46,5 +46,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Media.AmazonS3/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Media.AmazonS3/AdminMenu.cs index e30747d8ef5..e84a47989c7 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media.AmazonS3/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media.AmazonS3/AdminMenu.cs @@ -12,7 +12,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder.Add(S["Configuration"], configuration => configuration .Add(S["Media"], S["Media"].PrefixPosition(), media => media @@ -23,5 +23,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Media.Azure/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Media.Azure/AdminMenu.cs index f92833e33df..d5b22677ae6 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media.Azure/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media.Azure/AdminMenu.cs @@ -12,16 +12,19 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - builder.Add(S["Configuration"], configuration => configuration - .Add(S["Media"], S["Media"].PrefixPosition(), media => media - .Add(S["Azure Blob Options"], S["Azure Blob Options"].PrefixPosition(), options => options - .Action("Options", "Admin", "OrchardCore.Media.Azure") - .Permission(Permissions.ViewAzureMediaOptions) - .LocalNav() + builder + .Add(S["Configuration"], configuration => configuration + .Add(S["Media"], S["Media"].PrefixPosition(), media => media + .Add(S["Azure Blob Options"], S["Azure Blob Options"].PrefixPosition(), options => options + .Action("Options", "Admin", "OrchardCore.Media.Azure") + .Permission(Permissions.ViewAzureMediaOptions) + .LocalNav() + ) ) - ) - ); + ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Media/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Media/AdminMenu.cs index 8e708d8a5c1..1b816a92002 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media/AdminMenu.cs @@ -12,7 +12,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Content"], content => content @@ -25,19 +25,22 @@ protected override void Build(NavigationBuilder builder) ) ); - builder.Add(S["Configuration"], configuration => configuration - .Add(S["Media"], S["Media"].PrefixPosition(), media => media - .Add(S["Media Options"], S["Media Options"].PrefixPosition(), options => options - .Action("Options", "Admin", "OrchardCore.Media") - .Permission(Permissions.ViewMediaOptions) - .LocalNav() - ) - .Add(S["Media Profiles"], S["Media Profiles"].PrefixPosition(), mediaProfiles => mediaProfiles - .Action("Index", "MediaProfiles", "OrchardCore.Media") - .Permission(Permissions.ManageMediaProfiles) - .LocalNav() + builder + .Add(S["Configuration"], configuration => configuration + .Add(S["Media"], S["Media"].PrefixPosition(), media => media + .Add(S["Media Options"], S["Media Options"].PrefixPosition(), options => options + .Action("Options", "Admin", "OrchardCore.Media") + .Permission(Permissions.ViewMediaOptions) + .LocalNav() + ) + .Add(S["Media Profiles"], S["Media Profiles"].PrefixPosition(), mediaProfiles => mediaProfiles + .Action("Index", "MediaProfiles", "OrchardCore.Media") + .Permission(Permissions.ManageMediaProfiles) + .LocalNav() + ) ) - ) - ); + ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Media/MediaCacheAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Media/MediaCacheAdminMenu.cs index 32d62d62e74..5506d0f19a7 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/MediaCacheAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media/MediaCacheAdminMenu.cs @@ -12,16 +12,19 @@ public MediaCacheAdminMenu(IStringLocalizer stringLocalizer S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - builder.Add(S["Configuration"], configuration => configuration - .Add(S["Media"], S["Media"].PrefixPosition(), media => media - .Add(S["Media Cache"], S["Media Cache"].PrefixPosition(), cache => cache - .Action("Index", "MediaCache", "OrchardCore.Media") - .Permission(MediaCachePermissions.ManageAssetCache) - .LocalNav() + builder + .Add(S["Configuration"], configuration => configuration + .Add(S["Media"], S["Media"].PrefixPosition(), media => media + .Add(S["Media Cache"], S["Media Cache"].PrefixPosition(), cache => cache + .Action("Index", "MediaCache", "OrchardCore.Media") + .Permission(MediaCachePermissions.ManageAssetCache) + .LocalNav() + ) ) - ) - ); + ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Menu/AdminMenu.cs index 8795dea304f..fae19c4025b 100644 --- a/src/OrchardCore.Modules/OrchardCore.Menu/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Menu/AdminMenu.cs @@ -21,7 +21,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Content"], design => design @@ -31,5 +31,7 @@ protected override void Build(NavigationBuilder builder) .LocalNav() ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuAAD.cs b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuAAD.cs index 81bafdee390..50fe95576d6 100644 --- a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuAAD.cs +++ b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuAAD.cs @@ -19,7 +19,7 @@ public AdminMenuAAD(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Security"], security => security @@ -32,5 +32,7 @@ protected override void Build(NavigationBuilder builder) .LocalNav()) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuMicrosoftAccount.cs b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuMicrosoftAccount.cs index f9b23257f33..9dffe0bb112 100644 --- a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuMicrosoftAccount.cs +++ b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuMicrosoftAccount.cs @@ -19,7 +19,7 @@ public AdminMenuMicrosoftAccount(IStringLocalizer str S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Security"], security => security @@ -33,5 +33,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.OpenId/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.OpenId/AdminMenu.cs index 511de70a72c..2306f406634 100644 --- a/src/OrchardCore.Modules/OrchardCore.OpenId/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.OpenId/AdminMenu.cs @@ -26,7 +26,7 @@ public AdminMenu( _shellDescriptor = shellDescriptor; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Security"], security => security @@ -84,5 +84,7 @@ protected override void Build(NavigationBuilder builder) } }) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Placements/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Placements/AdminMenu.cs index 8c49082b185..d7366798449 100644 --- a/src/OrchardCore.Modules/OrchardCore.Placements/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Placements/AdminMenu.cs @@ -12,7 +12,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Design"], design => design @@ -22,5 +22,7 @@ protected override void Build(NavigationBuilder builder) .LocalNav() ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Queries/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Queries/AdminMenu.cs index 56186d2a48e..b2c83e5bc2c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Queries/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Queries/AdminMenu.cs @@ -12,7 +12,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Search"], NavigationConstants.AdminMenuSearchPosition, search => search @@ -28,5 +28,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Queries/Sql/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Queries/Sql/AdminMenu.cs index 9b697e1b3d7..8d155c89b0c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Queries/Sql/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Queries/Sql/AdminMenu.cs @@ -12,7 +12,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Search"], search => search @@ -24,5 +24,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ReCaptcha/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.ReCaptcha/AdminMenu.cs index 934fa5d5677..089a25a0926 100644 --- a/src/OrchardCore.Modules/OrchardCore.ReCaptcha/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.ReCaptcha/AdminMenu.cs @@ -20,7 +20,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Security"], security => security @@ -32,5 +32,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Recipes/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Recipes/AdminMenu.cs index 965aa4ca299..9a2e794ad78 100644 --- a/src/OrchardCore.Modules/OrchardCore.Recipes/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Recipes/AdminMenu.cs @@ -13,7 +13,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -25,5 +25,7 @@ protected override void Build(NavigationBuilder builder) .LocalNav() ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ReverseProxy/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.ReverseProxy/AdminMenu.cs index 5ef5e78283a..56c42a3d90b 100644 --- a/src/OrchardCore.Modules/OrchardCore.ReverseProxy/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.ReverseProxy/AdminMenu.cs @@ -20,7 +20,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -34,5 +34,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Roles/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Roles/AdminMenu.cs index 4c742283694..78c57e72d96 100644 --- a/src/OrchardCore.Modules/OrchardCore.Roles/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Roles/AdminMenu.cs @@ -12,7 +12,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Security"], security => security @@ -23,5 +23,7 @@ protected override void Build(NavigationBuilder builder) .LocalNav() ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Search.AzureAI/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Search.AzureAI/AdminMenu.cs index 6b7bd4dbb36..e5a0c7052ba 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search.AzureAI/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search.AzureAI/AdminMenu.cs @@ -20,7 +20,7 @@ public AdminMenu( S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Search"], NavigationConstants.AdminMenuSearchPosition, search => search @@ -52,5 +52,7 @@ protected override void Build(NavigationBuilder builder) ) ); } + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/AdminMenu.cs index 47b8867b48a..0d940c54362 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/AdminMenu.cs @@ -12,7 +12,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Search"], NavigationConstants.AdminMenuSearchPosition, search => search @@ -37,5 +37,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Search.Lucene/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Search.Lucene/AdminMenu.cs index d95f981642e..2e48aa588cd 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search.Lucene/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search.Lucene/AdminMenu.cs @@ -12,7 +12,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Search"], NavigationConstants.AdminMenuSearchPosition, search => search @@ -37,5 +37,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Search/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Search/AdminMenu.cs index 0f91b8a89ac..bc143efe169 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search/AdminMenu.cs @@ -19,7 +19,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Search"], NavigationConstants.AdminMenuSearchPosition, search => search @@ -33,5 +33,7 @@ protected override void Build(NavigationBuilder builder) .LocalNav() ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Security/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Security/AdminMenu.cs index e4191c954ca..01d2deac4b4 100644 --- a/src/OrchardCore.Modules/OrchardCore.Security/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Security/AdminMenu.cs @@ -21,7 +21,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Security"], NavigationConstants.AdminMenuSecurityPosition, security => security @@ -35,5 +35,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Seo/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Seo/AdminMenu.cs index 7693d188fb1..5726ee8b97e 100644 --- a/src/OrchardCore.Modules/OrchardCore.Seo/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Seo/AdminMenu.cs @@ -19,7 +19,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -33,5 +33,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Settings/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Settings/AdminMenu.cs index 7dd6d361541..8d9b8b67b1a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Settings/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Settings/AdminMenu.cs @@ -20,7 +20,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], NavigationConstants.AdminMenuConfigurationPosition, configuration => configuration @@ -36,5 +36,7 @@ protected override void Build(NavigationBuilder builder) ), priority: 1) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Shortcodes/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Shortcodes/AdminMenu.cs index 8702c8ebe53..4d8c821bab6 100644 --- a/src/OrchardCore.Modules/OrchardCore.Shortcodes/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Shortcodes/AdminMenu.cs @@ -12,7 +12,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Design"], design => design @@ -22,5 +22,7 @@ protected override void Build(NavigationBuilder builder) .LocalNav() ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Sitemaps/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Sitemaps/AdminMenu.cs index bd24ea63854..669442d7866 100644 --- a/src/OrchardCore.Modules/OrchardCore.Sitemaps/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Sitemaps/AdminMenu.cs @@ -12,7 +12,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -32,5 +32,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Sms/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Sms/AdminMenu.cs index eed965a4631..83991cf3fd7 100644 --- a/src/OrchardCore.Modules/OrchardCore.Sms/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Sms/AdminMenu.cs @@ -21,7 +21,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -42,5 +42,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Taxonomies/AdminMenu.cs index 970c73a464d..b8ad27533a3 100644 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/AdminMenu.cs @@ -20,7 +20,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -34,5 +34,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Templates/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Templates/AdminMenu.cs index 252936acc68..d42b12041e5 100644 --- a/src/OrchardCore.Modules/OrchardCore.Templates/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Templates/AdminMenu.cs @@ -12,7 +12,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Design"], design => design @@ -22,5 +22,7 @@ protected override void Build(NavigationBuilder builder) .LocalNav() ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Templates/AdminTemplatesAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Templates/AdminTemplatesAdminMenu.cs index 40a123a137d..c72eace6d4b 100644 --- a/src/OrchardCore.Modules/OrchardCore.Templates/AdminTemplatesAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Templates/AdminTemplatesAdminMenu.cs @@ -12,7 +12,7 @@ public AdminTemplatesAdminMenu(IStringLocalizer stringL S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Design"], design => design @@ -22,5 +22,7 @@ protected override void Build(NavigationBuilder builder) .LocalNav() ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Tenants/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Tenants/AdminMenu.cs index c05ba31865a..2ec88191320 100644 --- a/src/OrchardCore.Modules/OrchardCore.Tenants/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Tenants/AdminMenu.cs @@ -18,12 +18,12 @@ public AdminMenu( S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { // Don't add the menu item on non-default tenants. if (!_shellSettings.IsDefaultShell()) { - return; + return ValueTask.CompletedTask; } builder @@ -36,5 +36,7 @@ protected override void Build(NavigationBuilder builder) .LocalNav() ), priority: 1); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Tenants/FeatureProfilesAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Tenants/FeatureProfilesAdminMenu.cs index e39a9ecb5f9..bfb3ff21f0a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Tenants/FeatureProfilesAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Tenants/FeatureProfilesAdminMenu.cs @@ -19,12 +19,12 @@ public FeatureProfilesAdminMenu( } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { // Don't add the menu item on non-default tenants. if (!_shellSettings.IsDefaultShell()) { - return; + return ValueTask.CompletedTask; } builder @@ -36,5 +36,7 @@ protected override void Build(NavigationBuilder builder) .LocalNav() ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Themes/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Themes/AdminMenu.cs index eb64279d631..a74d793f86f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Themes/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Themes/AdminMenu.cs @@ -12,7 +12,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Design"], NavigationConstants.AdminMenuDesignPosition, design => design @@ -23,5 +23,7 @@ protected override void Build(NavigationBuilder builder) .LocalNav() ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenu.cs index e1d8c7195a3..05d5a96718f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenu.cs @@ -19,7 +19,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -32,5 +32,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenuSignin.cs b/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenuSignin.cs index 0c2f4756e1a..cafb085b0a9 100644 --- a/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenuSignin.cs +++ b/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenuSignin.cs @@ -19,7 +19,7 @@ public AdminMenuSignin(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Security"], security => security @@ -32,5 +32,7 @@ protected override void Build(NavigationBuilder builder) .LocalNav()) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Users/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Users/AdminMenu.cs index 028441d1801..91eb232cccd 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/AdminMenu.cs @@ -21,7 +21,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Security"], NavigationConstants.AdminMenuSecurityPosition, security => security @@ -43,5 +43,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Users/ChangeEmailAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Users/ChangeEmailAdminMenu.cs index 2fef8302bc8..f4fd6de6bf8 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/ChangeEmailAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/ChangeEmailAdminMenu.cs @@ -20,7 +20,7 @@ public ChangeEmailAdminMenu(IStringLocalizer stringLocaliz S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Security"], security => security @@ -32,5 +32,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Users/RegistrationAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Users/RegistrationAdminMenu.cs index 08e0c0e2a42..405b9efd03c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/RegistrationAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/RegistrationAdminMenu.cs @@ -20,7 +20,7 @@ public RegistrationAdminMenu(IStringLocalizer stringLocal S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Security"], security => security @@ -32,5 +32,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Users/ResetPasswordAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Users/ResetPasswordAdminMenu.cs index 12b8dc82c88..e34bff516d1 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/ResetPasswordAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/ResetPasswordAdminMenu.cs @@ -20,7 +20,7 @@ public ResetPasswordAdminMenu(IStringLocalizer stringLoc S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Security"], security => security @@ -32,5 +32,7 @@ protected override void Build(NavigationBuilder builder) ) ) ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Workflows/AdminMenu.cs index a8d648d9340..11230805471 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/AdminMenu.cs @@ -12,7 +12,7 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Workflows"], NavigationConstants.AdminMenuWorkflowsPosition, workflow => workflow @@ -22,5 +22,7 @@ protected override void Build(NavigationBuilder builder) .Permission(Permissions.ManageWorkflows) .LocalNav() ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/Trimming/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Workflows/Trimming/AdminMenu.cs index a9f1168e952..09271ab8271 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/Trimming/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/Trimming/AdminMenu.cs @@ -20,16 +20,19 @@ public AdminMenu(IStringLocalizer stringLocalizer) S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - builder.Add(S["Configuration"], configuration => configuration - .Add(S["Settings"], settings => settings - .Add(S["Workflow Trimming"], S["Workflow Trimming"], trimming => trimming - .Action("Index", "Admin", _routeValues) - .Permission(Permissions.ManageWorkflowSettings) - .LocalNav() + builder + .Add(S["Configuration"], configuration => configuration + .Add(S["Settings"], settings => settings + .Add(S["Workflow Trimming"], S["Workflow Trimming"], trimming => trimming + .Action("Index", "Admin", _routeValues) + .Permission(Permissions.ManageWorkflowSettings) + .LocalNav() + ) ) - ) - ); + ); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore/OrchardCore.Navigation.Core/NamedNavigationProvider.cs b/src/OrchardCore/OrchardCore.Navigation.Core/NamedNavigationProvider.cs index 951d8bae9c1..5dcf25fd73c 100644 --- a/src/OrchardCore/OrchardCore.Navigation.Core/NamedNavigationProvider.cs +++ b/src/OrchardCore/OrchardCore.Navigation.Core/NamedNavigationProvider.cs @@ -26,18 +26,5 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) /// Asynchronously builds the navigations menu. /// /// - protected virtual ValueTask BuildAsync(NavigationBuilder builder) - { - Build(builder); - - return ValueTask.CompletedTask; - } - - /// - /// Synchronously builds the navigations menu. - /// - /// - protected virtual void Build(NavigationBuilder builder) - { - } + protected abstract ValueTask BuildAsync(NavigationBuilder builder); } diff --git a/src/docs/releases/2.0.0.md b/src/docs/releases/2.0.0.md index d2fa11a9498..340bd8a8213 100644 --- a/src/docs/releases/2.0.0.md +++ b/src/docs/releases/2.0.0.md @@ -487,8 +487,6 @@ The `OrchardCore.Email` module has undergone a refactoring process with no break The admin menu has been optimized with significant performance improvements and code enhancements. When adding a navigation provider to the admin menu, it is now recommended to use the new `AdminMenuNavigationProvider` class rather than directly implementing the `INavigationProvider` interface in your project. -By inheriting from `AdminMenuNavigationProvider`, you can choose to implement either the `Build(NavigationBuilder builder)` method for synchronous operations or the `BuildAsync(NavigationBuilder builder)` method for asynchronous operations, depending on your needs. - Furthermore, when passing route values to actions, it's a best practice to store these values in constant variables for maintainability and clarity. Below is an example demonstrating this approach: ```csharp @@ -507,7 +505,7 @@ public sealed class AdminMenu : AdminMenuNavigationProvider S = stringLocalizer; } - protected override void Build(NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { builder .Add(S["Configuration"], configuration => configuration @@ -521,6 +519,8 @@ public sealed class AdminMenu : AdminMenuNavigationProvider ) ) ); + + return ValueTask.CompletedTask; } } ``` From bc83b4cafc04040005288d7519f65e8de2aa985c Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Fri, 6 Sep 2024 16:09:10 -0700 Subject: [PATCH 8/8] rename AdminMenuNavigationProvider to AdminNavigationProvider --- src/OrchardCore.Modules/OrchardCore.Admin/AdminMenu.cs | 2 +- .../OrchardCore.AdminMenu/AdminMenu.cs | 2 +- .../OrchardCore.Apis.GraphQL/AdminMenu.cs | 2 +- .../Navigation/AuditTrailAdminMenu.cs | 2 +- .../Navigation/AuditTrailSettingsAdminMenu.cs | 2 +- .../OrchardCore.BackgroundTasks/AdminMenu.cs | 2 +- .../OrchardCore.ContentLocalization/AdminMenu.cs | 2 +- .../OrchardCore.ContentTypes/AdminMenu.cs | 2 +- .../OrchardCore.Contents/AdminMenu.cs | 2 +- .../ExportContentToDeploymentTargetAdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs | 2 +- .../OrchardCore.CustomSettings/AdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs | 2 +- .../OrchardCore.Deployment.Remote/AdminMenu.cs | 2 +- .../OrchardCore.Deployment/AdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Email/AdminMenu.cs | 2 +- .../OrchardCore.Facebook/AdminMenu.cs | 2 +- .../OrchardCore.Facebook/AdminMenuLogin.cs | 2 +- .../OrchardCore.Facebook/AdminMenuPixel.cs | 2 +- .../OrchardCore.Features/AdminMenu.cs | 2 +- .../OrchardCore.GitHub/AdminMenuGitHubLogin.cs | 2 +- .../OrchardCore.Google/GoogleAnalyticsAdminMenu.cs | 2 +- .../OrchardCore.Google/GoogleAuthenticationAdminMenu.cs | 2 +- .../OrchardCore.Google/GoogleTagManagerAdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Https/AdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Layers/AdminMenu.cs | 2 +- .../OrchardCore.Localization/AdminMenu.cs | 2 +- .../OrchardCore.Media.AmazonS3/AdminMenu.cs | 2 +- .../OrchardCore.Media.Azure/AdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Media/AdminMenu.cs | 2 +- .../OrchardCore.Media/MediaCacheAdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Menu/AdminMenu.cs | 2 +- .../OrchardCore.Microsoft.Authentication/AdminMenuAAD.cs | 2 +- .../AdminMenuMicrosoftAccount.cs | 2 +- src/OrchardCore.Modules/OrchardCore.OpenId/AdminMenu.cs | 2 +- .../OrchardCore.Placements/AdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Queries/AdminMenu.cs | 2 +- .../OrchardCore.Queries/Sql/AdminMenu.cs | 2 +- .../OrchardCore.ReCaptcha/AdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Recipes/AdminMenu.cs | 2 +- .../OrchardCore.ReverseProxy/AdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Roles/AdminMenu.cs | 2 +- .../OrchardCore.Search.AzureAI/AdminMenu.cs | 2 +- .../OrchardCore.Search.Elasticsearch/AdminMenu.cs | 2 +- .../OrchardCore.Search.Lucene/AdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Search/AdminMenu.cs | 2 +- .../OrchardCore.Security/AdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Seo/AdminMenu.cs | 2 +- .../OrchardCore.Settings/AdminMenu.cs | 2 +- .../OrchardCore.Shortcodes/AdminMenu.cs | 2 +- .../OrchardCore.Sitemaps/AdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Sms/AdminMenu.cs | 2 +- .../OrchardCore.Taxonomies/AdminMenu.cs | 2 +- .../OrchardCore.Templates/AdminMenu.cs | 2 +- .../OrchardCore.Templates/AdminTemplatesAdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Tenants/AdminMenu.cs | 2 +- .../OrchardCore.Tenants/FeatureProfilesAdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Themes/AdminMenu.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenu.cs | 2 +- .../OrchardCore.Twitter/AdminMenuSignin.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Users/AdminMenu.cs | 2 +- .../OrchardCore.Users/ChangeEmailAdminMenu.cs | 2 +- .../OrchardCore.Users/RegistrationAdminMenu.cs | 2 +- .../OrchardCore.Users/ResetPasswordAdminMenu.cs | 2 +- .../OrchardCore.Workflows/AdminMenu.cs | 2 +- .../OrchardCore.Workflows/Trimming/AdminMenu.cs | 2 +- .../AdminMenuNavigationProvider.cs | 9 --------- .../AdminNavigationProvider.cs | 9 +++++++++ src/docs/reference/modules/Navigation/README.md | 2 +- src/docs/releases/2.0.0.md | 4 ++-- 70 files changed, 78 insertions(+), 78 deletions(-) delete mode 100644 src/OrchardCore/OrchardCore.Navigation.Core/AdminMenuNavigationProvider.cs create mode 100644 src/OrchardCore/OrchardCore.Navigation.Core/AdminNavigationProvider.cs diff --git a/src/OrchardCore.Modules/OrchardCore.Admin/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Admin/AdminMenu.cs index 9120f4df404..cdf8270f5e8 100644 --- a/src/OrchardCore.Modules/OrchardCore.Admin/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Admin/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Admin; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.AdminMenu/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.AdminMenu/AdminMenu.cs index 75185ddc454..9a60dc21942 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminMenu/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.AdminMenu/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.AdminMenu; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private readonly AdminMenuNavigationProvidersCoordinator _adminMenuNavigationProviderCoordinator; diff --git a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/AdminMenu.cs index 8e52cf3985b..02c371cda73 100644 --- a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Apis.GraphQL; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailAdminMenu.cs index 3fbddffef3e..95dcb31301d 100644 --- a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailAdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.AuditTrail.Navigation; -public sealed class AuditTrailAdminMenu : AdminMenuNavigationProvider +public sealed class AuditTrailAdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailSettingsAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailSettingsAdminMenu.cs index f31da61b267..6f9ddd25673 100644 --- a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailSettingsAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailSettingsAdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.AuditTrail.Navigation; -public sealed class AuditTrailSettingsAdminMenu : AdminMenuNavigationProvider +public sealed class AuditTrailSettingsAdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/AdminMenu.cs index 69029a9e525..08f64b7ce73 100644 --- a/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.BackgroundTasks; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/AdminMenu.cs index 7d89c341c9a..d13935970c3 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.ContentLocalization; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _providersRouteValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/AdminMenu.cs index 912f7d3787d..02eec290c50 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.ContentTypes; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly string _adminControllerName = typeof(AdminController).ControllerName(); diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Contents/AdminMenu.cs index ea910d16820..8c0b556131f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/AdminMenu.cs @@ -14,7 +14,7 @@ namespace OrchardCore.Contents; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetAdminMenu.cs index b5b1f8b0259..ea771404b90 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetAdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Contents.Deployment.ExportContentToDeploymentTarget; -public sealed class ExportContentToDeploymentTargetAdminMenu : AdminMenuNavigationProvider +public sealed class ExportContentToDeploymentTargetAdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs index 0bee452dd01..2d606abb6ef 100644 --- a/src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Cors; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.CustomSettings/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.CustomSettings/AdminMenu.cs index e3fd46a33ff..f49eaef5c30 100644 --- a/src/OrchardCore.Modules/OrchardCore.CustomSettings/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.CustomSettings/AdminMenu.cs @@ -7,7 +7,7 @@ namespace OrchardCore.CustomSettings; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly ConcurrentDictionary _routeValues = []; diff --git a/src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs index 8d74ea20688..7d1fe9d4e3f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Demo; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/AdminMenu.cs index be549e5df84..d69bf633a52 100644 --- a/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Deployment.Remote; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Deployment/AdminMenu.cs index 7adf3da5115..649a5793928 100644 --- a/src/OrchardCore.Modules/OrchardCore.Deployment/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Deployment/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Deployment; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Email/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Email/AdminMenu.cs index 634e1b106ed..d580f9096ec 100644 --- a/src/OrchardCore.Modules/OrchardCore.Email/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Email/AdminMenu.cs @@ -7,7 +7,7 @@ namespace OrchardCore.Email; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenu.cs index 6cd6bcbad01..d4e59228029 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Facebook; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs index 3d522a1663d..c4ad313080b 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Facebook; -public sealed class AdminMenuLogin : AdminMenuNavigationProvider +public sealed class AdminMenuLogin : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuPixel.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuPixel.cs index b5ba709da27..9494dd75d46 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuPixel.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuPixel.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Facebook; -public sealed class AdminMenuPixel : AdminMenuNavigationProvider +public sealed class AdminMenuPixel : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Features/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Features/AdminMenu.cs index f1f2c8a0dce..e4dbd3e2345 100644 --- a/src/OrchardCore.Modules/OrchardCore.Features/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Features/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Features; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.GitHub/AdminMenuGitHubLogin.cs b/src/OrchardCore.Modules/OrchardCore.GitHub/AdminMenuGitHubLogin.cs index 9117a0b7113..06be42e1584 100644 --- a/src/OrchardCore.Modules/OrchardCore.GitHub/AdminMenuGitHubLogin.cs +++ b/src/OrchardCore.Modules/OrchardCore.GitHub/AdminMenuGitHubLogin.cs @@ -4,7 +4,7 @@ namespace OrchardCore.GitHub; -public sealed class AdminMenuGitHubLogin : AdminMenuNavigationProvider +public sealed class AdminMenuGitHubLogin : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsAdminMenu.cs index d35181e8ecd..5e5ffdbc0e0 100644 --- a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsAdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Google; -public sealed class GoogleAnalyticsAdminMenu : AdminMenuNavigationProvider +public sealed class GoogleAnalyticsAdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationAdminMenu.cs index 3fb2c197e8c..9392cd6d583 100644 --- a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationAdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Google; -public sealed class GoogleAuthenticationAdminMenu : AdminMenuNavigationProvider +public sealed class GoogleAuthenticationAdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerAdminMenu.cs index 136a8b66d23..bb5fe072b1c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerAdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Google; -public sealed class GoogleTagManagerAdminMenu : AdminMenuNavigationProvider +public sealed class GoogleTagManagerAdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Https/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Https/AdminMenu.cs index ff55aa671a6..9df8c2e3f9f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Https/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Https/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Https; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Layers/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Layers/AdminMenu.cs index 45afa426ccc..732952081a6 100644 --- a/src/OrchardCore.Modules/OrchardCore.Layers/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Layers/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Layers; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Localization/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Localization/AdminMenu.cs index 6426551a2f4..42078f84b10 100644 --- a/src/OrchardCore.Modules/OrchardCore.Localization/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Localization/AdminMenu.cs @@ -8,7 +8,7 @@ namespace OrchardCore.Localization; /// /// Represents a localization menu in the admin site. /// -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Media.AmazonS3/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Media.AmazonS3/AdminMenu.cs index e84a47989c7..a32fe8bebf5 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media.AmazonS3/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media.AmazonS3/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Media.AmazonS3; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Media.Azure/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Media.Azure/AdminMenu.cs index d5b22677ae6..34cd3558ab2 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media.Azure/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media.Azure/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Media.Azure; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Media/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Media/AdminMenu.cs index 1b816a92002..46191f3aabb 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Media; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Media/MediaCacheAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Media/MediaCacheAdminMenu.cs index 5506d0f19a7..1781878da51 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/MediaCacheAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media/MediaCacheAdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Media; -public sealed class MediaCacheAdminMenu : AdminMenuNavigationProvider +public sealed class MediaCacheAdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Menu/AdminMenu.cs index fae19c4025b..fcaa009814a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Menu/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Menu/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Menu; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuAAD.cs b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuAAD.cs index 50fe95576d6..3a54ebefd0c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuAAD.cs +++ b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuAAD.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Microsoft.Authentication; -public sealed class AdminMenuAAD : AdminMenuNavigationProvider +public sealed class AdminMenuAAD : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuMicrosoftAccount.cs b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuMicrosoftAccount.cs index 9dffe0bb112..5cbbcbe0558 100644 --- a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuMicrosoftAccount.cs +++ b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/AdminMenuMicrosoftAccount.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Microsoft.Authentication; -public sealed class AdminMenuMicrosoftAccount : AdminMenuNavigationProvider +public sealed class AdminMenuMicrosoftAccount : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.OpenId/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.OpenId/AdminMenu.cs index 2306f406634..3f76c85c186 100644 --- a/src/OrchardCore.Modules/OrchardCore.OpenId/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.OpenId/AdminMenu.cs @@ -6,7 +6,7 @@ namespace OrchardCore.OpenId; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _clientRouteValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Placements/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Placements/AdminMenu.cs index d7366798449..936bac3b40e 100644 --- a/src/OrchardCore.Modules/OrchardCore.Placements/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Placements/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Placements; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Queries/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Queries/AdminMenu.cs index b2c83e5bc2c..b020bd83075 100644 --- a/src/OrchardCore.Modules/OrchardCore.Queries/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Queries/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Queries; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Queries/Sql/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Queries/Sql/AdminMenu.cs index 8d155c89b0c..bd02f352d8e 100644 --- a/src/OrchardCore.Modules/OrchardCore.Queries/Sql/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Queries/Sql/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Queries.Sql; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.ReCaptcha/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.ReCaptcha/AdminMenu.cs index 089a25a0926..0e02386740d 100644 --- a/src/OrchardCore.Modules/OrchardCore.ReCaptcha/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.ReCaptcha/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.ReCaptcha; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Recipes/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Recipes/AdminMenu.cs index 9a2e794ad78..a60ff2635e5 100644 --- a/src/OrchardCore.Modules/OrchardCore.Recipes/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Recipes/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Recipes; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.ReverseProxy/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.ReverseProxy/AdminMenu.cs index 56c42a3d90b..7d305565eab 100644 --- a/src/OrchardCore.Modules/OrchardCore.ReverseProxy/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.ReverseProxy/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.ReverseProxy; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Roles/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Roles/AdminMenu.cs index 78c57e72d96..607369ab16f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Roles/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Roles/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Roles; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Search.AzureAI/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Search.AzureAI/AdminMenu.cs index e5a0c7052ba..f83d396465e 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search.AzureAI/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search.AzureAI/AdminMenu.cs @@ -6,7 +6,7 @@ namespace OrchardCore.Search.AzureAI; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private readonly AzureAISearchDefaultOptions _azureAISearchSettings; diff --git a/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/AdminMenu.cs index 0d940c54362..6f3159ef762 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Search.Elasticsearch; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Search.Lucene/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Search.Lucene/AdminMenu.cs index 2e48aa588cd..cff75fd6424 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search.Lucene/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search.Lucene/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Search.Lucene; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Search/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Search/AdminMenu.cs index bc143efe169..f3176267655 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Search; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Security/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Security/AdminMenu.cs index 01d2deac4b4..2bc24e8b352 100644 --- a/src/OrchardCore.Modules/OrchardCore.Security/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Security/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Security; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Seo/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Seo/AdminMenu.cs index 5726ee8b97e..15e06e663da 100644 --- a/src/OrchardCore.Modules/OrchardCore.Seo/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Seo/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Seo; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Settings/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Settings/AdminMenu.cs index 8d9b8b67b1a..aefaaf97b2a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Settings/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Settings/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Settings; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Shortcodes/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Shortcodes/AdminMenu.cs index 4d8c821bab6..05eb954cc9f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Shortcodes/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Shortcodes/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Shortcodes; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Sitemaps/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Sitemaps/AdminMenu.cs index 669442d7866..aa152c86415 100644 --- a/src/OrchardCore.Modules/OrchardCore.Sitemaps/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Sitemaps/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Sitemaps; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Sms/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Sms/AdminMenu.cs index 83991cf3fd7..da32ab0d607 100644 --- a/src/OrchardCore.Modules/OrchardCore.Sms/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Sms/AdminMenu.cs @@ -6,7 +6,7 @@ namespace OrchardCore.Sms; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Taxonomies/AdminMenu.cs index b8ad27533a3..d66fccb078f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Taxonomies; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Templates/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Templates/AdminMenu.cs index d42b12041e5..1592d557a5c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Templates/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Templates/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Templates; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Templates/AdminTemplatesAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Templates/AdminTemplatesAdminMenu.cs index c72eace6d4b..5d2a236357f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Templates/AdminTemplatesAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Templates/AdminTemplatesAdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Templates; -public sealed class AdminTemplatesAdminMenu : AdminMenuNavigationProvider +public sealed class AdminTemplatesAdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Tenants/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Tenants/AdminMenu.cs index 2ec88191320..2a65a73a7ee 100644 --- a/src/OrchardCore.Modules/OrchardCore.Tenants/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Tenants/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Tenants; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private readonly ShellSettings _shellSettings; diff --git a/src/OrchardCore.Modules/OrchardCore.Tenants/FeatureProfilesAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Tenants/FeatureProfilesAdminMenu.cs index bfb3ff21f0a..e675610dc72 100644 --- a/src/OrchardCore.Modules/OrchardCore.Tenants/FeatureProfilesAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Tenants/FeatureProfilesAdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Tenants; -public sealed class FeatureProfilesAdminMenu : AdminMenuNavigationProvider +public sealed class FeatureProfilesAdminMenu : AdminNavigationProvider { private readonly ShellSettings _shellSettings; diff --git a/src/OrchardCore.Modules/OrchardCore.Themes/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Themes/AdminMenu.cs index a74d793f86f..a792d6924c5 100644 --- a/src/OrchardCore.Modules/OrchardCore.Themes/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Themes/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Themes; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenu.cs index 05d5a96718f..abbd61cc8b2 100644 --- a/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenu.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Twitter; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenuSignin.cs b/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenuSignin.cs index cafb085b0a9..071074d46e4 100644 --- a/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenuSignin.cs +++ b/src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenuSignin.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Twitter; -public sealed class AdminMenuSignin : AdminMenuNavigationProvider +public sealed class AdminMenuSignin : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Users/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Users/AdminMenu.cs index 91eb232cccd..a32f0b0bdaf 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/AdminMenu.cs @@ -6,7 +6,7 @@ namespace OrchardCore.Users; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Users/ChangeEmailAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Users/ChangeEmailAdminMenu.cs index f4fd6de6bf8..44682388897 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/ChangeEmailAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/ChangeEmailAdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Users; -public sealed class ChangeEmailAdminMenu : AdminMenuNavigationProvider +public sealed class ChangeEmailAdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Users/RegistrationAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Users/RegistrationAdminMenu.cs index 405b9efd03c..a568fe9d980 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/RegistrationAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/RegistrationAdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Users; -public sealed class RegistrationAdminMenu : AdminMenuNavigationProvider +public sealed class RegistrationAdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Users/ResetPasswordAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Users/ResetPasswordAdminMenu.cs index e34bff516d1..eeea745cb99 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/ResetPasswordAdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/ResetPasswordAdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Users; -public sealed class ResetPasswordAdminMenu : AdminMenuNavigationProvider +public sealed class ResetPasswordAdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Workflows/AdminMenu.cs index 11230805471..53c45ec6651 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/AdminMenu.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Workflows; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/Trimming/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Workflows/Trimming/AdminMenu.cs index 09271ab8271..9be8ceef695 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/Trimming/AdminMenu.cs +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/Trimming/AdminMenu.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Workflows.Trimming; -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { diff --git a/src/OrchardCore/OrchardCore.Navigation.Core/AdminMenuNavigationProvider.cs b/src/OrchardCore/OrchardCore.Navigation.Core/AdminMenuNavigationProvider.cs deleted file mode 100644 index 56d6fb9171a..00000000000 --- a/src/OrchardCore/OrchardCore.Navigation.Core/AdminMenuNavigationProvider.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OrchardCore.Navigation; - -public abstract class AdminMenuNavigationProvider : NamedNavigationProvider -{ - public AdminMenuNavigationProvider() - : base(NavigationConstants.AdminId) - { - } -} diff --git a/src/OrchardCore/OrchardCore.Navigation.Core/AdminNavigationProvider.cs b/src/OrchardCore/OrchardCore.Navigation.Core/AdminNavigationProvider.cs new file mode 100644 index 00000000000..c9a90ef5916 --- /dev/null +++ b/src/OrchardCore/OrchardCore.Navigation.Core/AdminNavigationProvider.cs @@ -0,0 +1,9 @@ +namespace OrchardCore.Navigation; + +public abstract class AdminNavigationProvider : NamedNavigationProvider +{ + public AdminNavigationProvider() + : base(NavigationConstants.AdminId) + { + } +} diff --git a/src/docs/reference/modules/Navigation/README.md b/src/docs/reference/modules/Navigation/README.md index a54b0be6f20..85c337c4d51 100644 --- a/src/docs/reference/modules/Navigation/README.md +++ b/src/docs/reference/modules/Navigation/README.md @@ -181,7 +181,7 @@ As mentioned about, you can implement the `INavigationProvider` interface to add | **Class Name** | **Description** | | ----------------------------- | -------------------------------------------------------------------------------- | | `NamedNavigationProvider` | Inherit from this class to add menu items to a menu with a specific name. | -| `AdminMenuNavigationProvider` | Inherit from this class to add menu items that will only appear in the admin menu. | +| `AdminNavigationProvider` | Inherit from this class to add menu items that will only appear in the admin menu. | diff --git a/src/docs/releases/2.0.0.md b/src/docs/releases/2.0.0.md index 340bd8a8213..57c88d0bcea 100644 --- a/src/docs/releases/2.0.0.md +++ b/src/docs/releases/2.0.0.md @@ -485,12 +485,12 @@ The `OrchardCore.Email` module has undergone a refactoring process with no break ### Admin Menu -The admin menu has been optimized with significant performance improvements and code enhancements. When adding a navigation provider to the admin menu, it is now recommended to use the new `AdminMenuNavigationProvider` class rather than directly implementing the `INavigationProvider` interface in your project. +The admin menu has been optimized with significant performance improvements and code enhancements. When adding a navigation provider to the admin menu, it is now recommended to use the new `AdminNavigationProvider` class rather than directly implementing the `INavigationProvider` interface in your project. Furthermore, when passing route values to actions, it's a best practice to store these values in constant variables for maintainability and clarity. Below is an example demonstrating this approach: ```csharp -public sealed class AdminMenu : AdminMenuNavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() {