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

TDEAL-2: Add EnableAutoSetupIfNotUITesting extension method #611

Merged
merged 11 commits into from
Nov 13, 2023
24 changes: 10 additions & 14 deletions src/Lombiq.OSOCE.Web/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using OrchardCore.Logging;
using System.Collections.Generic;
Expand All @@ -16,21 +15,18 @@
// create UI tests check out the project.
builder.Services
.AddSingleton(configuration)
.AddOrchardCms(orchardCoreBuilder =>
{
orchardCoreBuilder
.AddOrchardCoreApplicationInsightsTelemetry(configuration)
.ConfigureFeaturesGuard(
.AddOrchardCms(orchardCoreBuilder => orchardCoreBuilder
.AddOrchardCoreApplicationInsightsTelemetry(configuration)
.ConfigureFeaturesGuard(
new Dictionary<string, IEnumerable<string>>
{
["OrchardCore.Twitter"] = new[] { "Lombiq.UIKit", "Lombiq.ChartJs" },
});

if (!configuration.IsUITesting())
{
orchardCoreBuilder.AddSetupFeatures("OrchardCore.AutoSetup");
}
});
["OrchardCore.Twitter"] = new[]
{
Lombiq.UIKit.FeatureIds.Base,
Lombiq.ChartJs.Constants.FeatureIds.Default,
},
})
.EnableAutoSetupIfNotUITesting(configuration));

var app = builder.Build();

Expand Down
2 changes: 1 addition & 1 deletion tools/Lombiq.GitHub.Actions