Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSOE-751: Upgrade to Orchard Core 1.8 #103

Merged
merged 23 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ on:

jobs:
publish-nuget:
uses: Lombiq/GitHub-Actions/.github/workflows/publish-nuget.yml@dev
uses: Lombiq/GitHub-Actions/.github/workflows/publish-nuget.yml@issue/OSOE-751
secrets:
API_KEY: ${{ secrets.DEFAULT_NUGET_PUBLISH_API_KEY }}
8 changes: 4 additions & 4 deletions Lombiq.BaseTheme.Samples/Lombiq.BaseTheme.Samples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Condition="'$(NuGetBuild)' != 'true'" Project="..\..\..\Utilities\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions.props" />

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<DefaultItemExcludes>$(DefaultItemExcludes);.git*;node_modules\**;Tests\**</DefaultItemExcludes>
<Nullable>enable</Nullable>
Expand All @@ -26,8 +26,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="OrchardCore.Admin" Version="1.7.0" />
<PackageReference Include="OrchardCore.Theme.Targets" Version="1.7.0" />
<PackageReference Include="OrchardCore.Admin" Version="1.8.2" />
<PackageReference Include="OrchardCore.Theme.Targets" Version="1.8.2" />
</ItemGroup>

<ItemGroup>
Expand All @@ -39,7 +39,7 @@
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
<PackageReference Include="Lombiq.NodeJs.Extensions" Version="1.3.2" />
<PackageReference Include="Lombiq.NodeJs.Extensions" Version="1.3.3-alpha.0.osoe-751" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Lombiq.BaseTheme.Tests.UI/Lombiq.BaseTheme.Tests.UI.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -25,7 +25,7 @@
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
<PackageReference Include="Lombiq.Tests.UI" Version="8.1.0-alpha.1.osoe-638" />
<PackageReference Include="Lombiq.Tests.UI" Version="8.2.1-alpha.22.osoe-751" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions Lombiq.BaseTheme/Controllers/AdminController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Lombiq.BaseTheme.Models;
using Lombiq.BaseTheme.Models;
using Lombiq.BaseTheme.ViewModels;
using Lombiq.HelpfulExtensions.Extensions.ContentTypes;
using Microsoft.AspNetCore.Mvc;
Expand Down Expand Up @@ -108,8 +108,8 @@ private static BaseThemeSettingsPart CreatePart(BaseThemeSettings section)
Icon = new MediaField
{
ContentItem = content,
MediaTexts = new[] { section.Icon },
Paths = new[] { section.Icon },
MediaTexts = [section.Icon],
Paths = [section.Icon],
},
});

Expand Down
20 changes: 10 additions & 10 deletions Lombiq.BaseTheme/Lombiq.BaseTheme.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Condition="'$(NuGetBuild)' != 'true'" Project="..\..\..\Utilities\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions.props" />

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<DefaultItemExcludes>$(DefaultItemExcludes);.git*;node_modules\**</DefaultItemExcludes>
</PropertyGroup>
Expand Down Expand Up @@ -32,12 +32,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="OrchardCore.Theme.Targets" Version="1.7.0" />
<PackageReference Include="OrchardCore.Menu" Version="1.7.0" />
<PackageReference Include="OrchardCore.Media" Version="1.7.0" />
<PackageReference Include="OrchardCore.ContentManagement" Version="1.7.0" />
<PackageReference Include="OrchardCore.DisplayManagement" Version="1.7.0" />
<PackageReference Include="OrchardCore.ResourceManagement" Version="1.7.0" />
<PackageReference Include="OrchardCore.Theme.Targets" Version="1.8.2" />
<PackageReference Include="OrchardCore.Menu" Version="1.8.2" />
<PackageReference Include="OrchardCore.Media" Version="1.8.2" />
<PackageReference Include="OrchardCore.ContentManagement" Version="1.8.2" />
<PackageReference Include="OrchardCore.DisplayManagement" Version="1.8.2" />
<PackageReference Include="OrchardCore.ResourceManagement" Version="1.8.2" />
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' != 'true'">
Expand All @@ -47,9 +47,9 @@
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
<PackageReference Include="Lombiq.HelpfulLibraries" Version="8.1.1-alpha.5.tdeal-16" />
<PackageReference Include="Lombiq.HelpfulExtensions" Version="7.0.2" />
<PackageReference Include="Lombiq.NodeJs.Extensions" Version="1.3.2" />
<PackageReference Include="Lombiq.HelpfulLibraries" Version="8.1.1-alpha.7.osoe-751" />
<PackageReference Include="Lombiq.HelpfulExtensions" Version="7.0.3-alpha.4.osoe-751" />
<PackageReference Include="Lombiq.NodeJs.Extensions" Version="1.3.3-alpha.0.osoe-751" />

