diff --git a/.all-contributorsrc b/.all-contributorsrc index 50c79429a8d..d96ec12168e 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3177,6 +3177,42 @@ "contributions": [ "code" ] + }, + { + "login": "davidpuplava", + "name": "David Puplava", + "avatar_url": "https://avatars.githubusercontent.com/u/5144137?v=4", + "profile": "https://www.davidpuplava.com", + "contributions": [ + "code" + ] + }, + { + "login": "shinexyt", + "name": "Hanming Xing", + "avatar_url": "https://avatars.githubusercontent.com/u/12826837?v=4", + "profile": "https://github.com/shinexyt", + "contributions": [ + "code" + ] + }, + { + "login": "XopcT", + "name": "Vladimir Verbitsky", + "avatar_url": "https://avatars.githubusercontent.com/u/8039133?v=4", + "profile": "https://github.com/XopcT", + "contributions": [ + "code" + ] + }, + { + "login": "matTrabolsi", + "name": "matTrabolsi", + "avatar_url": "https://avatars.githubusercontent.com/u/72926503?v=4", + "profile": "https://github.com/matTrabolsi", + "contributions": [ + "code" + ] } ], "skipCi": true, diff --git a/.dockerignore b/.dockerignore index 86de177373f..6c08ef8ca28 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,16 +1,6 @@ -# ignore all -** - -# Except src for building -!./src/* -!Directory.Build.props - -# TODO : Remove this line when Docker Buildkit works in Windows -!/.build/release/* - # Ignore any App_Data folder **/App_Data/ -# Ignore all prebuild +# Ignore all built assets **/[b|B]in/ **/[O|o]bj/ diff --git a/.editorconfig b/.editorconfig index 7181698744e..bbb5af24d58 100644 --- a/.editorconfig +++ b/.editorconfig @@ -78,6 +78,8 @@ dotnet_diagnostic.IDE0303.severity = silent # Co dotnet_diagnostic.IDE0078.severity = silent # Use pattern matching +dotnet_diagnostic.IDE0130.severity = silent # Namespace does not match folder structure + dotnet_style_prefer_conditional_expression_over_assignment = silent # Remove redundant equality, e.g. Disabled == false dotnet_diagnostic.CA2263.severity = warning # Prefer generic overload when type is known diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 33005a6079f..2514eeffeee 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1 +1,7 @@ +# .git-blame-ignore-revs + +# Define formatting rules (#16567) +657342d05a221dfaba1fdf46813c0161dd12d4ec + +# Convert to file-scope namespaces (#16539) 05730cfeb221680240feb3d9edca563bc388a1ef diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md index 7e9d91e9d3a..a841f6f7ea7 100644 --- a/.github/ISSUE_TEMPLATE/release.md +++ b/.github/ISSUE_TEMPLATE/release.md @@ -27,7 +27,6 @@ Update the source, so everything looks like on the new version. - [ ] Update the `OrchardCore.Commons.props` file with `` such that preview build numbers are not injected in packages. Verify the `VersionPrefix` tag matches the released version. - [ ] Update module versions in `src/OrchardCore/OrchardCore.Abstractions/Modules/Manifest/ManifestConstants.cs`. - [ ] Create a new milestone. -- [ ] Change the Orchard Core version in the project templates, more specifically in `dotnetcli.host.json` and `template.json` files. - [ ] Add final updates to the release notes in the documentation. It should include the following, at least: - Overview of the release's highlights and goals. What do you want people to remember this release for? - Prerequisites. What framework version do you need, anything else to work with Orchard? diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a0ae63c5d47..bdbcf2043ab 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,11 +1,21 @@ version: 2 updates: - - package-ecosystem: "nuget" # See documentation for possible values - directory: "/" # Location of package manifests + # Dependabot can handle at most 150 "manifests", so for NuGet, csprojs referencing packages (see docs: + # https://docs.github.com/en/enterprise-cloud@latest/code-security/supply-chain-security/understanding-your-software-supply-chain/troubleshooting-the-dependency-graph#are-there-limits-which-affect-the-dependency-graph-data). + # Thus, it would fail for the whole solution. + # Grouping updates per directories or otherwise trying to have smaller batches is unnecessary, because due to + # centralized package management, Dependabot will find all dependencies from any project. So, just processing the + # OrchardCore project. + - package-ecosystem: "nuget" + directory: "/src/OrchardCore/OrchardCore" schedule: interval: "weekly" groups: - # Grouped version updates configuration all-dependencies: patterns: - "*" + ignore: + # We'll update GraphQL for v3 because it's breaking, see https://github.com/OrchardCMS/OrchardCore/issues/16826. + - dependency-name: "GraphQL*" + # See the corresponding comment in Directory.Packages.props. + - dependency-name: "System.Drawing.Common" diff --git a/.github/workflows/first_time_contributor.yml b/.github/workflows/first_time_contributor.yml index a4cb9cc6c18..a557c023a30 100644 --- a/.github/workflows/first_time_contributor.yml +++ b/.github/workflows/first_time_contributor.yml @@ -16,6 +16,7 @@ jobs: # directly. - uses: OrchardCMS/welcome-action@task/update-to-node-20 with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FIRST_ISSUE_COMMENT: > Thank you for submitting your first issue, awesome! 🚀 We're thrilled to receive your input. If you haven't completed the template yet, please take a moment to do so. This ensures that we fully understand your feature diff --git a/.gitignore b/.gitignore index e82568c0a66..564c6bdfcfa 100644 --- a/.gitignore +++ b/.gitignore @@ -200,15 +200,14 @@ wwwroot !src/OrchardCore.Themes/**/wwwroot !src/OrchardCore.Modules/**/Localization/**/*.po !src/OrchardCore.Themes/**/Localization/**/*.po -!src/Templates/**/content/** -src/Templates/**/content/**/[Bb]in/ -src/Templates/**/content/**/[Oo]bj/ -.template.config/ /OrchardCore.sln.GhostDoc.xml +# Templates +# .template.config folders are generated by our own msbuild task that injects the build version +src/Templates/**/content/**/.template.config/ + # Rider /.idea # BenchmarkDotNet artifacts BenchmarkDotNet.Artifacts - diff --git a/Directory.Build.props b/Directory.Build.props index 658a1de0111..61e0d8aae96 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -47,9 +47,6 @@ $(NoWarn);CA2201 - - $(NoWarn);CA1727 - $(NoWarn);CA1861 diff --git a/Directory.Packages.props b/Directory.Packages.props index e8cd3979080..cc1bd445047 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,51 +1,46 @@ - true + true - - true - true 2.3.0 - - + - + + - + - + - - - - - - + + + + + + - - + + - + - - - - - + + + - - - - - - + + + - + - - - - - - - - - + + + + + + + + + - + - - + + @@ -93,10 +85,13 @@ - - - - + + + + + + + - + - - - 8.0.8 - 8.0.8 + 8.0.10 + 8.0.10 - - @@ -154,11 +145,9 @@ - - - + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 7adafe714ea..3cb0f13bb44 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,25 @@ -FROM --platform=$BUILDPLATFORM golang:alpine AS build +# TARGETARCH and TARGETOS are set automatically when --platform is provided. +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env ARG TARGETOS - -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env LABEL stage=build-env -WORKDIR /app +WORKDIR /source -# Copy and build -COPY ./src /app -COPY Directory.Build.props / +# copy required files for building +# .dockerignore excludes App_Data and binaries from these +COPY ./src ./src +COPY Directory.Build.props . +COPY Directory.Packages.props . -RUN dotnet publish /app/OrchardCore.Cms.Web -c Release -o ./build/release --framework net8.0 /p:RunAnalyzers=false +# build, results are placed in /app +RUN dotnet publish src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj -c Release -o /app --framework net8.0 /p:RunAnalyzers=false -# Build runtime image +# build runtime image FROM mcr.microsoft.com/dotnet/aspnet:8.0-nanoserver-1809 AS build_windows FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS build_linux FROM build_${TARGETOS} AS aspnet EXPOSE 80 -ENV ASPNETCORE_URLS http://+:80 +ENV ASPNETCORE_URLS=http://+:80 WORKDIR /app -COPY --from=build-env /app/build/release . +COPY --from=build-env /app/ . ENTRYPOINT ["dotnet", "OrchardCore.Cms.Web.dll"] diff --git a/NuGet.config b/NuGet.config index fdb4bf7ac2a..84081b7aa33 100644 --- a/NuGet.config +++ b/NuGet.config @@ -3,8 +3,25 @@ - + + + + diff --git a/OrchardCore.sln b/OrchardCore.sln index e2b57d6f876..172cbd5cfc9 100644 --- a/OrchardCore.sln +++ b/OrchardCore.sln @@ -525,6 +525,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Rules.Core", "s EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Queries.Core", "src\OrchardCore\OrchardCore.Queries.Core\OrchardCore.Queries.Core.csproj", "{61B358F2-702C-40AA-9DF7-7121248FE6DE}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Sms.Azure", "src\OrchardCore.Modules\OrchardCore.Sms.Azure\OrchardCore.Sms.Azure.csproj", "{013C8BBF-6879-4B47-80C9-A466923E45E5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1389,6 +1391,10 @@ Global {61B358F2-702C-40AA-9DF7-7121248FE6DE}.Debug|Any CPU.Build.0 = Debug|Any CPU {61B358F2-702C-40AA-9DF7-7121248FE6DE}.Release|Any CPU.ActiveCfg = Release|Any CPU {61B358F2-702C-40AA-9DF7-7121248FE6DE}.Release|Any CPU.Build.0 = Release|Any CPU + {013C8BBF-6879-4B47-80C9-A466923E45E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {013C8BBF-6879-4B47-80C9-A466923E45E5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {013C8BBF-6879-4B47-80C9-A466923E45E5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {013C8BBF-6879-4B47-80C9-A466923E45E5}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1629,6 +1635,7 @@ Global {E8A1097D-A65A-4B17-A3A2-F50D79552732} = {A066395F-6F73-45DC-B5A6-B4E306110DCE} {4BAA08A2-878C-4B96-86BF-5B3DB2B6C2C7} = {F23AC6C2-DE44-4699-999D-3C478EF3D691} {61B358F2-702C-40AA-9DF7-7121248FE6DE} = {F23AC6C2-DE44-4699-999D-3C478EF3D691} + {013C8BBF-6879-4B47-80C9-A466923E45E5} = {A066395F-6F73-45DC-B5A6-B4E306110DCE} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {46A1D25A-78D1-4476-9CBF-25B75E296341} diff --git a/README.md b/README.md index 51afb895a40..425242463c7 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,11 @@ Orchard Core consists of two distinct projects: [![BSD-3-Clause License](https://img.shields.io/badge/license-BSD--3--Clause-blue.svg)](LICENSE) [![Documentation](https://readthedocs.org/projects/orchardcore/badge/)](https://docs.orchardcore.net/) [![Crowdin](https://badges.crowdin.net/orchard-core/localized.svg)](https://crowdin.com/project/orchard-core) +[![Discord](https://img.shields.io/discord/551136772243980291?color=%237289DA&label=OrchardCore&logo=discord&logoColor=white&style=flat-square)](https://orchardcore.net/discord) ## Build Status -Stable (`release/1.8.3`): +Stable (`release/2.0`): [![Build status](https://github.com/OrchardCMS/OrchardCore/actions/workflows/release_ci.yml/badge.svg)](https://github.com/OrchardCMS/OrchardCore/actions?query=workflow%3A%22Release+-+CI%22) [![NuGet](https://img.shields.io/nuget/v/OrchardCore.Application.Cms.Targets.svg)](https://www.nuget.org/packages/OrchardCore.Application.Cms.Targets) @@ -23,7 +24,7 @@ Nightly (`main`): [![Build status](https://github.com/OrchardCMS/OrchardCore/actions/workflows/preview_ci.yml/badge.svg)](https://github.com/OrchardCMS/OrchardCore/actions?query=workflow%3A%22Preview+-+CI%22) [![Cloudsmith](https://api-prd.cloudsmith.io/badges/version/orchardcore/preview/nuget/OrchardCore.Application.Cms.Targets/latest/x/?render=true&badge_token=gAAAAABey9hKFD_C-ZIpLvayS3HDsIjIorQluDs53KjIdlxoDz6Ntt1TzvMNJp7a_UWvQbsfN5nS7_0IbxCyqHZsjhmZP6cBkKforo-NqwrH5-E6QCrJ3D8%3D)](https://cloudsmith.io/~orchardcore/repos/preview/packages/detail/nuget/OrchardCore.Application.Cms.Targets/latest/) -## Project Status: v1.8.3 +## Project Status: v2.0.2 The software is production-ready, and capable of serving large mission-critical applications as well, and we're not aware of any fundamental bugs or missing features we deem crucial. Orchard Core continues to evolve, with each version bringing new improvements, and keeping up with the cutting-edge of .NET. diff --git a/mkdocs.yml b/mkdocs.yml index 3f005a20504..1a8c392cb2a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -5,11 +5,12 @@ theme: logo: assets/images/orchard-logo.png favicon: assets/images/favicon.png features: - - navigation.footer + - content.tabs.link - header.autohide + - navigation.footer - navigation.instant - navigation.tabs - - content.tabs.link + - navigation.top palette: - media: "(prefers-color-scheme: light)" scheme: default @@ -54,7 +55,7 @@ validation: # Add files here that are intentionally not in the navigation and thus omitted_files shouldn't warn about them. not_in_nav: | samples/ - releases/2.0.0.md + releases/2.1.0.md # Extensions markdown_extensions: @@ -196,6 +197,7 @@ nav: - Shortcodes: reference/modules/Shortcodes/README.md - Sitemaps: reference/modules/Sitemaps/README.md - SMS: reference/modules/Sms/README.md + - Azure Communication SMS: reference/modules/Sms.Azure/README.md - Spatial: reference/modules/Spatial/README.md - XML-RPC: reference/modules/XmlRpc/README.md - Menu: reference/modules/Menu/README.md @@ -271,6 +273,10 @@ nav: - Owners: resources/owners/README.md - Workshops: resources/workshops/README.md - Releases: + - 2.0.2: releases/2.0.2.md + - 2.0.1: releases/2.0.1.md + - 2.0.0: releases/2.0.0.md + - 1.8.4: releases/1.8.4.md - 1.8.3: releases/1.8.3.md - 1.8.2: releases/1.8.2.md - 1.8.1: releases/1.8.1.md diff --git a/src/OrchardCore.Build/OrchardCore.Commons.props b/src/OrchardCore.Build/OrchardCore.Commons.props index 896f8eddf95..ea4fa9d60eb 100644 --- a/src/OrchardCore.Build/OrchardCore.Commons.props +++ b/src/OrchardCore.Build/OrchardCore.Commons.props @@ -2,7 +2,7 @@ 12.0 - 2.0.0 + 2.1.0 preview $(VersionSuffix)-$(BuildNumber) 612,618 @@ -39,20 +39,10 @@ - - True icon.png - - - all - runtime; build; native; contentfiles; analyzers - - - - diff --git a/src/OrchardCore.Cms.Web/appsettings.json b/src/OrchardCore.Cms.Web/appsettings.json index a4e2b9e1074..4dbff971208 100644 --- a/src/OrchardCore.Cms.Web/appsettings.json +++ b/src/OrchardCore.Cms.Web/appsettings.json @@ -173,7 +173,11 @@ // "Key": "" // } //}, - // "Url": "http://localhost", + // Roles + //"OrchardCore_Roles": { + // "AdminRoleName":"Administrator" + //}, + //"Url": "http://localhost", // "Ports": [ 9200 ], // "Username": "admin", // "Password": "admin", @@ -250,10 +254,14 @@ // "Username": "", // "Password": "" //}, - //"OrchardCore_Email_Azure": { + //"OrchardCore_Email_AzureCommunicationServices": { // "DefaultSender": "", // "ConnectionString": "" //} + //"OrchardCore_Sms_AzureCommunicationServices": { + // "PhoneNumber": "", + // "ConnectionString": "" + //} //"OrchardCore_ReverseProxy": { // "ForwardedHeaders": "None" //}, diff --git a/src/OrchardCore.Modules/OrchardCore.Admin/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Admin/AdminMenu.cs index 22d4da0c5c7..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 : 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 Task BuildNavigationAsync(string name, NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -39,6 +34,6 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder) ) ); - return Task.CompletedTask; + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Admin/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Admin/Startup.cs index 1a83938744d..054c654b2d8 100644 --- a/src/OrchardCore.Modules/OrchardCore.Admin/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Admin/Startup.cs @@ -22,7 +22,6 @@ using OrchardCore.Mvc.Routing; using OrchardCore.Navigation; using OrchardCore.Security.Permissions; -using OrchardCore.Settings; using OrchardCore.Settings.Deployment; namespace OrchardCore.Admin; @@ -52,12 +51,12 @@ public override void ConfigureServices(IServiceCollection services) }); services.AddTransient(); - services.AddScoped(); + services.AddPermissionProvider(); services.AddScoped(); services.AddScoped(); - services.AddScoped, AdminSiteSettingsDisplayDriver>(); - services.AddScoped(); - services.AddScoped(); + services.AddSiteDisplayDriver(); + services.AddPermissionProvider(); + services.AddNavigationProvider(); services.AddSingleton(); services.AddScoped, VisitSiteNavbarDisplayDriver>(); diff --git a/src/OrchardCore.Modules/OrchardCore.AdminDashboard/Startup.cs b/src/OrchardCore.Modules/OrchardCore.AdminDashboard/Startup.cs index a1b471ccd58..26b34aab842 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminDashboard/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.AdminDashboard/Startup.cs @@ -31,7 +31,7 @@ public Startup(IOptions adminOptions) public override void ConfigureServices(IServiceCollection services) { - services.AddScoped(); + services.AddPermissionProvider(); services.AddScoped(); services.AddIndexProvider(); diff --git a/src/OrchardCore.Modules/OrchardCore.AdminMenu/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.AdminMenu/AdminMenu.cs index 266a89a2b3e..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 _adminMenuNavigationProvider; + private readonly AdminMenuNavigationProvidersCoordinator _adminMenuNavigationProviderCoordinator; internal readonly IStringLocalizer S; - public AdminMenu(AdminMenuNavigationProvidersCoordinator adminMenuNavigationProvider, - IStringLocalizer localizer) + public AdminMenu( + AdminMenuNavigationProvidersCoordinator adminMenuNavigationProviderCoordinator, + IStringLocalizer stringLocalizer) { - _adminMenuNavigationProvider = adminMenuNavigationProvider; - S = localizer; + _adminMenuNavigationProviderCoordinator = adminMenuNavigationProviderCoordinator; + S = stringLocalizer; } - public async Task BuildNavigationAsync(string name, NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return; - } - - // 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 async Task BuildNavigationAsync(string name, NavigationBuilder builder) ) ); - // This is the entry point for the adminMenu: dynamically generated custom admin menus - await _adminMenuNavigationProvider.BuildNavigationAsync(NavigationConstants.AdminMenuId, builder); + // 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.AdminMenu/Deployment/AdminMenuDeploymentSource.cs b/src/OrchardCore.Modules/OrchardCore.AdminMenu/Deployment/AdminMenuDeploymentSource.cs index 0d62c16c142..0502063da9b 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminMenu/Deployment/AdminMenuDeploymentSource.cs +++ b/src/OrchardCore.Modules/OrchardCore.AdminMenu/Deployment/AdminMenuDeploymentSource.cs @@ -7,7 +7,8 @@ namespace OrchardCore.AdminMenu.Deployment; -public class AdminMenuDeploymentSource : IDeploymentSource +public class AdminMenuDeploymentSource + : DeploymentSourceBase { private readonly IAdminMenuService _adminMenuService; private readonly JsonSerializerOptions _serializationOptions; @@ -19,15 +20,8 @@ public AdminMenuDeploymentSource(IAdminMenuService adminMenuService, _serializationOptions = serializationOptions.Value.SerializerOptions; } - public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlanResult result) + protected override async Task ProcessAsync(AdminMenuDeploymentStep step, DeploymentPlanResult result) { - var adminMenuStep = step as AdminMenuDeploymentStep; - - if (adminMenuStep == null) - { - return; - } - var data = new JsonArray(); result.Steps.Add(new JsonObject { @@ -40,7 +34,5 @@ public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlan var objectData = JObject.FromObject(adminMenu, _serializationOptions); data.Add(objectData); } - - return; } } diff --git a/src/OrchardCore.Modules/OrchardCore.AdminMenu/Recipes/AdminMenuStep.cs b/src/OrchardCore.Modules/OrchardCore.AdminMenu/Recipes/AdminMenuStep.cs index 6939244db07..6425c3d017e 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminMenu/Recipes/AdminMenuStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.AdminMenu/Recipes/AdminMenuStep.cs @@ -11,7 +11,7 @@ namespace OrchardCore.AdminMenu.Recipes; /// /// This recipe step creates a set of admin menus. /// -public sealed class AdminMenuStep : IRecipeStepHandler +public sealed class AdminMenuStep : NamedRecipeStepHandler { private readonly IAdminMenuService _adminMenuService; private readonly JsonSerializerOptions _serializationOptions; @@ -19,20 +19,16 @@ public sealed class AdminMenuStep : IRecipeStepHandler public AdminMenuStep( IAdminMenuService adminMenuService, IOptions serializationOptions) + : base("AdminMenu") { _adminMenuService = adminMenuService; - // The recipe step contains polymorphic types (menu items) which need to be resolved + // The recipe step contains polymorphic types (menu items) which need to be resolved. _serializationOptions = serializationOptions.Value.SerializerOptions; } - public async Task ExecuteAsync(RecipeExecutionContext context) + protected override async Task HandleAsync(RecipeExecutionContext context) { - if (!string.Equals(context.Name, "AdminMenu", StringComparison.OrdinalIgnoreCase)) - { - return; - } - var model = context.Step.ToObject(_serializationOptions); foreach (var token in model.Data.Cast()) @@ -47,8 +43,6 @@ public async Task ExecuteAsync(RecipeExecutionContext context) await _adminMenuService.SaveAsync(adminMenu); } - - return; } } diff --git a/src/OrchardCore.Modules/OrchardCore.AdminMenu/Services/AdminMenuNavigationProvidersCoordinator.cs b/src/OrchardCore.Modules/OrchardCore.AdminMenu/Services/AdminMenuNavigationProvidersCoordinator.cs index dba9e021d3e..8653cbe4b2d 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminMenu/Services/AdminMenuNavigationProvidersCoordinator.cs +++ b/src/OrchardCore.Modules/OrchardCore.AdminMenu/Services/AdminMenuNavigationProvidersCoordinator.cs @@ -31,7 +31,7 @@ public AdminMenuNavigationProvidersCoordinator( _logger = logger; } - public async Task BuildNavigationAsync(string name, NavigationBuilder builder) + public async ValueTask BuildNavigationAsync(string name, NavigationBuilder builder) { // We only add them if the caller uses the string "adminMenu". if (name != NavigationConstants.AdminMenuId) diff --git a/src/OrchardCore.Modules/OrchardCore.AdminMenu/Startup.cs b/src/OrchardCore.Modules/OrchardCore.AdminMenu/Startup.cs index 9a639e053c4..74e1b7fa0e9 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminMenu/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.AdminMenu/Startup.cs @@ -15,8 +15,8 @@ public sealed class Startup : StartupBase { public override void ConfigureServices(IServiceCollection services) { - services.AddScoped(); - services.AddScoped(); + services.AddPermissionProvider(); + services.AddNavigationProvider(); services.AddScoped(); services.AddScoped(); diff --git a/src/OrchardCore.Modules/OrchardCore.Alias/Handlers/AliasPartHandler.cs b/src/OrchardCore.Modules/OrchardCore.Alias/Handlers/AliasPartHandler.cs index 7c0407ac870..f8a31fe026f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Alias/Handlers/AliasPartHandler.cs +++ b/src/OrchardCore.Modules/OrchardCore.Alias/Handlers/AliasPartHandler.cs @@ -49,7 +49,7 @@ public override async Task ValidatingAsync(ValidateContentContext context, Alias } } - public async override Task UpdatedAsync(UpdateContentContext context, AliasPart part) + public override async Task UpdatedAsync(UpdateContentContext context, AliasPart part) { // Compute the Alias only if it's empty. if (!string.IsNullOrEmpty(part.Alias)) diff --git a/src/OrchardCore.Modules/OrchardCore.Alias/Services/ContentAliasShapeTableProvider.cs b/src/OrchardCore.Modules/OrchardCore.Alias/Services/ContentAliasShapeTableProvider.cs new file mode 100644 index 00000000000..cc883a8a9d2 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Alias/Services/ContentAliasShapeTableProvider.cs @@ -0,0 +1,35 @@ +using OrchardCore.Alias.Models; +using OrchardCore.ContentManagement; +using OrchardCore.DisplayManagement; +using OrchardCore.DisplayManagement.Descriptors; +using OrchardCore.DisplayManagement.Utilities; + +namespace OrchardCore.Alias.Services; + +public sealed class ContentAliasShapeTableProvider : ShapeTableProvider +{ + public override ValueTask DiscoverAsync(ShapeTableBuilder builder) + { + builder.Describe("Content") + .OnDisplaying(displaying => + { + var shape = displaying.Shape; + var contentItem = shape.GetProperty("ContentItem"); + + var aliasPart = contentItem?.As(); + + if (aliasPart != null) + { + var encodedAlias = aliasPart.Alias.EncodeAlternateElement(); + + // Content__Alias__[Alias] e.g. Content-Alias-example, Content-Alias-my-page + displaying.Shape.Metadata.Alternates.Add("Content__Alias__" + encodedAlias); + + // Content_[DisplayType]__Alias__[Alias] e.g. Content-Alias-example.Summary, Content-Alias-my-page.Summary + displaying.Shape.Metadata.Alternates.Add("Content_" + displaying.Shape.Metadata.DisplayType + "__Alias__" + encodedAlias); + } + }); + + return ValueTask.CompletedTask; + } +} diff --git a/src/OrchardCore.Modules/OrchardCore.Alias/Services/WidgetAliasShapeTableProvider.cs b/src/OrchardCore.Modules/OrchardCore.Alias/Services/WidgetAliasShapeTableProvider.cs new file mode 100644 index 00000000000..85d8a984550 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Alias/Services/WidgetAliasShapeTableProvider.cs @@ -0,0 +1,35 @@ +using OrchardCore.Alias.Models; +using OrchardCore.ContentManagement; +using OrchardCore.DisplayManagement; +using OrchardCore.DisplayManagement.Descriptors; +using OrchardCore.DisplayManagement.Utilities; + +namespace OrchardCore.Alias.Services; + +public sealed class WidgetAliasShapeTableProvider : ShapeTableProvider +{ + public override ValueTask DiscoverAsync(ShapeTableBuilder builder) + { + builder.Describe("Widget") + .OnDisplaying(displaying => + { + var shape = displaying.Shape; + var contentItem = shape.GetProperty("ContentItem"); + + var aliasPart = contentItem?.As(); + + if (aliasPart != null) + { + var encodedAlias = aliasPart.Alias.EncodeAlternateElement(); + + // Widget__Alias__[Alias] e.g. Widget-Alias-example, Widget-Alias-my-page + displaying.Shape.Metadata.Alternates.Add("Widget__Alias__" + encodedAlias); + + // Widget_[DisplayType]__Alias__[Alias] e.g. Widget-Alias-example.Summary, Widget-Alias-my-page.Summary + displaying.Shape.Metadata.Alternates.Add("Widget_" + displaying.Shape.Metadata.DisplayType + "__Alias__" + encodedAlias); + } + }); + + return ValueTask.CompletedTask; + } +} diff --git a/src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs index 36f54299b5b..c08f6df7e85 100644 --- a/src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs @@ -15,6 +15,8 @@ using OrchardCore.ContentTypes.Editors; using OrchardCore.Data; using OrchardCore.Data.Migration; +using OrchardCore.DisplayManagement; +using OrchardCore.DisplayManagement.Descriptors; using OrchardCore.Indexing; using OrchardCore.Liquid; using OrchardCore.Modules; @@ -72,3 +74,21 @@ public override void ConfigureServices(IServiceCollection services) services.AddScoped(); } } + +[RequireFeatures("OrchardCore.Contents")] +public sealed class ContentAliasStartup : StartupBase +{ + public override void ConfigureServices(IServiceCollection services) + { + services.AddShapeTableProvider(); + } +} + +[RequireFeatures("OrchardCore.Widgets")] +public sealed class WidgetAliasStartup : StartupBase +{ + public override void ConfigureServices(IServiceCollection services) + { + services.AddShapeTableProvider(); + } +} diff --git a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/AdminMenu.cs index 7785b68d27b..02c371cda73 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 Task BuildNavigationAsync(string name, NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["GraphiQL"], S["GraphiQL"].PrefixPosition(), graphiQL => graphiQL @@ -28,6 +23,6 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder) ) ); - return Task.CompletedTask; + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/Startup.cs index 09c260d0ba1..c928c74358f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/Startup.cs @@ -45,8 +45,8 @@ public override void ConfigureServices(IServiceCollection services) return new ErrorInfoProvider(new ErrorInfoProviderOptions { ExposeExceptionDetails = settings.Value.ExposeExceptions }); }); - services.AddScoped(); - services.AddTransient(); + services.AddPermissionProvider(); + services.AddNavigationProvider(); services.AddSingleton(); services.AddGraphQL(builder => builder.AddSystemTextJson((options, sp) => diff --git a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/ValidationRules/MaxNumberOfResultsValidationRule.cs b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/ValidationRules/MaxNumberOfResultsValidationRule.cs index a429869af6f..c4df8595dfc 100644 --- a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/ValidationRules/MaxNumberOfResultsValidationRule.cs +++ b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/ValidationRules/MaxNumberOfResultsValidationRule.cs @@ -60,7 +60,7 @@ public ValueTask ValidateAsync(ValidationContext validationContext } else { - _logger.LogInformation("'{value}' exceeds the maximum number of results for '{name}' ({total})", value.Value, arg.Name, _maxNumberOfResults); + _logger.LogInformation("'{Value}' exceeds the maximum number of results for '{Name}' ({Total})", value.Value, arg.Name, _maxNumberOfResults); arg = new GraphQLArgument(arg.Name, new GraphQLIntValue(_maxNumberOfResults)); // if disabled mode we just log info and override the arg to be maxvalue } diff --git a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/ValidationRules/RequiresPermissionValidationRule.cs b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/ValidationRules/RequiresPermissionValidationRule.cs index cd43c8d99dd..ba3183d2447 100644 --- a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/ValidationRules/RequiresPermissionValidationRule.cs +++ b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/ValidationRules/RequiresPermissionValidationRule.cs @@ -9,8 +9,10 @@ namespace OrchardCore.Apis.GraphQL.ValidationRules; public class RequiresPermissionValidationRule : IValidationRule { - public static readonly string ErrorCode = "Unauthorized"; + public const string ErrorCode = "Unauthorized"; + private readonly IAuthorizationService _authorizationService; + protected readonly IStringLocalizer S; public RequiresPermissionValidationRule( diff --git a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/package-lock.json b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/package-lock.json index ca50fbe1e2b..54a7b89a2d8 100644 --- a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/package-lock.json +++ b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/package-lock.json @@ -28,7 +28,7 @@ "style-loader": "^3.3.3", "ts-loader": "^9.4.4", "typescript": "^5.2.2", - "webpack": "^5.88.2", + "webpack": "^5.94.0", "webpack-cli": "^5.1.4" } }, @@ -1953,14 +1953,14 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" @@ -1976,22 +1976,22 @@ } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", - "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" } }, "node_modules/@jridgewell/sourcemap-codec": { @@ -2001,21 +2001,15 @@ "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", - "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@jridgewell/trace-mapping/node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - }, "node_modules/@lezer/common": { "version": "0.16.1", "resolved": "https://registry.npmjs.org/@lezer/common/-/common-0.16.1.tgz", @@ -2064,30 +2058,10 @@ "semver": "bin/semver.js" } }, - "node_modules/@types/eslint": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.1.tgz", - "integrity": "sha512-GE44+DNEyxxh2Kc6ro/VkIj+9ma0pO0bwv9+uHSyBrikYOHr8zYcdPvnBOp1aw8s+CjRvuSx7CyWqRrNFQ59mA==", - "dev": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint-scope": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.3.tgz", - "integrity": "sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g==", - "dev": true, - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "node_modules/@types/estree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", - "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, "node_modules/@types/json-schema": { @@ -2103,9 +2077,9 @@ "devOptional": true }, "node_modules/@webassemblyjs/ast": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", - "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", + "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", "dev": true, "dependencies": { "@webassemblyjs/helper-numbers": "1.11.6", @@ -2125,9 +2099,9 @@ "dev": true }, "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz", - "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", + "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", "dev": true }, "node_modules/@webassemblyjs/helper-numbers": { @@ -2148,15 +2122,15 @@ "dev": true }, "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz", - "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", + "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6" + "@webassemblyjs/wasm-gen": "1.12.1" } }, "node_modules/@webassemblyjs/ieee754": { @@ -2184,28 +2158,28 @@ "dev": true }, "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz", - "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", + "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/helper-wasm-section": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-opt": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6", - "@webassemblyjs/wast-printer": "1.11.6" + "@webassemblyjs/helper-wasm-section": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-opt": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1", + "@webassemblyjs/wast-printer": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz", - "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", + "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", "@webassemblyjs/ieee754": "1.11.6", "@webassemblyjs/leb128": "1.11.6", @@ -2213,24 +2187,24 @@ } }, "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz", - "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", + "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz", - "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", + "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-api-error": "1.11.6", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", "@webassemblyjs/ieee754": "1.11.6", @@ -2239,12 +2213,12 @@ } }, "node_modules/@webassemblyjs/wast-printer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz", - "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", + "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@xtuc/long": "4.2.2" } }, @@ -2305,9 +2279,9 @@ "dev": true }, "node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -2316,10 +2290,10 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-assertions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", - "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, "peerDependencies": { "acorn": "^8" @@ -2817,9 +2791,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.15.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", - "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dev": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -3165,9 +3139,9 @@ } }, "node_modules/graceful-fs": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", - "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, "node_modules/graphiql": { @@ -4526,9 +4500,9 @@ } }, "node_modules/serialize-javascript": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", - "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, "dependencies": { "randombytes": "^2.1.0" @@ -4705,9 +4679,9 @@ } }, "node_modules/terser": { - "version": "5.19.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.0.tgz", - "integrity": "sha512-JpcpGOQLOXm2jsomozdMDpd5f8ZHh1rR48OFgWUH3QsyZcfPgv2qDCYbcDEAYNd4OZRj2bWYKpwdll/udZCk/Q==", + "version": "5.31.6", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.6.tgz", + "integrity": "sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -4723,16 +4697,16 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.3.9", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz", - "integrity": "sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==", + "version": "5.3.10", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", + "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", "dev": true, "dependencies": { - "@jridgewell/trace-mapping": "^0.3.17", + "@jridgewell/trace-mapping": "^0.3.20", "jest-worker": "^27.4.5", "schema-utils": "^3.1.1", "serialize-javascript": "^6.0.1", - "terser": "^5.16.8" + "terser": "^5.26.0" }, "engines": { "node": ">= 10.13.0" @@ -5036,9 +5010,9 @@ "peer": true }, "node_modules/watchpack": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", - "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", + "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", "dev": true, "dependencies": { "glob-to-regexp": "^0.4.1", @@ -5049,34 +5023,33 @@ } }, "node_modules/webpack": { - "version": "5.88.2", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.88.2.tgz", - "integrity": "sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==", + "version": "5.94.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", + "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", "dev": true, "dependencies": { - "@types/eslint-scope": "^3.7.3", - "@types/estree": "^1.0.0", - "@webassemblyjs/ast": "^1.11.5", - "@webassemblyjs/wasm-edit": "^1.11.5", - "@webassemblyjs/wasm-parser": "^1.11.5", + "@types/estree": "^1.0.5", + "@webassemblyjs/ast": "^1.12.1", + "@webassemblyjs/wasm-edit": "^1.12.1", + "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.9.0", - "browserslist": "^4.14.5", + "acorn-import-attributes": "^1.9.5", + "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.15.0", + "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.9", + "graceful-fs": "^4.2.11", "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", "schema-utils": "^3.2.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.7", - "watchpack": "^2.4.0", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", "webpack-sources": "^3.2.3" }, "bin": { @@ -6574,14 +6547,14 @@ } }, "@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "requires": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" } }, "@jridgewell/resolve-uri": { @@ -6591,19 +6564,19 @@ "dev": true }, "@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true }, "@jridgewell/source-map": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", - "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "dev": true, "requires": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" } }, "@jridgewell/sourcemap-codec": { @@ -6613,21 +6586,13 @@ "dev": true }, "@jridgewell/trace-mapping": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", - "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "requires": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" - }, - "dependencies": { - "@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - } + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "@lezer/common": { @@ -6672,30 +6637,10 @@ "integrity": "sha512-3Yc1fUTs69MG/uZbJlLSI3JISMn2UV2rg+1D/vROUqZyh3l6iYHCs7GMp+M40ZD7yOdDbYjJcU1oTJhrc+dGKg==", "dev": true }, - "@types/eslint": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.1.tgz", - "integrity": "sha512-GE44+DNEyxxh2Kc6ro/VkIj+9ma0pO0bwv9+uHSyBrikYOHr8zYcdPvnBOp1aw8s+CjRvuSx7CyWqRrNFQ59mA==", - "dev": true, - "requires": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "@types/eslint-scope": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.3.tgz", - "integrity": "sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g==", - "dev": true, - "requires": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "@types/estree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", - "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, "@types/json-schema": { @@ -6711,9 +6656,9 @@ "devOptional": true }, "@webassemblyjs/ast": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", - "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", + "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", "dev": true, "requires": { "@webassemblyjs/helper-numbers": "1.11.6", @@ -6733,9 +6678,9 @@ "dev": true }, "@webassemblyjs/helper-buffer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz", - "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", + "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", "dev": true }, "@webassemblyjs/helper-numbers": { @@ -6756,15 +6701,15 @@ "dev": true }, "@webassemblyjs/helper-wasm-section": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz", - "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", + "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6" + "@webassemblyjs/wasm-gen": "1.12.1" } }, "@webassemblyjs/ieee754": { @@ -6792,28 +6737,28 @@ "dev": true }, "@webassemblyjs/wasm-edit": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz", - "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", + "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/helper-wasm-section": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-opt": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6", - "@webassemblyjs/wast-printer": "1.11.6" + "@webassemblyjs/helper-wasm-section": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-opt": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1", + "@webassemblyjs/wast-printer": "1.12.1" } }, "@webassemblyjs/wasm-gen": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz", - "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", + "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", "@webassemblyjs/ieee754": "1.11.6", "@webassemblyjs/leb128": "1.11.6", @@ -6821,24 +6766,24 @@ } }, "@webassemblyjs/wasm-opt": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz", - "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", + "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1" } }, "@webassemblyjs/wasm-parser": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz", - "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", + "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-api-error": "1.11.6", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", "@webassemblyjs/ieee754": "1.11.6", @@ -6847,12 +6792,12 @@ } }, "@webassemblyjs/wast-printer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz", - "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", + "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@xtuc/long": "4.2.2" } }, @@ -6890,15 +6835,15 @@ "dev": true }, "acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true }, - "acorn-import-assertions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", - "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, "requires": {} }, @@ -7258,9 +7203,9 @@ "dev": true }, "enhanced-resolve": { - "version": "5.15.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", - "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dev": true, "requires": { "graceful-fs": "^4.2.4", @@ -7523,9 +7468,9 @@ "dev": true }, "graceful-fs": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", - "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, "graphiql": { @@ -8484,9 +8429,9 @@ "dev": true }, "serialize-javascript": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", - "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, "requires": { "randombytes": "^2.1.0" @@ -8613,9 +8558,9 @@ "dev": true }, "terser": { - "version": "5.19.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.0.tgz", - "integrity": "sha512-JpcpGOQLOXm2jsomozdMDpd5f8ZHh1rR48OFgWUH3QsyZcfPgv2qDCYbcDEAYNd4OZRj2bWYKpwdll/udZCk/Q==", + "version": "5.31.6", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.6.tgz", + "integrity": "sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg==", "dev": true, "requires": { "@jridgewell/source-map": "^0.3.3", @@ -8633,16 +8578,16 @@ } }, "terser-webpack-plugin": { - "version": "5.3.9", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz", - "integrity": "sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==", + "version": "5.3.10", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", + "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", "dev": true, "requires": { - "@jridgewell/trace-mapping": "^0.3.17", + "@jridgewell/trace-mapping": "^0.3.20", "jest-worker": "^27.4.5", "schema-utils": "^3.1.1", "serialize-javascript": "^6.0.1", - "terser": "^5.16.8" + "terser": "^5.26.0" } }, "to-fast-properties": { @@ -8839,9 +8784,9 @@ "peer": true }, "watchpack": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", - "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", + "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", "dev": true, "requires": { "glob-to-regexp": "^0.4.1", @@ -8849,34 +8794,33 @@ } }, "webpack": { - "version": "5.88.2", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.88.2.tgz", - "integrity": "sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==", + "version": "5.94.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", + "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", "dev": true, "requires": { - "@types/eslint-scope": "^3.7.3", - "@types/estree": "^1.0.0", - "@webassemblyjs/ast": "^1.11.5", - "@webassemblyjs/wasm-edit": "^1.11.5", - "@webassemblyjs/wasm-parser": "^1.11.5", + "@types/estree": "^1.0.5", + "@webassemblyjs/ast": "^1.12.1", + "@webassemblyjs/wasm-edit": "^1.12.1", + "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.9.0", - "browserslist": "^4.14.5", + "acorn-import-attributes": "^1.9.5", + "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.15.0", + "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.9", + "graceful-fs": "^4.2.11", "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", "schema-utils": "^3.2.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.7", - "watchpack": "^2.4.0", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", "webpack-sources": "^3.2.3" } }, diff --git a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/package.json b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/package.json index 81524d09c6b..145f7dc2ee6 100644 --- a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/package.json +++ b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/package.json @@ -24,7 +24,7 @@ "style-loader": "^3.3.3", "ts-loader": "^9.4.4", "typescript": "^5.2.2", - "webpack": "^5.88.2", + "webpack": "^5.94.0", "webpack-cli": "^5.1.4" }, "scripts": { diff --git a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailAdminMenu.cs index f1a154e8d7f..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 : INavigationProvider +public sealed class AuditTrailAdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -20,13 +20,8 @@ public AuditTrailAdminMenu(IStringLocalizer stringLocalizer S = stringLocalizer; } - public Task BuildNavigationAsync(string name, NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - builder .Add(S["Audit Trail"], NavigationConstants.AdminMenuAuditTrailPosition, configuration => configuration .AddClass("audittrail") @@ -36,6 +31,6 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder) .LocalNav() ); - return Task.CompletedTask; + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailSettingsAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Navigation/AuditTrailSettingsAdminMenu.cs index 420c6376f6a..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 : INavigationProvider +public sealed class AuditTrailSettingsAdminMenu : AdminNavigationProvider { private static readonly RouteValueDictionary _routeValues = new() { @@ -20,13 +20,8 @@ public AuditTrailSettingsAdminMenu(IStringLocalizer S = stringLocalizer; } - public Task BuildNavigationAsync(string name, NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -40,6 +35,6 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder) ) ); - return Task.CompletedTask; + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Services/DefaultAuditTrailAdminListFilterProvider.cs b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Services/DefaultAuditTrailAdminListFilterProvider.cs index 47dd816fdc2..9cee1010c33 100644 --- a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Services/DefaultAuditTrailAdminListFilterProvider.cs +++ b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Services/DefaultAuditTrailAdminListFilterProvider.cs @@ -9,7 +9,6 @@ using OrchardCore.AuditTrail.ViewModels; using OrchardCore.Modules; using Parlot; -using YesSql; using YesSql.Filters.Query; using YesSql.Services; @@ -178,7 +177,7 @@ public void Build(QueryEngineBuilder builder) var normalizedUserName = lookupNormalizer.NormalizeName(val); query.With(x => x.NormalizedUserName.Contains(normalizedUserName)); - return new ValueTask>(query); + return ValueTask.FromResult(query); }, (val, query, ctx) => { @@ -187,7 +186,7 @@ public void Build(QueryEngineBuilder builder) var normalizedUserName = lookupNormalizer.NormalizeName(val); query.With(x => x.NormalizedUserName.NotContains(normalizedUserName)); - return new ValueTask>(query); + return ValueTask.FromResult(query); } ) ) diff --git a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Services/DefaultAuditTrailAdminListQueryService.cs b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Services/DefaultAuditTrailAdminListQueryService.cs index 4d74d31a419..45069577e40 100644 --- a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Services/DefaultAuditTrailAdminListQueryService.cs +++ b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Services/DefaultAuditTrailAdminListQueryService.cs @@ -87,7 +87,7 @@ public async Task QueryAsync(int page, int pageSize, } } - var localNow = await _localClock.LocalNowAsync; + var localNow = await _localClock.GetLocalNowAsync(); var startOfWeek = CultureInfo.CurrentUICulture.DateTimeFormat.FirstDayOfWeek; options.AuditTrailDates = diff --git a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Startup.cs b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Startup.cs index 684789e0ff1..8c76e521209 100644 --- a/src/OrchardCore.Modules/OrchardCore.AuditTrail/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.AuditTrail/Startup.cs @@ -17,7 +17,6 @@ using OrchardCore.Modules; using OrchardCore.Navigation; using OrchardCore.Security.Permissions; -using OrchardCore.Settings; using OrchardCore.Settings.Deployment; using YesSql.Filters.Query; @@ -43,12 +42,12 @@ public override void ConfigureServices(IServiceCollection services) services.AddIndexProvider(); services.AddSingleton(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); + services.AddPermissionProvider(); + services.AddNavigationProvider(); + services.AddNavigationProvider(); - services.AddScoped, AuditTrailSettingsDisplayDriver>(); - services.AddScoped, AuditTrailTrimmingSettingsDisplayDriver>(); + services.AddSiteDisplayDriver(); + services.AddSiteDisplayDriver(); services.AddScoped, AuditTrailOptionsDisplayDriver>(); diff --git a/src/OrchardCore.Modules/OrchardCore.AuditTrail/package-lock.json b/src/OrchardCore.Modules/OrchardCore.AuditTrail/package-lock.json index 6fd119a3934..1d017f13aee 100644 --- a/src/OrchardCore.Modules/OrchardCore.AuditTrail/package-lock.json +++ b/src/OrchardCore.Modules/OrchardCore.AuditTrail/package-lock.json @@ -31,7 +31,7 @@ "style-loader": "^3.3.3", "ts-loader": "^9.4.4", "typescript": "^5.2.2", - "webpack": "^5.88.2", + "webpack": "^5.94.0", "webpack-cli": "^5.1.4" } }, @@ -1948,14 +1948,14 @@ "integrity": "sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA==" }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" @@ -1971,22 +1971,22 @@ } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", - "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" } }, "node_modules/@jridgewell/sourcemap-codec": { @@ -1996,21 +1996,15 @@ "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", - "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@jridgewell/trace-mapping/node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - }, "node_modules/@nicolo-ribaudo/chokidar-2": { "version": "2.1.8-no-fsevents.3", "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz", @@ -2037,30 +2031,10 @@ "url": "https://opencollective.com/popperjs" } }, - "node_modules/@types/eslint": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.1.tgz", - "integrity": "sha512-GE44+DNEyxxh2Kc6ro/VkIj+9ma0pO0bwv9+uHSyBrikYOHr8zYcdPvnBOp1aw8s+CjRvuSx7CyWqRrNFQ59mA==", - "dev": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint-scope": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.3.tgz", - "integrity": "sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g==", - "dev": true, - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "node_modules/@types/estree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", - "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, "node_modules/@types/json-schema": { @@ -2070,10 +2044,13 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.4.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.1.tgz", - "integrity": "sha512-JIzsAvJeA/5iY6Y/OxZbv1lUcc8dNSE77lb2gnBH+/PJ3lFR1Ccvgwl5JWnHAkNHcRsT0TbpVOsiMKZ1F/yyJg==", - "dev": true + "version": "22.5.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.1.tgz", + "integrity": "sha512-KkHsxej0j9IW1KKOOAA/XBA0z08UFSrRQHErzEfA3Vgq57eXIMYboIlHJuYIfd+lwCQjtKqUu3UnmKbtUc9yRw==", + "dev": true, + "dependencies": { + "undici-types": "~6.19.2" + } }, "node_modules/@types/parse-json": { "version": "4.0.0", @@ -2113,9 +2090,9 @@ "dev": true }, "node_modules/@webassemblyjs/ast": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", - "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", + "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", "dev": true, "dependencies": { "@webassemblyjs/helper-numbers": "1.11.6", @@ -2135,9 +2112,9 @@ "dev": true }, "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz", - "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", + "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", "dev": true }, "node_modules/@webassemblyjs/helper-numbers": { @@ -2158,15 +2135,15 @@ "dev": true }, "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz", - "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", + "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6" + "@webassemblyjs/wasm-gen": "1.12.1" } }, "node_modules/@webassemblyjs/ieee754": { @@ -2194,28 +2171,28 @@ "dev": true }, "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz", - "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", + "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/helper-wasm-section": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-opt": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6", - "@webassemblyjs/wast-printer": "1.11.6" + "@webassemblyjs/helper-wasm-section": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-opt": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1", + "@webassemblyjs/wast-printer": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz", - "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", + "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", "@webassemblyjs/ieee754": "1.11.6", "@webassemblyjs/leb128": "1.11.6", @@ -2223,24 +2200,24 @@ } }, "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz", - "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", + "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz", - "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", + "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-api-error": "1.11.6", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", "@webassemblyjs/ieee754": "1.11.6", @@ -2249,12 +2226,12 @@ } }, "node_modules/@webassemblyjs/wast-printer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz", - "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", + "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@xtuc/long": "4.2.2" } }, @@ -2315,9 +2292,9 @@ "dev": true }, "node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -2326,10 +2303,10 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-assertions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", - "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, "peerDependencies": { "acorn": "^8" @@ -2903,9 +2880,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.15.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", - "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dev": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -3249,9 +3226,9 @@ } }, "node_modules/graceful-fs": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", - "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, "node_modules/has": { @@ -4616,9 +4593,9 @@ } }, "node_modules/serialize-javascript": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", - "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, "dependencies": { "randombytes": "^2.1.0" @@ -4779,9 +4756,9 @@ } }, "node_modules/terser": { - "version": "5.19.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.0.tgz", - "integrity": "sha512-JpcpGOQLOXm2jsomozdMDpd5f8ZHh1rR48OFgWUH3QsyZcfPgv2qDCYbcDEAYNd4OZRj2bWYKpwdll/udZCk/Q==", + "version": "5.31.6", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.6.tgz", + "integrity": "sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -4797,16 +4774,16 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.3.9", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz", - "integrity": "sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==", + "version": "5.3.10", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", + "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", "dev": true, "dependencies": { - "@jridgewell/trace-mapping": "^0.3.17", + "@jridgewell/trace-mapping": "^0.3.20", "jest-worker": "^27.4.5", "schema-utils": "^3.1.1", "serialize-javascript": "^6.0.1", - "terser": "^5.16.8" + "terser": "^5.26.0" }, "engines": { "node": ">= 10.13.0" @@ -4988,6 +4965,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true + }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -5088,9 +5071,9 @@ "dev": true }, "node_modules/watchpack": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", - "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", + "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", "dev": true, "dependencies": { "glob-to-regexp": "^0.4.1", @@ -5101,34 +5084,33 @@ } }, "node_modules/webpack": { - "version": "5.88.2", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.88.2.tgz", - "integrity": "sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==", + "version": "5.94.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", + "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", "dev": true, "dependencies": { - "@types/eslint-scope": "^3.7.3", - "@types/estree": "^1.0.0", - "@webassemblyjs/ast": "^1.11.5", - "@webassemblyjs/wasm-edit": "^1.11.5", - "@webassemblyjs/wasm-parser": "^1.11.5", + "@types/estree": "^1.0.5", + "@webassemblyjs/ast": "^1.12.1", + "@webassemblyjs/wasm-edit": "^1.12.1", + "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.9.0", - "browserslist": "^4.14.5", + "acorn-import-attributes": "^1.9.5", + "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.15.0", + "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.9", + "graceful-fs": "^4.2.11", "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", "schema-utils": "^3.2.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.7", - "watchpack": "^2.4.0", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", "webpack-sources": "^3.2.3" }, "bin": { @@ -6637,14 +6619,14 @@ "integrity": "sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA==" }, "@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "requires": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" } }, "@jridgewell/resolve-uri": { @@ -6654,19 +6636,19 @@ "dev": true }, "@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true }, "@jridgewell/source-map": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", - "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "dev": true, "requires": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" } }, "@jridgewell/sourcemap-codec": { @@ -6676,21 +6658,13 @@ "dev": true }, "@jridgewell/trace-mapping": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", - "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "requires": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" - }, - "dependencies": { - "@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - } + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "@nicolo-ribaudo/chokidar-2": { @@ -6712,30 +6686,10 @@ "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", "peer": true }, - "@types/eslint": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.1.tgz", - "integrity": "sha512-GE44+DNEyxxh2Kc6ro/VkIj+9ma0pO0bwv9+uHSyBrikYOHr8zYcdPvnBOp1aw8s+CjRvuSx7CyWqRrNFQ59mA==", - "dev": true, - "requires": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "@types/eslint-scope": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.3.tgz", - "integrity": "sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g==", - "dev": true, - "requires": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "@types/estree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", - "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, "@types/json-schema": { @@ -6745,10 +6699,13 @@ "dev": true }, "@types/node": { - "version": "20.4.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.1.tgz", - "integrity": "sha512-JIzsAvJeA/5iY6Y/OxZbv1lUcc8dNSE77lb2gnBH+/PJ3lFR1Ccvgwl5JWnHAkNHcRsT0TbpVOsiMKZ1F/yyJg==", - "dev": true + "version": "22.5.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.1.tgz", + "integrity": "sha512-KkHsxej0j9IW1KKOOAA/XBA0z08UFSrRQHErzEfA3Vgq57eXIMYboIlHJuYIfd+lwCQjtKqUu3UnmKbtUc9yRw==", + "dev": true, + "requires": { + "undici-types": "~6.19.2" + } }, "@types/parse-json": { "version": "4.0.0", @@ -6788,9 +6745,9 @@ "dev": true }, "@webassemblyjs/ast": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", - "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", + "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", "dev": true, "requires": { "@webassemblyjs/helper-numbers": "1.11.6", @@ -6810,9 +6767,9 @@ "dev": true }, "@webassemblyjs/helper-buffer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz", - "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", + "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", "dev": true }, "@webassemblyjs/helper-numbers": { @@ -6833,15 +6790,15 @@ "dev": true }, "@webassemblyjs/helper-wasm-section": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz", - "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", + "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6" + "@webassemblyjs/wasm-gen": "1.12.1" } }, "@webassemblyjs/ieee754": { @@ -6869,28 +6826,28 @@ "dev": true }, "@webassemblyjs/wasm-edit": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz", - "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", + "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/helper-wasm-section": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-opt": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6", - "@webassemblyjs/wast-printer": "1.11.6" + "@webassemblyjs/helper-wasm-section": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-opt": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1", + "@webassemblyjs/wast-printer": "1.12.1" } }, "@webassemblyjs/wasm-gen": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz", - "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", + "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", "@webassemblyjs/ieee754": "1.11.6", "@webassemblyjs/leb128": "1.11.6", @@ -6898,24 +6855,24 @@ } }, "@webassemblyjs/wasm-opt": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz", - "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", + "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1" } }, "@webassemblyjs/wasm-parser": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz", - "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", + "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-api-error": "1.11.6", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", "@webassemblyjs/ieee754": "1.11.6", @@ -6924,12 +6881,12 @@ } }, "@webassemblyjs/wast-printer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz", - "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", + "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@xtuc/long": "4.2.2" } }, @@ -6967,15 +6924,15 @@ "dev": true }, "acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true }, - "acorn-import-assertions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", - "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, "requires": {} }, @@ -7395,9 +7352,9 @@ } }, "enhanced-resolve": { - "version": "5.15.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", - "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dev": true, "requires": { "graceful-fs": "^4.2.4", @@ -7661,9 +7618,9 @@ "dev": true }, "graceful-fs": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", - "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, "has": { @@ -8613,9 +8570,9 @@ "dev": true }, "serialize-javascript": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", - "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, "requires": { "randombytes": "^2.1.0" @@ -8733,9 +8690,9 @@ "dev": true }, "terser": { - "version": "5.19.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.0.tgz", - "integrity": "sha512-JpcpGOQLOXm2jsomozdMDpd5f8ZHh1rR48OFgWUH3QsyZcfPgv2qDCYbcDEAYNd4OZRj2bWYKpwdll/udZCk/Q==", + "version": "5.31.6", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.6.tgz", + "integrity": "sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg==", "dev": true, "requires": { "@jridgewell/source-map": "^0.3.3", @@ -8753,16 +8710,16 @@ } }, "terser-webpack-plugin": { - "version": "5.3.9", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz", - "integrity": "sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==", + "version": "5.3.10", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", + "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", "dev": true, "requires": { - "@jridgewell/trace-mapping": "^0.3.17", + "@jridgewell/trace-mapping": "^0.3.20", "jest-worker": "^27.4.5", "schema-utils": "^3.1.1", "serialize-javascript": "^6.0.1", - "terser": "^5.16.8" + "terser": "^5.26.0" } }, "to-fast-properties": { @@ -8869,6 +8826,12 @@ "which-boxed-primitive": "^1.0.2" } }, + "undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true + }, "unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -8937,9 +8900,9 @@ "dev": true }, "watchpack": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", - "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", + "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", "dev": true, "requires": { "glob-to-regexp": "^0.4.1", @@ -8947,34 +8910,33 @@ } }, "webpack": { - "version": "5.88.2", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.88.2.tgz", - "integrity": "sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==", + "version": "5.94.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", + "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", "dev": true, "requires": { - "@types/eslint-scope": "^3.7.3", - "@types/estree": "^1.0.0", - "@webassemblyjs/ast": "^1.11.5", - "@webassemblyjs/wasm-edit": "^1.11.5", - "@webassemblyjs/wasm-parser": "^1.11.5", + "@types/estree": "^1.0.5", + "@webassemblyjs/ast": "^1.12.1", + "@webassemblyjs/wasm-edit": "^1.12.1", + "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.9.0", - "browserslist": "^4.14.5", + "acorn-import-attributes": "^1.9.5", + "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.15.0", + "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.9", + "graceful-fs": "^4.2.11", "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", "schema-utils": "^3.2.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.7", - "watchpack": "^2.4.0", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", "webpack-sources": "^3.2.3" } }, diff --git a/src/OrchardCore.Modules/OrchardCore.AuditTrail/package.json b/src/OrchardCore.Modules/OrchardCore.AuditTrail/package.json index 480a5181055..0f57740c22d 100644 --- a/src/OrchardCore.Modules/OrchardCore.AuditTrail/package.json +++ b/src/OrchardCore.Modules/OrchardCore.AuditTrail/package.json @@ -27,7 +27,7 @@ "style-loader": "^3.3.3", "ts-loader": "^9.4.4", "typescript": "^5.2.2", - "webpack": "^5.88.2", + "webpack": "^5.94.0", "webpack-cli": "^5.1.4" }, "scripts": { diff --git a/src/OrchardCore.Modules/OrchardCore.AutoSetup/Startup.cs b/src/OrchardCore.Modules/OrchardCore.AutoSetup/Startup.cs index ddc92f68d62..fe2567d190e 100644 --- a/src/OrchardCore.Modules/OrchardCore.AutoSetup/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.AutoSetup/Startup.cs @@ -102,7 +102,7 @@ public override void Configure(IApplicationBuilder app, IEndpointRouteBuilder ro stringBuilder.Append(error.ErrorMessage + ' '); } - _logger.LogError("AutoSetup did not start, configuration has following errors: {errors}", stringBuilder.ToString()); + _logger.LogError("AutoSetup did not start, configuration has following errors: {Errors}", stringBuilder.ToString()); } else if (string.IsNullOrWhiteSpace(options.AutoSetupPath)) { diff --git a/src/OrchardCore.Modules/OrchardCore.Autoroute/Handlers/AutoroutePartHandler.cs b/src/OrchardCore.Modules/OrchardCore.Autoroute/Handlers/AutoroutePartHandler.cs index a65e882d0ef..b14f8ce646c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Autoroute/Handlers/AutoroutePartHandler.cs +++ b/src/OrchardCore.Modules/OrchardCore.Autoroute/Handlers/AutoroutePartHandler.cs @@ -138,7 +138,7 @@ public override async Task UpdatedAsync(UpdateContentContext context, AutorouteP await GenerateContainedPathsFromPatternAsync(context.UpdatingItem, part); } - public async override Task CloningAsync(CloneContentContext context, AutoroutePart part) + public override async Task CloningAsync(CloneContentContext context, AutoroutePart part) { var clonedPart = context.CloneContentItem.As(); clonedPart.Path = await GenerateUniqueAbsolutePathAsync(part.Path, context.CloneContentItem.ContentItemId); diff --git a/src/OrchardCore.Modules/OrchardCore.Autoroute/Services/ContentAutorouteShapeTableProvider.cs b/src/OrchardCore.Modules/OrchardCore.Autoroute/Services/ContentAutorouteShapeTableProvider.cs new file mode 100644 index 00000000000..6b1c1576843 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Autoroute/Services/ContentAutorouteShapeTableProvider.cs @@ -0,0 +1,35 @@ +using OrchardCore.Autoroute.Models; +using OrchardCore.ContentManagement; +using OrchardCore.DisplayManagement; +using OrchardCore.DisplayManagement.Descriptors; +using OrchardCore.DisplayManagement.Utilities; + +namespace OrchardCore.Autoroute.Services; + +public sealed class ContentAutorouteShapeTableProvider : ShapeTableProvider +{ + public override ValueTask DiscoverAsync(ShapeTableBuilder builder) + { + builder.Describe("Content") + .OnDisplaying(displaying => + { + var shape = displaying.Shape; + var contentItem = shape.GetProperty("ContentItem"); + + var autoroutePart = contentItem?.As(); + + if (autoroutePart != null) + { + var encodedSlug = autoroutePart.Path.EncodeAlternateElement().Replace("/", "__"); + + // Content__Slug__[Slug] e.g. Content-Slug-example, Content-Slug-blog-my-post + displaying.Shape.Metadata.Alternates.Add("Content__Slug__" + encodedSlug); + + // Content_[DisplayType]__Slug__[Slug] e.g. Content-Slug-example.Summary, Content-Slug-blog-my-post.Summary + displaying.Shape.Metadata.Alternates.Add("Content_" + displaying.Shape.Metadata.DisplayType + "__Slug__" + encodedSlug); + } + }); + + return ValueTask.CompletedTask; + } +} diff --git a/src/OrchardCore.Modules/OrchardCore.Autoroute/Services/WidgetAutorouteShapeTableProvider.cs b/src/OrchardCore.Modules/OrchardCore.Autoroute/Services/WidgetAutorouteShapeTableProvider.cs new file mode 100644 index 00000000000..be4247f0fcb --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Autoroute/Services/WidgetAutorouteShapeTableProvider.cs @@ -0,0 +1,35 @@ +using OrchardCore.Autoroute.Models; +using OrchardCore.ContentManagement; +using OrchardCore.DisplayManagement; +using OrchardCore.DisplayManagement.Descriptors; +using OrchardCore.DisplayManagement.Utilities; + +namespace OrchardCore.Autoroute.Services; + +public sealed class WidgetAutorouteShapeTableProvider : ShapeTableProvider +{ + public override ValueTask DiscoverAsync(ShapeTableBuilder builder) + { + builder.Describe("Widget") + .OnDisplaying(displaying => + { + var shape = displaying.Shape; + var contentItem = shape.GetProperty("ContentItem"); + + var autoroutePart = contentItem?.As(); + + if (autoroutePart != null) + { + var encodedSlug = autoroutePart.Path.EncodeAlternateElement().Replace("/", "__"); + + // Widget__Slug__[Slug] e.g. Widget-Slug-example, Widget-Slug-blog-my-post + displaying.Shape.Metadata.Alternates.Add("Widget__Slug__" + encodedSlug); + + // Widget_[DisplayType]__Slug__[Slug] e.g. Widget-Slug-example.Summary, Widget-Slug-blog-my-post.Summary + displaying.Shape.Metadata.Alternates.Add("Widget_" + displaying.Shape.Metadata.DisplayType + "__Slug__" + encodedSlug); + } + }); + + return ValueTask.CompletedTask; + } +} diff --git a/src/OrchardCore.Modules/OrchardCore.Autoroute/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Autoroute/Startup.cs index 3f2634d1f45..c500a1ca040 100644 --- a/src/OrchardCore.Modules/OrchardCore.Autoroute/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Autoroute/Startup.cs @@ -10,6 +10,7 @@ using OrchardCore.Autoroute.Indexing; using OrchardCore.Autoroute.Models; using OrchardCore.Autoroute.Routing; +using OrchardCore.Autoroute.Services; using OrchardCore.Autoroute.Settings; using OrchardCore.Autoroute.Sitemaps; using OrchardCore.Autoroute.ViewModels; @@ -21,6 +22,8 @@ using OrchardCore.ContentTypes.Editors; using OrchardCore.Data; using OrchardCore.Data.Migration; +using OrchardCore.DisplayManagement; +using OrchardCore.DisplayManagement.Descriptors; using OrchardCore.Indexing; using OrchardCore.Liquid; using OrchardCore.Modules; @@ -52,7 +55,7 @@ public override void ConfigureServices(IServiceCollection services) if (!slug.StartsWith('/')) { - slug = "/" + slug; + slug = '/' + slug; } (var found, var entry) = await autorouteEntries.TryGetEntryByPathAsync(slug); @@ -74,7 +77,7 @@ public override void ConfigureServices(IServiceCollection services) services.AddScoped(); services.AddScoped(); - services.AddScoped(); + services.AddPermissionProvider(); services.AddScoped(); services.AddScoped(); @@ -113,3 +116,21 @@ public override void ConfigureServices(IServiceCollection services) services.AddScoped(); } } + +[RequireFeatures("OrchardCore.Contents")] +public sealed class ContentAutourouteStartup : StartupBase +{ + public override void ConfigureServices(IServiceCollection services) + { + services.AddShapeTableProvider(); + } +} + +[RequireFeatures("OrchardCore.Widgets")] +public sealed class WidgetAutourouteStartup : StartupBase +{ + public override void ConfigureServices(IServiceCollection services) + { + services.AddShapeTableProvider(); + } +} diff --git a/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/AdminMenu.cs index d0b3c30881c..08f64b7ce73 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 Task BuildNavigationAsync(string name, NavigationBuilder builder) + public AdminMenu(IStringLocalizer stringLocalizer) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } + S = stringLocalizer; + } + protected override ValueTask BuildAsync(NavigationBuilder builder) + { builder .Add(S["Configuration"], configuration => configuration .Add(S["Tasks"], S["Tasks"].PrefixPosition(), tasks => tasks @@ -27,6 +25,6 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder) ) ); - return Task.CompletedTask; + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/Startup.cs b/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/Startup.cs index 65705a7a8ee..6511d01e1d9 100644 --- a/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/Startup.cs @@ -12,8 +12,8 @@ public override void ConfigureServices(IServiceCollection services) { services .AddScoped() - .AddScoped() - .AddScoped() + .AddPermissionProvider() + .AddNavigationProvider() .AddScoped(); } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Media/Startup.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Media/Startup.cs index d1844ad0fcc..ca546e5dc46 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Media/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Media/Startup.cs @@ -1,5 +1,5 @@ using Microsoft.Extensions.DependencyInjection; -using OrchardCore.DisplayManagement.Descriptors; +using OrchardCore.DisplayManagement; using OrchardCore.Modules; namespace OrchardCore.ContentFields.Media; @@ -9,6 +9,6 @@ public sealed class Startup : StartupBase { public override void ConfigureServices(IServiceCollection services) { - services.AddScoped(); + services.AddShapeTableProvider(); } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/BooleanFieldSettingsDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/BooleanFieldSettingsDriver.cs index ddf595f35a9..f7bb762d5be 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/BooleanFieldSettingsDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/BooleanFieldSettingsDriver.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Nodes; using OrchardCore.ContentFields.Fields; using OrchardCore.ContentManagement.Metadata.Models; using OrchardCore.ContentTypes.Editors; @@ -13,7 +12,7 @@ public override IDisplayResult Edit(ContentPartFieldDefinition partFieldDefiniti { return Initialize("BooleanFieldSettings_Edit", model => { - var settings = partFieldDefinition.Settings.ToObject(); + var settings = partFieldDefinition.GetSettings(); model.Hint = settings.Hint; model.Label = settings.Label; diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/DateFieldSettingsDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/DateFieldSettingsDriver.cs index 76c91f54e7b..c18631f184e 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/DateFieldSettingsDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/DateFieldSettingsDriver.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Nodes; using OrchardCore.ContentFields.Fields; using OrchardCore.ContentManagement.Metadata.Models; using OrchardCore.ContentTypes.Editors; @@ -13,7 +12,7 @@ public override IDisplayResult Edit(ContentPartFieldDefinition partFieldDefiniti { return Initialize("DateFieldSettings_Edit", model => { - var settings = partFieldDefinition.Settings.ToObject(); + var settings = partFieldDefinition.GetSettings(); model.Hint = settings.Hint; model.Required = settings.Required; diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/DateTimeFieldSettingsDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/DateTimeFieldSettingsDriver.cs index 4637b788cc2..f6a080d75cb 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/DateTimeFieldSettingsDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/DateTimeFieldSettingsDriver.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Nodes; using OrchardCore.ContentFields.Fields; using OrchardCore.ContentManagement.Metadata.Models; using OrchardCore.ContentTypes.Editors; @@ -13,7 +12,7 @@ public override IDisplayResult Edit(ContentPartFieldDefinition partFieldDefiniti { return Initialize("DateTimeFieldSettings_Edit", model => { - var settings = partFieldDefinition.Settings.ToObject(); + var settings = partFieldDefinition.GetSettings(); model.Hint = settings.Hint; model.Required = settings.Required; diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/LinkFieldSettingsDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/LinkFieldSettingsDriver.cs index fae978770ef..a829d214f43 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/LinkFieldSettingsDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/LinkFieldSettingsDriver.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Nodes; using OrchardCore.ContentFields.Fields; using OrchardCore.ContentManagement.Metadata.Models; using OrchardCore.ContentTypes.Editors; @@ -13,7 +12,7 @@ public override IDisplayResult Edit(ContentPartFieldDefinition partFieldDefiniti { return Initialize("LinkFieldSettings_Edit", model => { - var settings = partFieldDefinition.Settings.ToObject(); + var settings = partFieldDefinition.GetSettings(); model.Hint = settings.Hint; model.HintLinkText = settings.HintLinkText; diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/LocalizationSetContentPickerFieldSettingsDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/LocalizationSetContentPickerFieldSettingsDriver.cs index c97990ec069..bfcae5bfd5f 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/LocalizationSetContentPickerFieldSettingsDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/LocalizationSetContentPickerFieldSettingsDriver.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Nodes; using OrchardCore.ContentFields.Fields; using OrchardCore.ContentManagement.Metadata.Models; using OrchardCore.ContentTypes.Editors; @@ -15,7 +14,7 @@ public override IDisplayResult Edit(ContentPartFieldDefinition partFieldDefiniti { return Initialize("LocalizationSetContentPickerFieldSettings_Edit", model => { - var settings = partFieldDefinition.Settings.ToObject(); + var settings = partFieldDefinition.GetSettings(); model.Hint = settings.Hint; model.Required = settings.Required; diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/NumericFieldSettingsDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/NumericFieldSettingsDriver.cs index a1d5e6584bb..4c402f89786 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/NumericFieldSettingsDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/NumericFieldSettingsDriver.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Nodes; using OrchardCore.ContentFields.Fields; using OrchardCore.ContentManagement.Metadata.Models; using OrchardCore.ContentTypes.Editors; @@ -13,7 +12,7 @@ public override IDisplayResult Edit(ContentPartFieldDefinition partFieldDefiniti { return Initialize("NumericFieldSettings_Edit", model => { - var settings = partFieldDefinition.Settings.ToObject(); + var settings = partFieldDefinition.GetSettings(); model.Hint = settings.Hint; model.Required = settings.Required; diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/TextFieldSettingsDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/TextFieldSettingsDriver.cs index 69a36e7c2fe..4619633d152 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/TextFieldSettingsDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/TextFieldSettingsDriver.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Nodes; using OrchardCore.ContentFields.Fields; using OrchardCore.ContentManagement.Metadata.Models; using OrchardCore.ContentTypes.Editors; @@ -13,7 +12,7 @@ public override IDisplayResult Edit(ContentPartFieldDefinition partFieldDefiniti { return Initialize("TextFieldSettings_Edit", model => { - var settings = partFieldDefinition.Settings.ToObject(); + var settings = partFieldDefinition.GetSettings(); model.Hint = settings.Hint; model.Required = settings.Required; diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/TimeFieldSettingsDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/TimeFieldSettingsDriver.cs index 7dc0ee25454..4cd8df6d16c 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/TimeFieldSettingsDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/TimeFieldSettingsDriver.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Nodes; using OrchardCore.ContentFields.Fields; using OrchardCore.ContentManagement.Metadata.Models; using OrchardCore.ContentTypes.Editors; @@ -13,7 +12,7 @@ public override IDisplayResult Edit(ContentPartFieldDefinition partFieldDefiniti { return Initialize("TimeFieldSettings_Edit", model => { - var settings = partFieldDefinition.Settings.ToObject(); + var settings = partFieldDefinition.GetSettings(); model.Hint = settings.Hint; model.Required = settings.Required; diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/UserPickerFieldSettingsDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/UserPickerFieldSettingsDriver.cs index c6fbb21ea96..71b4f6f00b1 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/UserPickerFieldSettingsDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/UserPickerFieldSettingsDriver.cs @@ -24,17 +24,15 @@ public override IDisplayResult Edit(ContentPartFieldDefinition partFieldDefiniti model.Hint = settings.Hint; model.Required = settings.Required; model.Multiple = settings.Multiple; - var roles = (await _roleService.GetRoleNamesAsync()) - .Except(RoleHelper.SystemRoleNames, StringComparer.OrdinalIgnoreCase) - .Select(roleName => new RoleEntry - { - Role = roleName, - IsSelected = settings.DisplayedRoles.Contains(roleName, StringComparer.OrdinalIgnoreCase) - }) - .ToArray(); + var roles = await _roleService.GetAssignableRolesAsync(); + var roleEntries = roles.Select(role => new RoleEntry + { + Role = role.RoleName, + IsSelected = settings.DisplayedRoles.Contains(role.RoleName, StringComparer.OrdinalIgnoreCase), + }).ToArray(); - model.Roles = roles; - model.DisplayAllUsers = settings.DisplayAllUsers || !roles.Where(x => x.IsSelected).Any(); + model.Roles = roleEntries; + model.DisplayAllUsers = settings.DisplayAllUsers || !roleEntries.Where(x => x.IsSelected).Any(); }).Location("Content"); } @@ -51,7 +49,12 @@ public override async Task UpdateAsync(ContentPartFieldDefinitio Multiple = model.Multiple }; - var selectedRoles = model.Roles.Where(x => x.IsSelected).Select(x => x.Role).ToArray(); + var roles = await _roleService.GetAssignableRolesAsync(); + + var selectedRoles = model.Roles + .Where(x => x.IsSelected && roles.Any(y => y.RoleName == x.Role)) + .Select(x => x.Role) + .ToArray(); if (model.DisplayAllUsers || selectedRoles.Length == 0) { diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/YoutubeFieldSettingsDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/YoutubeFieldSettingsDriver.cs index 587251dc49a..a9ad2f3d18a 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/YoutubeFieldSettingsDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/YoutubeFieldSettingsDriver.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Nodes; using OrchardCore.ContentFields.Fields; using OrchardCore.ContentManagement.Metadata.Models; using OrchardCore.ContentTypes.Editors; @@ -13,14 +12,17 @@ public override IDisplayResult Edit(ContentPartFieldDefinition partFieldDefiniti { return Initialize("YoutubeFieldSetting_Edit", model => { - var settings = partFieldDefinition.Settings.ToObject(); + var settings = partFieldDefinition.GetSettings(); - model.Height = model.Height != default ? model.Height : 315; - model.Width = model.Width != default ? model.Width : 560; + model.Hint = settings.Hint; + model.Label = settings.Label; + model.Height = settings.Height != default ? settings.Height : 315; + model.Width = settings.Width != default ? settings.Width : 560; + model.Required = settings.Required; }).Location("Content"); } - public async override Task UpdateAsync(ContentPartFieldDefinition partFieldDefinition, UpdatePartFieldEditorContext context) + public override async Task UpdateAsync(ContentPartFieldDefinition partFieldDefinition, UpdatePartFieldEditorContext context) { var model = new YoutubeFieldSettings(); await context.Updater.TryUpdateModelAsync(model, Prefix); diff --git a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/AdminMenu.cs index ea0f1b77a91..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 : 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 Task BuildNavigationAsync(string name, NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -55,6 +50,6 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder) ) ); - return Task.CompletedTask; + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Liquid/SwitchCultureUrlFilter.cs b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Liquid/SwitchCultureUrlFilter.cs index 1dc6a3bb458..89afdf56bc1 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Liquid/SwitchCultureUrlFilter.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Liquid/SwitchCultureUrlFilter.cs @@ -35,6 +35,6 @@ public ValueTask ProcessAsync(FluidValue input, FilterArguments argu contentItemUrl = request.Path.Value, queryStringValue = request.QueryString.Value, }); - return new ValueTask(FluidValue.Create(url, context.Options)); + return ValueTask.FromResult(FluidValue.Create(url, context.Options)); } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Sitemaps/LocalizedContentItemsQueryProvider.cs b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Sitemaps/LocalizedContentItemsQueryProvider.cs index ed8b8736efc..122db4ba656 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Sitemaps/LocalizedContentItemsQueryProvider.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Sitemaps/LocalizedContentItemsQueryProvider.cs @@ -13,40 +13,41 @@ namespace OrchardCore.ContentLocalization.Sitemaps; public class LocalizedContentItemsQueryProvider : IContentItemsQueryProvider { - private readonly ISession _session; + private readonly IStore _store; private readonly IRouteableContentTypeCoordinator _routeableContentTypeCoordinator; private readonly ILocalizationService _localizationService; public LocalizedContentItemsQueryProvider( - ISession session, + IStore store, IRouteableContentTypeCoordinator routeableContentTypeCoordinator, ILocalizationService localizationService ) { - _session = session; + _store = store; _routeableContentTypeCoordinator = routeableContentTypeCoordinator; _localizationService = localizationService; } - public async Task GetContentItemsAsync(ContentTypesSitemapSource source, ContentItemsQueryContext queryContext) + public async Task GetContentItemsAsync(ContentTypesSitemapSource source, ContentItemsQueryContext context, int? skip = null, int? take = null) { var routeableContentTypeDefinitions = await _routeableContentTypeCoordinator.ListRoutableTypeDefinitionsAsync(); + using var session = _store.CreateSession(withTracking: false); + + IEnumerable contentItems = null; if (source.IndexAll) { // Assumption here is that at least one content type will be localized. var ctdNames = routeableContentTypeDefinitions.Select(ctd => ctd.Name); - var queryResults = await _session.Query() + contentItems = await session.Query() .With(x => x.Published && x.ContentType.IsIn(ctdNames)) .OrderBy(x => x.CreatedUtc) + .ThenBy(x => x.Id) + .Skip(skip ?? 0) + .Take(take ?? 0) .ListAsync(); - queryContext.ContentItems = queryResults; - - // Provide all content items with localization as reference content items. - queryContext.ReferenceContentItems = queryResults - .Where(ci => ci.Has()); } else if (source.LimitItems) { @@ -61,41 +62,31 @@ public async Task GetContentItemsAsync(ContentTypesSitemapSource source, Content if (contentType.Parts.Any(ctd => string.Equals(ctd.Name, nameof(LocalizationPart), StringComparison.Ordinal))) { - // Get all content items here for reference. Then reduce by default culture. - // We know that the content item should be localized. - // If it doesn't have a localization part, the content item should have been saved. - var queryResults = await _session.Query() - .With(ci => ci.ContentType == source.LimitedContentType.ContentTypeName && ci.Published) - .OrderBy(ci => ci.CreatedUtc) - .With() - .ListAsync(); - // When limiting items Content item is valid if it is for the default culture. var defaultCulture = await _localizationService.GetDefaultCultureAsync(); - // Reduce by default culture. - var items = queryResults - .Where(ci => string.Equals(ci.As().Culture, defaultCulture, StringComparison.Ordinal)) - .Skip(source.LimitedContentType.Skip) - .Take(source.LimitedContentType.Take); - - queryContext.ContentItems = items; - - // Provide all content items with localization as reference content items. - queryContext.ReferenceContentItems = queryResults - .Where(ci => ci.Has()); + // Get all content items here for reference. Then reduce by default culture. + // We know that the content item should be localized. + // If it doesn't have a localization part, the content item should have been saved. + contentItems = await session.Query() + .With(ci => ci.ContentType == source.LimitedContentType.ContentTypeName && ci.Published) + .OrderBy(ci => ci.CreatedUtc) + .ThenBy(ci => ci.Id) + .With(x => x.Culture == defaultCulture) + .Take(take ?? 0) + .Skip(skip ?? 0) + .ListAsync(); } else { // Content type is not localized. Produce standard results. - var queryResults = await _session.Query() + contentItems = await session.Query() .With(x => x.ContentType == source.LimitedContentType.ContentTypeName && x.Published) .OrderBy(x => x.CreatedUtc) - .Skip(source.LimitedContentType.Skip) - .Take(source.LimitedContentType.Take) + .Skip(skip ?? 0) + .Take(take ?? 0) .ListAsync(); - queryContext.ContentItems = queryResults; } } else @@ -106,16 +97,23 @@ public async Task GetContentItemsAsync(ContentTypesSitemapSource source, Content .Select(x => x.Name); // No advantage here in reducing with localized index. - var queryResults = await _session.Query() + + contentItems = await session.Query() .With(x => x.ContentType.IsIn(typesToIndex) && x.Published) .OrderBy(x => x.CreatedUtc) + .ThenBy(x => x.Id) + .Skip(skip ?? 0) + .Take(take ?? 0) .ListAsync(); - queryContext.ContentItems = queryResults; + } + + if (contentItems != null) + { + context.ContentItems = contentItems; // Provide all content items with localization as reference content items. - queryContext.ReferenceContentItems = queryResults - .Where(ci => ci.Has()); + context.ReferenceContentItems = contentItems.Where(ci => ci.Has()); } } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Sitemaps/SitemapUrlHrefLangExtendedMetadataProvider.cs b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Sitemaps/SitemapUrlHrefLangExtendedMetadataProvider.cs index cc0d943f6db..77b8450d880 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Sitemaps/SitemapUrlHrefLangExtendedMetadataProvider.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Sitemaps/SitemapUrlHrefLangExtendedMetadataProvider.cs @@ -33,7 +33,9 @@ public async Task ApplyExtendedMetadataAsync( XElement url) { var part = contentItem.As(); - if (part == null) + if (part == null || + queryContext.ReferenceContentItems == null || + !queryContext.ReferenceContentItems.Any()) { return true; } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Startup.cs b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Startup.cs index 2d7c4ac6f7e..5c66b843436 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Startup.cs @@ -21,7 +21,6 @@ using OrchardCore.Modules; using OrchardCore.Navigation; using OrchardCore.Security.Permissions; -using OrchardCore.Settings; using OrchardCore.Sitemaps.Builders; namespace OrchardCore.ContentLocalization; @@ -40,7 +39,7 @@ public override void ConfigureServices(IServiceCollection services) services.AddSingleton(); services.AddContentLocalization(); - services.AddScoped(); + services.AddPermissionProvider(); services.AddScoped(); services.AddScoped(); @@ -62,10 +61,10 @@ public override void ConfigureServices(IServiceCollection services) { services.AddScoped, ContentCulturePickerNavbarDisplayDriver>(); services.AddLiquidFilter("switch_culture_url"); - services.AddScoped(); + services.AddNavigationProvider(); services.AddScoped(); - services.AddScoped, ContentCulturePickerSettingsDriver>(); - services.AddScoped, ContentRequestCultureProviderSettingsDriver>(); + services.AddSiteDisplayDriver(); + services.AddSiteDisplayDriver(); services.Configure(options => options.AddInitialRequestCultureProvider(new ContentRequestCultureProvider())); services.Configure(_shellConfiguration.GetSection("OrchardCore_ContentLocalization_CulturePickerOptions")); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/AdminMenu.cs index 7884038bc9b..02eec290c50 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 Task BuildNavigationAsync(string name, NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - builder .Add(S["Content"], content => content .Add(S["Content Definition"], S["Content Definition"].PrefixPosition("9"), contentDefinition => contentDefinition @@ -39,6 +34,6 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder) ) ); - return Task.CompletedTask; + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Deployment/ContentDefinitionDeploymentSource.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Deployment/ContentDefinitionDeploymentSource.cs index 703f0522860..f499be5309c 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Deployment/ContentDefinitionDeploymentSource.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Deployment/ContentDefinitionDeploymentSource.cs @@ -4,7 +4,8 @@ namespace OrchardCore.ContentTypes.Deployment; -public class ContentDefinitionDeploymentSource : IDeploymentSource +public class ContentDefinitionDeploymentSource + : DeploymentSourceBase { private readonly IContentDefinitionStore _contentDefinitionStore; @@ -13,24 +14,19 @@ public ContentDefinitionDeploymentSource(IContentDefinitionStore contentDefiniti _contentDefinitionStore = contentDefinitionStore; } - public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlanResult result) + protected override async Task ProcessAsync(ContentDefinitionDeploymentStep step, DeploymentPlanResult result) { - if (step is not ContentDefinitionDeploymentStep contentDefinitionStep) - { - return; - } - var contentTypeDefinitionRecord = await _contentDefinitionStore.LoadContentDefinitionAsync(); - var contentTypes = contentDefinitionStep.IncludeAll + var contentTypes = step.IncludeAll ? contentTypeDefinitionRecord.ContentTypeDefinitionRecords : contentTypeDefinitionRecord.ContentTypeDefinitionRecords - .Where(x => contentDefinitionStep.ContentTypes.Contains(x.Name)); + .Where(x => step.ContentTypes.Contains(x.Name)); - var contentParts = contentDefinitionStep.IncludeAll + var contentParts = step.IncludeAll ? contentTypeDefinitionRecord.ContentPartDefinitionRecords : contentTypeDefinitionRecord.ContentPartDefinitionRecords - .Where(x => contentDefinitionStep.ContentParts.Contains(x.Name)); + .Where(x => step.ContentParts.Contains(x.Name)); result.Steps.Add(new JsonObject { diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Deployment/DeleteContentDefinitionDeploymentSource.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Deployment/DeleteContentDefinitionDeploymentSource.cs index 4d021d43746..22e024d0107 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Deployment/DeleteContentDefinitionDeploymentSource.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Deployment/DeleteContentDefinitionDeploymentSource.cs @@ -3,20 +3,16 @@ namespace OrchardCore.ContentTypes.Deployment; -public class DeleteContentDefinitionDeploymentSource : IDeploymentSource +public class DeleteContentDefinitionDeploymentSource + : DeploymentSourceBase { - public Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlanResult result) + protected override Task ProcessAsync(DeleteContentDefinitionDeploymentStep step, DeploymentPlanResult result) { - if (step is not DeleteContentDefinitionDeploymentStep deleteContentDefinitionStep) - { - return Task.CompletedTask; - } - result.Steps.Add(new JsonObject { ["name"] = "DeleteContentDefinition", - ["ContentTypes"] = JArray.FromObject(deleteContentDefinitionStep.ContentTypes), - ["ContentParts"] = JArray.FromObject(deleteContentDefinitionStep.ContentParts), + ["ContentTypes"] = JArray.FromObject(step.ContentTypes), + ["ContentParts"] = JArray.FromObject(step.ContentParts), }); return Task.CompletedTask; diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Deployment/ReplaceContentDefinitionDeploymentSource.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Deployment/ReplaceContentDefinitionDeploymentSource.cs index 429b7805746..3d660902753 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Deployment/ReplaceContentDefinitionDeploymentSource.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Deployment/ReplaceContentDefinitionDeploymentSource.cs @@ -4,7 +4,8 @@ namespace OrchardCore.ContentTypes.Deployment; -public class ReplaceContentDefinitionDeploymentSource : IDeploymentSource +public class ReplaceContentDefinitionDeploymentSource + : DeploymentSourceBase { private readonly IContentDefinitionStore _contentDefinitionStore; @@ -13,24 +14,19 @@ public ReplaceContentDefinitionDeploymentSource(IContentDefinitionStore contentD _contentDefinitionStore = contentDefinitionStore; } - public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlanResult result) + protected override async Task ProcessAsync(ReplaceContentDefinitionDeploymentStep step, DeploymentPlanResult result) { - if (step is not ReplaceContentDefinitionDeploymentStep replaceContentDefinitionStep) - { - return; - } - var contentTypeDefinitionRecord = await _contentDefinitionStore.LoadContentDefinitionAsync(); - var contentTypes = replaceContentDefinitionStep.IncludeAll + var contentTypes = step.IncludeAll ? contentTypeDefinitionRecord.ContentTypeDefinitionRecords : contentTypeDefinitionRecord.ContentTypeDefinitionRecords - .Where(x => replaceContentDefinitionStep.ContentTypes.Contains(x.Name)); + .Where(x => step.ContentTypes.Contains(x.Name)); - var contentParts = replaceContentDefinitionStep.IncludeAll + var contentParts = step.IncludeAll ? contentTypeDefinitionRecord.ContentPartDefinitionRecords : contentTypeDefinitionRecord.ContentPartDefinitionRecords - .Where(x => replaceContentDefinitionStep.ContentParts.Contains(x.Name)); + .Where(x => step.ContentParts.Contains(x.Name)); result.Steps.Add(new JsonObject { diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/ContentDefinitionStep.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/ContentDefinitionStep.cs index b42b7b73194..6e9e751f718 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/ContentDefinitionStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/ContentDefinitionStep.cs @@ -11,7 +11,7 @@ namespace OrchardCore.ContentTypes.RecipeSteps; /// /// This recipe step creates content definitions. /// -public sealed class ContentDefinitionStep : IRecipeStepHandler +public sealed class ContentDefinitionStep : NamedRecipeStepHandler { private readonly IContentDefinitionManager _contentDefinitionManager; @@ -20,18 +20,14 @@ public sealed class ContentDefinitionStep : IRecipeStepHandler public ContentDefinitionStep( IContentDefinitionManager contentDefinitionManager, IStringLocalizer stringLocalizer) + : base("ContentDefinition") { _contentDefinitionManager = contentDefinitionManager; S = stringLocalizer; } - public async Task ExecuteAsync(RecipeExecutionContext context) + protected override async Task HandleAsync(RecipeExecutionContext context) { - if (!string.Equals(context.Name, "ContentDefinition", StringComparison.OrdinalIgnoreCase)) - { - return; - } - var step = context.Step.ToObject(); foreach (var contentType in step.ContentTypes) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/DeleteContentDefinitionStep.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/DeleteContentDefinitionStep.cs index 918ceb33a32..9ce53d9e213 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/DeleteContentDefinitionStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/DeleteContentDefinitionStep.cs @@ -8,22 +8,18 @@ namespace OrchardCore.ContentTypes.RecipeSteps; /// /// This recipe step deletes content definition records. /// -public sealed class DeleteContentDefinitionStep : IRecipeStepHandler +public sealed class DeleteContentDefinitionStep : NamedRecipeStepHandler { private readonly IContentDefinitionManager _contentDefinitionManager; public DeleteContentDefinitionStep(IContentDefinitionManager contentDefinitionManager) + : base("DeleteContentDefinition") { _contentDefinitionManager = contentDefinitionManager; } - public async Task ExecuteAsync(RecipeExecutionContext context) + protected override async Task HandleAsync(RecipeExecutionContext context) { - if (!string.Equals(context.Name, "DeleteContentDefinition", StringComparison.OrdinalIgnoreCase)) - { - return; - } - var step = context.Step.ToObject(); foreach (var contentType in step.ContentTypes) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/ReplaceContentDefinitionStep.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/ReplaceContentDefinitionStep.cs index 63e072724e2..4e8d6990e3f 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/ReplaceContentDefinitionStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/ReplaceContentDefinitionStep.cs @@ -9,22 +9,18 @@ namespace OrchardCore.ContentTypes.RecipeSteps; /// /// This recipe step replaces content definition records. /// -public sealed class ReplaceContentDefinitionStep : IRecipeStepHandler +public sealed class ReplaceContentDefinitionStep : NamedRecipeStepHandler { private readonly IContentDefinitionManager _contentDefinitionManager; public ReplaceContentDefinitionStep(IContentDefinitionManager contentDefinitionManager) + : base("ReplaceContentDefinition") { _contentDefinitionManager = contentDefinitionManager; } - public async Task ExecuteAsync(RecipeExecutionContext context) + protected override async Task HandleAsync(RecipeExecutionContext context) { - if (!string.Equals(context.Name, "ReplaceContentDefinition", StringComparison.OrdinalIgnoreCase)) - { - return; - } - var step = context.Step.ToObject(); // Delete existing parts first, as deleting them later will clear any imported content types using them. diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Startup.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Startup.cs index f56d7e70bbb..5de96f75766 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Startup.cs @@ -19,8 +19,8 @@ public sealed class Startup : StartupBase { public override void ConfigureServices(IServiceCollection services) { - services.AddScoped(); - services.AddScoped(); + services.AddPermissionProvider(); + services.AddNavigationProvider(); services.AddScoped(); services.AddScoped(); services.AddScoped(); diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Contents/AdminMenu.cs index 70d0c584538..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 Task 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/AuditTrail/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Contents/AuditTrail/Startup.cs index 8e9e4d50b5c..c78786f0dc1 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/AuditTrail/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/AuditTrail/Startup.cs @@ -14,7 +14,6 @@ using OrchardCore.Data.Migration; using OrchardCore.DisplayManagement.Handlers; using OrchardCore.Modules; -using OrchardCore.Settings; namespace OrchardCore.Contents.AuditTrail; @@ -32,7 +31,7 @@ public override void ConfigureServices(IServiceCollection services) services.AddTransient, ContentAuditTrailEventConfiguration>(); services.AddScoped(); - services.AddScoped, ContentAuditTrailSettingsDisplayDriver>(); + services.AddSiteDisplayDriver(); services.AddScoped, AuditTrailContentEventDisplayDriver>(); diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/AddToDeploymentPlan/AddToDeploymentPlanController.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/AddToDeploymentPlan/AddToDeploymentPlanController.cs index f7aa0e53480..4e6b20228a0 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/AddToDeploymentPlan/AddToDeploymentPlanController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/AddToDeploymentPlan/AddToDeploymentPlanController.cs @@ -126,7 +126,16 @@ await _authorizationService.AuthorizeAsync(User, OrchardCore.Deployment.CommonPe return Forbid(); } - var step = (ContentItemDeploymentStep)_factories.FirstOrDefault(x => x.Name == nameof(ContentItemDeploymentStep)).Create(); + + var step = (ContentItemDeploymentStep)_factories.FirstOrDefault(x => x.Name == nameof(ContentItemDeploymentStep))?.Create(); + + if (step is null) + { + await _notifier.WarningAsync(H["Couldn't add selected content to deployment plan."]); + + return BadRequest(); + } + step.ContentItemId = item.ContentItemId; deploymentPlan.DeploymentSteps.Add(step); diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/AddToDeploymentPlan/ContentItemDeploymentSource.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/AddToDeploymentPlan/ContentItemDeploymentSource.cs index 10e58072baf..03b49f2c683 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/AddToDeploymentPlan/ContentItemDeploymentSource.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/AddToDeploymentPlan/ContentItemDeploymentSource.cs @@ -4,7 +4,8 @@ namespace OrchardCore.Contents.Deployment.AddToDeploymentPlan; -public class ContentItemDeploymentSource : IDeploymentSource +public class ContentItemDeploymentSource + : DeploymentSourceBase { private readonly IContentManager _contentManager; @@ -13,16 +14,14 @@ public ContentItemDeploymentSource(IContentManager contentManager) _contentManager = contentManager; } - public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlanResult result) + protected override async Task ProcessAsync(ContentItemDeploymentStep step, DeploymentPlanResult result) { - var contentItemDeploymentStep = step as ContentItemDeploymentStep; - - if (contentItemDeploymentStep == null || contentItemDeploymentStep.ContentItemId == null) + if (step.ContentItemId == null) { return; } - var contentItem = await _contentManager.GetAsync(contentItemDeploymentStep.ContentItemId); + var contentItem = await _contentManager.GetAsync(step.ContentItemId); if (contentItem == null) { diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/AllContentDeploymentSource.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/AllContentDeploymentSource.cs index 70fd21f462a..bf2019faca2 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/AllContentDeploymentSource.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/AllContentDeploymentSource.cs @@ -6,7 +6,8 @@ namespace OrchardCore.Contents.Deployment; -public class AllContentDeploymentSource : IDeploymentSource +public class AllContentDeploymentSource + : DeploymentSourceBase { private readonly ISession _session; @@ -15,15 +16,8 @@ public AllContentDeploymentSource(ISession session) _session = session; } - public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlanResult result) + protected override async Task ProcessAsync(AllContentDeploymentStep step, DeploymentPlanResult result) { - var allContentStep = step as AllContentDeploymentStep; - - if (allContentStep == null) - { - return; - } - var data = new JsonArray(); result.Steps.Add(new JsonObject { @@ -35,10 +29,10 @@ public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlan { var objectData = JObject.FromObject(contentItem); - // Don't serialize the Id as it could be interpreted as an updated object when added back to YesSql + // Don't serialize the Id as it could be interpreted as an updated object when added back to YesSql. objectData.Remove(nameof(ContentItem.Id)); - if (allContentStep.ExportAsSetupRecipe) + if (step.ExportAsSetupRecipe) { objectData[nameof(ContentItem.Owner)] = "[js: parameters('AdminUserId')]"; objectData[nameof(ContentItem.Author)] = "[js: parameters('AdminUsername')]"; @@ -51,7 +45,5 @@ public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlan data.Add(objectData); } - - return; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ContentDeploymentSource.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ContentDeploymentSource.cs index 358c3ea1cf1..767605aae61 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ContentDeploymentSource.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ContentDeploymentSource.cs @@ -7,7 +7,8 @@ namespace OrchardCore.Contents.Deployment; -public class ContentDeploymentSource : IDeploymentSource +public class ContentDeploymentSource + : DeploymentSourceBase { private readonly ISession _session; @@ -16,27 +17,19 @@ public ContentDeploymentSource(ISession session) _session = session; } - public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlanResult result) + protected override async Task ProcessAsync(ContentDeploymentStep step, DeploymentPlanResult result) { // TODO: Batch and create separate content files in the result. - - var contentStep = step as ContentDeploymentStep; - - if (contentStep == null) - { - return; - } - var data = new JsonArray(); - foreach (var contentItem in await _session.Query(x => x.Published && x.ContentType.IsIn(contentStep.ContentTypes)).ListAsync()) + foreach (var contentItem in await _session.Query(x => x.Published && x.ContentType.IsIn(step.ContentTypes)).ListAsync()) { var objectData = JObject.FromObject(contentItem); // Don't serialize the Id as it could be interpreted as an updated object when added back to YesSql. objectData.Remove(nameof(ContentItem.Id)); - if (contentStep.ExportAsSetupRecipe) + if (step.ExportAsSetupRecipe) { objectData[nameof(ContentItem.Owner)] = "[js: parameters('AdminUserId')]"; objectData[nameof(ContentItem.Author)] = "[js: parameters('AdminUsername')]"; diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetAdminMenu.cs index e2bc1d6911e..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 : 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 Task BuildNavigationAsync(string name, NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Import/Export"], S["Import/Export"].PrefixPosition(), import => import @@ -39,6 +34,6 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder) ) ); - return Task.CompletedTask; + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetDeploymentSource.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetDeploymentSource.cs index 9f4dc8d047f..fd9d265606c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetDeploymentSource.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetDeploymentSource.cs @@ -8,7 +8,8 @@ namespace OrchardCore.Contents.Deployment.ExportContentToDeploymentTarget; -public class ExportContentToDeploymentTargetDeploymentSource : IDeploymentSource +public class ExportContentToDeploymentTargetDeploymentSource + : DeploymentSourceBase { private readonly IContentManager _contentManager; private readonly ISession _session; @@ -24,15 +25,8 @@ public ExportContentToDeploymentTargetDeploymentSource( _updateModelAccessor = updateModelAccessor; } - public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlanResult result) + protected override async Task ProcessAsync(ExportContentToDeploymentTargetDeploymentStep step, DeploymentPlanResult result) { - var exportContentToDeploymentTargetContentDeploymentStep = step as ExportContentToDeploymentTargetDeploymentStep; - - if (exportContentToDeploymentTargetContentDeploymentStep == null) - { - return; - } - var data = new JsonArray(); result.Steps.Add(new JsonObject { diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetStartup.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetStartup.cs index 581c9a6bdb5..a95510782bd 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetStartup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ExportContentToDeploymentTarget/ExportContentToDeploymentTargetStartup.cs @@ -6,7 +6,6 @@ using OrchardCore.DisplayManagement.Handlers; using OrchardCore.Modules; using OrchardCore.Navigation; -using OrchardCore.Settings; using OrchardCore.Settings.Deployment; namespace OrchardCore.Contents.Deployment.ExportContentToDeploymentTarget; @@ -16,9 +15,9 @@ public sealed class ExportContentToDeploymentTargetStartup : StartupBase { public override void ConfigureServices(IServiceCollection services) { - services.AddScoped(); + services.AddNavigationProvider(); - services.AddScoped, ExportContentToDeploymentTargetSettingsDisplayDriver>(); + services.AddSiteDisplayDriver(); services.AddDeployment(); diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/CreateEndpoint.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/CreateEndpoint.cs index d76cb805893..d89deb2329e 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/CreateEndpoint.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/CreateEndpoint.cs @@ -5,10 +5,12 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Routing; +using Microsoft.Extensions.Options; using OrchardCore.ContentManagement; using OrchardCore.ContentManagement.Handlers; using OrchardCore.ContentManagement.Metadata; using OrchardCore.DisplayManagement.ModelBinding; +using OrchardCore.Json; using OrchardCore.Modules; namespace OrchardCore.Contents.Endpoints.Api; @@ -37,6 +39,7 @@ private static async Task HandleAsync( IContentDefinitionManager contentDefinitionManager, IUpdateModelAccessor updateModelAccessor, HttpContext httpContext, + IOptions options, bool draft = false) { if (!await authorizationService.AuthorizeAsync(httpContext.User, CommonPermissions.AccessContentApi)) @@ -123,7 +126,7 @@ private static async Task HandleAsync( await contentManager.SaveDraftAsync(contentItem); } - return TypedResults.Ok(contentItem); + return Results.Json(contentItem, options.Value.SerializerOptions); } private static void AddValidationErrorsToModelState(ContentValidateResult result, ModelStateDictionary modelState) diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/DeleteEndpoint.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/DeleteEndpoint.cs index c6b26c5e64e..677e725a607 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/DeleteEndpoint.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/DeleteEndpoint.cs @@ -2,7 +2,9 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; +using Microsoft.Extensions.Options; using OrchardCore.ContentManagement; +using OrchardCore.Json; using OrchardCore.Modules; namespace OrchardCore.Contents.Endpoints.Api; @@ -23,7 +25,8 @@ private static async Task HandleAsync( string contentItemId, IContentManager contentManager, IAuthorizationService authorizationService, - HttpContext httpContext) + HttpContext httpContext, + IOptions options) { if (!await authorizationService.AuthorizeAsync(httpContext.User, CommonPermissions.AccessContentApi)) { @@ -44,6 +47,6 @@ private static async Task HandleAsync( await contentManager.RemoveAsync(contentItem); - return TypedResults.Ok(contentItem); + return Results.Json(contentItem, options.Value.SerializerOptions); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/GetEndpoint.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/GetEndpoint.cs index 441f7d77ead..e3d7e870cbd 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/GetEndpoint.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/GetEndpoint.cs @@ -2,7 +2,9 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; +using Microsoft.Extensions.Options; using OrchardCore.ContentManagement; +using OrchardCore.Json; using OrchardCore.Modules; namespace OrchardCore.Contents.Endpoints.Api; @@ -23,7 +25,8 @@ private static async Task HandleAsync( string contentItemId, IContentManager contentManager, IAuthorizationService authorizationService, - HttpContext httpContext) + HttpContext httpContext, + IOptions options) { if (!await authorizationService.AuthorizeAsync(httpContext.User, CommonPermissions.AccessContentApi)) { @@ -42,6 +45,6 @@ private static async Task HandleAsync( return httpContext.ChallengeOrForbid("Api"); } - return TypedResults.Ok(contentItem); + return Results.Json(contentItem, options.Value.SerializerOptions); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Liquid/BuildDisplayFilter.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Liquid/BuildDisplayFilter.cs index 047dffea335..675c0834d44 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Liquid/BuildDisplayFilter.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Liquid/BuildDisplayFilter.cs @@ -50,7 +50,7 @@ static async ValueTask Awaited(Task task, TemplateOptions op // a 'ContentItem' is still created but with some null properties. if (contentItem?.ContentItemId == null) { - return new ValueTask(NilValue.Instance); + return ValueTask.FromResult(NilValue.Instance); } // When {{ Model.ContentItem | shape_build_display | shape_render }} is called prevent unlimited recursions. @@ -59,7 +59,7 @@ static async ValueTask Awaited(Task task, TemplateOptions op var recursionLimit = maxRecursions.Type == FluidValues.Number ? Convert.ToInt32(maxRecursions.ToNumberValue()) : DefaultMaxContentItemRecursions; if (_buildDisplayRecursionHelper.IsRecursive(contentItem, recursionLimit)) { - return new ValueTask(NilValue.Instance); + return ValueTask.FromResult(NilValue.Instance); } var displayType = arguments["type"].Or(arguments.At(0)).ToStringValue(); @@ -67,7 +67,7 @@ static async ValueTask Awaited(Task task, TemplateOptions op var task = _contentItemDisplayManager.BuildDisplayAsync(contentItem, _updateModelAccessor.ModelUpdater, displayType); if (task.IsCompletedSuccessfully) { - return new ValueTask(FluidValue.Create(task.Result, ctx.Options)); + return ValueTask.FromResult(FluidValue.Create(task.Result, ctx.Options)); } return Awaited(task, ctx.Options); diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Liquid/DisplayTextFilter.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Liquid/DisplayTextFilter.cs index 2b5bccc2542..4073c056268 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Liquid/DisplayTextFilter.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Liquid/DisplayTextFilter.cs @@ -12,9 +12,9 @@ public static ValueTask DisplayText(FluidValue input, FilterArgument if (contentItem == null) { - return new ValueTask(NilValue.Instance); + return ValueTask.FromResult(NilValue.Instance); } - return new ValueTask(new StringValue(contentItem.DisplayText ?? "")); + return ValueTask.FromResult(new StringValue(contentItem.DisplayText ?? string.Empty)); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Recipes/ContentStep.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Recipes/ContentStep.cs index cc0d9ecb291..6a562959970 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Recipes/ContentStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Recipes/ContentStep.cs @@ -10,15 +10,15 @@ namespace OrchardCore.Contents.Recipes; /// /// This recipe step creates a set of content items. /// -public sealed class ContentStep : IRecipeStepHandler +public sealed class ContentStep : NamedRecipeStepHandler { - public Task ExecuteAsync(RecipeExecutionContext context) + public ContentStep() + : base("Content") { - if (!string.Equals(context.Name, "Content", StringComparison.OrdinalIgnoreCase)) - { - return Task.CompletedTask; - } + } + protected override Task HandleAsync(RecipeExecutionContext context) + { var model = context.Step.ToObject(); var contentItems = model.Data.ToObject(); @@ -26,6 +26,7 @@ public Task ExecuteAsync(RecipeExecutionContext context) if (ShellScope.Context.IsActivated) { var contentManager = ShellScope.Services.GetRequiredService(); + return contentManager.ImportAsync(contentItems); } @@ -34,6 +35,7 @@ public Task ExecuteAsync(RecipeExecutionContext context) ShellScope.AddDeferredTask(scope => { var contentManager = scope.ServiceProvider.GetRequiredService(); + return contentManager.ImportAsync(contentItems); }); diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Services/DefaultContentsAdminListFilterProvider.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Services/DefaultContentsAdminListFilterProvider.cs index 40eaad9b702..6df9cfe1956 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Services/DefaultContentsAdminListFilterProvider.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Services/DefaultContentsAdminListFilterProvider.cs @@ -51,7 +51,7 @@ public void Build(QueryEngineBuilder builder) query.With(x => x.Latest); } - return new ValueTask>(query); + return ValueTask.FromResult>(query); }) .MapTo((val, model) => { diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Services/DefaultContentsAdminListQueryService.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Services/DefaultContentsAdminListQueryService.cs index b7ee9f20919..fa73bd927be 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Services/DefaultContentsAdminListQueryService.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Services/DefaultContentsAdminListQueryService.cs @@ -11,7 +11,7 @@ namespace OrchardCore.Contents.Services; public class DefaultContentsAdminListQueryService : IContentsAdminListQueryService { - private readonly static string[] _operators = ["OR", "AND", "||", "&&"]; + private static readonly string[] _operators = ["OR", "AND", "||", "&&"]; private readonly ISession _session; private readonly IServiceProvider _serviceProvider; diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Sitemaps/ContentTypesSitemapSourceBuilder.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Sitemaps/ContentTypesSitemapSourceBuilder.cs index 0cee33f36ea..406d4e1c816 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Sitemaps/ContentTypesSitemapSourceBuilder.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Sitemaps/ContentTypesSitemapSourceBuilder.cs @@ -10,6 +10,8 @@ namespace OrchardCore.Contents.Sitemaps; public class ContentTypesSitemapSourceBuilder : SitemapSourceBuilderBase { + private const int _batchSize = 500; + private static readonly XNamespace _namespace = "http://www.sitemaps.org/schemas/sitemap/0.9"; private readonly IRouteableContentTypeCoordinator _routeableContentTypeCoordinator; @@ -21,8 +23,7 @@ public ContentTypesSitemapSourceBuilder( IRouteableContentTypeCoordinator routeableContentTypeCoordinator, IContentManager contentManager, IContentItemsQueryProvider contentItemsQueryProvider, - IEnumerable sitemapContentItemExtendedMetadataProviders - ) + IEnumerable sitemapContentItemExtendedMetadataProviders) { _routeableContentTypeCoordinator = routeableContentTypeCoordinator; _contentManager = contentManager; @@ -32,22 +33,66 @@ IEnumerable sitemapContentItemExten public override async Task BuildSourceAsync(ContentTypesSitemapSource source, SitemapBuilderContext context) { - var queryContext = new ContentItemsQueryContext(); - await _contentItemsQueryProvider.GetContentItemsAsync(source, queryContext); - foreach (var sciemp in _sitemapContentItemExtendedMetadataProviders) { context.Response.ResponseElement.Add(sciemp.GetExtendedAttribute); } - foreach (var contentItem in queryContext.ContentItems) + var maxAllowed = int.MaxValue; + var skip = 0; + + if (source.LimitedContentType != null) { - var url = new XElement(_namespace + "url"); + skip = source.LimitedContentType.Skip; + + if (source.LimitedContentType.Take > 0) + { + maxAllowed = source.LimitedContentType.Take; + } + } + + var total = 0; + var take = _batchSize; + var isLastBatch = false; + + while (true) + { + if ((total + take) > maxAllowed) + { + take = total + take - maxAllowed; + + isLastBatch = true; + } + + var queryContext = new ContentItemsQueryContext(); + + await _contentItemsQueryProvider.GetContentItemsAsync(source, queryContext, skip, take); - if (await BuildUrlsetMetadataAsync(source, context, queryContext, contentItem, url)) + if (queryContext.ContentItems == null || !queryContext.ContentItems.Any()) { - context.Response.ResponseElement.Add(url); + break; } + + var totalFound = queryContext.ContentItems.Count(); + + total += totalFound; + + foreach (var contentItem in queryContext.ContentItems) + { + var url = new XElement(_namespace + "url"); + + if (await BuildUrlsetMetadataAsync(source, context, queryContext, contentItem, url)) + { + context.Response.ResponseElement.Add(url); + } + } + + if (isLastBatch) + { + break; + } + + skip += take; } } @@ -58,7 +103,9 @@ private async Task BuildUrlsetMetadataAsync(ContentTypesSitemapSource sour if (await BuildExtendedMetadataAsync(context, queryContext, contentItem, url)) { PopulateLastMod(contentItem, url); + await PopulateChangeFrequencyPriority(source, contentItem, url); + return true; } @@ -71,6 +118,7 @@ private async Task BuildUrlsetMetadataAsync(ContentTypesSitemapSource sour private async Task BuildExtendedMetadataAsync(SitemapBuilderContext context, ContentItemsQueryContext queryContext, ContentItem contentItem, XElement url) { var succeeded = true; + foreach (var sc in _sitemapContentItemExtendedMetadataProviders) { if (!await sc.ApplyExtendedMetadataAsync(context, queryContext, contentItem, url)) @@ -78,6 +126,7 @@ private async Task BuildExtendedMetadataAsync(SitemapBuilderContext contex succeeded = false; } } + return succeeded; } @@ -94,6 +143,7 @@ private async Task BuildUrlAsync(SitemapBuilderContext context, ContentIte var loc = new XElement(_namespace + "loc"); loc.Add(locValue); url.Add(loc); + return true; } diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Sitemaps/ContentTypesSitemapSourceDriver.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Sitemaps/ContentTypesSitemapSourceDriver.cs index 8e435eb5fc0..88de84d0ec4 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Sitemaps/ContentTypesSitemapSourceDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Sitemaps/ContentTypesSitemapSourceDriver.cs @@ -67,7 +67,7 @@ public override async Task EditAsync(ContentTypesSitemapSource s model.ChangeFrequency = sitemapSource.ChangeFrequency; model.ContentTypes = entries; model.LimitedContentTypes = limitedEntries; - model.LimitedContentType = limitedCtd != null ? limitedCtd.Name : contentTypeDefinitions.FirstOrDefault().Name; + model.LimitedContentType = limitedCtd is null ? contentTypeDefinitions.FirstOrDefault()?.Name : limitedCtd.Name; model.SitemapSource = sitemapSource; }).Location("Content"); } diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Sitemaps/DefaultContentItemsQueryProvider.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Sitemaps/DefaultContentItemsQueryProvider.cs index 9cf583441d3..be23e40f8f0 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Sitemaps/DefaultContentItemsQueryProvider.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Sitemaps/DefaultContentItemsQueryProvider.cs @@ -10,32 +10,33 @@ namespace OrchardCore.Contents.Sitemaps; public class DefaultContentItemsQueryProvider : IContentItemsQueryProvider { - private readonly ISession _session; + private readonly IStore _store; private readonly IRouteableContentTypeCoordinator _routeableContentTypeCoordinator; public DefaultContentItemsQueryProvider( - ISession session, - IRouteableContentTypeCoordinator routeableContentTypeCoordinator - ) + IStore store, + IRouteableContentTypeCoordinator routeableContentTypeCoordinator) { - _session = session; + _store = store; _routeableContentTypeCoordinator = routeableContentTypeCoordinator; } - public async Task GetContentItemsAsync(ContentTypesSitemapSource source, ContentItemsQueryContext context) + public async Task GetContentItemsAsync(ContentTypesSitemapSource source, ContentItemsQueryContext context, int? skip = null, int? take = null) { + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(context); + var routeableContentTypeDefinitions = await _routeableContentTypeCoordinator.ListRoutableTypeDefinitionsAsync(); + using var session = _store.CreateSession(withTracking: false); + + var query = session.Query(); + if (source.IndexAll) { var rctdNames = routeableContentTypeDefinitions.Select(rctd => rctd.Name); - var queryResults = await _session.Query() - .With(x => x.Published && x.ContentType.IsIn(rctdNames)) - .OrderBy(x => x.CreatedUtc) - .ListAsync(); - - context.ContentItems = queryResults; + query = query.Where(x => x.Published && x.ContentType.IsIn(rctdNames)); } else if (source.LimitItems) { @@ -43,17 +44,12 @@ public async Task GetContentItemsAsync(ContentTypesSitemapSource source, Content var typeIsValid = routeableContentTypeDefinitions .Any(ctd => string.Equals(source.LimitedContentType.ContentTypeName, ctd.Name, StringComparison.Ordinal)); - if (typeIsValid) + if (!typeIsValid) { - var queryResults = await _session.Query() - .With(x => x.ContentType == source.LimitedContentType.ContentTypeName && x.Published) - .OrderBy(x => x.CreatedUtc) - .Skip(source.LimitedContentType.Skip) - .Take(source.LimitedContentType.Take) - .ListAsync(); - - context.ContentItems = queryResults; + return; } + + query = query.Where(x => x.ContentType == source.LimitedContentType.ContentTypeName && x.Published); } else { @@ -62,12 +58,14 @@ public async Task GetContentItemsAsync(ContentTypesSitemapSource source, Content .Where(ctd => source.ContentTypes.Any(s => string.Equals(ctd.Name, s.ContentTypeName, StringComparison.Ordinal))) .Select(x => x.Name); - var queryResults = await _session.Query() - .With(x => x.ContentType.IsIn(typesToIndex) && x.Published) - .OrderBy(x => x.CreatedUtc) - .ListAsync(); - - context.ContentItems = queryResults; + query = query.Where(x => x.ContentType.IsIn(typesToIndex) && x.Published); } + + context.ContentItems = await query + .OrderBy(x => x.CreatedUtc) + .ThenBy(x => x.Id) + .Take(take ?? 0) + .Skip(skip ?? 0) + .ListAsync(); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Startup.cs index 2621bd74210..c16e7fb6092 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Startup.cs @@ -14,6 +14,7 @@ using OrchardCore.Contents.AdminNodes; using OrchardCore.Contents.AuditTrail.Settings; using OrchardCore.Contents.Controllers; +using OrchardCore.Contents.Core; using OrchardCore.Contents.Deployment; using OrchardCore.Contents.Drivers; using OrchardCore.Contents.Endpoints.Api; @@ -32,7 +33,7 @@ using OrchardCore.ContentTypes.Editors; using OrchardCore.Data.Migration; using OrchardCore.Deployment; -using OrchardCore.DisplayManagement.Descriptors; +using OrchardCore.DisplayManagement; using OrchardCore.DisplayManagement.Handlers; using OrchardCore.DisplayManagement.Liquid; using OrchardCore.DisplayManagement.Liquid.Tags; @@ -59,6 +60,7 @@ public sealed class Startup : StartupBase { public override void ConfigureServices(IServiceCollection services) { + services.AddContentServices(); services.AddSingleton(); services.Configure(o => @@ -139,11 +141,11 @@ static async Task GetContentByHandleAsync(LiquidTemplateContext cont services.AddContentManagement(); services.AddContentManagementDisplay(); - services.AddScoped(); - services.AddScoped(); + services.AddPermissionProvider(); + services.AddPermissionProvider(); services.AddScoped(); - services.AddScoped(); - services.AddScoped(); + services.AddShapeTableProvider(); + services.AddNavigationProvider(); services.AddScoped(); services.AddScoped(); services.AddRecipeExecutionStep(); diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Workflows/Activities/CreateContentTask.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Workflows/Activities/CreateContentTask.cs index 4392ac0b953..99740684c6d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Workflows/Activities/CreateContentTask.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Workflows/Activities/CreateContentTask.cs @@ -62,7 +62,7 @@ public override IEnumerable GetPossibleOutcomes(WorkflowExecutionContex return Outcomes(S["Done"], S["Failed"]); } - public async override Task ExecuteAsync(WorkflowExecutionContext workflowContext, ActivityContext activityContext) + public override async Task ExecuteAsync(WorkflowExecutionContext workflowContext, ActivityContext activityContext) { if (InlineEvent.IsStart && InlineEvent.ContentType == ContentType) { diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Workflows/Activities/UpdateContentTask.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Workflows/Activities/UpdateContentTask.cs index a3a68101b23..643643d551e 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Workflows/Activities/UpdateContentTask.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Workflows/Activities/UpdateContentTask.cs @@ -67,7 +67,7 @@ public override IEnumerable GetPossibleOutcomes(WorkflowExecutionContex return Outcomes(S["Done"], S["Failed"]); } - public async override Task ExecuteAsync(WorkflowExecutionContext workflowContext, ActivityContext activityContext) + public override async Task ExecuteAsync(WorkflowExecutionContext workflowContext, ActivityContext activityContext) { var contentItemId = (await GetContentItemIdAsync(workflowContext)) ?? throw new InvalidOperationException($"The {nameof(UpdateContentTask)} failed to evaluate the 'ContentItemId'."); diff --git a/src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs index 892f4aa07b8..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 : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; @@ -12,13 +12,8 @@ public AdminMenu(IStringLocalizer localizer) S = localizer; } - public Task BuildNavigationAsync(string name, NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -32,6 +27,6 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder) ) ); - return Task.CompletedTask; + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Cors/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Cors/Startup.cs index fa15e478948..27e88a5990b 100644 --- a/src/OrchardCore.Modules/OrchardCore.Cors/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Cors/Startup.cs @@ -24,8 +24,8 @@ public override void Configure(IApplicationBuilder app, IEndpointRouteBuilder ro public override void ConfigureServices(IServiceCollection services) { - services.AddScoped(); - services.AddScoped(); + services.AddNavigationProvider(); + services.AddPermissionProvider(); services.AddSingleton(); services.TryAddEnumerable(ServiceDescriptor diff --git a/src/OrchardCore.Modules/OrchardCore.Cors/Views/Admin/Index.cshtml b/src/OrchardCore.Modules/OrchardCore.Cors/Views/Admin/Index.cshtml index 1d0b46e21b0..1420efe6dda 100644 --- a/src/OrchardCore.Modules/OrchardCore.Cors/Views/Admin/Index.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Cors/Views/Admin/Index.cshtml @@ -1,7 +1,7 @@ @model CorsSettingsViewModel - + diff --git a/src/OrchardCore.Modules/OrchardCore.CustomSettings/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.CustomSettings/AdminMenu.cs index 6ed4c424978..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 Task 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.CustomSettings/Deployment/CustomSettingsDeploymentSource.cs b/src/OrchardCore.Modules/OrchardCore.CustomSettings/Deployment/CustomSettingsDeploymentSource.cs index 2b5b5e585fa..7e61377cc34 100644 --- a/src/OrchardCore.Modules/OrchardCore.CustomSettings/Deployment/CustomSettingsDeploymentSource.cs +++ b/src/OrchardCore.Modules/OrchardCore.CustomSettings/Deployment/CustomSettingsDeploymentSource.cs @@ -4,7 +4,8 @@ namespace OrchardCore.CustomSettings.Deployment; -public class CustomSettingsDeploymentSource : IDeploymentSource +public class CustomSettingsDeploymentSource + : DeploymentSourceBase { private readonly CustomSettingsService _customSettingsService; @@ -13,22 +14,16 @@ public CustomSettingsDeploymentSource(CustomSettingsService customSettingsServic _customSettingsService = customSettingsService; } - public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlanResult result) + protected override async Task ProcessAsync(CustomSettingsDeploymentStep step, DeploymentPlanResult result) { - var customSettingsStep = step as CustomSettingsDeploymentStep; - if (customSettingsStep == null) - { - return; - } - var settingsList = new List> { new("name", "custom-settings"), }; - var settingsTypes = customSettingsStep.IncludeAll + var settingsTypes = step.IncludeAll ? (await _customSettingsService.GetAllSettingsTypesAsync()).ToArray() - : (await _customSettingsService.GetSettingsTypesAsync(customSettingsStep.SettingsTypeNames)).ToArray(); + : (await _customSettingsService.GetSettingsTypesAsync(step.SettingsTypeNames)).ToArray(); foreach (var settingsType in settingsTypes) { diff --git a/src/OrchardCore.Modules/OrchardCore.CustomSettings/Recipes/CustomSettingsStep.cs b/src/OrchardCore.Modules/OrchardCore.CustomSettings/Recipes/CustomSettingsStep.cs index 35de1a97ffe..2a2627a7589 100644 --- a/src/OrchardCore.Modules/OrchardCore.CustomSettings/Recipes/CustomSettingsStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.CustomSettings/Recipes/CustomSettingsStep.cs @@ -7,22 +7,18 @@ namespace OrchardCore.CustomSettings.Recipes; /// /// This recipe step updates the site settings. /// -public sealed class CustomSettingsStep : IRecipeStepHandler +public sealed class CustomSettingsStep : NamedRecipeStepHandler { private readonly ISiteService _siteService; public CustomSettingsStep(ISiteService siteService) + : base("custom-settings") { _siteService = siteService; } - public async Task ExecuteAsync(RecipeExecutionContext context) + protected override async Task HandleAsync(RecipeExecutionContext context) { - if (!string.Equals(context.Name, "custom-settings", StringComparison.OrdinalIgnoreCase)) - { - return; - } - var siteSettings = await _siteService.LoadSiteSettingsAsync(); var model = context.Step; diff --git a/src/OrchardCore.Modules/OrchardCore.CustomSettings/Startup.cs b/src/OrchardCore.Modules/OrchardCore.CustomSettings/Startup.cs index 93a212611e9..3d534193221 100644 --- a/src/OrchardCore.Modules/OrchardCore.CustomSettings/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.CustomSettings/Startup.cs @@ -12,7 +12,6 @@ using OrchardCore.Navigation; using OrchardCore.Recipes; using OrchardCore.Security.Permissions; -using OrchardCore.Settings; namespace OrchardCore.CustomSettings; @@ -20,12 +19,12 @@ public sealed class Startup : StartupBase { public override void ConfigureServices(IServiceCollection services) { - services.AddScoped(); - services.AddScoped, CustomSettingsDisplayDriver>(); + services.AddSiteDisplayDriver(); + services.AddNavigationProvider(); services.AddScoped(); services.AddScoped(); // Permissions - services.AddScoped(); + services.AddPermissionProvider(); services.AddScoped(); services.AddRecipeExecutionStep(); diff --git a/src/OrchardCore.Modules/OrchardCore.DataProtection.Azure/BlobModularTenantEvents.cs b/src/OrchardCore.Modules/OrchardCore.DataProtection.Azure/BlobModularTenantEvents.cs new file mode 100644 index 00000000000..5803cf30503 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.DataProtection.Azure/BlobModularTenantEvents.cs @@ -0,0 +1,39 @@ +using Azure.Storage.Blobs; +using Microsoft.Extensions.Logging; +using OrchardCore.Environment.Shell.Removing; +using OrchardCore.Modules; + +namespace OrchardCore.DataProtection.Azure; + +/// +/// A tenant event that deletes data protection blobs from a container when a tenant is deleted. +/// +public class BlobModularTenantEvents : ModularTenantEvents +{ + private readonly BlobOptions _blobOptions; + private readonly ILogger _logger; + + public BlobModularTenantEvents( + BlobOptions blobOptions, + ILogger logger) + { + _blobOptions = blobOptions; + _logger = logger; + } + + /// + /// Removes the data protection blob from the container when a tenant is deleted. + /// + /// The + public async override Task RemovingAsync(ShellRemovingContext context) + { + var blobClient = new BlobClient( + _blobOptions.ConnectionString, + _blobOptions.ContainerName, + _blobOptions.BlobName); + + _logger.LogDebug("Deleting blob '{BlobName}' from container '{ContainerName}'.", _blobOptions.BlobName, _blobOptions.ContainerName); + + await blobClient.DeleteIfExistsAsync(); + } +} diff --git a/src/OrchardCore.Modules/OrchardCore.DataProtection.Azure/Startup.cs b/src/OrchardCore.Modules/OrchardCore.DataProtection.Azure/Startup.cs index a88327caf1a..f127898a043 100644 --- a/src/OrchardCore.Modules/OrchardCore.DataProtection.Azure/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.DataProtection.Azure/Startup.cs @@ -39,6 +39,8 @@ public override void ConfigureServices(IServiceCollection services) options.ContainerName, options.BlobName); }); + + services.AddScoped(); } else { diff --git a/src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs index 6cb5f157beb..7d1fe9d4e3f 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 Task BuildNavigationAsync(string name, NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - builder .Add(S["Demo"], "10", demo => demo .AddClass("demo").Id("demo") @@ -50,6 +45,6 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder) ) ); - return Task.CompletedTask; + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Demo/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Demo/Startup.cs index 203aa0ec992..539e4fc9334 100644 --- a/src/OrchardCore.Modules/OrchardCore.Demo/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Demo/Startup.cs @@ -17,6 +17,7 @@ using OrchardCore.Demo.Models; using OrchardCore.Demo.Services; using OrchardCore.Demo.TagHelpers; +using OrchardCore.DisplayManagement; using OrchardCore.DisplayManagement.Descriptors; using OrchardCore.DisplayManagement.Handlers; using OrchardCore.Environment.Commands; @@ -84,12 +85,12 @@ public override void ConfigureServices(IServiceCollection services) services.AddScoped(); services.AddScoped(); services.AddSingleton(); - services.AddScoped(); + services.AddShapeTableProvider(); services.AddShapeAttributes(); - services.AddScoped(); + services.AddNavigationProvider(); services.AddScoped(); services.AddDataMigration(); - services.AddScoped(); + services.AddPermissionProvider(); services.AddContentPart(); services.AddScoped(); diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/AdminMenu.cs index 55d5a584754..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 : INavigationProvider +public sealed class AdminMenu : AdminNavigationProvider { internal readonly IStringLocalizer S; @@ -12,13 +12,8 @@ public AdminMenu(IStringLocalizer localizer) S = localizer; } - public Task BuildNavigationAsync(string name, NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Import/Export"], import => import @@ -35,6 +30,6 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder) ) ); - return Task.CompletedTask; + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/Startup.cs index 2627bd02ee9..b4eb3c0152d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Deployment.Remote/Startup.cs @@ -13,10 +13,10 @@ public override void ConfigureServices(IServiceCollection services) { services.AddHttpClient(); - services.AddScoped(); + services.AddNavigationProvider(); services.AddScoped(); services.AddScoped(); services.AddScoped(); - services.AddScoped(); + services.AddPermissionProvider(); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Deployment/AdminMenu.cs index c07bee68586..649a5793928 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 Task BuildNavigationAsync(string name, NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Import/Export"], S["Import/Export"].PrefixPosition(), import => import @@ -40,6 +35,6 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder) ) ); - return Task.CompletedTask; + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment/Deployment/DeploymentPlanDeploymentSource.cs b/src/OrchardCore.Modules/OrchardCore.Deployment/Deployment/DeploymentPlanDeploymentSource.cs index a99c2c82b9d..f0aacb6b9b1 100644 --- a/src/OrchardCore.Modules/OrchardCore.Deployment/Deployment/DeploymentPlanDeploymentSource.cs +++ b/src/OrchardCore.Modules/OrchardCore.Deployment/Deployment/DeploymentPlanDeploymentSource.cs @@ -5,7 +5,8 @@ namespace OrchardCore.Deployment.Deployment; -public class DeploymentPlanDeploymentSource : IDeploymentSource +public class DeploymentPlanDeploymentSource + : DeploymentSourceBase { private readonly IDeploymentPlanService _deploymentPlanService; private readonly IEnumerable _deploymentStepFactories; @@ -21,13 +22,8 @@ public DeploymentPlanDeploymentSource( _jsonSerializerOptions = jsonSerializerOptions.Value.SerializerOptions; } - public async Task ProcessDeploymentStepAsync(DeploymentStep deploymentStep, DeploymentPlanResult result) + protected override async Task ProcessAsync(DeploymentPlanDeploymentStep step, DeploymentPlanResult result) { - if (deploymentStep is not DeploymentPlanDeploymentStep deploymentPlanStep) - { - return; - } - if (!await _deploymentPlanService.DoesUserHavePermissionsAsync()) { return; @@ -35,9 +31,9 @@ public async Task ProcessDeploymentStepAsync(DeploymentStep deploymentStep, Depl var deploymentStepFactories = _deploymentStepFactories.ToDictionary(f => f.Name); - var deploymentPlans = deploymentPlanStep.IncludeAll + var deploymentPlans = step.IncludeAll ? (await _deploymentPlanService.GetAllDeploymentPlansAsync()).ToArray() - : (await _deploymentPlanService.GetDeploymentPlansAsync(deploymentPlanStep.DeploymentPlanNames)).ToArray(); + : (await _deploymentPlanService.GetDeploymentPlansAsync(step.DeploymentPlanNames)).ToArray(); var plans = (from plan in deploymentPlans select new diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment/Recipes/DeploymentPlansRecipeStep.cs b/src/OrchardCore.Modules/OrchardCore.Deployment/Recipes/DeploymentPlansRecipeStep.cs index 6c41659ef0e..a5a6d3a0807 100644 --- a/src/OrchardCore.Modules/OrchardCore.Deployment/Recipes/DeploymentPlansRecipeStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.Deployment/Recipes/DeploymentPlansRecipeStep.cs @@ -12,7 +12,7 @@ namespace OrchardCore.Deployment.Recipes; /// /// This recipe step creates a deployment plan. /// -public sealed class DeploymentPlansRecipeStep : IRecipeStepHandler +public sealed class DeploymentPlansRecipeStep : NamedRecipeStepHandler { private readonly IServiceProvider _serviceProvider; private readonly JsonSerializerOptions _jsonSerializerOptions; @@ -25,6 +25,7 @@ public DeploymentPlansRecipeStep( IOptions jsonSerializerOptions, IDeploymentPlanService deploymentPlanService, IStringLocalizer stringLocalizer) + : base("deployment") { _serviceProvider = serviceProvider; _jsonSerializerOptions = jsonSerializerOptions.Value.SerializerOptions; @@ -32,13 +33,8 @@ public DeploymentPlansRecipeStep( S = stringLocalizer; } - public Task ExecuteAsync(RecipeExecutionContext context) + protected override Task HandleAsync(RecipeExecutionContext context) { - if (!string.Equals(context.Name, "deployment", StringComparison.OrdinalIgnoreCase)) - { - return Task.CompletedTask; - } - var deploymentStepFactories = _serviceProvider.GetServices().ToDictionary(f => f.Name); var model = context.Step.ToObject(); diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Deployment/Startup.cs index 41ea146766e..0985f40db64 100644 --- a/src/OrchardCore.Modules/OrchardCore.Deployment/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Deployment/Startup.cs @@ -19,8 +19,8 @@ public override void ConfigureServices(IServiceCollection services) { services.AddDeploymentServices(); - services.AddScoped(); - services.AddScoped(); + services.AddNavigationProvider(); + services.AddPermissionProvider(); services.AddSingleton(); diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment/Steps/CustomFileDeploymentSource.cs b/src/OrchardCore.Modules/OrchardCore.Deployment/Steps/CustomFileDeploymentSource.cs index 656298b2c11..1b5925b8040 100644 --- a/src/OrchardCore.Modules/OrchardCore.Deployment/Steps/CustomFileDeploymentSource.cs +++ b/src/OrchardCore.Modules/OrchardCore.Deployment/Steps/CustomFileDeploymentSource.cs @@ -2,15 +2,9 @@ namespace OrchardCore.Deployment.Steps; -public class CustomFileDeploymentSource : IDeploymentSource +public class CustomFileDeploymentSource + : DeploymentSourceBase { - public Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlanResult result) - { - if (step is not CustomFileDeploymentStep customFile) - { - return Task.CompletedTask; - } - - return result.FileBuilder.SetFileAsync(customFile.FileName, Encoding.UTF8.GetBytes(customFile.FileContent)); - } + protected override Task ProcessAsync(CustomFileDeploymentStep step, DeploymentPlanResult result) + => result.FileBuilder.SetFileAsync(step.FileName, Encoding.UTF8.GetBytes(step.FileContent)); } diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment/Steps/JsonRecipeDeploymentSource.cs b/src/OrchardCore.Modules/OrchardCore.Deployment/Steps/JsonRecipeDeploymentSource.cs index 7387c9b9ea8..110be9c6018 100644 --- a/src/OrchardCore.Modules/OrchardCore.Deployment/Steps/JsonRecipeDeploymentSource.cs +++ b/src/OrchardCore.Modules/OrchardCore.Deployment/Steps/JsonRecipeDeploymentSource.cs @@ -2,16 +2,12 @@ namespace OrchardCore.Deployment.Steps; -public class JsonRecipeDeploymentSource : IDeploymentSource +public class JsonRecipeDeploymentSource + : DeploymentSourceBase { - public Task ProcessDeploymentStepAsync(DeploymentStep deploymentStep, DeploymentPlanResult result) + protected override Task ProcessAsync(JsonRecipeDeploymentStep step, DeploymentPlanResult result) { - if (deploymentStep is not JsonRecipeDeploymentStep jsonRecipeStep) - { - return Task.CompletedTask; - } - - result.Steps.Add(JObject.Parse(jsonRecipeStep.Json)); + result.Steps.Add(JObject.Parse(step.Json)); return Task.CompletedTask; } diff --git a/src/OrchardCore.Modules/OrchardCore.DynamicCache/TagHelpers/DynamicCacheTagHelper.cs b/src/OrchardCore.Modules/OrchardCore.DynamicCache/TagHelpers/DynamicCacheTagHelper.cs index 779fed6b761..69ec086cd9a 100644 --- a/src/OrchardCore.Modules/OrchardCore.DynamicCache/TagHelpers/DynamicCacheTagHelper.cs +++ b/src/OrchardCore.Modules/OrchardCore.DynamicCache/TagHelpers/DynamicCacheTagHelper.cs @@ -78,7 +78,7 @@ public class DynamicCacheTagHelper : TagHelper /// /// Prefix used by instances when creating entries in . /// - public static readonly string CacheKeyPrefix = nameof(DynamicCacheTagHelper); + public const string CacheKeyPrefix = nameof(DynamicCacheTagHelper); private readonly IDynamicCacheService _dynamicCacheService; private readonly ICacheScopeManager _cacheScopeManager; diff --git a/src/OrchardCore.Modules/OrchardCore.Email.Azure/Drivers/AzureEmailSettingsDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.Email.Azure/Drivers/AzureEmailSettingsDisplayDriver.cs index 4245da42623..c751a6ea31f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Email.Azure/Drivers/AzureEmailSettingsDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.Email.Azure/Drivers/AzureEmailSettingsDisplayDriver.cs @@ -60,7 +60,7 @@ public override async Task EditAsync(ISite site, AzureEmailSetti model.IsEnabled = settings.IsEnabled; model.DefaultSender = settings.DefaultSender; model.HasConnectionString = !string.IsNullOrWhiteSpace(settings.ConnectionString); - }).Location("Content:5#Azure") + }).Location("Content:5#Azure Communication Services") .OnGroup(SettingsGroupId); } diff --git a/src/OrchardCore.Modules/OrchardCore.Email.Azure/Manifest.cs b/src/OrchardCore.Modules/OrchardCore.Email.Azure/Manifest.cs index 921f06486e4..25891a42437 100644 --- a/src/OrchardCore.Modules/OrchardCore.Email.Azure/Manifest.cs +++ b/src/OrchardCore.Modules/OrchardCore.Email.Azure/Manifest.cs @@ -1,14 +1,14 @@ using OrchardCore.Modules.Manifest; [assembly: Module( - Name = "Azure Email Provider", + Name = "Azure Communication Services Email", Author = ManifestConstants.OrchardCoreTeam, Website = ManifestConstants.OrchardCoreWebsite, Version = ManifestConstants.OrchardCoreVersion, - Description = "Provides an email service provider leveraging Azure Communication Services (ACS).", + Description = "Provides email service providers leveraging Azure Communication Services (ACS).", Dependencies = [ - "OrchardCore.Email" + "OrchardCore.Email", ], Category = "Messaging" )] diff --git a/src/OrchardCore.Modules/OrchardCore.Email.Azure/Services/AzureEmailProvider.cs b/src/OrchardCore.Modules/OrchardCore.Email.Azure/Services/AzureEmailProvider.cs index 3a159f485e7..f1d444b2310 100644 --- a/src/OrchardCore.Modules/OrchardCore.Email.Azure/Services/AzureEmailProvider.cs +++ b/src/OrchardCore.Modules/OrchardCore.Email.Azure/Services/AzureEmailProvider.cs @@ -18,5 +18,6 @@ public AzureEmailProvider( { } - public override LocalizedString DisplayName => S["Azure Communication Service"]; + public override LocalizedString DisplayName + => S["Azure Communication Services"]; } diff --git a/src/OrchardCore.Modules/OrchardCore.Email.Azure/Services/AzureEmailProviderBase.cs b/src/OrchardCore.Modules/OrchardCore.Email.Azure/Services/AzureEmailProviderBase.cs index 678b1961f29..ae02404f1f1 100644 --- a/src/OrchardCore.Modules/OrchardCore.Email.Azure/Services/AzureEmailProviderBase.cs +++ b/src/OrchardCore.Modules/OrchardCore.Email.Azure/Services/AzureEmailProviderBase.cs @@ -81,6 +81,8 @@ public abstract class AzureEmailProviderBase : IEmailProvider private readonly IEmailAddressValidator _emailAddressValidator; private readonly ILogger _logger; + private EmailClient _emailClient; + protected readonly IStringLocalizer S; public AzureEmailProviderBase( @@ -132,8 +134,9 @@ public virtual async Task SendAsync(MailMessage message) try { - var client = new EmailClient(_providerOptions.ConnectionString); - var emailResult = await client.SendAsync(WaitUntil.Completed, emailMessage); + _emailClient ??= new EmailClient(_providerOptions.ConnectionString); + + var emailResult = await _emailClient.SendAsync(WaitUntil.Completed, emailMessage); if (emailResult.HasValue) { @@ -215,7 +218,7 @@ private EmailMessage FromMailMessage(MailMessage message, Dictionary S["Default Azure Communication Service"]; + public override LocalizedString DisplayName + => S["Default Azure Communication Services"]; } diff --git a/src/OrchardCore.Modules/OrchardCore.Email.Azure/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Email.Azure/Startup.cs index d6be2d33b6e..4ecf3dca2fb 100644 --- a/src/OrchardCore.Modules/OrchardCore.Email.Azure/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Email.Azure/Startup.cs @@ -8,7 +8,6 @@ using OrchardCore.Email.Core; using OrchardCore.Email.Services; using OrchardCore.Environment.Shell.Configuration; -using OrchardCore.Settings; namespace OrchardCore.Email.Azure; @@ -26,10 +25,13 @@ public void ConfigureServices(IServiceCollection services) services.AddTransient, AzureEmailOptionsConfiguration>(); services.AddEmailProviderOptionsConfiguration() - .AddScoped, AzureEmailSettingsDisplayDriver>(); + .AddSiteDisplayDriver(); services.Configure(options => { + _shellConfiguration.GetSection("OrchardCore_Email_AzureCommunicationServices").Bind(options); + + // The 'OrchardCore_Email_Azure' key can be removed in version 3. _shellConfiguration.GetSection("OrchardCore_Email_Azure").Bind(options); options.IsEnabled = options.ConfigurationExists(); diff --git a/src/OrchardCore.Modules/OrchardCore.Email.Smtp/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Email.Smtp/Startup.cs index 873d8c46056..b57b9f3dd24 100644 --- a/src/OrchardCore.Modules/OrchardCore.Email.Smtp/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Email.Smtp/Startup.cs @@ -6,7 +6,6 @@ using OrchardCore.Email.Smtp.Extensions; using OrchardCore.Email.Smtp.Services; using OrchardCore.Environment.Shell.Configuration; -using OrchardCore.Settings; namespace OrchardCore.Email.Smtp; @@ -22,7 +21,7 @@ public Startup(IShellConfiguration shellConfiguration) public void ConfigureServices(IServiceCollection services) { services.AddSmtpEmailProvider() - .AddScoped, SmtpSettingsDisplayDriver>() + .AddSiteDisplayDriver() .AddTransient, SmtpOptionsConfiguration>(); services.Configure(options => diff --git a/src/OrchardCore.Modules/OrchardCore.Email/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Email/AdminMenu.cs index 1a23e2a7829..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 : 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 Task BuildNavigationAsync(string name, NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -49,6 +44,6 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder) ) ); - return Task.CompletedTask; + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Email/Manifest.cs b/src/OrchardCore.Modules/OrchardCore.Email/Manifest.cs index 546cc8977dc..a0968f5837f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Email/Manifest.cs +++ b/src/OrchardCore.Modules/OrchardCore.Email/Manifest.cs @@ -5,6 +5,6 @@ Author = ManifestConstants.OrchardCoreTeam, Website = ManifestConstants.OrchardCoreWebsite, Version = ManifestConstants.OrchardCoreVersion, - Description = "Provides the necessary infrastructure for configuring email settings and offers a default SMTP provider.", + Description = "Provides the necessary infrastructure for configuring email settings.", Category = "Messaging" )] diff --git a/src/OrchardCore.Modules/OrchardCore.Email/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Email/Startup.cs index 38c059baafb..2eca8683011 100644 --- a/src/OrchardCore.Modules/OrchardCore.Email/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Email/Startup.cs @@ -7,7 +7,6 @@ using OrchardCore.Modules; using OrchardCore.Navigation; using OrchardCore.Security.Permissions; -using OrchardCore.Settings; namespace OrchardCore.Email; @@ -16,9 +15,9 @@ public sealed class Startup : StartupBase public override void ConfigureServices(IServiceCollection services) { services.AddEmailServices() - .AddScoped, EmailSettingsDisplayDriver>() - .AddScoped() - .AddScoped(); + .AddSiteDisplayDriver() + .AddPermissionProvider() + .AddNavigationProvider(); services.AddDataMigration(); } diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenu.cs index 6eae881a631..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 : 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 Task BuildNavigationAsync(string name, NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Settings"], settings => settings @@ -39,86 +34,6 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder) ) ); - return Task.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 Task BuildNavigationAsync(string name, NavigationBuilder builder) - { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.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 Task.CompletedTask; - } -} - -public sealed class AdminMenuPixel : INavigationProvider -{ - private static readonly RouteValueDictionary _routeValues = new() - { - { "area", "OrchardCore.Settings" }, - { "groupId", FacebookConstants.PixelSettingsGroupId }, - }; - - internal readonly IStringLocalizer S; - - public AdminMenuPixel( - IStringLocalizer stringLocalizer) - { - S = stringLocalizer; - } - - public Task BuildNavigationAsync(string name, NavigationBuilder builder) - { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - - builder - .Add(S["Configuration"], configuration => configuration - .Add(S["Settings"], settings => settings - .Add(S["Meta Pixel"], S["Meta Pixel"].PrefixPosition(), pixel => pixel - .AddClass("facebookPixel") - .Id("facebookPixel") - .Action("Index", "Admin", _routeValues) - .Permission(FacebookConstants.ManageFacebookPixelPermission) - .LocalNav() - ) - ) - ); - - return Task.CompletedTask; + 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..c4ad313080b --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuLogin.cs @@ -0,0 +1,39 @@ +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 ValueTask BuildAsync(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() + ) + ) + ); + + return ValueTask.CompletedTask; + } +} diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuPixel.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuPixel.cs new file mode 100644 index 00000000000..9494dd75d46 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/AdminMenuPixel.cs @@ -0,0 +1,40 @@ +using Microsoft.AspNetCore.Routing; +using Microsoft.Extensions.Localization; +using OrchardCore.Navigation; + +namespace OrchardCore.Facebook; + +public sealed class AdminMenuPixel : AdminNavigationProvider +{ + private static readonly RouteValueDictionary _routeValues = new() + { + { "area", "OrchardCore.Settings" }, + { "groupId", FacebookConstants.PixelSettingsGroupId }, + }; + + internal readonly IStringLocalizer S; + + public AdminMenuPixel( + IStringLocalizer stringLocalizer) + { + S = stringLocalizer; + } + + protected override ValueTask BuildAsync(NavigationBuilder builder) + { + builder + .Add(S["Configuration"], configuration => configuration + .Add(S["Settings"], settings => settings + .Add(S["Meta Pixel"], S["Meta Pixel"].PrefixPosition(), pixel => pixel + .AddClass("facebookPixel") + .Id("facebookPixel") + .Action("Index", "Admin", _routeValues) + .Permission(FacebookConstants.ManageFacebookPixelPermission) + .LocalNav() + ) + ) + ); + + return ValueTask.CompletedTask; + } +} diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/Deployment/FacebookLoginDeploymentSource.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/Deployment/FacebookLoginDeploymentSource.cs index cbff15786d2..62ad15bbb73 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/Deployment/FacebookLoginDeploymentSource.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/Deployment/FacebookLoginDeploymentSource.cs @@ -4,7 +4,8 @@ namespace OrchardCore.Facebook.Deployment; -public class FacebookLoginDeploymentSource : IDeploymentSource +public class FacebookLoginDeploymentSource + : DeploymentSourceBase { private readonly IFacebookService _facebookService; @@ -13,15 +14,8 @@ public FacebookLoginDeploymentSource(IFacebookService facebookService) _facebookService = facebookService; } - public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlanResult result) + protected override async Task ProcessAsync(FacebookLoginDeploymentStep step, DeploymentPlanResult result) { - var facebookLoginStep = step as FacebookLoginDeploymentStep; - - if (facebookLoginStep == null) - { - return; - } - var settings = await _facebookService.GetSettingsAsync(); // The 'name' property should match the related recipe step name. diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/Login/Recipes/FacebookLoginSettingsStep.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/Login/Recipes/FacebookLoginSettingsStep.cs index 701bce2cf9e..27ad3ee9b87 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/Login/Recipes/FacebookLoginSettingsStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/Login/Recipes/FacebookLoginSettingsStep.cs @@ -9,22 +9,18 @@ namespace OrchardCore.Facebook.Login.Recipes; /// /// This recipe step sets general Facebook Login settings. /// -public sealed class FacebookLoginSettingsStep : IRecipeStepHandler +public sealed class FacebookLoginSettingsStep : NamedRecipeStepHandler { private readonly IFacebookLoginService _loginService; public FacebookLoginSettingsStep(IFacebookLoginService loginService) + : base(nameof(FacebookLoginSettings)) { _loginService = loginService; } - public async Task ExecuteAsync(RecipeExecutionContext context) + protected override async Task HandleAsync(RecipeExecutionContext context) { - if (!string.Equals(context.Name, nameof(FacebookLoginSettings), StringComparison.OrdinalIgnoreCase)) - { - return; - } - var model = context.Step.ToObject(); var settings = await _loginService.LoadSettingsAsync(); diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/Manifest.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/Manifest.cs index 2374c361c7a..659243405a1 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/Manifest.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/Manifest.cs @@ -24,7 +24,8 @@ Description = "Authenticates users from Meta.", Dependencies = [ - FacebookConstants.Features.Core + FacebookConstants.Features.Core, + "OrchardCore.Users.ExternalAuthentication", ] )] diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/Recipes/FacebookSettingsStep.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/Recipes/FacebookSettingsStep.cs index 9b7421d5ca7..946d42b0f76 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/Recipes/FacebookSettingsStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/Recipes/FacebookSettingsStep.cs @@ -8,16 +8,17 @@ namespace OrchardCore.Facebook.Recipes; /// /// This recipe step sets general Facebook Login settings. /// -public sealed class FacebookSettingsStep : IRecipeStepHandler +public sealed class FacebookSettingsStep : NamedRecipeStepHandler { private readonly IFacebookService _facebookService; public FacebookSettingsStep(IFacebookService facebookService) + : base("FacebookCoreSettings") { _facebookService = facebookService; } - public async Task ExecuteAsync(RecipeExecutionContext context) + protected override async Task HandleAsync(RecipeExecutionContext context) { if (!string.Equals(context.Name, "FacebookCoreSettings", StringComparison.OrdinalIgnoreCase)) { diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/Startup.cs index e71bbee0ac0..2b30ef8dd60 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/Startup.cs @@ -14,7 +14,6 @@ using OrchardCore.Recipes; using OrchardCore.ResourceManagement; using OrchardCore.Security.Permissions; -using OrchardCore.Settings; namespace OrchardCore.Facebook; @@ -27,11 +26,11 @@ public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilde public override void ConfigureServices(IServiceCollection services) { - services.AddScoped(); - services.AddScoped(); + services.AddPermissionProvider(); + services.AddNavigationProvider(); services.AddSingleton(); - services.AddScoped, FacebookSettingsDisplayDriver>(); + services.AddSiteDisplayDriver(); services.AddRecipeExecutionStep(); services.AddTransient, ResourceManagementOptionsConfiguration>(); diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/StartupLogin.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/StartupLogin.cs index b86b4f5fd1a..c152dca0e0d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/StartupLogin.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/StartupLogin.cs @@ -13,7 +13,6 @@ using OrchardCore.Modules; using OrchardCore.Navigation; using OrchardCore.Recipes; -using OrchardCore.Settings; namespace OrchardCore.Facebook; @@ -22,10 +21,10 @@ public sealed class StartupLogin : StartupBase { public override void ConfigureServices(IServiceCollection services) { - services.AddScoped(); + services.AddNavigationProvider(); services.AddSingleton(); - services.AddScoped, FacebookLoginSettingsDisplayDriver>(); + services.AddSiteDisplayDriver(); services.AddRecipeExecutionStep(); // Register the options initializers required by the Facebook handler. diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/StartupPixel.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/StartupPixel.cs index 3ac45eb5945..694c64b80e7 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/StartupPixel.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/StartupPixel.cs @@ -6,7 +6,6 @@ using OrchardCore.Modules; using OrchardCore.Navigation; using OrchardCore.Security.Permissions; -using OrchardCore.Settings; namespace OrchardCore.Facebook; @@ -15,9 +14,9 @@ public sealed class StartupPixel : StartupBase { public override void ConfigureServices(IServiceCollection services) { - services.AddScoped, FacebookPixelSettingsDisplayDriver>(); - services.AddScoped(); - services.AddScoped(); + services.AddSiteDisplayDriver(); + services.AddPermissionProvider(); + services.AddNavigationProvider(); services.Configure((options) => { diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/StartupWidgets.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/StartupWidgets.cs index edbcffa7096..77f76b6e020 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/StartupWidgets.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/StartupWidgets.cs @@ -3,7 +3,7 @@ using OrchardCore.ContentManagement.Display.ContentDisplay; using OrchardCore.ContentTypes.Editors; using OrchardCore.Data.Migration; -using OrchardCore.DisplayManagement.Descriptors; +using OrchardCore.DisplayManagement; using OrchardCore.Facebook.Widgets; using OrchardCore.Facebook.Widgets.Drivers; using OrchardCore.Facebook.Widgets.Handlers; @@ -20,7 +20,7 @@ public sealed class StartupWidgets : StartupBase public override void ConfigureServices(IServiceCollection services) { services.AddDataMigration(); - services.AddScoped(); + services.AddShapeTableProvider(); services.AddContentPart() .UseDisplayDriver() diff --git a/src/OrchardCore.Modules/OrchardCore.Features/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Features/AdminMenu.cs index b97f75d79b5..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 : 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 Task BuildNavigationAsync(string name, NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - builder .Add(S["Configuration"], configuration => configuration .Add(S["Features"], S["Features"].PrefixPosition(), deployment => deployment @@ -36,6 +31,6 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder) ) ); - return Task.CompletedTask; + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Features/Deployment/AllFeaturesDeploymentSource.cs b/src/OrchardCore.Modules/OrchardCore.Features/Deployment/AllFeaturesDeploymentSource.cs index b3058a7ab1f..3712eeb51a5 100644 --- a/src/OrchardCore.Modules/OrchardCore.Features/Deployment/AllFeaturesDeploymentSource.cs +++ b/src/OrchardCore.Modules/OrchardCore.Features/Deployment/AllFeaturesDeploymentSource.cs @@ -4,7 +4,8 @@ namespace OrchardCore.Features.Deployment; -public class AllFeaturesDeploymentSource : IDeploymentSource +public class AllFeaturesDeploymentSource + : DeploymentSourceBase { private readonly IModuleService _moduleService; @@ -13,13 +14,8 @@ public AllFeaturesDeploymentSource(IModuleService moduleService) _moduleService = moduleService; } - public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlanResult result) + protected override async Task ProcessAsync(AllFeaturesDeploymentStep step, DeploymentPlanResult result) { - if (step is not AllFeaturesDeploymentStep allFeaturesStep) - { - return; - } - var features = await _moduleService.GetAvailableFeaturesAsync(); var featureStep = new JsonObject { @@ -27,7 +23,7 @@ public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlan ["enable"] = JNode.FromObject(features.Where(f => f.IsEnabled).Select(f => f.Descriptor.Id).ToArray()), }; - if (!allFeaturesStep.IgnoreDisabledFeatures) + if (!step.IgnoreDisabledFeatures) { featureStep.Add("disable", JNode.FromObject(features.Where(f => !f.IsEnabled).Select(f => f.Descriptor.Id).ToArray())); } diff --git a/src/OrchardCore.Modules/OrchardCore.Features/Recipes/Executors/FeatureStep.cs b/src/OrchardCore.Modules/OrchardCore.Features/Recipes/Executors/FeatureStep.cs index 207a9950e05..bd92f764011 100644 --- a/src/OrchardCore.Modules/OrchardCore.Features/Recipes/Executors/FeatureStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.Features/Recipes/Executors/FeatureStep.cs @@ -8,22 +8,18 @@ namespace OrchardCore.Features.Recipes.Executors; /// /// This recipe step enables or disables a set of features. /// -public sealed class FeatureStep : IRecipeStepHandler +public sealed class FeatureStep : NamedRecipeStepHandler { private readonly IShellFeaturesManager _shellFeaturesManager; public FeatureStep(IShellFeaturesManager shellFeaturesManager) + : base("Feature") { _shellFeaturesManager = shellFeaturesManager; } - public async Task ExecuteAsync(RecipeExecutionContext context) + protected override async Task HandleAsync(RecipeExecutionContext context) { - if (!string.Equals(context.Name, "Feature", StringComparison.OrdinalIgnoreCase)) - { - return; - } - var step = context.Step.ToObject(); var features = await _shellFeaturesManager.GetAvailableFeaturesAsync(); diff --git a/src/OrchardCore.Modules/OrchardCore.Features/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Features/Startup.cs index 13a04229a77..7b14e5f0050 100644 --- a/src/OrchardCore.Modules/OrchardCore.Features/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Features/Startup.cs @@ -18,9 +18,9 @@ public sealed class Startup : StartupBase public override void ConfigureServices(IServiceCollection services) { services.AddRecipeExecutionStep(); - services.AddScoped(); + services.AddPermissionProvider(); services.AddScoped(); - services.AddScoped(); + services.AddNavigationProvider(); services.AddDeployment(); } diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/ButtonPartDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/ButtonPartDisplayDriver.cs index 37200abfc35..6ced0475a2a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/ButtonPartDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/ButtonPartDisplayDriver.cs @@ -23,7 +23,7 @@ public override IDisplayResult Edit(ButtonPart part, BuildPartEditorContext cont }); } - public async override Task UpdateAsync(ButtonPart part, UpdatePartEditorContext context) + public override async Task UpdateAsync(ButtonPart part, UpdatePartEditorContext context) { var viewModel = new ButtonPartEditViewModel(); diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/FormElementLabelPartDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/FormElementLabelPartDisplayDriver.cs index 07c7c5a58b3..7ea8fe31e5a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/FormElementLabelPartDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/FormElementLabelPartDisplayDriver.cs @@ -23,7 +23,7 @@ public override IDisplayResult Edit(FormElementLabelPart part, BuildPartEditorCo }); } - public async override Task UpdateAsync(FormElementLabelPart part, UpdatePartEditorContext context) + public override async Task UpdateAsync(FormElementLabelPart part, UpdatePartEditorContext context) { var viewModel = new FormElementLabelPartViewModel(); diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/FormElementPartDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/FormElementPartDisplayDriver.cs index 34e4917e409..912a30cc9d2 100644 --- a/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/FormElementPartDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/FormElementPartDisplayDriver.cs @@ -16,7 +16,7 @@ public override IDisplayResult Edit(FormElementPart part, BuildPartEditorContext }); } - public async override Task UpdateAsync(FormElementPart part, UpdatePartEditorContext context) + public override async Task UpdateAsync(FormElementPart part, UpdatePartEditorContext context) { var viewModel = new FormElementPartEditViewModel(); diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/FormElementValidationPartDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/FormElementValidationPartDisplayDriver.cs index d7097832d17..e829c1a2430 100644 --- a/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/FormElementValidationPartDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/FormElementValidationPartDisplayDriver.cs @@ -22,7 +22,7 @@ public override IDisplayResult Edit(FormElementValidationPart part, BuildPartEdi }); } - public async override Task UpdateAsync(FormElementValidationPart part, UpdatePartEditorContext context) + public override async Task UpdateAsync(FormElementValidationPart part, UpdatePartEditorContext context) { var viewModel = new FormElementValidationPartViewModel(); diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/FormInputElementPartDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/FormInputElementPartDisplayDriver.cs index bff6a2c28d2..f999ee103ab 100644 --- a/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/FormInputElementPartDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/FormInputElementPartDisplayDriver.cs @@ -25,7 +25,7 @@ public override IDisplayResult Edit(FormInputElementPart part, BuildPartEditorCo }); } - public async override Task UpdateAsync(FormInputElementPart part, UpdatePartEditorContext context) + public override async Task UpdateAsync(FormInputElementPart part, UpdatePartEditorContext context) { var viewModel = new FormInputElementPartEditViewModel(); diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/FormPartDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/FormPartDisplayDriver.cs index 0c18dbb2d78..d22b511d7f4 100644 --- a/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/FormPartDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/FormPartDisplayDriver.cs @@ -21,7 +21,7 @@ public override IDisplayResult Edit(FormPart part, BuildPartEditorContext contex }); } - public async override Task UpdateAsync(FormPart part, UpdatePartEditorContext context) + public override async Task UpdateAsync(FormPart part, UpdatePartEditorContext context) { var viewModel = new FormPartEditViewModel(); diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/InputPartDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/InputPartDisplayDriver.cs index 62011e35b5a..9c6701c2d24 100644 --- a/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/InputPartDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/InputPartDisplayDriver.cs @@ -23,7 +23,7 @@ public override IDisplayResult Edit(InputPart part, BuildPartEditorContext conte }); } - public async override Task UpdateAsync(InputPart part, UpdatePartEditorContext context) + public override async Task UpdateAsync(InputPart part, UpdatePartEditorContext context) { var viewModel = new InputPartEditViewModel(); diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/SelectPartDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/SelectPartDisplayDriver.cs index d4f774da1b2..9dc4b2c0fda 100644 --- a/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/SelectPartDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/SelectPartDisplayDriver.cs @@ -32,7 +32,7 @@ public override IDisplayResult Edit(SelectPart part, BuildPartEditorContext cont }); } - public async override Task UpdateAsync(SelectPart part, UpdatePartEditorContext context) + public override async Task UpdateAsync(SelectPart part, UpdatePartEditorContext context) { var viewModel = new SelectPartEditViewModel(); await context.Updater.TryUpdateModelAsync(viewModel, Prefix); diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/TextAreaPartDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/TextAreaPartDisplayDriver.cs index fb421eb1a59..30d853eb25e 100644 --- a/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/TextAreaPartDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/TextAreaPartDisplayDriver.cs @@ -22,7 +22,7 @@ public override IDisplayResult Edit(TextAreaPart part, BuildPartEditorContext co }); } - public async override Task UpdateAsync(TextAreaPart part, UpdatePartEditorContext context) + public override async Task UpdateAsync(TextAreaPart part, UpdatePartEditorContext context) { var viewModel = new InputPartEditViewModel(); diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/ValidationPartDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/ValidationPartDisplayDriver.cs index 1879b52d75b..3656515e4c5 100644 --- a/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/ValidationPartDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.Forms/Drivers/ValidationPartDisplayDriver.cs @@ -21,7 +21,7 @@ public override IDisplayResult Edit(ValidationPart part, BuildPartEditorContext }); } - public async override Task UpdateAsync(ValidationPart part, UpdatePartEditorContext context) + public override async Task UpdateAsync(ValidationPart part, UpdatePartEditorContext context) { var viewModel = new ValidationPartEditViewModel(); diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Forms/Startup.cs index 4d8d419f79c..8c7825587da 100644 --- a/src/OrchardCore.Modules/OrchardCore.Forms/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Forms/Startup.cs @@ -4,7 +4,7 @@ using OrchardCore.ContentManagement; using OrchardCore.ContentManagement.Display.ContentDisplay; using OrchardCore.Data.Migration; -using OrchardCore.DisplayManagement.Descriptors; +using OrchardCore.DisplayManagement; using OrchardCore.Forms.Activities; using OrchardCore.Forms.Activities.Drivers; using OrchardCore.Forms.Drivers; @@ -77,7 +77,7 @@ public override void ConfigureServices(IServiceCollection services) .UseDisplayDriver(); services.AddDataMigration(); - services.AddScoped(); + services.AddShapeTableProvider(); } } diff --git a/src/OrchardCore.Modules/OrchardCore.GitHub/AdminMenuGitHubLogin.cs b/src/OrchardCore.Modules/OrchardCore.GitHub/AdminMenuGitHubLogin.cs index efbf84567bb..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 : 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 Task BuildNavigationAsync(string name, NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - builder .Add(S["Security"], security => security .Add(S["Authentication"], authentication => authentication @@ -39,6 +34,6 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder) ) ); - return Task.CompletedTask; + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.GitHub/Configuration/GithubDefaults.cs b/src/OrchardCore.Modules/OrchardCore.GitHub/Configuration/GithubDefaults.cs index e64e7e80adf..dfa612da0e5 100644 --- a/src/OrchardCore.Modules/OrchardCore.GitHub/Configuration/GithubDefaults.cs +++ b/src/OrchardCore.Modules/OrchardCore.GitHub/Configuration/GithubDefaults.cs @@ -3,8 +3,12 @@ namespace OrchardCore.GitHub.Configuration; public static class GitHubDefaults { public const string AuthenticationScheme = "GitHub"; - public static readonly string DisplayName = "GitHub"; - public static readonly string AuthorizationEndpoint = "https://github.com/login/oauth/authorize"; - public static readonly string TokenEndpoint = "https://github.com/login/oauth/access_token"; - public static readonly string UserInformationEndpoint = "https://api.github.com/user"; + + public const string DisplayName = "GitHub"; + + public const string AuthorizationEndpoint = "https://github.com/login/oauth/authorize"; + + public const string TokenEndpoint = "https://github.com/login/oauth/access_token"; + + public const string UserInformationEndpoint = "https://api.github.com/user"; } diff --git a/src/OrchardCore.Modules/OrchardCore.GitHub/Manifest.cs b/src/OrchardCore.Modules/OrchardCore.GitHub/Manifest.cs index 50934ea7ff0..3b719d76abf 100644 --- a/src/OrchardCore.Modules/OrchardCore.GitHub/Manifest.cs +++ b/src/OrchardCore.Modules/OrchardCore.GitHub/Manifest.cs @@ -13,5 +13,9 @@ Id = GitHubConstants.Features.GitHubAuthentication, Name = "GitHub Authentication", Category = "GitHub", - Description = "Authenticates users with their GitHub Account." + Description = "Authenticates users with their GitHub Account.", + Dependencies = + [ + "OrchardCore.Users.ExternalAuthentication", + ] )] diff --git a/src/OrchardCore.Modules/OrchardCore.GitHub/Recipes/GithubAuthenticationSettingsStep.cs b/src/OrchardCore.Modules/OrchardCore.GitHub/Recipes/GithubAuthenticationSettingsStep.cs index 95336a13088..b9aff618228 100644 --- a/src/OrchardCore.Modules/OrchardCore.GitHub/Recipes/GithubAuthenticationSettingsStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.GitHub/Recipes/GithubAuthenticationSettingsStep.cs @@ -9,22 +9,18 @@ namespace OrchardCore.GitHub.Recipes; /// /// This recipe step sets GitHub Account settings. /// -public sealed class GitHubAuthenticationSettingsStep : IRecipeStepHandler +public sealed class GitHubAuthenticationSettingsStep : NamedRecipeStepHandler { private readonly IGitHubAuthenticationService _githubAuthenticationService; public GitHubAuthenticationSettingsStep(IGitHubAuthenticationService githubLoginService) + : base(nameof(GitHubAuthenticationSettings)) { _githubAuthenticationService = githubLoginService; } - public async Task ExecuteAsync(RecipeExecutionContext context) + protected override async Task HandleAsync(RecipeExecutionContext context) { - if (!string.Equals(context.Name, nameof(GitHubAuthenticationSettings), StringComparison.OrdinalIgnoreCase)) - { - return; - } - var model = context.Step.ToObject(); var settings = await _githubAuthenticationService.LoadSettingsAsync(); diff --git a/src/OrchardCore.Modules/OrchardCore.GitHub/Startup.cs b/src/OrchardCore.Modules/OrchardCore.GitHub/Startup.cs index 8b4e68cc01e..bcca7e22c6b 100644 --- a/src/OrchardCore.Modules/OrchardCore.GitHub/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.GitHub/Startup.cs @@ -12,7 +12,6 @@ using OrchardCore.Navigation; using OrchardCore.Recipes; using OrchardCore.Security.Permissions; -using OrchardCore.Settings; namespace OrchardCore.GitHub; @@ -20,7 +19,7 @@ public sealed class Startup : StartupBase { public override void ConfigureServices(IServiceCollection services) { - services.AddScoped(); + services.AddPermissionProvider(); } } @@ -30,8 +29,8 @@ public sealed class GitHubLoginStartup : StartupBase public override void ConfigureServices(IServiceCollection services) { services.AddSingleton(); - services.AddScoped, GitHubAuthenticationSettingsDisplayDriver>(); - services.AddScoped(); + services.AddSiteDisplayDriver(); + services.AddNavigationProvider(); services.AddRecipeExecutionStep(); services.AddTransient, GitHubAuthenticationSettingsConfiguration>(); diff --git a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsAdminMenu.cs new file mode 100644 index 00000000000..5e5ffdbc0e0 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsAdminMenu.cs @@ -0,0 +1,38 @@ +using Microsoft.AspNetCore.Routing; +using Microsoft.Extensions.Localization; +using OrchardCore.Navigation; + +namespace OrchardCore.Google; + +public sealed class GoogleAnalyticsAdminMenu : AdminNavigationProvider +{ + private static readonly RouteValueDictionary _routeValues = new() + { + { "area", "OrchardCore.Settings" }, + { "groupId", GoogleConstants.Features.GoogleAnalytics }, + }; + + internal readonly IStringLocalizer S; + + public GoogleAnalyticsAdminMenu(IStringLocalizer stringLocalizer) + { + S = stringLocalizer; + } + + protected override ValueTask BuildAsync(NavigationBuilder builder) + { + builder + .Add(S["Configuration"], configuration => configuration + .Add(S["Settings"], settings => settings + .Add(S["Google Analytics"], S["Google Analytics"].PrefixPosition(), google => google + .AddClass("googleAnalytics").Id("googleAnalytics") + .Action("Index", "Admin", _routeValues) + .Permission(Permissions.ManageGoogleAnalytics) + .LocalNav() + ) + ) + ); + + return ValueTask.CompletedTask; + } +} diff --git a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationAdminMenu.cs index 96ed4718417..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 : 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 Task BuildNavigationAsync(string name, NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - builder .Add(S["Security"], security => security .Add(S["Authentication"], authentication => authentication @@ -39,83 +34,6 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder) ) ); - return Task.CompletedTask; - } -} - -public sealed class GoogleAnalyticsAdminMenu : INavigationProvider -{ - private static readonly RouteValueDictionary _routeValues = new() - { - { "area", "OrchardCore.Settings" }, - { "groupId", GoogleConstants.Features.GoogleAnalytics }, - }; - - internal readonly IStringLocalizer S; - - public GoogleAnalyticsAdminMenu(IStringLocalizer localizer) - { - S = localizer; - } - - public Task BuildNavigationAsync(string name, NavigationBuilder builder) - { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - - builder - .Add(S["Configuration"], configuration => configuration - .Add(S["Settings"], settings => settings - .Add(S["Google Analytics"], S["Google Analytics"].PrefixPosition(), google => google - .AddClass("googleAnalytics").Id("googleAnalytics") - .Action("Index", "Admin", _routeValues) - .Permission(Permissions.ManageGoogleAnalytics) - .LocalNav() - ) - ) - ); - - return Task.CompletedTask; - } -} - -public sealed class GoogleTagManagerAdminMenu : INavigationProvider -{ - private static readonly RouteValueDictionary _routeValues = new() - { - { "area", "OrchardCore.Settings" }, - { "groupId", GoogleConstants.Features.GoogleTagManager }, - }; - - internal readonly IStringLocalizer S; - - public GoogleTagManagerAdminMenu(IStringLocalizer localizer) - { - S = localizer; - } - - public Task BuildNavigationAsync(string name, NavigationBuilder builder) - { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - - builder - .Add(S["Configuration"], configuration => configuration - .Add(S["Settings"], settings => settings - .Add(S["Google Tag Manager"], S["Google Tag Manager"].PrefixPosition(), google => google - .AddClass("googleTagManager") - .Id("googleTagManager") - .Action("Index", "Admin", _routeValues) - .Permission(Permissions.ManageGoogleTagManager) - .LocalNav() - ) - ) - ); - - return Task.CompletedTask; + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationStartup.cs b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationStartup.cs index 6a077e7da54..f01e66e54a8 100644 --- a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationStartup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationStartup.cs @@ -20,7 +20,6 @@ using OrchardCore.Modules; using OrchardCore.Navigation; using OrchardCore.Security.Permissions; -using OrchardCore.Settings; using OrchardCore.Settings.Deployment; namespace OrchardCore.Google; @@ -30,10 +29,11 @@ public sealed class GoogleAuthenticationStartup : StartupBase { public override void ConfigureServices(IServiceCollection services) { - services.AddScoped(); + services.AddPermissionProvider(); services.AddSingleton(); - services.AddScoped, GoogleAuthenticationSettingsDisplayDriver>(); - services.AddScoped(); + services.AddSiteDisplayDriver(); + services.AddNavigationProvider(); + // Register the options initializers required by the Google Handler. services.TryAddEnumerable(new[] { @@ -53,11 +53,12 @@ public sealed class GoogleAnalyticsStartup : StartupBase { public override void ConfigureServices(IServiceCollection services) { - services.AddScoped(); + services.AddPermissionProvider(); services.AddSingleton(); - services.AddScoped, GoogleAnalyticsSettingsDisplayDriver>(); - services.AddScoped(); + services.AddSiteDisplayDriver(); + services.AddNavigationProvider(); + services.Configure((options) => { options.Filters.Add(); @@ -70,11 +71,11 @@ public sealed class GoogleTagManagerStartup : StartupBase { public override void ConfigureServices(IServiceCollection services) { - services.AddScoped(); + services.AddPermissionProvider(); services.AddSingleton(); + services.AddSiteDisplayDriver(); + services.AddNavigationProvider(); - services.AddScoped, GoogleTagManagerSettingsDisplayDriver>(); - services.AddScoped(); services.Configure((options) => { options.Filters.Add(); diff --git a/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerAdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerAdminMenu.cs new file mode 100644 index 00000000000..bb5fe072b1c --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerAdminMenu.cs @@ -0,0 +1,40 @@ +using Microsoft.AspNetCore.Routing; +using Microsoft.Extensions.Localization; +using OrchardCore.Navigation; + +namespace OrchardCore.Google; + +public sealed class GoogleTagManagerAdminMenu : AdminNavigationProvider +{ + private static readonly RouteValueDictionary _routeValues = new() + { + { "area", "OrchardCore.Settings" }, + { "groupId", GoogleConstants.Features.GoogleTagManager }, + }; + + internal readonly IStringLocalizer S; + + public GoogleTagManagerAdminMenu(IStringLocalizer stringLocalizer) + { + S = stringLocalizer; + } + + protected override ValueTask BuildAsync(NavigationBuilder builder) + { + builder + .Add(S["Configuration"], configuration => configuration + .Add(S["Settings"], settings => settings + .Add(S["Google Tag Manager"], S["Google Tag Manager"].PrefixPosition(), google => google + .AddClass("googleTagManager") + .Id("googleTagManager") + .Action("Index", "Admin", _routeValues) + .Permission(Permissions.ManageGoogleTagManager) + .LocalNav() + ) + ) + ); + + + return ValueTask.CompletedTask; + } +} diff --git a/src/OrchardCore.Modules/OrchardCore.Google/Manifest.cs b/src/OrchardCore.Modules/OrchardCore.Google/Manifest.cs index 5ca5c03429d..731c3576ec8 100644 --- a/src/OrchardCore.Modules/OrchardCore.Google/Manifest.cs +++ b/src/OrchardCore.Modules/OrchardCore.Google/Manifest.cs @@ -13,7 +13,11 @@ Id = GoogleConstants.Features.GoogleAuthentication, Name = "Google Authentication", Category = "Google", - Description = "Authenticates users with their Google Account." + Description = "Authenticates users with their Google Account.", + Dependencies = + [ + "OrchardCore.Users.ExternalAuthentication", + ] )] [assembly: Feature( diff --git a/src/OrchardCore.Modules/OrchardCore.Html/Media/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Html/Media/Startup.cs index 13a487ed114..50dcdefadd5 100644 --- a/src/OrchardCore.Modules/OrchardCore.Html/Media/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Html/Media/Startup.cs @@ -1,5 +1,5 @@ using Microsoft.Extensions.DependencyInjection; -using OrchardCore.DisplayManagement.Descriptors; +using OrchardCore.DisplayManagement; using OrchardCore.Modules; namespace OrchardCore.Html.Media; @@ -9,6 +9,6 @@ public sealed class Startup : StartupBase { public override void ConfigureServices(IServiceCollection services) { - services.AddScoped(); + services.AddShapeTableProvider(); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Https/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Https/AdminMenu.cs index 343c5fefad6..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 : 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 Task BuildNavigationAsync(string name, NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - builder .Add(S["Security"], security => security .Add(S["Settings"], settings => settings @@ -38,6 +33,6 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder) ) ); - return Task.CompletedTask; + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Https/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Https/Startup.cs index 0f44f6a8ede..b7894083b28 100644 --- a/src/OrchardCore.Modules/OrchardCore.Https/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Https/Startup.cs @@ -10,7 +10,6 @@ using OrchardCore.Modules; using OrchardCore.Navigation; using OrchardCore.Security.Permissions; -using OrchardCore.Settings; using OrchardCore.Settings.Deployment; namespace OrchardCore.Https; @@ -34,11 +33,11 @@ public override async ValueTask ConfigureAsync(IApplicationBuilder app, IEndpoin public override void ConfigureServices(IServiceCollection services) { - services.AddScoped(); - services.AddScoped, HttpsSettingsDisplayDriver>(); + services.AddSiteDisplayDriver(); + services.AddNavigationProvider(); services.AddSingleton(); - services.AddScoped(); + services.AddPermissionProvider(); services.AddOptions() .Configure((options, service) => diff --git a/src/OrchardCore.Modules/OrchardCore.Layers/AdminMenu.cs b/src/OrchardCore.Modules/OrchardCore.Layers/AdminMenu.cs index 35a0ee94c1e..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 : 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 Task BuildNavigationAsync(string name, NavigationBuilder builder) + protected override ValueTask BuildAsync(NavigationBuilder builder) { - if (!NavigationHelper.IsAdminMenu(name)) - { - return Task.CompletedTask; - } - builder .Add(S["Design"], design => design .Add(S["Settings"], settings => settings @@ -43,6 +38,6 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder) ) ); - return Task.CompletedTask; + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Layers/Deployment/AllLayersDeploymentSource.cs b/src/OrchardCore.Modules/OrchardCore.Layers/Deployment/AllLayersDeploymentSource.cs index 576ad39d5c4..c2dc930aaeb 100644 --- a/src/OrchardCore.Modules/OrchardCore.Layers/Deployment/AllLayersDeploymentSource.cs +++ b/src/OrchardCore.Modules/OrchardCore.Layers/Deployment/AllLayersDeploymentSource.cs @@ -9,7 +9,8 @@ namespace OrchardCore.Layers.Deployment; -public class AllLayersDeploymentSource : IDeploymentSource +public class AllLayersDeploymentSource + : DeploymentSourceBase { private readonly ILayerService _layerService; private readonly ISiteService _siteService; @@ -25,13 +26,8 @@ public AllLayersDeploymentSource( _jsonSerializerOptions = serializationOptions.Value.SerializerOptions; } - public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlanResult result) + protected override async Task ProcessAsync(AllLayersDeploymentStep step, DeploymentPlanResult result) { - if (step is not AllLayersDeploymentStep) - { - return; - } - var layers = await _layerService.GetLayersAsync(); result.Steps.Add(new JsonObject diff --git a/src/OrchardCore.Modules/OrchardCore.Layers/Recipes/LayerStep.cs b/src/OrchardCore.Modules/OrchardCore.Layers/Recipes/LayerStep.cs index 9b42468ac6b..dc7c620765c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Layers/Recipes/LayerStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.Layers/Recipes/LayerStep.cs @@ -15,7 +15,7 @@ namespace OrchardCore.Layers.Recipes; /// /// This recipe step creates or updates a layer. /// -public sealed class LayerStep : IRecipeStepHandler +public sealed class LayerStep : NamedRecipeStepHandler { private readonly ILayerService _layerService; private readonly IConditionIdGenerator _conditionIdGenerator; @@ -30,6 +30,7 @@ public LayerStep( IEnumerable factories, IOptions serializationOptions, IStringLocalizer stringLocalizer) + : base("Layers") { _layerService = layerService; _conditionIdGenerator = conditionIdGenerator; @@ -38,14 +39,9 @@ public LayerStep( S = stringLocalizer; } - public async Task ExecuteAsync(RecipeExecutionContext context) + protected override async Task HandleAsync(RecipeExecutionContext context) { - if (!string.Equals(context.Name, "Layers", StringComparison.OrdinalIgnoreCase)) - { - return; - } - - // The recipe step contains polymorphic types which need to be resolved + // The recipe step contains polymorphic types which need to be resolved. var model = context.Step.ToObject(_serializationOptions); var allLayers = await _layerService.LoadLayersAsync(); diff --git a/src/OrchardCore.Modules/OrchardCore.Layers/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Layers/Startup.cs index 018ddce7002..ad7b82b30fa 100644 --- a/src/OrchardCore.Modules/OrchardCore.Layers/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Layers/Startup.cs @@ -21,7 +21,6 @@ using OrchardCore.Recipes; using OrchardCore.Scripting; using OrchardCore.Security.Permissions; -using OrchardCore.Settings; namespace OrchardCore.Layers; @@ -39,15 +38,15 @@ public override void ConfigureServices(IServiceCollection services) options.Filters.Add(); }); - services.AddScoped, LayerSiteSettingsDisplayDriver>(); + services.AddSiteDisplayDriver(); services.AddContentPart(); services.AddScoped(); - services.AddScoped(); + services.AddNavigationProvider(); services.AddScoped(); services.AddScoped(); services.AddIndexProvider(); services.AddDataMigration(); - services.AddScoped(); + services.AddPermissionProvider(); services.AddRecipeExecutionStep(); services.AddDeployment(); services.AddSingleton(); diff --git a/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/AbsoluteUrlFilter.cs b/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/AbsoluteUrlFilter.cs index c7b2496119a..99c5df08421 100644 --- a/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/AbsoluteUrlFilter.cs +++ b/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/AbsoluteUrlFilter.cs @@ -19,12 +19,13 @@ public ValueTask ProcessAsync(FluidValue input, FilterArguments argu if (string.IsNullOrWhiteSpace(relativePath)) { - return new ValueTask(input); + return ValueTask.FromResult(input); } var urlHelper = _urlHelperFactory.GetUrlHelper(context.ViewContext); - var result = new StringValue(urlHelper.ToAbsoluteUrl(relativePath)); - return new ValueTask(result); + var result = StringValue.Create(urlHelper.ToAbsoluteUrl(relativePath)); + + return ValueTask.FromResult(result); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/ContentUrlFilter.cs b/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/ContentUrlFilter.cs index 39b164148b5..05e20d91002 100644 --- a/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/ContentUrlFilter.cs +++ b/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/ContentUrlFilter.cs @@ -17,6 +17,6 @@ public ValueTask ProcessAsync(FluidValue input, FilterArguments argu { var urlHelper = _urlHelperFactory.GetUrlHelper(context.ViewContext); - return new ValueTask(new StringValue((urlHelper).Content(input.ToStringValue()))); + return ValueTask.FromResult(new StringValue((urlHelper).Content(input.ToStringValue()))); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/JsonFilter.cs b/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/JsonFilter.cs index 27cd5085dfd..423cea7c14d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/JsonFilter.cs +++ b/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/JsonFilter.cs @@ -17,31 +17,31 @@ public static ValueTask Json(FluidValue input, FilterArguments argum switch (input.Type) { case FluidValues.Array: - return new ValueTask(new StringValue(JConvert.SerializeObject(input.Enumerate(context).Select(o => o.ToObjectValue()), formatting))); + return ValueTask.FromResult(new StringValue(JConvert.SerializeObject(input.Enumerate(context).Select(o => o.ToObjectValue()), formatting))); case FluidValues.Boolean: - return new ValueTask(new StringValue(JConvert.SerializeObject(input.ToBooleanValue(), formatting))); + return ValueTask.FromResult(new StringValue(JConvert.SerializeObject(input.ToBooleanValue(), formatting))); case FluidValues.Nil: - return new ValueTask(StringValue.Create("null")); + return ValueTask.FromResult(StringValue.Create("null")); case FluidValues.Number: - return new ValueTask(new StringValue(JConvert.SerializeObject(input.ToNumberValue(), formatting))); + return ValueTask.FromResult(new StringValue(JConvert.SerializeObject(input.ToNumberValue(), formatting))); case FluidValues.DateTime: case FluidValues.Dictionary: case FluidValues.Object: - return new ValueTask(new StringValue(JConvert.SerializeObject(input.ToObjectValue(), formatting))); + return ValueTask.FromResult(new StringValue(JConvert.SerializeObject(input.ToObjectValue(), formatting))); case FluidValues.String: var stringValue = input.ToStringValue(); if (string.IsNullOrWhiteSpace(stringValue)) { - return new ValueTask(input); + return ValueTask.FromResult(input); } - return new ValueTask(new StringValue(JConvert.SerializeObject(stringValue, formatting))); + return ValueTask.FromResult(new StringValue(JConvert.SerializeObject(stringValue, formatting))); } throw new NotSupportedException("Unrecognized FluidValue"); diff --git a/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/JsonParseFilter.cs b/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/JsonParseFilter.cs index 9e7d143465e..1f04a35be40 100644 --- a/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/JsonParseFilter.cs +++ b/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/JsonParseFilter.cs @@ -12,9 +12,9 @@ public static ValueTask JsonParse(FluidValue input, FilterArguments var parsedValue = JNode.Parse(input.ToStringValue()); if (parsedValue.GetValueKind() == JsonValueKind.Array) { - return new ValueTask(FluidValue.Create(parsedValue, context.Options)); + return ValueTask.FromResult(FluidValue.Create(parsedValue, context.Options)); } - return new ValueTask(new ObjectValue(parsedValue)); + return ValueTask.FromResult(new ObjectValue(parsedValue)); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/LocalTimeZoneFilter.cs b/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/LocalTimeZoneFilter.cs index d109ff16896..fe8eff67a06 100644 --- a/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/LocalTimeZoneFilter.cs +++ b/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/LocalTimeZoneFilter.cs @@ -24,7 +24,7 @@ public async ValueTask ProcessAsync(FluidValue input, FilterArgument if (stringValue == "now" || stringValue == "today") { - value = await _localClock.LocalNowAsync; + value = await _localClock.GetLocalNowAsync(); } else { diff --git a/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/UtcTimeZoneFilter.cs b/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/UtcTimeZoneFilter.cs index a56eee9c0ab..481ddcef24d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/UtcTimeZoneFilter.cs +++ b/src/OrchardCore.Modules/OrchardCore.Liquid/Filters/UtcTimeZoneFilter.cs @@ -24,7 +24,7 @@ public async ValueTask ProcessAsync(FluidValue input, FilterArgument if (stringValue == "now" || stringValue == "today") { - value = await _localClock.LocalNowAsync; + value = await _localClock.GetLocalNowAsync(); } else { diff --git a/src/OrchardCore.Modules/OrchardCore.Liquid/ScriptsMiddleware.cs b/src/OrchardCore.Modules/OrchardCore.Liquid/ScriptsMiddleware.cs index 0081280939c..6c5c148f961 100644 --- a/src/OrchardCore.Modules/OrchardCore.Liquid/ScriptsMiddleware.cs +++ b/src/OrchardCore.Modules/OrchardCore.Liquid/ScriptsMiddleware.cs @@ -32,6 +32,7 @@ public async Task Invoke(HttpContext httpContext) if (v.Contains(_etag)) { httpContext.Response.StatusCode = StatusCodes.Status304NotModified; + return; } } @@ -57,10 +58,13 @@ public async Task Invoke(HttpContext httpContext) httpContext.Response.Headers[HeaderNames.CacheControl] = cacheControl; httpContext.Response.Headers[HeaderNames.ContentType] = "application/javascript"; httpContext.Response.Headers[HeaderNames.ETag] = _etag; - await httpContext.Response.Body.WriteAsync(_bytes, httpContext?.RequestAborted ?? CancellationToken.None); + + await httpContext.Response.Body.WriteAsync(_bytes, httpContext.RequestAborted); + return; } } + await _next.Invoke(httpContext); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Liquid/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Liquid/Startup.cs index 4aec1a89aac..2491270ca6a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Liquid/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Liquid/Startup.cs @@ -9,7 +9,7 @@ using OrchardCore.ContentManagement; using OrchardCore.ContentManagement.Display.ContentDisplay; using OrchardCore.Data.Migration; -using OrchardCore.DisplayManagement.Descriptors; +using OrchardCore.DisplayManagement; using OrchardCore.DisplayManagement.Liquid.Filters; using OrchardCore.Indexing; using OrchardCore.Liquid.Drivers; @@ -85,7 +85,7 @@ public sealed class LiquidPartStartup : StartupBase public override void ConfigureServices(IServiceCollection services) { // Liquid Part - services.AddScoped(); + services.AddShapeTableProvider(); services.AddContentPart() .UseDisplayDriver() .AddHandler(); diff --git a/src/OrchardCore.Modules/OrchardCore.Lists/Drivers/ListPartDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.Lists/Drivers/ListPartDisplayDriver.cs index 9ad53a59351..d4bd1c0a7e4 100644 --- a/src/OrchardCore.Modules/OrchardCore.Lists/Drivers/ListPartDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.Lists/Drivers/ListPartDisplayDriver.cs @@ -49,6 +49,7 @@ public override IDisplayResult Display(ListPart listPart, BuildPartDisplayContex InitializeDisplayListPartDisplayShape(listPart, context), InitializeDisplayListPartDetailAdminShape(listPart, context), InitializeDisplayListPartNavigationAdminShape(listPart, context, settings), + InitializeDisplayListPartDetailAdminSearchPanelShape(), InitializeDisplayListPartHeaderAdminShape(listPart, settings), InitializeDisplayListPartSummaryAdmin(listPart) ); @@ -134,6 +135,17 @@ private ShapeResult InitializeDisplayListPartDetailAdminShape(ListPart listPart, })) .Location("DetailAdmin", "Content:10"); } + private ShapeResult InitializeDisplayListPartDetailAdminSearchPanelShape() + { + return Initialize("ListPartDetailAdminSearchPanel", async model => + { + var listPartFilterViewModel = new ListPartFilterViewModel(); + await _updateModelAccessor.ModelUpdater.TryUpdateModelAsync(listPartFilterViewModel, Prefix); + + model.ListPartFilterViewModel = listPartFilterViewModel; + + }).Location("DetailAdmin", "Content:5"); + } private ShapeResult InitializeDisplayListPartDisplayShape(ListPart listPart, BuildPartDisplayContext context) { diff --git a/src/OrchardCore.Modules/OrchardCore.Lists/Indexes/ContainedPartIndex.cs b/src/OrchardCore.Modules/OrchardCore.Lists/Indexes/ContainedPartIndex.cs index 2d77b5f3103..e69a1b709e9 100644 --- a/src/OrchardCore.Modules/OrchardCore.Lists/Indexes/ContainedPartIndex.cs +++ b/src/OrchardCore.Modules/OrchardCore.Lists/Indexes/ContainedPartIndex.cs @@ -6,6 +6,8 @@ namespace OrchardCore.Lists.Indexes; public class ContainedPartIndex : MapIndex { + public const int MaxDisplayTextSize = 255; + public string ListContentItemId { get; set; } public int Order { get; set; } @@ -40,7 +42,7 @@ public override void Describe(DescribeContext context) return null; } - return new ContainedPartIndex + var containedPartIndex = new ContainedPartIndex { ContentItemId = contentItem.ContentItemId, ListContentType = containedPart.ListContentType, @@ -48,8 +50,18 @@ public override void Describe(DescribeContext context) Order = containedPart.Order, Published = contentItem.Published, Latest = contentItem.Latest, - DisplayText = contentItem.DisplayText, }; + + if (containedPartIndex.DisplayText?.Length > ContainedPartIndex.MaxDisplayTextSize) + { + containedPartIndex.DisplayText = contentItem.DisplayText[..ContainedPartIndex.MaxDisplayTextSize]; + } + else + { + containedPartIndex.DisplayText = contentItem.DisplayText; + } + + return containedPartIndex; }); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Lists/Migrations.cs b/src/OrchardCore.Modules/OrchardCore.Lists/Migrations.cs index 9f0dddf6467..7b552d74fac 100644 --- a/src/OrchardCore.Modules/OrchardCore.Lists/Migrations.cs +++ b/src/OrchardCore.Modules/OrchardCore.Lists/Migrations.cs @@ -25,7 +25,7 @@ await _contentDefinitionManager.AlterPartDefinitionAsync("ListPart", builder => await SchemaBuilder.CreateMapIndexTableAsync(table => table .Column("ContentItemId", column => column.WithLength(26)) .Column("ListContentItemId", column => column.WithLength(26)) - .Column("DisplayText") + .Column("DisplayText", column => column.WithLength(ContainedPartIndex.MaxDisplayTextSize)) .Column("Order") .Column("ListContentType") .Column("Published") @@ -84,7 +84,7 @@ await SchemaBuilder.AlterIndexTableAsync(table => table ); await SchemaBuilder.AlterIndexTableAsync(table => table - .AddColumn("DisplayText") + .AddColumn("DisplayText", column => column.WithLength(ContainedPartIndex.MaxDisplayTextSize)) ); await SchemaBuilder.AlterIndexTableAsync(table => table diff --git a/src/OrchardCore.Modules/OrchardCore.Lists/Views/ListPartDetailAdmin.cshtml b/src/OrchardCore.Modules/OrchardCore.Lists/Views/ListPartDetailAdmin.cshtml index 64157790c6d..1eab4391aa4 100644 --- a/src/OrchardCore.Modules/OrchardCore.Lists/Views/ListPartDetailAdmin.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Lists/Views/ListPartDetailAdmin.cshtml @@ -1,13 +1,5 @@ -@using OrchardCore.Contents -@using OrchardCore.Lists.ViewModels -@using System.Globalization -@using OrchardCore.Localization -@using Microsoft.AspNetCore.Authorization @model OrchardCore.Lists.ViewModels.ListPartViewModel - @inject OrchardCore.ContentManagement.Display.IContentItemDisplayManager ContentItemDisplayManager -@inject OrchardCore.ContentManagement.IContentManager ContentManager -@inject Microsoft.AspNetCore.Authorization.IAuthorizationService AuthorizationService @{ var enableOrdering = Model.EnableOrdering && @@ -19,28 +11,7 @@ { } - - var authorizedContentTypeDefinitions = new List(); - - foreach (var contentTypeDefinition in Model.ContainedContentTypeDefinitions) - { - if (await AuthorizationService.AuthorizeAsync( - User, - CommonPermissions.EditContent, - await ContentManager.NewAsync(contentTypeDefinition.Name))) - { - authorizedContentTypeDefinitions.Add(contentTypeDefinition); - } - } - var dropdownClassList = new List() - { - "dropdown-menu" - }; - - if (CultureInfo.CurrentUICulture.IsRightToLeft()) - { - dropdownClassList.Add("dropdown-menu-start"); - } + } @if (!Model.ContainedContentTypeDefinitions.Any()) { @@ -50,30 +21,6 @@ } else { -
-
-
-
-
-
- - - - - -
-
-
-
-
-
@if (Model.ContentItems.Any()) { diff --git a/src/OrchardCore.Modules/OrchardCore.Lists/Views/ListPartDetailAdminSearchPanel.cshtml b/src/OrchardCore.Modules/OrchardCore.Lists/Views/ListPartDetailAdminSearchPanel.cshtml new file mode 100644 index 00000000000..5dd74af4b96 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Lists/Views/ListPartDetailAdminSearchPanel.cshtml @@ -0,0 +1,37 @@ +@using System.Globalization +@using Microsoft.AspNetCore.Mvc.TagHelpers +@using OrchardCore.Lists.ViewModels +@using OrchardCore.Localization + +@model OrchardCore.Lists.ViewModels.ListPartViewModel + +@{ + var dropdownClassList = CultureInfo.CurrentUICulture.IsRightToLeft() + ? "dropdown-menu dropdown-menu-start" + : "dropdown-menu"; +} + +
+
+
+
+
+
+ +
+ @* Latest not surfaced here to be consistent with the main content items list filter. *@ + @T["Only draft items"] + @T["Only published items"] + @T["Owned by me"] +
+ + + +
+
+
+
+
+
diff --git a/src/OrchardCore.Modules/OrchardCore.Lists/Views/ListPartNavigationAdmin.cshtml b/src/OrchardCore.Modules/OrchardCore.Lists/Views/ListPartNavigationAdmin.cshtml index f048b58392b..c9b8b56e008 100644 --- a/src/OrchardCore.Modules/OrchardCore.Lists/Views/ListPartNavigationAdmin.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Lists/Views/ListPartNavigationAdmin.cshtml @@ -2,9 +2,20 @@ @using OrchardCore.ContentManagement @using OrchardCore.Contents @model OrchardCore.Lists.ViewModels.ListPartNavigationAdminViewModel -@inject OrchardCore.ContentManagement.IContentManager ContentManager -@inject Microsoft.AspNetCore.Authorization.IAuthorizationService AuthorizationService - +@inject IContentManager ContentManager +@inject IAuthorizationService AuthorizationService +@{ + var authorizedContentTypeDefinitions = new List(); + foreach (var contentTypeDefinition in Model.ContainedContentTypeDefinitions) + { + if (!await AuthorizationService.AuthorizeAsync(User, CommonPermissions.EditContent, await ContentManager.NewAsync(contentTypeDefinition.Name))) + { + continue; + } + + authorizedContentTypeDefinitions.Add(contentTypeDefinition); + } +}
@@ -21,9 +32,9 @@ } - @if (Model.ContainedContentTypeDefinitions.Length == 1) + @if (authorizedContentTypeDefinitions.Count == 1) { - var contentTypeDefinition = Model.ContainedContentTypeDefinitions[0]; + var contentTypeDefinition = authorizedContentTypeDefinitions.FirstOrDefault(); if (await AuthorizationService.AuthorizeContentTypeAsync(User, CommonPermissions.EditContent, contentTypeDefinition, User.Identity.Name)) { @@ -32,13 +43,13 @@ } } - else if (Model.ContainedContentTypeDefinitions.Length > 1) + else if (authorizedContentTypeDefinitions.Count > 1) {