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-818: Upgrade to Orchard Core 2.0 #125

Merged
merged 99 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
8e748f5
Update NuGet versions to pre-release.
sarahelsaig Feb 22, 2024
1ba3de8
Fix compilation errors.
sarahelsaig Feb 23, 2024
f772075
Avoid using ContentElement.Content wherever possible.
sarahelsaig Feb 24, 2024
823e9fd
Replace JsonConvert.SerializeObject.
sarahelsaig Feb 24, 2024
3647ae2
unusing
sarahelsaig Feb 25, 2024
e7f8fb1
Update OC to latest (because of bug fix for WorkflowTypeStep)
sarahelsaig Mar 3, 2024
2622b96
Update OC preview version.
sarahelsaig Mar 7, 2024
025cde5
Update OC package
sarahelsaig Mar 13, 2024
be8c218
Merge remote-tracking branch 'origin/dev' into issue/OSOE-795
sarahelsaig Mar 16, 2024
97568eb
Merge remote-tracking branch 'origin/dev' into issue/OSOE-795
sarahelsaig Mar 29, 2024
e36133d
Use JObject.FromObject instead of JsonSerializer.SerializeToNode wher…
sarahelsaig Apr 2, 2024
367a7e3
Merge remote-tracking branch 'origin/dev' into issue/OSOE-795
sarahelsaig Apr 22, 2024
13c84b7
Update OC preview version.
sarahelsaig Apr 23, 2024
5ddf97e
Update OC package version.
sarahelsaig Apr 27, 2024
b5be49c
Merge remote-tracking branch 'origin/dev' into issue/OSOE-795
sarahelsaig May 4, 2024
7b227e0
Update OC versions
sarahelsaig May 4, 2024
f1e695b
Update OC to the latest preview.
sarahelsaig May 7, 2024
ec6d84c
Merge branch 'task/system-text-json-migration' into issue/OSOE-795
sarahelsaig May 12, 2024
7917895
Merge pull request #104 from Lombiq/issue/OSOE-795
dministro May 15, 2024
eb71ef8
Merge remote-tracking branch 'origin/dev' into task/system-text-json-…
sarahelsaig May 16, 2024
0d18ccd
Merge remote-tracking branch 'origin/dev' into task/system-text-json-…
sarahelsaig May 28, 2024
d5ceb3f
Update OC preview version.
sarahelsaig May 28, 2024
510baa8
Update OC preview version.
sarahelsaig May 30, 2024
f0ea5b0
Fix new "Obsolete" warnings.
sarahelsaig May 30, 2024
26d266a
Simplify initialization.
sarahelsaig May 31, 2024
10e176a
Update OC preview version.
sarahelsaig Jun 5, 2024
23a0f44
Merge remote-tracking branch 'origin/dev' into task/system-text-json-…
sarahelsaig Jun 14, 2024
b89aec6
Merge branch 'task/system-text-json-migration' into issue/OCC-245
sarahelsaig Jun 14, 2024
a9e7566
Update OC version.
sarahelsaig Jun 18, 2024
e6691cb
Update OC version.
sarahelsaig Jun 19, 2024
8707888
Update OC preview version.
sarahelsaig Jun 20, 2024
4ec582c
Update OC preview version.
sarahelsaig Jun 21, 2024
1e74624
Merge remote-tracking branch 'origin/issue/OCC-245' into issue/OCC-245
sarahelsaig Jun 21, 2024
d0f4940
Update HL and UITT NuGet versions.
sarahelsaig Jun 24, 2024
672adf3
Update OC NuGet versions.
sarahelsaig Jun 24, 2024
60fd563
Update to latest OC preview version.
sarahelsaig Jul 2, 2024
198bc42
Update OC preview version.
sarahelsaig Jul 11, 2024
bd3e81f
Fix package consolidation.
sarahelsaig Jul 11, 2024
3f43732
Update HL version.
sarahelsaig Jul 13, 2024
45533cb
Update UITT version.
sarahelsaig Jul 13, 2024
03c75d5
Update HL nuget version.
sarahelsaig Jul 16, 2024
081fcae
Update all UITT Nuget versions.
sarahelsaig Jul 16, 2024
dfd5f59
Update package version.
sarahelsaig Jul 16, 2024
4e3d10f
Update OC preview versions.
sarahelsaig Jul 24, 2024
3e8e76f
Update ResourceManagerDecorator from Upstream.
sarahelsaig Jul 26, 2024
83ec11e
Update HL preview version.
sarahelsaig Jul 26, 2024
accc03d
Update UITT preview version.
sarahelsaig Jul 26, 2024
065fc54
Update HL preview.
sarahelsaig Jul 27, 2024
293756f
Update UITT version.
sarahelsaig Jul 27, 2024
079f4cf
Update UITT preview version.
sarahelsaig Jul 27, 2024
805baf6
Update HE version.
sarahelsaig Jul 27, 2024
b0c98f2
NuGet.config
sarahelsaig Jul 27, 2024
1222574
Update HL nuget version.
sarahelsaig Jul 27, 2024
970e5ff
Update HL.
sarahelsaig Jul 27, 2024
125bd37
Merge pull request #117 from Lombiq/issue/OCC-245
Piedone Jul 28, 2024
120b448
Update OC preview version.
sarahelsaig Jul 29, 2024
74cd722
Update OC preview version again (sigh).
sarahelsaig Jul 30, 2024
8a545a7
Move GoogleTag to HE, it was inappropriate and not reliable here.
sarahelsaig Aug 4, 2024
f67c7e4
Update OC preview version.
sarahelsaig Aug 6, 2024
2892bda
Update HL alpha version.
sarahelsaig Aug 7, 2024
d42cb33
Update UITT alpha version.
sarahelsaig Aug 7, 2024
65d2836
Update HE alpha version.
sarahelsaig Aug 7, 2024
4711880
Update OC preview version.
sarahelsaig Aug 7, 2024
9b9b75e
Update OC preview.
sarahelsaig Aug 8, 2024
9fa24bc
Update HL alpha version.
sarahelsaig Aug 9, 2024
f3b7375
Update UITT alpha version.
sarahelsaig Aug 9, 2024
81cdd02
Update OC previews.
sarahelsaig Aug 13, 2024
941de1f
Merge branch 'task/system-text-json-migration' into issue/NEST-536
sarahelsaig Aug 13, 2024
f546624
Update OC preview version.
sarahelsaig Aug 17, 2024
b9cac9a
Update OC preview version.
sarahelsaig Aug 20, 2024
4deca4b
Merge branch 'issue/OSOE-898' into issue/OSOE-898-new
sarahelsaig Aug 20, 2024
be9734a
Make it local only if it's not target="_blank".
sarahelsaig Aug 20, 2024
10f83ec
Update OC preview version.
sarahelsaig Aug 20, 2024
1f4e7c1
Update OC preview version.
sarahelsaig Aug 21, 2024
0ea093e
Merge remote-tracking branch 'origin/issue/NEST-536' into issue/OSOE-…
sarahelsaig Aug 22, 2024
f6bea78
Update OC preview version.
sarahelsaig Aug 23, 2024
17c5d2f
Update OC preview version.
sarahelsaig Aug 23, 2024
05280b8
Merge remote-tracking branch 'origin/issue/NEST-536' into issue/NEST-536
sarahelsaig Aug 23, 2024
7164bdb
Merge pull request #122 from Lombiq/issue/NEST-536
sarahelsaig Aug 23, 2024
cde0983
Merge branch 'task/system-text-json-migration' into issue/OSOE-898-new
sarahelsaig Aug 26, 2024
2f1a1b0
Use OC release version.
sarahelsaig Sep 22, 2024
b9f736c
Merge pull request #124 from Lombiq/issue/OSOE-898-new
barthamark Sep 23, 2024
75e2635
Merge remote-tracking branch 'origin/dev' into issue/OSOE-818
sarahelsaig Sep 23, 2024
69625f7
Update HL preview.
sarahelsaig Sep 23, 2024
47a672a
Update HL.
sarahelsaig Sep 23, 2024
81fd5c6
Update HE version.
sarahelsaig Sep 23, 2024
bdc2604
Merge remote-tracking branch 'origin/dev' into task/system-text-json-…
sarahelsaig Sep 24, 2024
9a6972e
Merge branch 'task/system-text-json-migration' into issue/OSOE-818
sarahelsaig Sep 24, 2024
397f652
Use AddNavigationProvider everywhere.
sarahelsaig Sep 24, 2024
d0d71b3
Make migrations and background tasks sealed.
sarahelsaig Sep 24, 2024
ec78026
Seal INavigationProvider, IAsyncResultFilter, IPermissionProvider, St…
sarahelsaig Sep 24, 2024
75c43b6
Use AddPermissionProvider.
sarahelsaig Sep 24, 2024
dbf7274
Use GetSettingsAsync().
sarahelsaig Sep 24, 2024
4eb7927
Merge remote-tracking branch 'origin/dev' into issue/OSOE-818
sarahelsaig Sep 24, 2024
c945b55
Merge remote-tracking branch 'origin/dev' into issue/OSOE-818
Piedone Sep 24, 2024
d00567d
Merge branch 'issue/OSOE-818' of https://github.com/Lombiq/Orchard-Ba…
sarahelsaig Sep 24, 2024
3b2a9c1
Update HL NuGet version.
sarahelsaig Sep 25, 2024
849e851
Update UITT version.
sarahelsaig Sep 25, 2024
11c3157
Update HE version.
sarahelsaig Sep 25, 2024
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
4 changes: 2 additions & 2 deletions Lombiq.BaseTheme.Samples/Lombiq.BaseTheme.Samples.csproj
Piedone marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="OrchardCore.Admin" Version="1.8.0" />
<PackageReference Include="OrchardCore.Theme.Targets" Version="1.8.0" />
<PackageReference Include="OrchardCore.Admin" Version="2.0.0" />
<PackageReference Include="OrchardCore.Theme.Targets" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Lombiq.BaseTheme.Samples/Migrations/RecipeMigrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Lombiq.BaseTheme.Samples.Migrations;
// invoke the corresponding "{module-or-theme-id}.UpdateFromN.recipe.json" recipe and return the incremented version
// number.
// If you just want a static default icon, check out the DerivedTheme.Favicon in Manifest.cs!
public class RecipeMigrations : RecipeMigrationsBase
public sealed class RecipeMigrations : RecipeMigrationsBase
{
public RecipeMigrations(IRecipeMigrator recipeMigrator)
: base(recipeMigrator)
Expand Down
4 changes: 2 additions & 2 deletions Lombiq.BaseTheme.Samples/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

namespace Lombiq.BaseTheme.Samples;

public class Startup : StartupBase
public sealed class Startup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddTransient<IConfigureOptions<ResourceManagementOptions>, ResourceManagementOptionsConfiguration>();

// This is a sample main menu item. See the "Front-end navigation via the "main" menu" section.
services.AddScoped<INavigationProvider, AccountNavigationProvider>();
services.AddNavigationProvider<AccountNavigationProvider>();

// This service provides configuration to the ResourceFilterMiddleware.
services.AddScoped<IResourceFilterProvider, ResourceFilters>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

@* You can even include shapes conditionally. In this case we want a link to the admin dashboard but only for users who
are able to access it. Using this approach can be much easier than implementing a custom layer condition. *@
@if (await AuthorizationService.AuthorizeAsync(User, Permissions.AccessAdminPanel))
@if (await AuthorizationService.AuthorizeAsync(User, AdminPermissions.AccessAdminPanel))
{
<zone name="@ZoneNames.Footer" position="1">
<div class="zoneInsertionExample_footer">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.Services;
using Newtonsoft.Json;
using OpenQA.Selenium;
using System.Text.Json;
using System.Threading.Tasks;

namespace Lombiq.BaseTheme.Tests.UI.Extensions;
Expand All @@ -12,7 +12,7 @@ public static async Task ClickMainMenuPathAsync(this UITestContext context, stri
{
var byFirst = By.XPath(
$"//div[contains(@class, \"menuWidget__content\")]/ul/li/a" +
$"[contains(@class, \"nav-link\") and contains(., {JsonConvert.SerializeObject(topMenuLabel)})]");
$"[contains(@class, \"nav-link\") and contains(., {JsonSerializer.Serialize(topMenuLabel)})]");

if (string.IsNullOrWhiteSpace(subMenuLabel))
{
Expand All @@ -22,7 +22,7 @@ public static async Task ClickMainMenuPathAsync(this UITestContext context, stri
{
await context.SelectFromBootstrapDropdownReliablyAsync(
context.Get(byFirst),
By.XPath($".//*[contains(@class, 'dropdown-item') and contains(., {JsonConvert.SerializeObject(subMenuLabel)})]"));
By.XPath($".//*[contains(@class, 'dropdown-item') and contains(., {JsonSerializer.Serialize(subMenuLabel)})]"));
}
}
}
2 changes: 1 addition & 1 deletion Lombiq.BaseTheme.Tests.UI/Lombiq.BaseTheme.Tests.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
<PackageReference Include="Lombiq.Tests.UI" Version="10.0.1" />
<PackageReference Include="Lombiq.Tests.UI" Version="11.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions Lombiq.BaseTheme/Controllers/AdminController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
using Lombiq.HelpfulExtensions.Extensions.ContentTypes;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Localization;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using OrchardCore.ContentManagement;
using OrchardCore.ContentManagement.Metadata.Models;
using OrchardCore.DisplayManagement;
Expand All @@ -16,13 +14,15 @@
using OrchardCore.Modules;
using OrchardCore.Settings;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Threading.Tasks;

namespace Lombiq.BaseTheme.Controllers;

// This controller is there for editing the BaseThemeSettings. We can't use a site settings driver for this, because you
// can't declare admin-accessible shapes in a site theme.
public class AdminController : Controller
public sealed class AdminController : Controller
{
private readonly IClock _clock;
private readonly INotifier _notifier;
Expand Down Expand Up @@ -59,7 +59,7 @@ public async Task<IActionResult> Index()

editor.Paths = string.IsNullOrWhiteSpace(section.Icon)
? "[]"
: JsonConvert.SerializeObject(new[] { new { path = section.Icon } });
: JsonSerializer.Serialize(new[] { new { path = section.Icon } });
editor.Field = part.Icon;
editor.Part = part;
editor.PartFieldDefinition = new ContentPartFieldDefinition(
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 @@ -42,12 +42,12 @@
</ItemGroup>

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

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

<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
<PackageReference Include="Lombiq.HelpfulLibraries" Version="10.0.0" />
<PackageReference Include="Lombiq.HelpfulExtensions" Version="8.0.1" />
<PackageReference Include="Lombiq.HelpfulLibraries" Version="11.0.0" />
<PackageReference Include="Lombiq.HelpfulExtensions" Version="9.0.0" />
<PackageReference Include="Lombiq.NodeJs.Extensions" Version="2.1.0" />
<PackageReference Include="Lombiq.HelpfulLibraries.SourceGenerators" Version="10.0.0" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<PackageReference Include="Lombiq.HelpfulLibraries.Attributes" Version="10.0.0" OutputItemType="Analyzer" ReferenceOutputAssembly="true" />
<PackageReference Include="Lombiq.HelpfulLibraries.SourceGenerators" Version="11.0.0" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<PackageReference Include="Lombiq.HelpfulLibraries.Attributes" Version="11.0.0" OutputItemType="Analyzer" ReferenceOutputAssembly="true" />

<Content Include="Assets/Styles/**/*.*">
<IncludeInPackage>true</IncludeInPackage>
Expand Down
2 changes: 1 addition & 1 deletion Lombiq.BaseTheme/Migrations/LayoutInjectionMigrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Lombiq.BaseTheme.Migrations;

public class LayoutInjectionMigrations : DataMigration
public sealed class LayoutInjectionMigrations : DataMigration
{
private readonly IContentDefinitionManager _contentDefinitionManager;

Expand Down
2 changes: 1 addition & 1 deletion Lombiq.BaseTheme/Migrations/RecipeMigrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Lombiq.BaseTheme.Migrations;

public class RecipeMigrations : DataMigration
public sealed class RecipeMigrations : DataMigration
{
private readonly IRecipeMigrator _recipeMigrator;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Lombiq.BaseTheme.Permissions;

public class BaseThemeSettingsPermissions : AdminPermissionBase
public sealed class BaseThemeSettingsPermissions : AdminPermissionBase
{
public static readonly Permission ManageBaseThemeSettings =
new(nameof(ManageBaseThemeSettings), "Manage Lombiq.BaseTheme Settings.");
Expand Down
3 changes: 1 addition & 2 deletions Lombiq.BaseTheme/Services/IconResourceFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ public void AddResourceFilter(ResourceFilterBuilder builder) =>
}

// If the site setting icon is set, that should take priority.
if ((await _siteService.GetSiteSettingsAsync()).As<BaseThemeSettings>() is { } settings &&
!string.IsNullOrEmpty(settings.Icon))
if (await _siteService.GetSettingsAsync<BaseThemeSettings>() is { Icon.Length: > 0 } settings)
{
var path = _mediaFileStore.MapPathToPublicUrl(settings.Icon);
AddIcon(resourceManager, $"{path}?at={settings.TimeStamp.ToTechnicalString()}");
Expand Down
7 changes: 2 additions & 5 deletions Lombiq.BaseTheme/Services/MainMenuNavigationProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.Extensions.Localization;
using Newtonsoft.Json.Linq;
using OrchardCore.ContentManagement;
using OrchardCore.Menu.Models;
using OrchardCore.Navigation;
Expand Down Expand Up @@ -58,14 +57,12 @@ private async Task AddAsync(NavigationBuilder builder, ContentItem menuItem)

if (menuItem.As<LinkMenuItemPart>() is { } linkMenuItemPart)
{
builder.Add(text, menu => menu.Url(linkMenuItemPart.Url).LocalNav());
builder.Add(text, menu => menu.Url(linkMenuItemPart.Url).Local(linkMenuItemPart.Target != "_blank"));
}
else if (menuItem.As<ContentMenuItemPart>() is { } contentMenuItemPart)
{
if (contentMenuItemPart.Content.SelectedContentItem is JObject &&
contentMenuItemPart.Content.SelectedContentItem.ContentItemIds is JArray contentItemIds)
if (contentMenuItemPart.GetProperty<IEnumerable<string>>("SelectedContentItem.ContentItemIds") is { } ids)
{
var ids = contentItemIds.ToObject<IEnumerable<string>>();
await AddContentMenuItemPartAsync(builder, text, ids);
}
}
Expand Down
15 changes: 6 additions & 9 deletions Lombiq.BaseTheme/Services/MainMenuWidgetFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Lombiq.BaseTheme.Services;

public class MainMenuWidgetFilter : WidgetFilterBase<MenuWidgetViewModel>
public sealed class MainMenuWidgetFilter : WidgetFilterBase<MenuWidgetViewModel>
{
private readonly INavigationManager _navigationManager;
private readonly IActionContextAccessor _actionContextAccessor;
Expand Down Expand Up @@ -43,19 +43,16 @@ public MainMenuWidgetFilter(

protected override async Task<MenuWidgetViewModel> GetViewModelAsync()
{
var siteSettings = await _siteService.GetSiteSettingsAsync();
if (siteSettings.As<BaseThemeSettings>()?.HideMenu == true) return null;
if (await _siteService.GetSettingsAsync<BaseThemeSettings>() is { HideMenu: true }) return null;

// Add the <nav> classes to the zone holder <nav>.
_cssClassHolder.AddClassToZone(ZoneNames.Navigation, "navbar-expand-md");
_cssClassHolder.AddClassToZone(ZoneNames.Navigation, "navbar");

return new()
{
MenuItems = await _navigationManager.BuildMenuAsync(
return new(
noWrapper: true, // The navigation zone is already the wrapper.
menuItems: await _navigationManager.BuildMenuAsync(
MainMenuNavigationProviderBase.MainNavigationName,
_actionContextAccessor.ActionContext),
NoWrapper = true, // The navigation zone is already the wrapper.
};
_actionContextAccessor.ActionContext));
}
}
9 changes: 2 additions & 7 deletions Lombiq.BaseTheme/Services/ResourceManagerDecorator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;

namespace Lombiq.BaseTheme.Services;

Expand Down Expand Up @@ -93,9 +92,7 @@ public void RenderStylesheet(TextWriter writer)

var first = true;

var styleSheets = GetRequiredResources("stylesheet").ToList();

foreach (var context in styleSheets)
foreach (var context in GetRequiredResources("stylesheet"))
{
if (context.Settings.Location == ResourceLocation.Inline)
{
Expand All @@ -119,10 +116,8 @@ public void RenderStylesheet(TextWriter writer)
context.WriteTo(writer, _options.ContentBasePath);
}

var registeredStyles = GetRegisteredStyles().ToArray();
for (var i = 0; i < registeredStyles.Length; i++)
foreach (var context in GetRegisteredStyles())
{
var context = registeredStyles[i];
if (!first)
{
writer.Write(Environment.NewLine);
Expand Down
8 changes: 4 additions & 4 deletions Lombiq.BaseTheme/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Lombiq.BaseTheme;

public class Startup : StartupBase
public sealed class Startup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
Expand All @@ -31,10 +31,10 @@ public override void ConfigureServices(IServiceCollection services)
services.AddScoped<IResourceFilterProvider, IconResourceFilter>();

PerTenantShapeTableManager.ReplaceDefaultShapeTableManager(services);
services.AddScoped<INavigationProvider, MainMenuNavigationProvider>();
services.AddNavigationProvider<MainMenuNavigationProvider>();

services.AddScoped<IPermissionProvider, BaseThemeSettingsPermissions>();
services.AddScoped<INavigationProvider, BaseThemeSettingsAdminMenu>();
services.AddPermissionProvider<BaseThemeSettingsPermissions>();
services.AddNavigationProvider<BaseThemeSettingsAdminMenu>();

services.Decorate<IResourceManager, ResourceManagerDecorator>();
}
Expand Down
10 changes: 0 additions & 10 deletions Lombiq.BaseTheme/ViewModels/GoogleTagViewModel.cs

This file was deleted.

38 changes: 0 additions & 38 deletions Lombiq.BaseTheme/Views/GoogleTag.cshtml

This file was deleted.

10 changes: 10 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!-- Ignore global configuration -->
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="OrchardCorePreview" value="https://nuget.cloudsmith.io/orchardcore/preview/v3/index.json" />
<add key="Lombiq" value="https://nuget.cloudsmith.io/lombiq/open-source-orchard-core-extensions/v3/index.json" />
</packageSources>
</configuration>