From 5b39041494d252afa0a142d646f7b9237d45cc30 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Tue, 4 Jul 2023 14:29:05 +0200 Subject: [PATCH] Add UIHintDescriptor model to API client --- .../WorkflowDefinitions/Models/ArgumentDefinition.cs | 5 +++++ .../WorkflowDefinitions/Models/UIHintDescriptor.cs | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/UIHintDescriptor.cs diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/ArgumentDefinition.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/ArgumentDefinition.cs index 31e2bd246..730cbec3e 100644 --- a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/ArgumentDefinition.cs +++ b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/ArgumentDefinition.cs @@ -34,4 +34,9 @@ public abstract class ArgumentDefinition /// The category to which this input belongs. /// public string Category { get; set; } = default!; + + /// + /// The type name of the variable, including the array indicator. + /// + public string GetTypeDisplayName() => IsArray ? $"{Type}[]" : Type; } \ No newline at end of file diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/UIHintDescriptor.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/UIHintDescriptor.cs new file mode 100644 index 000000000..600690eb3 --- /dev/null +++ b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/UIHintDescriptor.cs @@ -0,0 +1,9 @@ +namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Models; + +/// +/// Represents a UI hint. +/// +/// The name of the UI hint. +/// The display name of the UI hint. +/// The description of the UI hint. +public record UIHintDescriptor(string Name, string DisplayName, string? Description); \ No newline at end of file