Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
5961733
Update OC versions to preview.
sarahelsaig Jan 7, 2026
b95a3f8
Fix some build errors.
sarahelsaig Jan 8, 2026
d2c83d0
Fix training demo build errors.
sarahelsaig Jan 9, 2026
313b82d
Fix miscileneous warnings.
sarahelsaig Jan 9, 2026
7afed69
Fix remaining warnings.
sarahelsaig Jan 9, 2026
e7cf14f
Upgrade Moq.AutoMock.
sarahelsaig Jan 9, 2026
58d034c
Upgrade OC preview.
sarahelsaig Jan 14, 2026
3f364ce
Merge remote-tracking branch 'origin/dev' into issue/OSOE-925
sarahelsaig Jan 16, 2026
587d4ff
Change all sync-over-async site settings accesses to use the new sync…
sarahelsaig Jan 17, 2026
0693e6e
CompatibilitySuppressions.xml
sarahelsaig Jan 20, 2026
c5f1e62
Nuget.
sarahelsaig Jan 20, 2026
e11eb61
Delete all CompatibilitySuppressions so we may start from scratch.
sarahelsaig Jan 20, 2026
3e917f4
Fix net10 for web project.
sarahelsaig Jan 20, 2026
93f639e
Fix OC version.
sarahelsaig Jan 20, 2026
4a80508
DRY OC versions.
sarahelsaig Jan 20, 2026
6e2a29b
Fix branch selectors.
sarahelsaig Jan 20, 2026
d447bf0
Revert "DRY OC versions."
sarahelsaig Jan 20, 2026
c154acf
Nothing to do here.
sarahelsaig Jan 22, 2026
564e938
Upgrade OC preview.
sarahelsaig Jan 22, 2026
c10102b
HL nuget
sarahelsaig Jan 22, 2026
70732e4
Fix CA2263.
sarahelsaig Jan 22, 2026
dc09d61
UC preview update.
sarahelsaig Jan 23, 2026
d409361
Update HL nuget.
sarahelsaig Jan 23, 2026
044bc19
Fix content handler behavior change.
sarahelsaig Jan 26, 2026
39c610b
Comma.
sarahelsaig Jan 26, 2026
13fa27d
Added note about title part.
sarahelsaig Jan 26, 2026
96027af
Clear trailing whitespace.
sarahelsaig Jan 26, 2026
70982e1
Update OC preview.
sarahelsaig Jan 27, 2026
0f4ea3a
Update HL NuGet.
sarahelsaig Jan 28, 2026
abf7aec
Update OC preview.
sarahelsaig Feb 4, 2026
14fb82e
Update OC preview.
sarahelsaig Feb 5, 2026
6654f19
Update HL Nuget.
sarahelsaig Feb 5, 2026
cc19e0c
Upda
sarahelsaig Feb 6, 2026
e68dadc
Fix menus.
sarahelsaig Feb 8, 2026
d98f23f
Update OC previews to fix package downgrade.
sarahelsaig Feb 13, 2026
c260954
Update HL nuget.
sarahelsaig Feb 22, 2026
7a08493
OC preview version
sarahelsaig Feb 22, 2026
62681f2
Update HL nuget correctly.
sarahelsaig Feb 22, 2026
8f9fa2d
Fix breaking changes.
sarahelsaig Feb 22, 2026
791f1b7
Update nugets.
sarahelsaig Mar 7, 2026
fd41ca8
Merge remote-tracking branch 'origin/dev' into issue/OSOE-925
sarahelsaig Mar 20, 2026
c766d7e
Fix package consolidation.
sarahelsaig Mar 20, 2026
af32fc9
Update OC preview.
sarahelsaig Mar 20, 2026
3ea39d5
Fix new analyzer warnings.
sarahelsaig Mar 29, 2026
8f9619a
Update OC preview.
sarahelsaig Mar 29, 2026
4c97de7
Fix package downgrade.
sarahelsaig Mar 29, 2026
dbce9d0
Create new SLNX files.
sarahelsaig Apr 2, 2026
52d4d8d
Remove SLN files.
sarahelsaig Apr 3, 2026
9e74841
Update OC preview.
sarahelsaig Apr 8, 2026
af3b532
Fix obsolete "As".
sarahelsaig Apr 11, 2026
6fa9607
Fix and clean up GetOrCreate usages.
sarahelsaig Apr 11, 2026
937fbef
Update HL Nuget.
sarahelsaig Apr 11, 2026
5c63556
Update OC preview.
sarahelsaig Apr 13, 2026
c5693fa
Fix package consolidation.
sarahelsaig Apr 24, 2026
f773ba2
Update OC preview.
sarahelsaig Apr 25, 2026
d41765b
Merge remote-tracking branch 'origin/issue/OSOE-925' into issue/OSOE-…
sarahelsaig Apr 25, 2026
2fa3517
Merge remote-tracking branch 'origin/issue/OSOE-1208' into issue/OSOE…
sarahelsaig Apr 25, 2026
8ff9183
Merge remote-tracking branch 'origin/dev' into issue/OSOE-1199
sarahelsaig Apr 25, 2026
24d0d4a
Merge remote-tracking branch 'origin/dev' into issue/OSOE-925
sarahelsaig Apr 25, 2026
b474f5d
Merge remote-tracking branch 'origin/issue/OSOE-925' into issue/OSOE-…
sarahelsaig Apr 25, 2026
dc3f829
Merge remote-tracking branch 'origin/issue/OSOE-1208' into issue/OSOE…
sarahelsaig Apr 25, 2026
0e15139
Fix branch selectors.
sarahelsaig Apr 26, 2026
db107d5
Merge pull request #202 from Lombiq/issue/OSOE-1199
DemeSzabolcs Apr 27, 2026
319882a
Update GHA branch selectors.
sarahelsaig Apr 27, 2026
971a8f4
Fix package downgrade.
sarahelsaig May 6, 2026
2cedc6f
Update OC preview.
sarahelsaig May 16, 2026
a84794d
Update Microsoft.NET.Test.Sdk.
sarahelsaig May 16, 2026
45d42c5
Merge remote-tracking branch 'origin/dev' into issue/OSOE-925
sarahelsaig May 16, 2026
083ffa9
Fix package downgrades.
sarahelsaig May 24, 2026
2bd7392
Fix build warnings.
sarahelsaig Jun 13, 2026
3bb593c
Use OrchardCoreVersion variable from SDK.
sarahelsaig Jun 13, 2026
1a82124
Update OC preview.
sarahelsaig Jun 15, 2026
ef5cf4a
Update OC preview.
sarahelsaig Jun 16, 2026
f7cc1a8
Update OC preview and
sarahelsaig Jun 20, 2026
06a6a0f
Update Microsoft.NET.Test.Sdk
sarahelsaig Jun 20, 2026
28594d1
Merge remote-tracking branch 'origin/dev' into issue/OSOE-925
sarahelsaig Jun 20, 2026
4670d3d
Use OC3 release.
sarahelsaig Jun 20, 2026
997b0e5
Fix NU1903 without suppressing.
sarahelsaig Jun 21, 2026
e4b922b
nuget
sarahelsaig Jun 24, 2026
0d73d35
Update HL NuGet.
sarahelsaig Jun 26, 2026
61c3704
Security
sarahelsaig Jun 27, 2026
8ebafd0
Fix OC version.
sarahelsaig Jun 27, 2026
68c1d53
Fix Modules/Lombiq.ChartJs/Lombiq.ChartJs.Samples/Models/ExpensePart.cs.
sarahelsaig Jun 27, 2026
840de4e
Check if Microsoft.AspNetCore.DataProtection.StackExchangeRedis is st…
sarahelsaig Jun 28, 2026
354f5c4
Upgrade to 3.0.1's preview and fix build/runtime errors.
sarahelsaig Jul 2, 2026
9045068
Fix MA0040.
sarahelsaig Jul 2, 2026
95577a0
Remove Microsoft.Data.Sqlite.
sarahelsaig Jul 2, 2026
6a35e50
Update Microsoft.Web.LibraryManager.Build.
sarahelsaig Jul 2, 2026
4044b86
Merge remote-tracking branch 'origin/dev' into issue/OSOE-925
sarahelsaig Jul 2, 2026
327b325
Update Microsoft.NET.Test.Sdk.
sarahelsaig Jul 10, 2026
d891be4
Merge remote-tracking branch 'origin/dev' into issue/OSOE-925
sarahelsaig Jul 10, 2026
1884524
Upgrade to OC 3.0.1
sarahelsaig Jul 11, 2026
2ae4621
Update NuGet versions.
sarahelsaig Jul 12, 2026
4177c82
revert all branch selectors
sarahelsaig Jul 18, 2026
0e68a2a
NuGet cleanup.
sarahelsaig Jul 18, 2026
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.TrainingDemo.Tests/Lombiq.TrainingDemo.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>

