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.
28 lines
927 B
C#
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
|
|
});
|
|
}
|
|
} |