Skip to content

Commit 4fc8dc8

Browse files
authored
Merge branch 'main' into hishamco/data-context-const
2 parents 91ef38f + a477f5b commit 4fc8dc8

116 files changed

Lines changed: 3645 additions & 862 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3538,6 +3538,15 @@
35383538
"contributions": [
35393539
"code"
35403540
]
3541+
},
3542+
{
3543+
"login": "ahlxjg",
3544+
"name": "Jack Liu",
3545+
"avatar_url": "https://avatars.githubusercontent.com/u/28708286?v=4",
3546+
"profile": "https://github.com/ahlxjg",
3547+
"contributions": [
3548+
"code"
3549+
]
35413550
}
35423551
],
35433552
"skipCi": true,

.github/workflows/community_metrics.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
Write-Output "LAST_MONTH=$firstDay..$lastDay" >> $env:GITHUB_ENV
3131

3232
- name: Compute Issue Metrics
33-
uses: github/issue-metrics@6a35322ff89cee3e1a594d282c27eb34bffa9174 # v4.1.1
33+
uses: github/issue-metrics@326551a377784dd5dd766944c9a87289550e7eb5 # v4.1.2
3434
env:
3535
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3636
SEARCH_QUERY: 'repo:OrchardCMS/OrchardCore is:issue created:${{ env.LAST_MONTH }} -reason:"not planned" -label:"community metrics"'
@@ -43,7 +43,7 @@ jobs:
4343
Add-Content -Path ./community_metrics.md -Value (Get-Content -Path ./issue_metrics.md -Raw)
4444
4545
- name: Compute Pull Request Metrics
46-
uses: github/issue-metrics@6a35322ff89cee3e1a594d282c27eb34bffa9174 # v4.1.1
46+
uses: github/issue-metrics@326551a377784dd5dd766944c9a87289550e7eb5 # v4.1.2
4747
env:
4848
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4949
SEARCH_QUERY: 'repo:OrchardCMS/OrchardCore is:pr created:${{ env.LAST_MONTH }} -label:dontmerge -label:notready -is:draft'
@@ -56,7 +56,7 @@ jobs:
5656
Add-Content -Path ./community_metrics.md -Value ([Environment]::NewLine + $content)
5757
5858
- name: Compute Q&A Discussion Request Metrics
59-
uses: github/issue-metrics@6a35322ff89cee3e1a594d282c27eb34bffa9174 # v4.1.1
59+
uses: github/issue-metrics@326551a377784dd5dd766944c9a87289550e7eb5 # v4.1.2
6060
env:
6161
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6262
SEARCH_QUERY: 'repo:OrchardCMS/OrchardCore type:discussions created:${{ env.LAST_MONTH }} category:Q&A'

.github/workflows/preview_ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,6 @@ jobs:
7777
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data -Recurse | Remove-Item -Recurse -Confirm:$false
7878
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data_Tests -Recurse | Remove-Item -Recurse -Confirm:$false
7979
$output = [System.IO.Path]::GetFullPath("./.build/release")
80-
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net10.0
80+
dotnet publish src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj -c Release --property:PublishDir=$output --no-build --framework net10.0
8181
docker buildx build -f Dockerfile-CI --platform=linux/amd64 -t orchardproject/orchardcore-cms-linux:dev --push .
8282
docker buildx build -f Dockerfile-CI --platform=windows/amd64 -t orchardproject/orchardcore-cms-windows:dev --push .

.github/workflows/release_ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ jobs:
7979
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data -Recurse | Remove-Item -Recurse -Confirm:$false
8080
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data_Tests -Recurse | Remove-Item -Recurse -Confirm:$false
8181
$output = [System.IO.Path]::GetFullPath("./.build/release")
82-
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net10.0
82+
dotnet publish src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj -c Release --property:PublishDir=$output --no-build --framework net10.0
8383
docker buildx build -f Dockerfile-CI --platform=linux/amd64 -t orchardproject/orchardcore-cms-linux:latest -t orchardproject/orchardcore-cms-linux:${{ steps.get_version.outputs.VERSION }} --push .
8484
docker buildx build -f Dockerfile-CI --platform=windows/amd64 -t orchardproject/orchardcore-cms-windows:latest -t orchardproject/orchardcore-cms-windows:${{ steps.get_version.outputs.VERSION }} --push .
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const translations: Record<string, string> = {};
2+
3+
/**
4+
* Returns the current translations record.
5+
*/
6+
export function getTranslations(): Record<string, string> {
7+
return translations;
8+
}
9+
10+
/**
11+
* Merges the given translations into the store.
12+
*/
13+
export function setTranslations(t: Record<string, string>): void {
14+
Object.assign(translations, t);
15+
}

