Skip to content

Commit

Permalink
Merge branch 'main' into 16939-publish-content-task
Browse files Browse the repository at this point in the history
  • Loading branch information
AmyBlaine committed Nov 15, 2024
2 parents 54e39c0 + 05bd65a commit ab8e349
Show file tree
Hide file tree
Showing 177 changed files with 1,547 additions and 1,336 deletions.
36 changes: 28 additions & 8 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
<PackageVersion Include="Castle.Core" Version="5.1.1" />
<PackageVersion Include="DocumentFormat.OpenXml" Version="3.1.0" />
<PackageVersion Include="Fluid.Core" Version="2.11.1" />
<PackageVersion Include="Fluid.Core" Version="2.12.0" />
<PackageVersion Include="GraphQL" Version="7.9.0" />
<PackageVersion Include="GraphQL.DataLoader" Version="7.9.0" />
<PackageVersion Include="GraphQL.MicrosoftDI" Version="7.9.0" />
Expand All @@ -39,7 +39,6 @@
<PackageVersion Include="MailKit" Version="4.8.0" />
<PackageVersion Include="Markdig" Version="0.37.0" />
<PackageVersion Include="Microsoft.Extensions.Azure" Version="1.7.5" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="8.9.1" />
<PackageVersion Include="Microsoft.Identity.Web" Version="3.2.0" />
<!--
Important: the version of the Microsoft.IdentityModel.Protocols.OpenIdConnect package MUST
Expand All @@ -49,6 +48,7 @@
See https://github.com/OrchardCMS/OrchardCore/pull/16057 for more information.
-->
<PackageVersion Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.1.0" />
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="MimeKit" Version="4.8.0" />
<PackageVersion Include="MiniProfiler.AspNetCore.Mvc" Version="4.3.8" />
Expand Down Expand Up @@ -84,11 +84,15 @@
<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" />

<!-- dotnet/extensions -->
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="8.10.0" />
</ItemGroup>
<ItemGroup>
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<GlobalPackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="4.11.0" />
</ItemGroup>

<!-- These versions are used for tansitive dependency forced upgrades only. E.g. when a package references a vulnerable version. -->
<!-- To list all vulnerable direct references run 'dotnet list package -vulnerable' (use double dash, just XML comments can't contain it) -->
<!-- To list all vulnerable transitive references run 'dotnet list package -vulnerable -include-transitive' (use double dash, just XML comments can't contain it) -->
Expand All @@ -113,14 +117,30 @@
<!-- When removing this, remove the corresponding ignore in dependabot.yml too. -->
<PackageVersion Include="System.Drawing.Common" Version="4.7.2" />
<!--
Microsoft.AspNetCore.DataProtection.StackExchangeRedis (v8.0.8)
└─ Microsoft.AspNetCore.DataProtection (v8.0.8)
└─ System.Security.Cryptography.Xml (v8.0.1)
└─ System.Security.Cryptography.Pkcs (v8.0.0)
└─ System.Formats.Asn1 (v8.0.0)
OrchardCore.Media.Indexing.OpenXML (v2.1.0-preview)
└─ DocumentFormat.OpenXml (v3.1.0)
└─ DocumentFormat.OpenXml.Framework (v3.1.0)
└─ System.IO.Packaging (v8.0.0)
-->
<PackageVersion Include="System.Formats.Asn1" Version="8.0.1" />
<PackageVersion Include="System.IO.Packaging" Version="8.0.1" />

<!--
YesSql (v5.1.1)
└─ YesSql.Provider.SqlServer (v5.1.1)
└─ Microsoft.Data.SqlClient (v5.2.1)
└─ System.Runtime.Caching (v8.0.0)
-->
<PackageVersion Include="System.Runtime.Caching" Version="8.0.1" />

<PackageVersion Include="System.Private.Uri" Version="4.3.2" />

<!-- Several transitive dependencies on 8.0.4 and lower which has known vulnerabilities -->
<PackageVersion Include="System.Text.Json" Version="8.0.5" />

<!-- Several transitive dependencies on 8.0.0 which has known vulnerabilities -->
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
</ItemGroup>

<!-- These versions are used for the NuGet packages that are dependent on the current TFM -->
<!-- Versions are preset for the default TFM (there may be no TFM in an evaluation phase) -->
<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.101",
"rollForward": "latestFeature"
"rollForward": "latestMajor"
}
}
3 changes: 2 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 @@ -13,6 +13,7 @@
<!-- 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>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<!-- For Unit Tests-->
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/OrchardCore.Modules/OrchardCore.Admin/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public override void ConfigureServices(IServiceCollection services)
services.AddPermissionProvider<PermissionsAdminSettings>();
services.AddNavigationProvider<AdminMenu>();
services.AddSingleton<IPageRouteModelProvider, AdminPageRouteModelProvider>();
services.AddScoped<IDisplayDriver<Navbar>, VisitSiteNavbarDisplayDriver>();
services.AddDisplayDriver<Navbar, VisitSiteNavbarDisplayDriver>();

