Revert FlowSendHttpRequest outcome UI hint

It breaks the Stencil designer. Additionally, we might need more advanced control over the available outcomes in the future.
This commit is contained in:
Sipke Schoorstra 2023-09-20 10:29:35 +02:00
parent 710950a287
commit a0ef307ff6

View file

@ -1,10 +1,8 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using Elsa.Extensions;
using Elsa.Workflows.Core;
using Elsa.Workflows.Core.Attributes;
using Elsa.Workflows.Core.Models;
using Elsa.Workflows.Core.Options;
namespace Elsa.Http;
@ -22,7 +20,7 @@ public class FlowSendHttpRequest : SendHttpRequestBase
/// <summary>
/// A list of expected status codes to handle.
/// </summary>
[Input(Description = "A list of expected status codes to handle.", UIHint = InputUIHints.DynamicOutcomes, OptionsMethod = nameof(GetExpectedStatusCodesOptionsAsync))]
[Input(Description = "A list of expected status codes to handle.", UIHint = InputUIHints.MultiText)]
public Input<ICollection<int>> ExpectedStatusCodes { get; set; } = default!;
/// <inheritdoc />
@ -47,14 +45,4 @@ public class FlowSendHttpRequest : SendHttpRequestBase
{
await context.CompleteActivityWithOutcomesAsync("Timeout");
}
private static ValueTask<IDictionary<string, object>> GetExpectedStatusCodesOptionsAsync(PropertyInfo property, CancellationToken cancellationToken = default)
{
var options = new Dictionary<string, object>
{
[nameof(DynamicOutcomesOptions)] = new DynamicOutcomesOptions(new[]{"Unmatched status code", "Failed to connect", "Timeout", "Done"})
};
return new(options);
}
}