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-795: Upgrade to latest OC preview to test System.Text.Json #84

Merged
merged 15 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 14 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
6 changes: 3 additions & 3 deletions Lombiq.Privacy.Samples/Lombiq.Privacy.Samples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="OrchardCore.Forms" Version="1.8.2" />
<PackageReference Include="OrchardCore.Module.Targets" Version="1.8.2" />
<PackageReference Include="OrchardCore.Workflows" Version="1.8.2" />
<PackageReference Include="OrchardCore.Forms" Version="2.0.0-preview-18200" />
<PackageReference Include="OrchardCore.Module.Targets" Version="2.0.0-preview-18200" />
<PackageReference Include="OrchardCore.Workflows" Version="2.0.0-preview-18200" />
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ public static async Task TestRegistrationConsentCheckboxAsync(this UITestContext

// Go to registration and create a new user.
await context.GoToRegistrationPageAsync();
await context.FillInWithRetriesAsync(By.Id("UserName"), TestUser.Name);
await context.FillInWithRetriesAsync(By.Id("Email"), TestUser.Email);
await context.FillInWithRetriesAsync(By.Id("Password"), TestUser.Password);
await context.FillInWithRetriesAsync(By.Id("ConfirmPassword"), TestUser.Password);
await context.SetCheckboxValueAsync(By.Id("RegistrationCheckbox"), isChecked: true);
await context.FillInWithRetriesAsync(By.Id("RegisterUserForm_UserName"), TestUser.Name);
await context.FillInWithRetriesAsync(By.Id("RegisterUserForm_Email"), TestUser.Email);
await context.FillInWithRetriesAsync(By.Id("RegisterUserForm_Password"), TestUser.Password);
await context.FillInWithRetriesAsync(By.Id("RegisterUserForm_ConfirmPassword"), TestUser.Password);
await context.SetCheckboxValueAsync(By.Id("RegisterUserForm_RegistrationCheckbox"), isChecked: true);
await context.ClickReliablyOnSubmitAsync();

// Login with the created user.
Expand Down
13 changes: 13 additions & 0 deletions Lombiq.Privacy/Drivers/RegistrationCheckboxDriver.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Lombiq.Privacy.ViewModels;
using OrchardCore.DisplayManagement.Handlers;
using OrchardCore.DisplayManagement.Views;
using OrchardCore.Users.Models;

namespace Lombiq.Privacy.Drivers;

public class RegistrationCheckboxDriver : DisplayDriver<RegisterUserForm>
{
public override IDisplayResult Edit(RegisterUserForm model) =>
Initialize<PrivacyRegistrationConsentCheckboxViewModel>("Lombiq_Privacy_RegistrationCheckbox", _ => { })
.Location("Content:after");
}
47 changes: 0 additions & 47 deletions Lombiq.Privacy/Filters/RegistrationCheckboxInjectionFilter.cs

This file was deleted.

18 changes: 9 additions & 9 deletions Lombiq.Privacy/Lombiq.Privacy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="OrchardCore.CustomSettings" Version="1.8.2" />
<PackageReference Include="OrchardCore.Forms" Version="1.8.2" />
<PackageReference Include="OrchardCore.Liquid" Version="1.8.2" />
<PackageReference Include="OrchardCore.Module.Targets" Version="1.8.2" />
<PackageReference Include="OrchardCore.ContentManagement" Version="1.8.2" />
<PackageReference Include="OrchardCore.ContentTypes.Abstractions" Version="1.8.2" />
<PackageReference Include="OrchardCore.DisplayManagement" Version="1.8.2" />
<PackageReference Include="OrchardCore.Navigation" Version="1.8.2" />
<PackageReference Include="OrchardCore.Users" Version="1.8.2" />
<PackageReference Include="OrchardCore.CustomSettings" Version="2.0.0-preview-18200" />
<PackageReference Include="OrchardCore.Forms" Version="2.0.0-preview-18200" />
<PackageReference Include="OrchardCore.Liquid" Version="2.0.0-preview-18200" />
<PackageReference Include="OrchardCore.Module.Targets" Version="2.0.0-preview-18200" />
<PackageReference Include="OrchardCore.ContentManagement" Version="2.0.0-preview-18200" />
<PackageReference Include="OrchardCore.ContentTypes.Abstractions" Version="2.0.0-preview-18200" />
<PackageReference Include="OrchardCore.DisplayManagement" Version="2.0.0-preview-18200" />
<PackageReference Include="OrchardCore.Navigation" Version="2.0.0-preview-18200" />
<PackageReference Include="OrchardCore.Users" Version="2.0.0-preview-18200" />
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' != 'true'">
Expand Down
10 changes: 5 additions & 5 deletions Lombiq.Privacy/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Lombiq.HelpfulLibraries.AspNetCore.Extensions;
using Lombiq.Privacy.Activities;
using Lombiq.Privacy.Constants;
using Lombiq.Privacy.Drivers;
Expand All @@ -9,17 +10,18 @@
using Lombiq.Privacy.Services;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using OrchardCore.ContentManagement;
using OrchardCore.ContentManagement.Display.ContentDisplay;
using OrchardCore.Data.Migration;
using OrchardCore.DisplayManagement.Handlers;
using OrchardCore.Modules;
using OrchardCore.Navigation;
using OrchardCore.ResourceManagement;
using OrchardCore.Users.Events;
using OrchardCore.Users.Models;
using OrchardCore.Workflows.Helpers;
using System;
using System.Threading.Tasks;
Expand Down Expand Up @@ -91,8 +93,7 @@ public class ConsentBannerStartup : StartupBase
public override void ConfigureServices(IServiceCollection services)
{
services.AddTransient<IConfigureOptions<ResourceManagementOptions>, ResourceManagementOptionsConfiguration>();
services.Configure<MvcOptions>((options) =>
options.Filters.Add(typeof(PrivacyConsentBannerInjectionFilter)));
services.AddAsyncResultFilter<PrivacyConsentBannerInjectionFilter>();
services.AddDataMigration<PrivacyConsentBannerSettingsMigrations>();
services.AddScoped<INavigationProvider, PrivacyConsentBannerSettingsMenu>();
}
Expand All @@ -106,8 +107,7 @@ public class RegistrationConsentStartup : StartupBase

public override void ConfigureServices(IServiceCollection services)
{
services.Configure<MvcOptions>((options) =>
options.Filters.Add(typeof(RegistrationCheckboxInjectionFilter)));
services.AddScoped<IDisplayDriver<RegisterUserForm>, RegistrationCheckboxDriver>();
services.AddScoped<IRegistrationFormEvents, RegistrationFormEventHandler>();
services.AddDataMigration<PrivacyRegistrationConsentSettingsMigrations>();
services.AddScoped<INavigationProvider, PrivacyRegistrationConsentSettingsMenu>();
Expand Down