From e6076d0c7d26f5935abe030b98e75b2edfe84fa8 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Sun, 25 May 2025 20:42:29 +0200 Subject: [PATCH] Make GetUIPropertiesAsync method virtual Allow derived classes to override the GetUIPropertiesAsync method by marking it as virtual. This change enhances flexibility and customization for implementations of DropDown and CheckList options providers. --- .../UIHints/CheckList/CheckListOptionsProviderBase.cs | 2 +- .../UIHints/Dropdown/DropDownOptionsProviderBase.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/Elsa.Workflows.Core/UIHints/CheckList/CheckListOptionsProviderBase.cs b/src/modules/Elsa.Workflows.Core/UIHints/CheckList/CheckListOptionsProviderBase.cs index 7bc8d3404..240a94db0 100644 --- a/src/modules/Elsa.Workflows.Core/UIHints/CheckList/CheckListOptionsProviderBase.cs +++ b/src/modules/Elsa.Workflows.Core/UIHints/CheckList/CheckListOptionsProviderBase.cs @@ -12,7 +12,7 @@ public abstract class CheckListOptionsProviderBase : IPropertyUIHandler protected virtual bool RefreshOnChange => false; /// - public async ValueTask> GetUIPropertiesAsync(PropertyInfo propertyInfo, object? context, CancellationToken cancellationToken = default) + public virtual async ValueTask> GetUIPropertiesAsync(PropertyInfo propertyInfo, object? context, CancellationToken cancellationToken = default) { var items = await GetItemsAsync(propertyInfo, context, cancellationToken); var props = new CheckListProps diff --git a/src/modules/Elsa.Workflows.Core/UIHints/Dropdown/DropDownOptionsProviderBase.cs b/src/modules/Elsa.Workflows.Core/UIHints/Dropdown/DropDownOptionsProviderBase.cs index af146901c..c6a59ca54 100644 --- a/src/modules/Elsa.Workflows.Core/UIHints/Dropdown/DropDownOptionsProviderBase.cs +++ b/src/modules/Elsa.Workflows.Core/UIHints/Dropdown/DropDownOptionsProviderBase.cs @@ -11,12 +11,12 @@ public abstract class DropDownOptionsProviderBase : IPropertyUIHandler protected virtual bool RefreshOnChange => false; /// - public async ValueTask> GetUIPropertiesAsync(PropertyInfo propertyInfo, object? context, CancellationToken cancellationToken = default) + public virtual async ValueTask> GetUIPropertiesAsync(PropertyInfo propertyInfo, object? context, CancellationToken cancellationToken = default) { var selectListItems = await GetItemsAsync(propertyInfo, context, cancellationToken); var props = new DropDownProps { - SelectList = new SelectList(selectListItems) + SelectList = new(selectListItems) }; var options = new Dictionary