diff --git a/src/common/Elsa.Features/Implementations/Module.cs b/src/common/Elsa.Features/Implementations/Module.cs index 4821e91d79..ba9cc1d2e6 100644 --- a/src/common/Elsa.Features/Implementations/Module.cs +++ b/src/common/Elsa.Features/Implementations/Module.cs @@ -127,6 +127,7 @@ public void Apply() } Services.AddSingleton(registry); + Services.AddSingleton(sp => new InstalledFeatureProvider(sp.GetRequiredService())); } private IEnumerable ExcludeFeaturesWithMissingDependencies(IEnumerable features) diff --git a/src/modules/Elsa.Common/Elsa.Common.csproj b/src/modules/Elsa.Common/Elsa.Common.csproj index 7767da9750..8aaef8d1a8 100644 --- a/src/modules/Elsa.Common/Elsa.Common.csproj +++ b/src/modules/Elsa.Common/Elsa.Common.csproj @@ -15,7 +15,6 @@ - diff --git a/src/modules/Elsa.Common/ShellFeatures/DefaultFormattersFeature.cs b/src/modules/Elsa.Common/ShellFeatures/DefaultFormattersFeature.cs index 930bfb1a87..be1213da84 100644 --- a/src/modules/Elsa.Common/ShellFeatures/DefaultFormattersFeature.cs +++ b/src/modules/Elsa.Common/ShellFeatures/DefaultFormattersFeature.cs @@ -6,6 +6,7 @@ namespace Elsa.Common.ShellFeatures; +[ShellFeature("DefaultFormatters")] public class DefaultFormattersFeature : IShellFeature { public void ConfigureServices(IServiceCollection services) diff --git a/src/modules/Elsa.Common/ShellFeatures/MediatorFeature.cs b/src/modules/Elsa.Common/ShellFeatures/MediatorFeature.cs index f4f355b4c5..43e2ed7dbe 100644 --- a/src/modules/Elsa.Common/ShellFeatures/MediatorFeature.cs +++ b/src/modules/Elsa.Common/ShellFeatures/MediatorFeature.cs @@ -6,6 +6,7 @@ namespace Elsa.Common.ShellFeatures; /// /// Adds and configures the Mediator feature. /// +[ShellFeature("Mediator")] public class MediatorFeature : IShellFeature { public void ConfigureServices(IServiceCollection services) diff --git a/src/modules/Elsa.Common/ShellFeatures/MultitenancyFeature.cs b/src/modules/Elsa.Common/ShellFeatures/MultitenancyFeature.cs index 7e43f4e5e6..dc2c02343e 100644 --- a/src/modules/Elsa.Common/ShellFeatures/MultitenancyFeature.cs +++ b/src/modules/Elsa.Common/ShellFeatures/MultitenancyFeature.cs @@ -9,6 +9,7 @@ namespace Elsa.Common.ShellFeatures; +[ShellFeature("Multitenancy")] public class MultitenancyFeature : IShellFeature { private readonly Func _tenantsProviderFactory = sp => sp.GetRequiredService(); diff --git a/src/modules/Elsa.Common/ShellFeatures/StringCompressionFeature.cs b/src/modules/Elsa.Common/ShellFeatures/StringCompressionFeature.cs index 3d75e87b30..9a0b4ed59f 100644 --- a/src/modules/Elsa.Common/ShellFeatures/StringCompressionFeature.cs +++ b/src/modules/Elsa.Common/ShellFeatures/StringCompressionFeature.cs @@ -7,6 +7,7 @@ namespace Elsa.Common.ShellFeatures; [UsedImplicitly] +[ShellFeature("StringCompression")] public class StringCompressionFeature : IShellFeature { public void ConfigureServices(IServiceCollection services) diff --git a/src/modules/Elsa.Common/ShellFeatures/SystemClockFeature.cs b/src/modules/Elsa.Common/ShellFeatures/SystemClockFeature.cs index 93dd9831e7..0ef670e2b2 100644 --- a/src/modules/Elsa.Common/ShellFeatures/SystemClockFeature.cs +++ b/src/modules/Elsa.Common/ShellFeatures/SystemClockFeature.cs @@ -7,6 +7,7 @@ namespace Elsa.Common.ShellFeatures; /// /// Configures the system clock. /// +[ShellFeature("SystemClock")] public class SystemClockFeature : IShellFeature { public void ConfigureServices(IServiceCollection services) diff --git a/src/modules/Elsa.Expressions.JavaScript/ShellFeatures/JavaScriptFeature.cs b/src/modules/Elsa.Expressions.JavaScript/ShellFeatures/JavaScriptFeature.cs index 4f06cffef9..e4cc1fad4f 100644 --- a/src/modules/Elsa.Expressions.JavaScript/ShellFeatures/JavaScriptFeature.cs +++ b/src/modules/Elsa.Expressions.JavaScript/ShellFeatures/JavaScriptFeature.cs @@ -37,7 +37,6 @@ public void ConfigureServices(IServiceCollection services) // JavaScript services. services .AddScoped() - .AddScoped() .AddExpressionDescriptorProvider(); // Type definition services. diff --git a/src/modules/Elsa.Expressions/ShellFeatures/ExpressionsFeature.cs b/src/modules/Elsa.Expressions/ShellFeatures/ExpressionsFeature.cs index 94032e21d8..eccf3af3cf 100644 --- a/src/modules/Elsa.Expressions/ShellFeatures/ExpressionsFeature.cs +++ b/src/modules/Elsa.Expressions/ShellFeatures/ExpressionsFeature.cs @@ -8,6 +8,7 @@ namespace Elsa.Expressions.ShellFeatures; /// /// Installs and configures the expressions feature. /// +[ShellFeature("Expressions")] public class ExpressionsFeature : IShellFeature { public void ConfigureServices(IServiceCollection services) diff --git a/src/modules/Elsa.Identity/ShellFeatures/IdentityFeature.cs b/src/modules/Elsa.Identity/ShellFeatures/IdentityFeature.cs index d03b496ee3..8ac1bf4df2 100644 --- a/src/modules/Elsa.Identity/ShellFeatures/IdentityFeature.cs +++ b/src/modules/Elsa.Identity/ShellFeatures/IdentityFeature.cs @@ -56,8 +56,8 @@ public class IdentityFeature : IFastEndpointsShellFeature public void ConfigureServices(IServiceCollection services) { - // Configure options with defaults - services.Configure(options => { options.SigningKey = "A really long signing key that should be replaced with something more secure."; }); + // Configure options - Note: SigningKey must be configured by the application for security + services.Configure(_ => { }); services.Configure(ApiKeyDefaults.AuthenticationScheme, options => { options.Realm = "Elsa Workflows"; diff --git a/src/modules/Elsa.Persistence.EFCore.Common/PersistenceShellFeatureBase.cs b/src/modules/Elsa.Persistence.EFCore.Common/PersistenceShellFeatureBase.cs index 4da028d57c..4f8c46a914 100644 --- a/src/modules/Elsa.Persistence.EFCore.Common/PersistenceShellFeatureBase.cs +++ b/src/modules/Elsa.Persistence.EFCore.Common/PersistenceShellFeatureBase.cs @@ -23,7 +23,7 @@ public abstract class PersistenceShellFeatureBase : IShellFeature public bool RunMigrations { get; set; } = true; /// - /// Gets or sets the lifetime of the . Defaults to . + /// Gets or sets the lifetime of the . Defaults to . /// public ServiceLifetime DbContextFactoryLifetime { get; set; } = ServiceLifetime.Scoped; diff --git a/src/modules/Elsa.WorkflowProviders.BlobStorage/ShellFeatures/BlobStorageFeature.cs b/src/modules/Elsa.WorkflowProviders.BlobStorage/ShellFeatures/BlobStorageFeature.cs index 805f89aba5..0edba6556c 100644 --- a/src/modules/Elsa.WorkflowProviders.BlobStorage/ShellFeatures/BlobStorageFeature.cs +++ b/src/modules/Elsa.WorkflowProviders.BlobStorage/ShellFeatures/BlobStorageFeature.cs @@ -42,8 +42,11 @@ public void ConfigureServices(IServiceCollection services) /// public static string GetDefaultWorkflowsDirectory() { - var entryAssemblyDir = Path.GetDirectoryName(Assembly.GetEntryAssembly()!.Location)!; - var directory = Path.Combine(entryAssemblyDir, "Workflows"); + var entryAssembly = Assembly.GetEntryAssembly(); + var entryAssemblyDir = entryAssembly != null + ? Path.GetDirectoryName(entryAssembly.Location) + : AppContext.BaseDirectory; + var directory = Path.Combine(entryAssemblyDir!, "Workflows"); return directory; } } diff --git a/src/modules/Elsa.Workflows.Core/Elsa.Workflows.Core.csproj b/src/modules/Elsa.Workflows.Core/Elsa.Workflows.Core.csproj index 74eb3c854b..e400062f4d 100644 --- a/src/modules/Elsa.Workflows.Core/Elsa.Workflows.Core.csproj +++ b/src/modules/Elsa.Workflows.Core/Elsa.Workflows.Core.csproj @@ -12,7 +12,6 @@ - diff --git a/src/modules/Elsa.Workflows.Core/ShellFeatures/CommitStrategiesFeature.cs b/src/modules/Elsa.Workflows.Core/ShellFeatures/CommitStrategiesFeature.cs index c529df84d4..5c8803789d 100644 --- a/src/modules/Elsa.Workflows.Core/ShellFeatures/CommitStrategiesFeature.cs +++ b/src/modules/Elsa.Workflows.Core/ShellFeatures/CommitStrategiesFeature.cs @@ -6,6 +6,7 @@ namespace Elsa.Workflows.ShellFeatures; +[ShellFeature("CommitStrategies")] public class CommitStrategiesFeature : IShellFeature { public void ConfigureServices(IServiceCollection services) diff --git a/src/modules/Elsa.Workflows.Core/ShellFeatures/WorkflowsFeature.cs b/src/modules/Elsa.Workflows.Core/ShellFeatures/WorkflowsFeature.cs index 4c906c1617..4e88b9ef2f 100644 --- a/src/modules/Elsa.Workflows.Core/ShellFeatures/WorkflowsFeature.cs +++ b/src/modules/Elsa.Workflows.Core/ShellFeatures/WorkflowsFeature.cs @@ -172,12 +172,6 @@ public void ConfigureServices(IServiceCollection services) // Logging .AddLogging(); - - // Flowchart - services.AddSerializationOptionsConfigurator(); - - // Register FlowchartOptions - services.AddOptions(); // Overridable services services.AddScoped(); diff --git a/src/modules/Elsa.Workflows.Management/ShellFeatures/WorkflowManagementFeature.cs b/src/modules/Elsa.Workflows.Management/ShellFeatures/WorkflowManagementFeature.cs index 65b632402f..8c81f0e9a1 100644 --- a/src/modules/Elsa.Workflows.Management/ShellFeatures/WorkflowManagementFeature.cs +++ b/src/modules/Elsa.Workflows.Management/ShellFeatures/WorkflowManagementFeature.cs @@ -112,11 +112,7 @@ public void ConfigureServices(IServiceCollection services) .AddSingleton() .AddSingleton() .AddScoped() - .AddScoped() - .AddSingleton() - .Decorate() - .Decorate() - .AddNotificationHandler(); + .AddScoped(); services .AddNotificationHandler() diff --git a/src/modules/Elsa.Workflows.Runtime/ShellFeatures/WorkflowRuntimeFeature.cs b/src/modules/Elsa.Workflows.Runtime/ShellFeatures/WorkflowRuntimeFeature.cs index 0fdc8ae6ea..a1905acaff 100644 --- a/src/modules/Elsa.Workflows.Runtime/ShellFeatures/WorkflowRuntimeFeature.cs +++ b/src/modules/Elsa.Workflows.Runtime/ShellFeatures/WorkflowRuntimeFeature.cs @@ -134,10 +134,6 @@ public void ConfigureServices(IServiceCollection services) { options.Channels.AddRange(WorkflowDispatcherChannels.Values); }); - services.Configure(options => - { - options.Schedule.ConfigureTask(TimeSpan.FromSeconds(10)); - }); services // Core. @@ -182,9 +178,7 @@ public void ConfigureServices(IServiceCollection services) .AddScoped() .AddScoped() .AddScoped(WorkflowResumer) - .AddScoped() .AddScoped(BookmarkQueueWorker) - .AddScoped() .AddScoped() .AddScoped() .AddScoped() @@ -262,13 +256,5 @@ public void ConfigureServices(IServiceCollection services) .AddScoped() .AddScoped() ; - - services - // Decorators. - .Decorate() - - // Handlers. - .AddNotificationHandler() - .AddNotificationHandler(); } } \ No newline at end of file