Expand All @@ -18,7 +18,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.7.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Moq.AutoMock" Version="3.5.0" />
<PackageReference Include="Moq.AutoMock" Version="4.0.1" />
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="xunit.v3" Version="3.2.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
Expand Down
4 changes: 2 additions & 2 deletions Lombiq.TrainingDemo.Web/Lombiq.TrainingDemo.Web.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<OrchardCoreVersion>2.2.1</OrchardCoreVersion>
<OrchardCoreVersion>3.0.0</OrchardCoreVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
59 changes: 0 additions & 59 deletions Lombiq.TrainingDemo.sln

This file was deleted.

19 changes: 19 additions & 0 deletions Lombiq.TrainingDemo.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Solution>
<Folder Name="/.github/" />
<Folder Name="/.github/workflows/">
<File Path=".github/workflows/build-and-test.yml" />
<File Path=".github/workflows/create-jira-issues-for-community-activities.yml" />
<File Path=".github/workflows/validate-pull-request.yml" />
</Folder>
<Folder Name="/Solution Items/">
<File Path=".gitattributes" />
<File Path=".gitignore" />
<File Path="License.md" />
<File Path="NuGet.config" />
<File Path="Readme.md" />
<File Path="Reset-Local.ps1" />
</Folder>
<Project Path="Lombiq.TrainingDemo.Tests/Lombiq.TrainingDemo.Tests.csproj" />
<Project Path="Lombiq.TrainingDemo.Web/Lombiq.TrainingDemo.Web.csproj" />
<Project Path="Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj" />
</Solution>
4 changes: 2 additions & 2 deletions Lombiq.TrainingDemo/Controllers/AdminController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public async Task<IActionResult> PersonListNewest()
.Where(index => index.ContentType == ContentTypes.PersonPage)
.OrderByDescending(index => index.CreatedUtc)
.Take(10)
.ListAsync();
.ListAsync(HttpContext.RequestAborted);

// In the Views/Admin/PersonList.cshtml file you can see how shape lists (IEnumerable<dynamic>) are displayed.
return View("PersonList", await GetShapesAsync(persons));
Expand All @@ -81,7 +81,7 @@ public async Task<IActionResult> PersonListOldest()
.Where(index => index.ContentType == ContentTypes.PersonPage)
.OrderBy(index => index.CreatedUtc)
.Take(10)
.ListAsync();
.ListAsync(HttpContext.RequestAborted);

return View("PersonList", await GetShapesAsync(persons));
}
Expand Down
4 changes: 2 additions & 2 deletions Lombiq.TrainingDemo/Controllers/DatabaseStorageController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public async Task<IActionResult> CreateBooksPost()
foreach (var book in CreateDemoBooks())
{
// So now you understand what will happen in the background when this service is being called.
await _session.SaveAsync(book);
await _session.SaveAsync(book, cancellationToken: HttpContext.RequestAborted);
}

await _notifier.InformationAsync(H["Books have been created in the database."]);
Expand All @@ -84,7 +84,7 @@ public async Task<IActionResult> JKRosenzweigBooks()
// In the .Where() method you can describe a lambda where the object will be the index object.
.Where(index => index.Author == "J.K. (Joanne) Rosenzweig")
// When the query is built up you can call ListAsync() to execute it. This will return a list of books.
.ListAsync();
.ListAsync(HttpContext.RequestAborted);

// Now this is what we possibly understand now, we will create a list of display shapes from the previously
// fetched books. Note how we use the AwaitEachAsync() extension to run async operations sequentially. This is
Expand Down
8 changes: 4 additions & 4 deletions Lombiq.TrainingDemo/Controllers/PersonListController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public async Task<IActionResult> OlderThan30()
// threshold date. Notice that there is no Where method. The Query method has an overload for that which can
// be useful if you don't want to filter in multiple indexes.
.Query<ContentItem, PersonPartIndex>(index => index.BirthDateUtc < thresholdDate)
.ListAsync();
.ListAsync(HttpContext.RequestAborted);

// Now let's build the display shape for a content item! Notice that this is not the IDisplayManager service.
// The IContentItemDisplayManager is an abstraction over that and it's specifically for content items. The
Expand Down Expand Up @@ -92,7 +92,7 @@ public async Task<string> FountainOfEternalYouth()
var thresholdDate = _clock.UtcNow.AddYears(-90);
var oldPeople = (await _session
.Query<ContentItem, PersonPartIndex>(index => index.BirthDateUtc < thresholdDate)
.ListAsync())
.ListAsync(HttpContext.RequestAborted))
.ToList();

foreach (var person in oldPeople)
Expand Down Expand Up @@ -136,7 +136,7 @@ public async Task<string> FountainOfEternalYouth()

return "People modified: " +
(oldPeople.Count != 0 ?
string.Join(", ", oldPeople.Select(person => person.As<PersonPart>().Name)) :
string.Join(", ", oldPeople.Select(person => person.GetOrCreate<PersonPart>().Name)) :
"Nobody. Did you create people older than 90?");

// That was a quick intro to modifying content items from code. It's a lot more involved than this but it should
Expand Down Expand Up @@ -167,7 +167,7 @@ public async Task<string> CreateAnAndroid()

// Watch out, this is different compared to editing existing content items! You can't do this within
// person.Alter<PersonPart>(). You have to fetch the content part anew and alter the fields like this:
var personPart = person.As<PersonPart>();
var personPart = person.GetOrCreate<PersonPart>();
personPart.Alter<TextField>(nameof(PersonPart.Biography), field => field.Text = "I'm sentient now!");

// This is the point where we actually save the content item into the database. Note that it's saved as a draft.
Expand Down
4 changes: 2 additions & 2 deletions Lombiq.TrainingDemo/Drivers/ColorFieldDisplayDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public override async Task<IDisplayResult> UpdateAsync(ColorField field, UpdateF

// Also some custom validation for our ColorField hex value.
var isInvalidHexColor = !string.IsNullOrWhiteSpace(viewModel.Value) &&
!RegexExpression().IsMatch(viewModel.Value);
!RegexExpression.IsMatch(viewModel.Value);

if (isInvalidHexColor) updater.ModelState.AddModelError(Prefix, T["The given color is invalid."]);

Expand All @@ -85,7 +85,7 @@ public override async Task<IDisplayResult> UpdateAsync(ColorField field, UpdateF
}

[GeneratedRegex("^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", RegexOptions.ExplicitCapture, matchTimeoutMilliseconds: 1000)]
private static partial Regex RegexExpression();
private static partial Regex RegexExpression { get; }
}

// END OF TRAINING SECTION: Content Field development
Expand Down
14 changes: 8 additions & 6 deletions Lombiq.TrainingDemo/Events/LoginGreeting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
* login events.
*/

#nullable enable

using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Localization;
using OrchardCore.DisplayManagement.Notify;
using OrchardCore.Users;
Expand All @@ -15,7 +18,7 @@
namespace Lombiq.TrainingDemo.Events;