services.Configure<AdminOptions>(_configuration.GetSection("OrchardCore_Admin"));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using OrchardCore.AdminDashboard.Indexes;
using OrchardCore.ContentManagement.Metadata;
using OrchardCore.ContentManagement.Metadata.Settings;
using OrchardCore.Data.Migration;
using OrchardCore.Recipes;
using OrchardCore.Recipes.Services;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public sealed class DashboardPartContentTypeDefinitionHandler : IContentDefiniti
/// </summary>
public void ContentTypeBuilding(ContentTypeBuildingContext context)
{
if (!context.Record.Settings.TryGetPropertyValue(nameof(ContentTypeSettings), out var node))
if (context?.Record?.Settings is null || !context.Record.Settings.TryGetPropertyValue(nameof(ContentTypeSettings), out var node))
{
return;
}
Expand Down Expand Up @@ -52,7 +52,7 @@ public void ContentTypeBuilding(ContentTypeBuildingContext context)
/// </summary>
public void ContentTypePartBuilding(ContentTypePartBuildingContext context)
{
if (!context.Record.PartName.EqualsOrdinalIgnoreCase(nameof(DashboardPart)))
if (context?.Record?.Settings is null || !context.Record.PartName.EqualsOrdinalIgnoreCase(nameof(DashboardPart)))
{
return;
}
Expand Down
1 change: 0 additions & 1 deletion src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
using OrchardCore.Data;
using OrchardCore.Data.Migration;
using OrchardCore.DisplayManagement;
using OrchardCore.DisplayManagement.Descriptors;
using OrchardCore.Indexing;
using OrchardCore.Liquid;
using OrchardCore.Modules;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
@*
For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
*@

@inherits OrchardCore.DisplayManagement.Razor.RazorPage<TModel>
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, OrchardCore.DisplayManagement
Expand Down
5 changes: 2 additions & 3 deletions src/OrchardCore.Modules/OrchardCore.AuditTrail/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ public override void ConfigureServices(IServiceCollection services)

services.AddScoped<IAuditTrailManager, AuditTrailManager>();

services
.AddScoped<IDisplayDriver<AuditTrailEvent>, AuditTrailEventDisplayDriver>();
services.AddDisplayDriver<AuditTrailEvent, AuditTrailEventDisplayDriver>();

services.AddSingleton<IAuditTrailIdGenerator, AuditTrailIdGenerator>();

Expand All @@ -49,7 +48,7 @@ public override void ConfigureServices(IServiceCollection services)
services.AddSiteDisplayDriver<AuditTrailSettingsDisplayDriver>();
services.AddSiteDisplayDriver<AuditTrailTrimmingSettingsDisplayDriver>();

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

services.AddScoped<IAuditTrailAdminListQueryService, DefaultAuditTrailAdminListQueryService>();

Expand Down
1 change: 0 additions & 1 deletion src/OrchardCore.Modules/OrchardCore.Autoroute/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
using OrchardCore.Data;
using OrchardCore.Data.Migration;
using OrchardCore.DisplayManagement;
using OrchardCore.DisplayManagement.Descriptors;
using OrchardCore.Indexing;
using OrchardCore.Liquid;
using OrchardCore.Modules;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
@*
For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
*@

@inherits OrchardCore.DisplayManagement.Razor.RazorPage<TModel>
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, OrchardCore.Contents.TagHelpers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
@*
For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
*@

@inherits OrchardCore.DisplayManagement.Razor.RazorPage<TModel>
@using OrchardCore.ContentFields.Settings
@using OrchardCore.ContentLocalization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public override void ConfigureServices(IServiceCollection services)

services.AddScoped<IContentsAdminListFilter, LocalizationPartContentsAdminListFilter>();
services.AddTransient<IContentsAdminListFilterProvider, LocalizationPartContentsAdminListFilterProvider>();
services.AddScoped<IDisplayDriver<ContentOptionsViewModel>, LocalizationContentsAdminListDisplayDriver>();
services.AddDisplayDriver<ContentOptionsViewModel, LocalizationContentsAdminListDisplayDriver>();
}
}

Expand All @@ -59,7 +59,7 @@ public ContentPickerStartup(IShellConfiguration shellConfiguration)

public override void ConfigureServices(IServiceCollection services)
{
services.AddScoped<IDisplayDriver<Navbar>, ContentCulturePickerNavbarDisplayDriver>();
services.AddDisplayDriver<Navbar, ContentCulturePickerNavbarDisplayDriver>();
services.AddLiquidFilter<SwitchCultureUrlFilter>("switch_culture_url");
services.AddNavigationProvider<AdminMenu>();
services.AddScoped<IContentCulturePickerService, ContentCulturePickerService>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Options;
using OrchardCore.ContentManagement;
using OrchardCore.ContentManagement.Display.ContentDisplay;
Expand Down Expand Up @@ -28,6 +27,6 @@ public override void ConfigureServices(IServiceCollection services)

services.AddDataMigration<Migrations>();
services.AddScoped<IContentTypePartDefinitionDisplayDriver, PreviewPartSettingsDisplayDriver>();
services.TryAddEnumerable(ServiceDescriptor.Singleton<IStartupFilter, PreviewStartupFilter>());
services.AddSingleton<IStartupFilter, PreviewStartupFilter>();
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
@*
For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
*@
@using Microsoft.AspNetCore.Authorization

@inherits OrchardCore.DisplayManagement.Razor.RazorPage<TModel>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
@*
For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
*@

@inherits OrchardCore.DisplayManagement.Razor.RazorPage<TModel>
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, OrchardCore.DisplayManagement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public override void ConfigureServices(IServiceCollection services)
services.AddScoped<IAuditTrailEventHandler, ContentAuditTrailEventHandler>();
services.AddSiteDisplayDriver<ContentAuditTrailSettingsDisplayDriver>();

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

services.AddScoped<IContentHandler, AuditTrailContentHandler>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ public override void ConfigureServices(IServiceCollection services)
{
services.AddDeployment<ContentItemDeploymentSource, ContentItemDeploymentStep, ContentItemDeploymentStepDriver>();
services.AddScoped<IContentDisplayDriver, AddToDeploymentPlanContentDriver>();
services.AddScoped<IDisplayDriver<ContentOptionsViewModel>, AddToDeploymentPlanContentsAdminListDisplayDriver>();
services.AddDisplayDriver<ContentOptionsViewModel, AddToDeploymentPlanContentsAdminListDisplayDriver>();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public override void ConfigureServices(IServiceCollection services)

services.AddDataMigration<ExportContentToDeploymentTargetMigrations>();
services.AddScoped<IContentDisplayDriver, ExportContentToDeploymentTargetContentDriver>();
services.AddScoped<IDisplayDriver<ContentOptionsViewModel>, ExportContentToDeploymentTargetContentsAdminListDisplayDriver>();
services.AddDisplayDriver<ContentOptionsViewModel, ExportContentToDeploymentTargetContentsAdminListDisplayDriver>();

services.AddSiteSettingsPropertyDeploymentStep<ExportContentToDeploymentTargetSettings, ExportContentToDeploymentTargetStartup>(S => S["Export Content To Deployment Target settings"], S => S["Exports the Export Content To Deployment Target settings."]);
}
Expand Down
4 changes: 2 additions & 2 deletions src/OrchardCore.Modules/OrchardCore.Contents/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static async Task<FluidValue> GetContentByHandleAsync(LiquidTemplateContext cont

services.AddScoped<IContentsAdminListQueryService, DefaultContentsAdminListQueryService>();

services.AddScoped<IDisplayDriver<ContentOptionsViewModel>, ContentOptionsDisplayDriver>();
services.AddDisplayDriver<ContentOptionsViewModel, ContentOptionsDisplayDriver>();

services.AddScoped(typeof(IContentItemRecursionHelper<>), typeof(ContentItemRecursionHelper<>));

Expand Down Expand Up @@ -279,7 +279,7 @@ public override void ConfigureServices(IServiceCollection services)
services.AddScoped<ISitemapSourceBuilder, ContentTypesSitemapSourceBuilder>();
services.AddScoped<ISitemapSourceUpdateHandler, ContentTypesSitemapSourceUpdateHandler>();
services.AddScoped<ISitemapSourceModifiedDateProvider, ContentTypesSitemapSourceModifiedDateProvider>();
services.AddScoped<IDisplayDriver<SitemapSource>, ContentTypesSitemapSourceDriver>();
services.AddDisplayDriver<SitemapSource, ContentTypesSitemapSourceDriver>();
services.AddScoped<ISitemapSourceFactory, SitemapSourceFactory<ContentTypesSitemapSource>>();
services.AddScoped<IContentItemsQueryProvider, DefaultContentItemsQueryProvider>();
services.AddScoped<IContentHandler, ContentTypesSitemapUpdateHandler>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ public SelectContentTypesViewComponent(IContentDefinitionManager contentDefiniti

public async Task<IViewComponentResult> InvokeAsync(IEnumerable<string> selectedContentTypes, string htmlName, string stereotype)
{
selectedContentTypes ??= Array.Empty<string>();

var contentTypes = await ContentTypeSelection.BuildAsync(_contentDefinitionManager, selectedContentTypes);
var contentTypes = await ContentTypeSelection.BuildAsync(_contentDefinitionManager, selectedContentTypes ?? []);

if (!string.IsNullOrEmpty(stereotype))
{
contentTypes = contentTypes
.Where(x => x.ContentTypeDefinition.GetStereotype() == stereotype)
.Where(x => x.ContentTypeDefinition.StereotypeEquals(stereotype))
.ToArray();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
@using OrchardCore.ContentManagement
@using OrchardCore.Mvc.Utilities
@{
ContentItem contentItem = Model.ContentItem;
//Html.AddPageClassNames("detail-" + contentItem.ContentType.HtmlClassify());
}
@await DisplayAsync(Model)
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
@using OrchardCore.ContentManagement
@using OrchardCore.Mvc.Utilities
@{
ContentItem contentItem = Model.ContentItem;
//Html.AddPageClassNames("detail-" + contentItem.ContentType.HtmlClassify());
}
@await DisplayAsync(Model)
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
@using OrchardCore.ContentManagement
@using OrchardCore.Mvc.Utilities
@{
ContentItem contentItem = Model.ContentItem;
//Html.AddPageClassNames("preview", "detail-" + contentItem.ContentType.HtmlClassify());
}
@await DisplayAsync(Model)
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
@*
For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
*@
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Routing
@using Microsoft.AspNetCore.Mvc.Localization
Expand Down
4 changes: 1 addition & 3 deletions src/OrchardCore.Modules/OrchardCore.Cors/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Microsoft.AspNetCore.Cors.Infrastructure;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Options;
using OrchardCore.Cors.Services;
using OrchardCore.Modules;
Expand All @@ -28,7 +27,6 @@ public override void ConfigureServices(IServiceCollection services)
services.AddPermissionProvider<Permissions>();
services.AddSingleton<CorsService>();

services.TryAddEnumerable(ServiceDescriptor
.Transient<IConfigureOptions<CorsOptions>, CorsOptionsConfiguration>());
services.AddTransient<IConfigureOptions<CorsOptions>, CorsOptionsConfiguration>();
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
@*
For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
*@

@inherits OrchardCore.DisplayManagement.Razor.RazorPage<TModel>
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, OrchardCore.DisplayManagement
Expand Down
2 changes: 1 addition & 1 deletion src/OrchardCore.Modules/OrchardCore.Demo/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public override void ConfigureServices(IServiceCollection services)
services.AddContentPart<TestContentPartA>();
services.AddScoped<IUserClaimsProvider, UserProfileClaimsProvider>();

services.AddScoped<IDisplayDriver<User>, UserProfileDisplayDriver>();
services.AddDisplayDriver<User, UserProfileDisplayDriver>();

services.Configure<RazorPagesOptions>(options =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ public async Task<IActionResult> Import(ImportViewModel model)
}

// Create a temporary filename to save the archive
var tempArchiveName = PathExtensions.Combine(Path.GetTempPath(), Path.GetRandomFileName()) + ".zip";
var tempArchiveName = PathExtensions.GetTempFileName() + ".zip";

// Create a temporary folder to extract the archive to
var tempArchiveFolder = PathExtensions.Combine(Path.GetTempPath(), Path.GetRandomFileName());
var tempArchiveFolder = PathExtensions.GetTempFileName();

try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public async Task<IActionResult> Import(IFormFile importedPackage)

if (importedPackage != null)
{
var tempArchiveName = PathExtensions.Combine(Path.GetTempPath(), Path.GetRandomFileName()) + Path.GetExtension(importedPackage.FileName);
var tempArchiveFolder = PathExtensions.Combine(Path.GetTempPath(), Path.GetRandomFileName());
var tempArchiveName = PathExtensions.GetTempFileName() + Path.GetExtension(importedPackage.FileName);
var tempArchiveFolder = PathExtensions.GetTempFileName();

try
{
Expand Down
Loading

0 comments on commit ab8e349

Please sign in to comment.