<Content Include="Assets/Styles/**/*.*">
<IncludeInPackage>true</IncludeInPackage>
Expand Down
11 changes: 6 additions & 5 deletions Lombiq.BaseTheme/Manifest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using OrchardCore.DisplayManagement.Manifest;
using static Lombiq.HelpfulExtensions.FeatureIds;

[assembly: Theme(
Name = "Lombiq Base Theme",
Expand All @@ -8,9 +9,9 @@
Description = "The base frontend theme for shared code that is not specific to a specific project's theme." +
"Warning: themes using this as the base remove the stock Bootstrap resource. If you switch to a different " +
"theme, please reload the tenant from Configuration → Tenants in the admin menu.",
Dependencies = new[]
{
Lombiq.HelpfulExtensions.FeatureIds.ContentTypes,
Lombiq.HelpfulExtensions.FeatureIds.Widgets,
}
Dependencies =
[
ContentTypes,
Widgets,
]
)]
97 changes: 0 additions & 97 deletions Lombiq.BaseTheme/Middlewares/RemoveBootstrapMiddleware.cs

This file was deleted.

7 changes: 4 additions & 3 deletions Lombiq.BaseTheme/Migrations/LayoutInjectionMigrations.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using OrchardCore.ContentManagement.Metadata;
using OrchardCore.ContentManagement.Metadata;
using OrchardCore.ContentManagement.Metadata.Builders;
using OrchardCore.ContentManagement.Metadata.Settings;
using OrchardCore.Data.Migration;
using System.Threading.Tasks;
using static Lombiq.BaseTheme.Constants.ContentTypes;

namespace Lombiq.BaseTheme.Migrations;
Expand All @@ -13,9 +14,9 @@ public class LayoutInjectionMigrations : DataMigration
public LayoutInjectionMigrations(IContentDefinitionManager contentDefinitionManager) =>
_contentDefinitionManager = contentDefinitionManager;

public int Create()
public async Task<int> CreateAsync()
{
_contentDefinitionManager.AlterTypeDefinition(LayoutInjection, builder => builder
await _contentDefinitionManager.AlterTypeDefinitionAsync(LayoutInjection, builder => builder
.SetAbilities(creatable: true)
.Stereotype("Widget"));

Expand Down
2 changes: 1 addition & 1 deletion Lombiq.BaseTheme/ResourceManagementOptionsConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class ResourceManagementOptionsConfiguration : IConfigureOptions<Resource
private const string Vendors = WwwRoot + "vendors/";

// Make sure to keep this exactly the same version as the "bootstrap" dependency in the package.json file.
public static readonly Version NpmBootstrapVersion = new(5, 2, 3);
public static readonly Version NpmBootstrapVersion = new(5, 3, 2);

private static readonly ResourceManifest _manifest = new();

Expand Down
6 changes: 3 additions & 3 deletions Lombiq.BaseTheme/Services/CssClassHolder.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System.Collections.Generic;
using System.Collections.Generic;

namespace Lombiq.BaseTheme.Services;

public class CssClassHolder : ICssClassHolder
{
private readonly Dictionary<string, HashSet<string>> _classesByZones = new();
private readonly Dictionary<string, HashSet<string>> _classesByZones = [];

public ISet<string> Body { get; } = new HashSet<string>();

Expand All @@ -17,7 +17,7 @@ public ISet<string> GetZoneClasses(string zoneName)
{
if (_classesByZones.TryGetValue(zoneName, out var classes)) return classes;

classes = new();
classes = [];
_classesByZones[zoneName] = classes;
return classes;
}
Expand Down
3 changes: 1 addition & 2 deletions Lombiq.BaseTheme/Services/IconResourceFilter.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using Lombiq.BaseTheme.Attributes;
using Lombiq.BaseTheme.Attributes;
using Lombiq.BaseTheme.Models;
using Lombiq.HelpfulLibraries.OrchardCore.ResourceManagement;
using OrchardCore;
using OrchardCore.Entities;
using OrchardCore.Media;
using OrchardCore.ResourceManagement;
using OrchardCore.Settings;
Expand Down
3 changes: 1 addition & 2 deletions Lombiq.BaseTheme/Services/MainMenuWidgetFilter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Lombiq.BaseTheme.Constants;
using Lombiq.BaseTheme.Constants;
using Lombiq.BaseTheme.Models;
using Lombiq.HelpfulExtensions.Extensions.Widgets;
using Lombiq.HelpfulExtensions.Extensions.Widgets.ViewModels;
Expand All @@ -8,7 +8,6 @@
using Microsoft.AspNetCore.Mvc.Infrastructure;
using OrchardCore.DisplayManagement;
using OrchardCore.DisplayManagement.Layout;
using OrchardCore.Entities;
using OrchardCore.Navigation;
using OrchardCore.Settings;
using System.Threading.Tasks;
Expand Down
Loading
Loading