Skip to content

Commit

Permalink
Merge branch 'main' into hishamco/poparser-perf
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamco authored Aug 7, 2024
2 parents 2270907 + ecfd665 commit 612f311
Show file tree
Hide file tree
Showing 637 changed files with 6,304 additions and 6,448 deletions.
56 changes: 28 additions & 28 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,56 +12,56 @@

<ItemGroup>
<PackageVersion Include="AngleSharp" Version="1.1.2" />
<PackageVersion Include="AWSSDK.S3" Version="3.7.310.2" />
<PackageVersion Include="AWSSDK.S3" Version="3.7.400.2" />
<PackageVersion Include="AWSSDK.Extensions.NETCore.Setup" Version="3.7.301" />
<PackageVersion Include="Azure.Communication.Email" Version="1.0.1" />
<PackageVersion Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.3.1" />
<PackageVersion Include="Azure.Extensions.AspNetCore.DataProtection.Blobs" Version="1.3.4" />
<PackageVersion Include="Azure.Identity" Version="1.12.0" />
<PackageVersion Include="Azure.Search.Documents" Version="11.5.1" />
<PackageVersion Include="Azure.Storage.Blobs" Version="12.20.0" />
<PackageVersion Include="Azure.Search.Documents" Version="11.6.0" />
<PackageVersion Include="Azure.Storage.Blobs" Version="12.21.1" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.12" />
<PackageVersion Include="Castle.Core" Version="5.1.1" />
<PackageVersion Include="DocumentFormat.OpenXml" Version="3.0.2" />
<PackageVersion Include="Fluid.Core" Version="2.10.0" />
<PackageVersion Include="DocumentFormat.OpenXml" Version="3.1.0" />
<PackageVersion Include="Fluid.Core" Version="2.11.1" />
<PackageVersion Include="GraphQL" Version="7.8.0" />
<PackageVersion Include="GraphQL.DataLoader" Version="7.8.0" />
<PackageVersion Include="GraphQL.MicrosoftDI" Version="7.8.0" />
<PackageVersion Include="GraphQL.SystemTextJson" Version="7.8.0" />
<PackageVersion Include="Jint" Version="3.1.4" />
<PackageVersion Include="JsonPath.Net" Version="1.1.2" />
<PackageVersion Include="HtmlSanitizer" Version="8.1.860-beta" />
<PackageVersion Include="Jint" Version="4.0.0" />
<PackageVersion Include="JsonPath.Net" Version="1.1.3" />
<PackageVersion Include="HtmlSanitizer" Version="8.2.871-beta" />
<PackageVersion Include="Irony" Version="1.5.1" />
<PackageVersion Include="libphonenumber-csharp" Version="8.13.40" />
<PackageVersion Include="libphonenumber-csharp" Version="8.13.42" />
<PackageVersion Include="Lorem.Universal.NET" Version="4.0.80" />
<PackageVersion Include="Lucene.Net" Version="4.8.0-beta00016" />
<PackageVersion Include="Lucene.Net.Analysis.Common" Version="4.8.0-beta00016" />
<PackageVersion Include="Lucene.Net.QueryParser" Version="4.8.0-beta00016" />
<PackageVersion Include="Lucene.Net.Spatial" Version="4.8.0-beta00016" />
<PackageVersion Include="MailKit" Version="4.7.0" />
<PackageVersion Include="MailKit" Version="4.7.1.1" />
<PackageVersion Include="Markdig" Version="0.37.0" />
<PackageVersion Include="MessagePack" Version="2.2.60" />
<PackageVersion Include="Microsoft.Extensions.Azure" Version="1.7.4" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="8.6.0" />
<PackageVersion Include="Microsoft.Identity.Web" Version="2.20.0" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="8.7.0" />
<PackageVersion Include="Microsoft.Identity.Web" Version="3.0.1" />

<!--
Important: the version of the Microsoft.IdentityModel.Protocols.OpenIdConnect package MUST
match the IdentityModel version transitively referenced by OpenIddict to ensure we don't
accidentally end up referencing inconsistent versions (which is not supported by IM).
See https://github.com/OrchardCMS/OrchardCore/pull/16057 for more information.
-->

