Merge pull request #6393 from KnibbsyMan/feat/add-in-sql-editor
Removes Built In SQL Editor Configuration
This commit is contained in:
commit
08f7bd7019
|
|
@ -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
|
||||
{
|
||||
|
|
@ -44,7 +44,9 @@ public class SqlCommand : Activity
|
|||
/// </summary>
|
||||
[Input(
|
||||
Description = "Command to run against the database.",
|
||||
UIHint = InputUIHints.SqlEditor)]
|
||||
UIHint = InputUIHints.CodeEditor,
|
||||
UIHandler = typeof(SqlCodeOptionsProvider)
|
||||
)]
|
||||
public Input<string?> Command { get; set; } = default!;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,9 @@ public class SqlQuery : Activity
|
|||
/// </summary>
|
||||
[Input(
|
||||
Description = "Query to run against the database.",
|
||||
UIHint = InputUIHints.SqlEditor)]
|
||||
UIHint = InputUIHints.CodeEditor,
|
||||
UIHandler = typeof(SqlCodeOptionsProvider)
|
||||
)]
|
||||
public Input<string?> Query { get; set; } = default!;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,9 @@ public class SqlSingleValue : Activity
|
|||
/// </summary>
|
||||
[Input(
|
||||
Description = "Query to run against the database.",
|
||||
UIHint = InputUIHints.SqlEditor)]
|
||||
UIHint = InputUIHints.CodeEditor,
|
||||
UIHandler = typeof(SqlCodeOptionsProvider)
|
||||
)]
|
||||
public Input<string?> Query { get; set; } = default!;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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<ISqlClientFactory, SqlClientFactory>()
|
||||
|
||||
// Providers
|
||||
.AddScoped<IPropertyUIHandler, SqlCodeOptionsProvider>()
|
||||
.AddScoped<IPropertyUIHandler, SqlClientsDropDownProvider>()
|
||||
.AddScoped<ISqlClientNamesProvider, SqlClientNamesProvider>();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -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<IUIHintHandler, DropDownUIHintHandler>()
|
||||
.AddScoped<IUIHintHandler, CheckListUIHintHandler>()
|
||||
.AddScoped<IUIHintHandler, JsonEditorUIHintHandler>()
|
||||
.AddScoped<IUIHintHandler, SqlEditorUIHintHandler>()
|
||||
|
||||
// UI property handlers.
|
||||
.AddScoped<IPropertyUIHandler, StaticCheckListOptionsProvider>()
|
||||
.AddScoped<IPropertyUIHandler, StaticDropDownOptionsProvider>()
|
||||
.AddScoped<IPropertyUIHandler, JsonCodeOptionsProvider>()
|
||||
.AddScoped<IPropertyUIHandler, SqlCodeOptionsProvider>()
|
||||
|
||||
// Logger state generators.
|
||||
.AddSingleton(WorkflowLoggerStateGenerator)
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
using System.Reflection;
|
||||
|
||||
namespace Elsa.Workflows.UIHints.SqlEditor;
|
||||
|
||||
/// <inheritdoc />
|
||||
public class SqlEditorUIHintHandler : IUIHintHandler
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public string UIHint => InputUIHints.SqlEditor;
|
||||
|
||||
/// <inheritdoc />
|
||||
public ValueTask<IEnumerable<Type>> GetPropertyUIHandlersAsync(PropertyInfo propertyInfo, CancellationToken cancellationToken)
|
||||
{
|
||||
return new([typeof(SqlCodeOptionsProvider)]);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue