elsa-core/src/apps/Elsa.Server.Web/StaticCheckListOptionsProvider.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

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);
}
}