<PackageVersion Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="7.6.2" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="MimeKit" Version="4.7.0" />
<PackageVersion Include="MimeKit" Version="4.7.1" />
<PackageVersion Include="MiniProfiler.AspNetCore.Mvc" Version="4.3.8" />
<PackageVersion Include="Moq" Version="4.20.70" />
<PackageVersion Include="ncrontab" Version="3.3.3" />
<PackageVersion Include="NEST" Version="7.17.5" />
<PackageVersion Include="NJsonSchema" Version="11.0.1" />
<PackageVersion Include="NJsonSchema" Version="11.0.2" />
<PackageVersion Include="NLog.Web.AspNetCore" Version="5.3.11" />
<PackageVersion Include="NodaTime" Version="3.1.11" />
<PackageVersion Include="OpenIddict.Core" Version="5.7.0" />
Expand All @@ -72,23 +72,23 @@
<PackageVersion Include="OpenIddict.Validation.SystemNetHttp" Version="5.7.0" />
<PackageVersion Include="OrchardCore.Translations.All" Version="1.8.0" />
<PackageVersion Include="PdfPig" Version="0.1.8" />
<PackageVersion Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageVersion Include="Shortcodes" Version="1.3.3" />
<PackageVersion Include="SixLabors.ImageSharp.Web" Version="3.1.2" />
<PackageVersion Include="SixLabors.ImageSharp.Web.Providers.Azure" Version="3.1.2" />
<PackageVersion Include="SixLabors.ImageSharp.Web.Providers.AWS" Version="3.1.2" />
<PackageVersion Include="Serilog.AspNetCore" Version="8.0.2" />
<PackageVersion Include="Shortcodes" Version="1.3.4" />
<PackageVersion Include="SixLabors.ImageSharp.Web" Version="3.1.3" />
<PackageVersion Include="SixLabors.ImageSharp.Web.Providers.Azure" Version="3.1.3" />
<PackageVersion Include="SixLabors.ImageSharp.Web.Providers.AWS" Version="3.1.3" />
<PackageVersion Include="StackExchange.Redis" Version="2.8.0" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.1.118" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="System.IO.Hashing" Version="8.0.0" />
<PackageVersion Include="xunit" Version="2.8.1" />
<PackageVersion Include="xunit.analyzers" Version="1.14.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.1" />
<PackageVersion Include="YesSql" Version="5.0.0" />
<PackageVersion Include="YesSql.Abstractions" Version="5.0.0" />
<PackageVersion Include="YesSql.Core" Version="5.0.0" />
<PackageVersion Include="YesSql.Filters.Abstractions" Version="5.0.0" />
<PackageVersion Include="YesSql.Filters.Query" Version="5.0.0" />
<PackageVersion Include="xunit" Version="2.9.0" />
<PackageVersion Include="xunit.analyzers" Version="1.15.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="YesSql" Version="5.1.1" />
<PackageVersion Include="YesSql.Abstractions" Version="5.1.1" />
<PackageVersion Include="YesSql.Core" Version="5.1.1" />
<PackageVersion Include="YesSql.Filters.Abstractions" Version="5.1.1" />
<PackageVersion Include="YesSql.Filters.Query" Version="5.1.1" />
<PackageVersion Include="ZString" Version="2.6.0" />
</ItemGroup>