// ILoginFormEvent exposes events of the, well, login form :). Useful to display a login greeting or anything even more
// useful! The rest of it is pretty standard and we just use INotifier again.
// useful! The rest of it is pretty standard, and we just use INotifier again.
public class LoginGreeting : ILoginFormEvent
{
private readonly INotifier _notifier;
Expand All @@ -29,15 +32,14 @@ public LoginGreeting(INotifier notifier, IHtmlLocalizer<LoginGreeting> htmlLocal

public Task IsLockedOutAsync(IUser user) => Task.CompletedTask;

public async Task LoggedInAsync(IUser user)
{
public async Task LoggedInAsync(IUser user) =>
await _notifier.SuccessAsync(H["Hi {0}!", user.UserName]);

return;
}

public Task LoggingInAsync(string userName, Action<string, string> reportError) => Task.CompletedTask;

public Task<IActionResult?> LoggingInAsync() => Task.FromResult<IActionResult?>(null);
public Task<IActionResult?> ValidatingLoginAsync(IUser user) => Task.FromResult<IActionResult?>(null);

public Task LoggingInFailedAsync(string userName) => Task.CompletedTask;

public Task LoggingInFailedAsync(IUser user) => Task.CompletedTask;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ public void Build(
AddFilter(contentQuery, "_ne");
}

public void Clear()
{
// Nothing to do here.
}
Comment thread
Piedone marked this conversation as resolved.

private static void AddFilter(FieldType contentQuery, string suffix)
{
var argument = new QueryArgument<IntGraphType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public Task<IEnumerable<ContentItem>> PostQueryAsync(
var filterType = name[^2..]; // The name operator like gt, le, etc.

contentItems = contentItems.Where(item =>
item.As<PersonPart>()?.BirthDateUtc is { } birthDateUtc &&
item.GetMaybe<PersonPart>()?.BirthDateUtc is { } birthDateUtc &&
Filter((now - birthDateUtc).TotalYears(), age, filterType));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using GraphQL.Types;
using Lombiq.TrainingDemo.Indexes;
using Lombiq.TrainingDemo.Models;
using Microsoft.Extensions.Localization;
using OrchardCore.Apis.GraphQL.Queries;
using static Lombiq.TrainingDemo.GraphQL.Services.PersonPartObjectGraphType;

Expand All @@ -10,7 +11,8 @@ namespace Lombiq.TrainingDemo.GraphQL.Services;
// automatically generate YesSql logic for database-side filtering.
public class PersonPartWhereInputObjectGraphType : WhereInputObjectGraphType<PersonPart>
{
public PersonPartWhereInputObjectGraphType()
public PersonPartWhereInputObjectGraphType(IStringLocalizer<PersonPartWhereInputObjectGraphType> stringLocalizer)
: base(stringLocalizer)
{
// Since filters depend on the index, we use their "nameof" as reference.
AddScalarFilterFields<DateTimeGraphType>(nameof(PersonPartIndex.BirthDateUtc), BirthDateDescription);
Expand Down
10 changes: 9 additions & 1 deletion Lombiq.TrainingDemo/Handlers/PersonPartHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Lombiq.TrainingDemo.Handlers;

// Handlers are basically event handlers for content parts and content items. When you ask something like "how can I run
// my code when my content part is published?" most possibly the answer will be to write a handler. This one here is a
// handler for a content part but you could similarly have a handler for whole content items by inheriting from
// handler for a content part, but you could similarly have a handler for whole content items by inheriting from
// ContentHandlerBase.
public class PersonPartHandler : ContentPartHandler<PersonPart>
{
Expand All @@ -16,10 +16,18 @@ public class PersonPartHandler : ContentPartHandler<PersonPart>
// content item is updated. Check out all the other events that you can use!
public override Task UpdatedAsync(UpdateContentContext context, PersonPart part)
{
// Note that the Title Part already does this specific thing. So if that's all you wanted from a handler than
// using Title Part instead of a custom field and handler combination makes more sense.
context.ContentItem.DisplayText = part.Name;

return Task.CompletedTask;
}

// If you've ever used Orchard Core before 3.0, "UpdatedAsync" used to be called during content item creation as
// well. Since 3.0 it's intentionally not the case, so you have to apply such a bridge code if you use "Updating*"
// or "Updated*" methods. Alternatively, put the shared code in a private method and call it from both.
public override Task CreatedAsync(CreateContentContext context, PersonPart part) =>
UpdatedAsync(new UpdateContentContext(context.ContentItem), part);
}

// END OF TRAINING SECTION: Content Item display management and queries
Expand Down
2 changes: 1 addition & 1 deletion Lombiq.TrainingDemo/Indexes/PersonPartIndex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public override void Describe(DescribeContext<ContentItem> context) =>
// https://github.com/sebastienros/yessql/wiki/Tutorial
.Map(contentItem =>
{
var personPart = contentItem.As<PersonPart>();
var personPart = contentItem.GetOrCreate<PersonPart>();

return new PersonPartIndex
{
Expand Down
Loading
Loading