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.
22 lines
660 B
C#
22 lines
660 B
C#
using System.Reflection;
|
|
using Elsa.Workflows.UIHints.CheckList;
|
|
|
|
namespace Elsa.Server.Web;
|
|
|
|
/// <summary>
|
|
/// Provides static drop-down options for a given property.
|
|
/// </summary>
|
|
public class CustomCheckListOptionsProvider : CheckListOptionsProviderBase
|
|
{
|
|
/// <inheritdoc />
|
|
protected override ValueTask<ICollection<CheckListItem>> GetItemsAsync(PropertyInfo propertyInfo, object? context, CancellationToken cancellationToken)
|
|
{
|
|
var items = new[]
|
|
{
|
|
"Apple", "Banana", "Cherry"
|
|
};
|
|
var selectListItems = items.Select(x => new CheckListItem(x, x)).ToList();
|
|
|
|
return new(selectListItems);
|
|
}
|
|
} |