elsa-core/src/modules/Elsa.Http/UIHints/HttpEndpointPathUIHandler.cs
Sipke Schoorstra 892099c235 Refactor UI handler hierarchy and remove sample workflows.
Replaced direct implementation of `IPropertyUIHandler` with a new `PropertyUIHandlerBase` abstract class to simplify UI handler management and introduce a priority mechanism. Removed outdated `SampleWorkflow` and `SlowActivity` code to clean up the repository. Introduced a custom checklist options provider and registered it within the application services.
2025-05-26 20:06:39 +02:00

28 lines
927 B
C#

using System.Reflection;
using Elsa.Workflows;
using Elsa.Workflows.UIHints;
using Elsa.Workflows.UIHints.SingleLine;
namespace Elsa.Http.UIHints;
/// <summary>
/// Provides additional options for the Path input field.
/// </summary>
public class HttpEndpointPathUIHandler(IHttpEndpointBasePathProvider httpEndpointBasePathProvider) : PropertyUIHandlerBase
{
/// <inheritdoc />
public override ValueTask<IDictionary<string, object>> GetUIPropertiesAsync(PropertyInfo propertyInfo, object? context, CancellationToken cancellationToken = default)
{
var completeBaseUrl = httpEndpointBasePathProvider.GetBasePath();
return new(new Dictionary<string, object>
{
[InputUIHints.SingleLine] = new SingleLineProps
{
AdornmentText = completeBaseUrl,
EnableCopyAdornment = true
},
["Refresh"] = true
});
}
}