Directory.Packages.props

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
</PropertyGroup>
66
<ItemGroup>
77
<PackageVersion Include="AngleSharp" Version="1.4.0" />
8-
<PackageVersion Include="AWSSDK.S3" Version="4.0.19" />
9-
<PackageVersion Include="AWSSDK.Extensions.NETCore.Setup" Version="4.0.3.25" />
8+
<PackageVersion Include="AWSSDK.S3" Version="4.0.19.1" />
9+
<PackageVersion Include="AWSSDK.Extensions.NETCore.Setup" Version="4.0.3.26" />
1010
<PackageVersion Include="Azure.Communication.Email" Version="1.1.0" />
1111
<PackageVersion Include="Azure.Communication.Sms" Version="1.0.2" />
1212
<PackageVersion Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.5.0" />
@@ -16,8 +16,8 @@
1616
<PackageVersion Include="Azure.Storage.Blobs" Version="12.27.0" />
1717
<PackageVersion Include="BenchmarkDotNet" Version="0.15.8" />
1818
<PackageVersion Include="Castle.Core" Version="5.2.1" />
19-
<PackageVersion Include="DocumentFormat.OpenXml" Version="3.4.1" />
20-
<PackageVersion Include="Elastic.Clients.Elasticsearch" Version="8.19.16" />
19+
<PackageVersion Include="DocumentFormat.OpenXml" Version="3.5.1" />
20+
<PackageVersion Include="Elastic.Clients.Elasticsearch" Version="8.19.17" />
2121
<PackageVersion Include="Fluid.Core" Version="2.31.0" />
2222
<PackageVersion Include="GraphQL" Version="8.8.4" />
2323
<PackageVersion Include="GraphQL.DataLoader" Version="8.8.4" />
@@ -38,7 +38,7 @@
3838
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="5.3.0" />
3939
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.3.0" />
4040
<PackageVersion Include="Microsoft.Extensions.Azure" Version="1.13.1" />
41-
<PackageVersion Include="Microsoft.Identity.Web" Version="4.5.0" />
41+
<PackageVersion Include="Microsoft.Identity.Web" Version="4.6.0" />
4242
<PackageVersion Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.16.0" />
4343
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
4444
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
@@ -61,7 +61,7 @@
6161
<PackageVersion Include="SixLabors.ImageSharp.Web" Version="3.2.0" />
6262
<PackageVersion Include="SixLabors.ImageSharp.Web.Providers.Azure" Version="3.2.0" />
6363
<PackageVersion Include="SixLabors.ImageSharp.Web.Providers.AWS" Version="3.2.0" />
64-
<PackageVersion Include="StackExchange.Redis" Version="2.12.1" />
64+
<PackageVersion Include="StackExchange.Redis" Version="2.12.4" />
6565
<PackageVersion Include="StyleCop.Analyzers" Version="1.1.118" />
6666
<PackageVersion Include="xunit.v3.mtp-v2" Version="3.2.2" />
6767
<PackageVersion Include="YesSql" Version="5.4.7" />

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ nav:
268268
- HTTPS: reference/modules/Https/README.md
269269
- Key Vault (Azure): reference/modules/KeyVault.Azure/README.md
270270
- Localization: reference/modules/Localize/README.md
271+
- JavaScript Localization: reference/modules/Localize/javascript-localization.md
271272
- Data Localization: reference/modules/DataLocalization/README.md
272273
- Logging Serilog: reference/modules/Logging.Serilog/README.md
273274
- Mini Profiler: reference/modules/MiniProfiler/README.md
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using System.Collections.Concurrent;
2+
using OrchardCore.DisplayManagement.Utilities;
3+
4+
namespace OrchardCore.Alias.Services;
5+
6+
/// <summary>
7+
/// Provides cached alternate patterns for Content shapes with Alias.
8+
/// Alternates are computed once per unique alias and display type combination and cached for reuse.
9+
/// </summary>
10+
internal static class AliasAlternatesFactory
11+
{
12+
private static readonly ConcurrentDictionary<AliasAlternatesCacheKey, string[]> _cache = new();
13+
14+
/// <summary>
15+
/// Gets or creates cached alternates for a Content shape with Alias configuration.
16+
/// </summary>
17+
public static string[] GetAlternates(string alias, string displayType)
18+
{
19+
var key = new AliasAlternatesCacheKey(alias, displayType);
20+
return _cache.GetOrAdd(key, BuildAlternates);
21+
}
22+
23+
private static string[] BuildAlternates(AliasAlternatesCacheKey key)
24+
{
25+
var encodedAlias = key.Alias.EncodeAlternateElement();
26+
27+
return
28+
[
29+
// Content__Alias__[Alias] e.g. Content-Alias-example, Content-Alias-my-page
30+
$"Content__Alias__{encodedAlias}",
31+
32+
// Content_[DisplayType]__Alias__[Alias] e.g. Content-Alias-example.Summary, Content-Alias-my-page.Summary
33+
$"Content_{key.DisplayType}__Alias__{encodedAlias}"
34+
];
35+
}
36+
37+
internal readonly record struct AliasAlternatesCacheKey(
38+
string Alias,
39+
string DisplayType);
40+
}

src/OrchardCore.Modules/OrchardCore.Alias/Services/ContentAliasShapeTableProvider.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ public override ValueTask DiscoverAsync(ShapeTableBuilder builder)
2020

2121
if (aliasPart != null)
2222
{
23-
var encodedAlias = aliasPart.Alias.EncodeAlternateElement();
23+
var displayType = displaying.Shape.Metadata.DisplayType;
2424

25-
// Content__Alias__[Alias] e.g. Content-Alias-example, Content-Alias-my-page
26-
displaying.Shape.Metadata.Alternates.Add("Content__Alias__" + encodedAlias);
25+
// Get cached alternates and add them efficiently
26+
var cachedAlternates = AliasAlternatesFactory.GetAlternates(
27+
aliasPart.Alias,
28+
displayType);
2729

28-
// Content_[DisplayType]__Alias__[Alias] e.g. Content-Alias-example.Summary, Content-Alias-my-page.Summary
29-
displaying.Shape.Metadata.Alternates.Add("Content_" + displaying.Shape.Metadata.DisplayType + "__Alias__" + encodedAlias);
30+
displaying.Shape.Metadata.Alternates.AddRange(cachedAlternates);
3031
}
3132
});
3233

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using System.Collections.Concurrent;
2+
using OrchardCore.DisplayManagement.Utilities;
3+
4+
namespace OrchardCore.Alias.Services;
5+
6+
/// <summary>
7+
/// Provides cached alternate patterns for Widget shapes with Alias.
8+
/// Alternates are computed once per unique alias and display type combination and cached for reuse.
9+
/// </summary>
10+
internal static class WidgetAliasAlternatesFactory
11+
{
12+
private static readonly ConcurrentDictionary<WidgetAliasAlternatesCacheKey, string[]> _cache = new();
13+
14+
/// <summary>
15+
/// Gets or creates cached alternates for a Widget shape with Alias configuration.
16+
/// </summary>
17+
public static string[] GetAlternates(string alias, string displayType)
18+
{
19+
var key = new WidgetAliasAlternatesCacheKey(alias, displayType);
20+
return _cache.GetOrAdd(key, BuildAlternates);
21+
}
22+
23+
private static string[] BuildAlternates(WidgetAliasAlternatesCacheKey key)
24+
{
25+
var encodedAlias = key.Alias.EncodeAlternateElement();
26+
27+
return
28+
[
29+
// Widget__Alias__[Alias] e.g. Widget-Alias-example, Widget-Alias-my-page
30+
$"Widget__Alias__{encodedAlias}",
31+
32+
// Widget_[DisplayType]__Alias__[Alias] e.g. Widget-Alias-example.Summary, Widget-Alias-my-page.Summary
33+
$"Widget_{key.DisplayType}__Alias__{encodedAlias}"
34+
];
35+
}
36+
37+
internal readonly record struct WidgetAliasAlternatesCacheKey(
38+
string Alias,
39+
string DisplayType);
40+
}

0 commit comments

Comments
 (0)