Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ dotnet_diagnostic.CA1724.severity = none
# CA2007 — consider calling ConfigureAwait (not needed in ASP.NET Core)
dotnet_diagnostic.CA2007.severity = none

# CA1711 — identifiers should not have incorrect suffix (xUnit collections, EventHandler, Permission)
dotnet_diagnostic.CA1711.severity = none

# CA1716 — identifiers should not match keywords
dotnet_diagnostic.CA1716.severity = none

Expand Down
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<RestoreUseStaticGraphEvaluation>true</RestoreUseStaticGraphEvaluation>
<!-- Hardlinks instead of file copies where possible -->
<CreateHardLinksForCopyFilesToOutputDirectoryIfPossible>true</CreateHardLinksForCopyFilesToOutputDirectoryIfPossible>
<!-- Auto-discover runsettings for parallel test execution -->
<RunSettingsFilePath>$(MSBuildThisFileDirectory)test.runsettings</RunSettingsFilePath>
</PropertyGroup>
<!-- NuGet package metadata (version injected by CI via -p:Version) -->
<PropertyGroup>
Expand Down
6 changes: 6 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<!-- Remove Roslynator from test projects (not needed for test code quality) -->
<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<PackageReference Remove="Roslynator.Analyzers" />
</ItemGroup>
</Project>
6 changes: 1 addition & 5 deletions framework/SimpleModule.Agents/AgentChatService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@ public async IAsyncEnumerable<string> ChatStreamAsync(
? new FunctionInvokingChatClient(chatClient)
: chatClient;
await foreach (
var update in client.GetStreamingResponseAsync(
messages,
chatOptions,
cancellationToken
)
var update in client.GetStreamingResponseAsync(messages, chatOptions, cancellationToken)
)
{
foreach (var content in update.Contents)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,17 @@ public void Emit(SourceProductionContext context, DiscoveryData data)

foreach (var module in data.Modules)
{
sb.AppendLine(
$" typeof({module.FullyQualifiedName}).Assembly,"
);
sb.AppendLine($" typeof({module.FullyQualifiedName}).Assembly,");
}

sb.AppendLine(" };");
sb.AppendLine(" loader.Initialize(assemblies);");
sb.AppendLine(" }");
sb.AppendLine("}");

context.AddSource("LocalizationExtensions.g.cs", SourceText.From(sb.ToString(), Encoding.UTF8));
context.AddSource(
"LocalizationExtensions.g.cs",
SourceText.From(sb.ToString(), Encoding.UTF8)
);
}
}
7 changes: 1 addition & 6 deletions framework/SimpleModule.Rag/KnowledgeIndexingHostedService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
using var sourceScope = serviceProvider.CreateScope();
var scopedStore = sourceScope.ServiceProvider.GetRequiredService<IKnowledgeStore>();
await IndexSourceAsync(
scopedStore,
source,
sourceScope.ServiceProvider,
stoppingToken
);
await IndexSourceAsync(scopedStore, source, sourceScope.ServiceProvider, stoppingToken);
});
await Task.WhenAll(tasks);
}
Expand Down
1 change: 0 additions & 1 deletion framework/SimpleModule.Rag/VectorKnowledgeStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public async Task<IReadOnlyList<KnowledgeSearchResult>> SearchAsync(
if (!await collection.CollectionExistsAsync(cancellationToken))
return [];


var queryEmbeddings = await embeddingGenerator.GenerateAsync(
[query],
cancellationToken: cancellationToken
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

namespace Admin.Tests.Integration;

public class AdminPermissionsTests : IClassFixture<SimpleModuleWebApplicationFactory>
[Collection(TestCollections.Integration)]
public class AdminPermissionsTests
{
private readonly SimpleModuleWebApplicationFactory _factory;

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

namespace Admin.Tests.Integration;

public class AdminRolesEndpointTests : IClassFixture<SimpleModuleWebApplicationFactory>
[Collection(TestCollections.Integration)]
public class AdminRolesEndpointTests
{
private readonly SimpleModuleWebApplicationFactory _factory;

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

namespace Admin.Tests.Integration;

public class AdminUsersEndpointTests : IClassFixture<SimpleModuleWebApplicationFactory>
[Collection(TestCollections.Integration)]
public class AdminUsersEndpointTests
{
private readonly SimpleModuleWebApplicationFactory _factory;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using SimpleModule.Tests.Shared.Fixtures;
using Xunit;

[CollectionDefinition(TestCollections.Integration)]
public sealed class IntegrationTestCollection
: ICollectionFixture<SimpleModuleWebApplicationFactory>;
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)

if (batch.Count > 0)
{
await FlushBatchAsync(batch, opts.MaxLogEntries, stoppingToken);
// Use CancellationToken.None: entries were already consumed from the
// channel, so the flush must complete to avoid data loss if StopAsync
// cancels stoppingToken mid-save.
await FlushBatchAsync(batch, opts.MaxLogEntries, CancellationToken.None);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

namespace BackgroundJobs.Tests.Integration;

public class BackgroundJobsEndpointTests : IClassFixture<SimpleModuleWebApplicationFactory>
[Collection(TestCollections.Integration)]
public class BackgroundJobsEndpointTests
{
private readonly SimpleModuleWebApplicationFactory _factory;

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

namespace BackgroundJobs.Tests.Integration;

public class BackgroundJobsViewEndpointTests : IClassFixture<SimpleModuleWebApplicationFactory>
[Collection(TestCollections.Integration)]
public class BackgroundJobsViewEndpointTests
{
private readonly SimpleModuleWebApplicationFactory _factory;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using SimpleModule.Tests.Shared.Fixtures;
using Xunit;

[CollectionDefinition(TestCollections.Integration)]
public sealed class IntegrationTestCollection
: ICollectionFixture<SimpleModuleWebApplicationFactory>;
1 change: 1 addition & 0 deletions modules/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />
<!--
Incremental JS/Vite build for modules.
Skips npx vite build when no source files have changed since the last build.
Expand Down
156 changes: 78 additions & 78 deletions modules/Email/src/SimpleModule.Email/Locales/keys.ts
Original file line number Diff line number Diff line change
@@ -1,110 +1,110 @@
export const EmailKeys = {
Templates: {
Title: 'Templates.Title',
Description: 'Templates.Description',
NewTemplate: 'Templates.NewTemplate',
ColName: 'Templates.ColName',
ColSlug: 'Templates.ColSlug',
ColSubject: 'Templates.ColSubject',
ColHtml: 'Templates.ColHtml',
ColActions: 'Templates.ColActions',
EditButton: 'Templates.EditButton',
DeleteButton: 'Templates.DeleteButton',
EmptyTitle: 'Templates.EmptyTitle',
EmptyDescription: 'Templates.EmptyDescription',
DeleteDialog: {
Title: 'Templates.DeleteDialog.Title',
Confirm: 'Templates.DeleteDialog.Confirm',
DeleteButton: 'Templates.DeleteDialog.DeleteButton',
},
CancelButton: 'Templates.CancelButton',
Yes: 'Templates.Yes',
No: 'Templates.No',
FilterSearch: 'Templates.FilterSearch',
FilterApply: 'Templates.FilterApply',
Showing: 'Templates.Showing',
Of: 'Templates.Of',
Previous: 'Templates.Previous',
Next: 'Templates.Next',
},
CreateTemplate: {
Title: 'CreateTemplate.Title',
Description: 'CreateTemplate.Description',
CardTitle: 'CreateTemplate.CardTitle',
BodyLabel: 'CreateTemplate.BodyLabel',
BodyPlaceholder: 'CreateTemplate.BodyPlaceholder',
Breadcrumb: 'CreateTemplate.Breadcrumb',
BreadcrumbTemplates: 'CreateTemplate.BreadcrumbTemplates',
CancelButton: 'CreateTemplate.CancelButton',
CardTitle: 'CreateTemplate.CardTitle',
Description: 'CreateTemplate.Description',
IsHtmlLabel: 'CreateTemplate.IsHtmlLabel',
NameLabel: 'CreateTemplate.NameLabel',
SlugLabel: 'CreateTemplate.SlugLabel',
SlugPlaceholder: 'CreateTemplate.SlugPlaceholder',
SubjectLabel: 'CreateTemplate.SubjectLabel',
SubjectPlaceholder: 'CreateTemplate.SubjectPlaceholder',
BodyLabel: 'CreateTemplate.BodyLabel',
BodyPlaceholder: 'CreateTemplate.BodyPlaceholder',
IsHtmlLabel: 'CreateTemplate.IsHtmlLabel',
SubmitButton: 'CreateTemplate.SubmitButton',
CancelButton: 'CreateTemplate.CancelButton',
Title: 'CreateTemplate.Title',
},
Dashboard: {
DailyVolume: 'Dashboard.DailyVolume',
Description: 'Dashboard.Description',
Failed: 'Dashboard.Failed',
FailureRate: 'Dashboard.FailureRate',
Last24Hours: 'Dashboard.Last24Hours',
Sent: 'Dashboard.Sent',
Title: 'Dashboard.Title',
TopErrorsCount: 'Dashboard.TopErrorsCount',
TopErrorsEmpty: 'Dashboard.TopErrorsEmpty',
TopErrorsErrorMessage: 'Dashboard.TopErrorsErrorMessage',
TopErrorsTitle: 'Dashboard.TopErrorsTitle',
TotalFailed: 'Dashboard.TotalFailed',
TotalQueued: 'Dashboard.TotalQueued',
TotalRetrying: 'Dashboard.TotalRetrying',
TotalSent: 'Dashboard.TotalSent',
},
EditTemplate: {
Title: 'EditTemplate.Title',
Description: 'EditTemplate.Description',
CardTitle: 'EditTemplate.CardTitle',
BodyLabel: 'EditTemplate.BodyLabel',
Breadcrumb: 'EditTemplate.Breadcrumb',
BreadcrumbTemplates: 'EditTemplate.BreadcrumbTemplates',
NameLabel: 'EditTemplate.NameLabel',
SubjectLabel: 'EditTemplate.SubjectLabel',
BodyLabel: 'EditTemplate.BodyLabel',
IsHtmlLabel: 'EditTemplate.IsHtmlLabel',
SaveChanges: 'EditTemplate.SaveChanges',
CancelButton: 'EditTemplate.CancelButton',
CardTitle: 'EditTemplate.CardTitle',
DangerZone: 'EditTemplate.DangerZone',
DeleteTemplate: 'EditTemplate.DeleteTemplate',
DeleteDialog: {
Title: 'EditTemplate.DeleteDialog.Title',
CancelButton: 'EditTemplate.DeleteDialog.CancelButton',
Confirm: 'EditTemplate.DeleteDialog.Confirm',
DeleteButton: 'EditTemplate.DeleteDialog.DeleteButton',
CancelButton: 'EditTemplate.DeleteDialog.CancelButton',
Title: 'EditTemplate.DeleteDialog.Title',
},
DeleteTemplate: 'EditTemplate.DeleteTemplate',
Description: 'EditTemplate.Description',
IsHtmlLabel: 'EditTemplate.IsHtmlLabel',
NameLabel: 'EditTemplate.NameLabel',
SaveChanges: 'EditTemplate.SaveChanges',
SubjectLabel: 'EditTemplate.SubjectLabel',
Title: 'EditTemplate.Title',
},
History: {
Title: 'History.Title',
Description: 'History.Description',
ColTo: 'History.ColTo',
ColSubject: 'History.ColSubject',
ColStatus: 'History.ColStatus',
AllStatuses: 'History.AllStatuses',
ColError: 'History.ColError',
ColProvider: 'History.ColProvider',
ColSentAt: 'History.ColSentAt',
ColError: 'History.ColError',
EmptyTitle: 'History.EmptyTitle',
ColStatus: 'History.ColStatus',
ColSubject: 'History.ColSubject',
ColTo: 'History.ColTo',
Description: 'History.Description',
EmptyDescription: 'History.EmptyDescription',
FilterStatus: 'History.FilterStatus',
FilterTo: 'History.FilterTo',
FilterSubject: 'History.FilterSubject',
EmptyTitle: 'History.EmptyTitle',
EmptyWithFilters: 'History.EmptyWithFilters',
FilterApply: 'History.FilterApply',
FilterClear: 'History.FilterClear',
FilterDateFrom: 'History.FilterDateFrom',
FilterDateTo: 'History.FilterDateTo',
AllStatuses: 'History.AllStatuses',
Showing: 'History.Showing',
FilterStatus: 'History.FilterStatus',
FilterSubject: 'History.FilterSubject',
FilterTo: 'History.FilterTo',
Next: 'History.Next',
Of: 'History.Of',
Previous: 'History.Previous',
Next: 'History.Next',
FilterApply: 'History.FilterApply',
FilterClear: 'History.FilterClear',
EmptyWithFilters: 'History.EmptyWithFilters',
Showing: 'History.Showing',
Title: 'History.Title',
},
Dashboard: {
Title: 'Dashboard.Title',
Description: 'Dashboard.Description',
TotalSent: 'Dashboard.TotalSent',
TotalFailed: 'Dashboard.TotalFailed',
TotalQueued: 'Dashboard.TotalQueued',
TotalRetrying: 'Dashboard.TotalRetrying',
Last24Hours: 'Dashboard.Last24Hours',
FailureRate: 'Dashboard.FailureRate',
DailyVolume: 'Dashboard.DailyVolume',
TopErrorsTitle: 'Dashboard.TopErrorsTitle',
TopErrorsErrorMessage: 'Dashboard.TopErrorsErrorMessage',
TopErrorsCount: 'Dashboard.TopErrorsCount',
TopErrorsEmpty: 'Dashboard.TopErrorsEmpty',
Sent: 'Dashboard.Sent',
Failed: 'Dashboard.Failed',
Templates: {
CancelButton: 'Templates.CancelButton',
ColActions: 'Templates.ColActions',
ColHtml: 'Templates.ColHtml',
ColName: 'Templates.ColName',
ColSlug: 'Templates.ColSlug',
ColSubject: 'Templates.ColSubject',
DeleteButton: 'Templates.DeleteButton',
DeleteDialog: {
Confirm: 'Templates.DeleteDialog.Confirm',
DeleteButton: 'Templates.DeleteDialog.DeleteButton',
Title: 'Templates.DeleteDialog.Title',
},
Description: 'Templates.Description',
EditButton: 'Templates.EditButton',
EmptyDescription: 'Templates.EmptyDescription',
EmptyTitle: 'Templates.EmptyTitle',
FilterApply: 'Templates.FilterApply',
FilterSearch: 'Templates.FilterSearch',
NewTemplate: 'Templates.NewTemplate',
Next: 'Templates.Next',
No: 'Templates.No',
Of: 'Templates.Of',
Previous: 'Templates.Previous',
Showing: 'Templates.Showing',
Title: 'Templates.Title',
Yes: 'Templates.Yes',
},
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

namespace FeatureFlags.Tests.Integration;

[Collection(TestCollections.Integration)]
public class FeatureFlagEndpointTests(SimpleModuleWebApplicationFactory factory)
: IClassFixture<SimpleModuleWebApplicationFactory>
{
private static readonly string[] ViewPermission = [FeatureFlagsPermissions.View];

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using SimpleModule.Tests.Shared.Fixtures;
using Xunit;

[CollectionDefinition(TestCollections.Integration)]
public sealed class IntegrationTestCollection
: ICollectionFixture<SimpleModuleWebApplicationFactory>;
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ public void ConfigureServices(IServiceCollection services, IConfiguration config
services.AddLocalization();
services.AddSingleton<IStringLocalizerFactory, JsonStringLocalizerFactory>();
services.AddScoped<LocalizationService>();
services.AddScoped<ILocalizationContracts>(sp => sp.GetRequiredService<LocalizationService>());
services.AddScoped<ILocalizationContracts>(sp =>
sp.GetRequiredService<LocalizationService>()
);
}

public void ConfigureMiddleware(IApplicationBuilder app)
Expand Down
Loading
Loading