Expand Down
7 changes: 7 additions & 0 deletions OrchardCore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Email.Smtp", "s
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Rules.Core", "src\OrchardCore\OrchardCore.Rules.Core\OrchardCore.Rules.Core.csproj", "{4BAA08A2-878C-4B96-86BF-5B3DB2B6C2C7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrchardCore.Queries.Core", "src\OrchardCore\OrchardCore.Queries.Core\OrchardCore.Queries.Core.csproj", "{61B358F2-702C-40AA-9DF7-7121248FE6DE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1383,6 +1385,10 @@ Global
{4BAA08A2-878C-4B96-86BF-5B3DB2B6C2C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4BAA08A2-878C-4B96-86BF-5B3DB2B6C2C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4BAA08A2-878C-4B96-86BF-5B3DB2B6C2C7}.Release|Any CPU.Build.0 = Release|Any CPU
{61B358F2-702C-40AA-9DF7-7121248FE6DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1622,6 +1628,7 @@ Global
{C35AB37B-5A09-4896-BEEE-B126B7E7018A} = {A066395F-6F73-45DC-B5A6-B4E306110DCE}
{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}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {46A1D25A-78D1-4476-9CBF-25B75E296341}
Expand Down
5 changes: 4 additions & 1 deletion src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk.Web">
<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk.Web">

<!-- Necessary as we reference the Project and not the Package -->
<Import Project="..\OrchardCore\OrchardCore.Application.Cms.Core.Targets\OrchardCore.Application.Cms.Core.Targets.props" />
Expand All @@ -10,6 +10,9 @@
<RazorRuntimeCompilation>false</RazorRuntimeCompilation>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<!-- With this GUID, user secrets can be added with "dotnet user-secrets set key value" without further changes in
git. See an example use-case at https://docs.orchardcore.net/en/latest/reference/modules/AutoSetup/. -->
<UserSecretsId>2cfccf50-2ae4-4017-bbd7-a0e453cbf713</UserSecretsId>
</PropertyGroup>
<!-- For Unit Tests-->
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@

namespace OrchardCore.Admin.Drivers
{
public class AdminSiteSettingsDisplayDriver : SectionDisplayDriver<ISite, AdminSettings>
public sealed class AdminSiteSettingsDisplayDriver : SiteDisplayDriver<AdminSettings>
{
public const string GroupId = "admin";

private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IAuthorizationService _authorizationService;

Expand All @@ -25,7 +26,10 @@ public AdminSiteSettingsDisplayDriver(
_authorizationService = authorizationService;
}

public override async Task<IDisplayResult> EditAsync(AdminSettings settings, BuildEditorContext context)
protected override string SettingsGroupId
=> GroupId;

public override async Task<IDisplayResult> EditAsync(ISite site, AdminSettings settings, BuildEditorContext context)
{
var user = _httpContextAccessor.HttpContext?.User;

Expand All @@ -40,10 +44,11 @@ public override async Task<IDisplayResult> EditAsync(AdminSettings settings, Bui
model.DisplayMenuFilter = settings.DisplayMenuFilter;
model.DisplayNewMenu = settings.DisplayNewMenu;
model.DisplayTitlesInTopbar = settings.DisplayTitlesInTopbar;
}).Location("Content:3").OnGroup(GroupId);
}).Location("Content:3")
.OnGroup(SettingsGroupId);
}

public override async Task<IDisplayResult> UpdateAsync(AdminSettings settings, UpdateEditorContext context)
public override async Task<IDisplayResult> UpdateAsync(ISite site, AdminSettings settings, UpdateEditorContext context)
{
var user = _httpContextAccessor.HttpContext?.User;

Expand All @@ -52,19 +57,16 @@ public override async Task<IDisplayResult> UpdateAsync(AdminSettings settings, U
return null;
}

if (context.GroupId.Equals(GroupId, StringComparison.OrdinalIgnoreCase))
{
var model = new AdminSettingsViewModel();
var model = new AdminSettingsViewModel();

await context.Updater.TryUpdateModelAsync(model, Prefix);
await context.Updater.TryUpdateModelAsync(model, Prefix);

settings.DisplayThemeToggler = model.DisplayThemeToggler;
settings.DisplayMenuFilter = model.DisplayMenuFilter;
settings.DisplayNewMenu = model.DisplayNewMenu;
settings.DisplayTitlesInTopbar = model.DisplayTitlesInTopbar;
}
settings.DisplayThemeToggler = model.DisplayThemeToggler;
settings.DisplayMenuFilter = model.DisplayMenuFilter;
settings.DisplayNewMenu = model.DisplayNewMenu;
settings.DisplayTitlesInTopbar = model.DisplayTitlesInTopbar;

return await EditAsync(settings, context);
return await EditAsync(site, settings, context);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

namespace OrchardCore.Admin.Drivers;

public class VisitSiteNavbarDisplayDriver : DisplayDriver<Navbar>
public sealed class VisitSiteNavbarDisplayDriver : DisplayDriver<Navbar>
{
public override IDisplayResult Display(Navbar model)
public override IDisplayResult Display(Navbar model, BuildDisplayContext context)
{
return View("VisitSiteNavbarItem", model)
.Location("DetailAdmin", "Content:20");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,19 @@

namespace OrchardCore.AdminDashboard.Drivers
{
public class DashboardContentDisplayDriver : ContentDisplayDriver
public sealed class DashboardContentDisplayDriver : ContentDisplayDriver
{
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IAuthorizationService _authorizationService;
private readonly IContentManager _contentManager;


public DashboardContentDisplayDriver(IHttpContextAccessor httpContextAccessor,
IAuthorizationService authorizationService,
IContentManager contentManager)
{
_httpContextAccessor = httpContextAccessor;
_authorizationService = authorizationService;
_contentManager = contentManager;

}

public override async Task<IDisplayResult> DisplayAsync(ContentItem model, BuildDisplayContext context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OrchardCore.AdminDashboard.Drivers
{
public class DashboardPartDisplayDriver : ContentPartDisplayDriver<DashboardPart>
public sealed class DashboardPartDisplayDriver : ContentPartDisplayDriver<DashboardPart>
{
public override Task<IDisplayResult> DisplayAsync(DashboardPart part, BuildPartDisplayContext context)
{
Expand All @@ -20,9 +20,13 @@ public override IDisplayResult Edit(DashboardPart dashboardPart, BuildPartEditor
return Initialize<DashboardPartViewModel>(GetEditorShapeType(context), m => BuildViewModel(m, dashboardPart));
}

public override async Task<IDisplayResult> UpdateAsync(DashboardPart model, IUpdateModel updater, UpdatePartEditorContext context)
public override async Task<IDisplayResult> UpdateAsync(DashboardPart model, UpdatePartEditorContext context)
{
await updater.TryUpdateModelAsync(model, Prefix, t => t.Position, t => t.Width, t => t.Height);
await context.Updater.TryUpdateModelAsync(model, Prefix,
t => t.Position,
t => t.Width,
t => t.Height);

return Edit(model, context);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
using System.Threading.Tasks;
using OrchardCore.AdminMenu.Services;
using OrchardCore.DisplayManagement.Handlers;
using OrchardCore.DisplayManagement.ModelBinding;
using OrchardCore.DisplayManagement.Views;
using OrchardCore.Navigation;

namespace OrchardCore.AdminMenu.AdminNodes
{
public class LinkAdminNodeDriver : DisplayDriver<MenuItem, LinkAdminNode>
public sealed class LinkAdminNodeDriver : DisplayDriver<MenuItem, LinkAdminNode>
{
private readonly IAdminMenuPermissionService _adminMenuPermissionService;

Expand All @@ -18,15 +17,15 @@ public LinkAdminNodeDriver(IAdminMenuPermissionService adminMenuPermissionServic
_adminMenuPermissionService = adminMenuPermissionService;
}

public override IDisplayResult Display(LinkAdminNode treeNode)
public override Task<IDisplayResult> DisplayAsync(LinkAdminNode treeNode, BuildDisplayContext context)
{
return Combine(
return CombineAsync(
View("LinkAdminNode_Fields_TreeSummary", treeNode).Location("TreeSummary", "Content"),
View("LinkAdminNode_Fields_TreeThumbnail", treeNode).Location("TreeThumbnail", "Content")
);
}

public override IDisplayResult Edit(LinkAdminNode treeNode)
public override IDisplayResult Edit(LinkAdminNode treeNode, BuildEditorContext context)
{
return Initialize<LinkAdminNodeViewModel>("LinkAdminNode_Fields_TreeEdit", async model =>
{
Expand Down Expand Up @@ -54,24 +53,31 @@ public override IDisplayResult Edit(LinkAdminNode treeNode)
}).Location("Content");
}

public override async Task<IDisplayResult> UpdateAsync(LinkAdminNode treeNode, IUpdateModel updater)
public override async Task<IDisplayResult> UpdateAsync(LinkAdminNode treeNode, UpdateEditorContext context)
{
var model = new LinkAdminNodeViewModel();
await updater.TryUpdateModelAsync(model, Prefix, x => x.LinkUrl, x => x.LinkText, x => x.Target, x => x.IconClass, x => x.SelectedPermissionNames);
await context.Updater.TryUpdateModelAsync(model, Prefix,
x => x.LinkUrl,
x => x.LinkText,
x => x.Target,
x => x.IconClass,
x => x.SelectedPermissionNames);

treeNode.LinkText = model.LinkText;
treeNode.LinkUrl = model.LinkUrl;
treeNode.Target = model.Target;
treeNode.IconClass = model.IconClass;

var selectedPermissions = (model.SelectedPermissionNames == null ? [] : model.SelectedPermissionNames.Split(',', StringSplitOptions.RemoveEmptyEntries));
var selectedPermissions = model.SelectedPermissionNames == null
? []
: model.SelectedPermissionNames.Split(',', StringSplitOptions.RemoveEmptyEntries);

var permissions = await _adminMenuPermissionService.GetPermissionsAsync();
treeNode.PermissionNames = permissions
.Where(p => selectedPermissions.Contains(p.Name))
.Select(p => p.Name).ToArray();

return Edit(treeNode);
return Edit(treeNode, context);
}
}
}
Loading

0 comments on commit 612f311

Please sign in to comment.