diff --git a/src/modules/Elsa.Workflows.Core/UIHints/SqlEditor/SqlCodeOptionsProvider.cs b/src/modules/Elsa.Sql/Activities/SqlCodeOptionsProvider.cs similarity index 86% rename from src/modules/Elsa.Workflows.Core/UIHints/SqlEditor/SqlCodeOptionsProvider.cs rename to src/modules/Elsa.Sql/Activities/SqlCodeOptionsProvider.cs index 588ea20cf..f61bad42f 100644 --- a/src/modules/Elsa.Workflows.Core/UIHints/SqlEditor/SqlCodeOptionsProvider.cs +++ b/src/modules/Elsa.Sql/Activities/SqlCodeOptionsProvider.cs @@ -2,7 +2,7 @@ using System.Reflection; using Elsa.Workflows.UIHints.CodeEditor; // ReSharper disable once CheckNamespace -namespace Elsa.Workflows.UIHints.SqlEditor; +namespace Elsa.Sql.Activities; internal class SqlCodeOptionsProvider : CodeEditorOptionsProviderBase { diff --git a/src/modules/Elsa.Sql/Activities/SqlCommand.cs b/src/modules/Elsa.Sql/Activities/SqlCommand.cs index 0038e1aeb..da287a5db 100644 --- a/src/modules/Elsa.Sql/Activities/SqlCommand.cs +++ b/src/modules/Elsa.Sql/Activities/SqlCommand.cs @@ -44,7 +44,9 @@ public class SqlCommand : Activity /// [Input( Description = "Command to run against the database.", - UIHint = InputUIHints.SqlEditor)] + UIHint = InputUIHints.CodeEditor, + UIHandler = typeof(SqlCodeOptionsProvider) + )] public Input Command { get; set; } = default!; diff --git a/src/modules/Elsa.Sql/Activities/SqlQuery.cs b/src/modules/Elsa.Sql/Activities/SqlQuery.cs index 4a2653055..27d9c34a1 100644 --- a/src/modules/Elsa.Sql/Activities/SqlQuery.cs +++ b/src/modules/Elsa.Sql/Activities/SqlQuery.cs @@ -45,7 +45,9 @@ public class SqlQuery : Activity /// [Input( Description = "Query to run against the database.", - UIHint = InputUIHints.SqlEditor)] + UIHint = InputUIHints.CodeEditor, + UIHandler = typeof(SqlCodeOptionsProvider) + )] public Input Query { get; set; } = default!; diff --git a/src/modules/Elsa.Sql/Activities/SqlSingleValue.cs b/src/modules/Elsa.Sql/Activities/SqlSingleValue.cs index 037863911..0c5909bd9 100644 --- a/src/modules/Elsa.Sql/Activities/SqlSingleValue.cs +++ b/src/modules/Elsa.Sql/Activities/SqlSingleValue.cs @@ -44,7 +44,9 @@ public class SqlSingleValue : Activity /// [Input( Description = "Query to run against the database.", - UIHint = InputUIHints.SqlEditor)] + UIHint = InputUIHints.CodeEditor, + UIHandler = typeof(SqlCodeOptionsProvider) + )] public Input Query { get; set; } = default!; diff --git a/src/modules/Elsa.Sql/Features/SqlFeature.cs b/src/modules/Elsa.Sql/Features/SqlFeature.cs index b0e4cbab0..e2593b641 100644 --- a/src/modules/Elsa.Sql/Features/SqlFeature.cs +++ b/src/modules/Elsa.Sql/Features/SqlFeature.cs @@ -1,6 +1,7 @@ using Elsa.Extensions; using Elsa.Features.Abstractions; using Elsa.Features.Services; +using Elsa.Sql.Activities; using Elsa.Sql.Contracts; using Elsa.Sql.Factory; using Elsa.Sql.Implimentations; @@ -51,7 +52,10 @@ public class SqlFeature : FeatureBase }) .AddSingleton() + // Providers + .AddScoped() .AddScoped() .AddScoped(); + } } \ No newline at end of file diff --git a/src/modules/Elsa.Workflows.Core/Features/WorkflowsFeature.cs b/src/modules/Elsa.Workflows.Core/Features/WorkflowsFeature.cs index 9a1464533..ffafd87cb 100644 --- a/src/modules/Elsa.Workflows.Core/Features/WorkflowsFeature.cs +++ b/src/modules/Elsa.Workflows.Core/Features/WorkflowsFeature.cs @@ -24,7 +24,6 @@ using Elsa.Workflows.Services; using Elsa.Workflows.UIHints.CheckList; using Elsa.Workflows.UIHints.Dropdown; using Elsa.Workflows.UIHints.JsonEditor; -using Elsa.Workflows.UIHints.SqlEditor; using Microsoft.Extensions.DependencyInjection; namespace Elsa.Workflows.Features; @@ -232,13 +231,11 @@ public class WorkflowsFeature : FeatureBase .AddScoped() .AddScoped() .AddScoped() - .AddScoped() // UI property handlers. .AddScoped() .AddScoped() .AddScoped() - .AddScoped() // Logger state generators. .AddSingleton(WorkflowLoggerStateGenerator) diff --git a/src/modules/Elsa.Workflows.Core/UIHints/InputUIHints.cs b/src/modules/Elsa.Workflows.Core/UIHints/InputUIHints.cs index 6616ea606..8465e1bbf 100644 --- a/src/modules/Elsa.Workflows.Core/UIHints/InputUIHints.cs +++ b/src/modules/Elsa.Workflows.Core/UIHints/InputUIHints.cs @@ -21,6 +21,5 @@ public static class InputUIHints public const string OutputPicker = "output-picker"; public const string OutcomePicker = "outcome-picker"; public const string JsonEditor = "json-editor"; - public const string SqlEditor = "sql-editor"; public const string DynamicOutcomes = "dynamic-outcomes"; } \ No newline at end of file diff --git a/src/modules/Elsa.Workflows.Core/UIHints/SqlEditor/SqlEditorUIHintHandler.cs b/src/modules/Elsa.Workflows.Core/UIHints/SqlEditor/SqlEditorUIHintHandler.cs deleted file mode 100644 index 642bc6878..000000000 --- a/src/modules/Elsa.Workflows.Core/UIHints/SqlEditor/SqlEditorUIHintHandler.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Reflection; - -namespace Elsa.Workflows.UIHints.SqlEditor; - -/// -public class SqlEditorUIHintHandler : IUIHintHandler -{ - /// - public string UIHint => InputUIHints.SqlEditor; - - /// - public ValueTask> GetPropertyUIHandlersAsync(PropertyInfo propertyInfo, CancellationToken cancellationToken) - { - return new([typeof(SqlCodeOptionsProvider)]); - } -} \ No newline at end of file