Skip to content

Commit 0e54668

Browse files
committed
Merge remote-tracking branch 'origin/main' into develop/3.7.0
2 parents d205e3c + eddf70a commit 0e54668

File tree

111 files changed

+6279
-546
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+6279
-546
lines changed

.github/workflows/packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
release:
1616
types: [ prereleased, published ]
1717
env:
18-
base_version: '3.6.0'
18+
base_version: '3.7.0'
1919
nuget_feed_feedzio: 'https://f.feedz.io/elsa-workflows/elsa-3/nuget/index.json'
2020
nuget_feed_nuget: 'https://api.nuget.org/v3/index.json'
2121
npm_feed_feedzio: 'https://f.feedz.io/elsa-workflows/elsa-3/npm/'

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
55
</PropertyGroup>
66
<ItemGroup Label="Elsa">
7-
<PackageVersion Include="Elsa.Api.Client" Version="3.6.0-preview.3976" />
7+
<PackageVersion Include="Elsa.Api.Client" Version="3.7.0-preview.3141" />
88
</ItemGroup>
99
<ItemGroup>
1010
<PackageVersion Include="Blazored.FluentValidation" Version="2.2.0" />

Elsa.Studio.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Studio.Translations",
8686
EndProject
8787
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Studio.Host.HostedWasm", "src\hosts\Elsa.Studio.Host.HostedWasm\Elsa.Studio.Host.HostedWasm.csproj", "{25BA3052-4F17-4D24-9AE9-01FBD75E8804}"
8888
EndProject
89+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Studio.Labels", "src\modules\Elsa.Studio.Labels\Elsa.Studio.Labels.csproj", "{F6F4CD65-8E0C-5401-A668-108C6C0E8CD1}"
90+
EndProject
8991
Global
9092
GlobalSection(SolutionConfigurationPlatforms) = preSolution
9193
Debug|Any CPU = Debug|Any CPU
@@ -200,6 +202,10 @@ Global
200202
{25BA3052-4F17-4D24-9AE9-01FBD75E8804}.Debug|Any CPU.Build.0 = Debug|Any CPU
201203
{25BA3052-4F17-4D24-9AE9-01FBD75E8804}.Release|Any CPU.ActiveCfg = Release|Any CPU
202204
{25BA3052-4F17-4D24-9AE9-01FBD75E8804}.Release|Any CPU.Build.0 = Release|Any CPU
205+
{F6F4CD65-8E0C-5401-A668-108C6C0E8CD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
206+
{F6F4CD65-8E0C-5401-A668-108C6C0E8CD1}.Debug|Any CPU.Build.0 = Debug|Any CPU
207+
{F6F4CD65-8E0C-5401-A668-108C6C0E8CD1}.Release|Any CPU.ActiveCfg = Release|Any CPU
208+
{F6F4CD65-8E0C-5401-A668-108C6C0E8CD1}.Release|Any CPU.Build.0 = Release|Any CPU
203209
EndGlobalSection
204210
GlobalSection(SolutionProperties) = preSolution
205211
HideSolutionNode = FALSE
@@ -236,6 +242,7 @@ Global
236242
{DE57FD2C-3874-486A-89B1-D982726A1189} = {D66B9A40-8608-46F3-9868-625C50EACE43}
237243
{76C60D97-FA22-4023-BDB3-6BC47D097E40} = {C5288F1B-F4E5-423C-AEE8-049996613668}
238244
{25BA3052-4F17-4D24-9AE9-01FBD75E8804} = {2AA1AEE9-017E-4F8B-B5FC-2BEA37E83514}
245+
{F6F4CD65-8E0C-5401-A668-108C6C0E8CD1} = {D66B9A40-8608-46F3-9868-625C50EACE43}
239246
EndGlobalSection
240247
GlobalSection(ExtensibilityGlobals) = postSolution
241248
SolutionGuid = {5B8719CC-CF87-45E1-BE1A-13842F951B28}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Microsoft.AspNetCore.Components;
2+
3+
namespace Elsa.Studio.Contracts;
4+
5+
/// <summary>
6+
/// Defines a provider for an activity picker component,
7+
/// allowing for the retrieval of a RenderFragment to represent the component.
8+
/// </summary>
9+
public interface IActivityPickerComponentProvider
10+
{
11+
/// <summary>
12+
/// Retrieves a RenderFragment that represents the activity picker component.
13+
/// </summary>
14+
/// <returns>A RenderFragment instance containing the activity picker component.</returns>
15+
RenderFragment GetActivityPickerComponent();
16+
}
Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,49 @@
1+
using Elsa.Studio.Models;
12
using Microsoft.AspNetCore.Components;
23

34
namespace Elsa.Studio.Contracts;
45

56
/// <summary>
6-
/// Defines the contract for app bar service.
7+
/// Provides functionality for managing app bar items in the application.
78
/// </summary>
89
public interface IAppBarService
910
{
1011
/// <summary>
1112
/// Invoked when the app bar items change.
1213
/// </summary>
1314
event Action AppBarItemsChanged;
15+
16+
/// <summary>
17+
/// Gets the collection of elements displayed in the app bar.
18+
/// </summary>
19+
IEnumerable<AppBarElement> AppBarElements { get; }
1420

1521
/// <summary>
1622
/// A collection of components to render in the app bar.
1723
/// </summary>
18-
IEnumerable<RenderFragment> AppBarItems { get; }
24+
IEnumerable<RenderFragment> AppBarComponents { get; }
1925

2026
/// <summary>
2127
/// Adds a component to the app bar.
2228
/// </summary>
2329
/// <typeparam name="T">The type of the component.</typeparam>
30+
[Obsolete("Use AddElement instead.")]
2431
void AddAppBarItem<T>() where T : IComponent;
32+
33+
/// <summary>
34+
/// Adds a component of the specified type to the app bar.
35+
/// </summary>
36+
/// <typeparam name="T">The type of the component to add.</typeparam>
37+
void AddComponent<T>(float? order = null) where T : IComponent;
38+
39+
/// <summary>
40+
/// Adds an element of the specified type to the app bar.
41+
/// </summary>
42+
void AddElement<T>(float? order = null) where T : AppBarElement, new();
43+
44+
/// <summary>
45+
/// Adds an element to the app bar.
46+
/// </summary>
47+
/// <param name="element">The app bar element to add.</param>
48+
void AddElement(AppBarElement element);
2549
}

src/framework/Elsa.Studio.Core/ElsaStudioIcons.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public static class Tabler
7070
/// Provides the flask value.
7171
/// </summary>
7272
public const string Flask = """<svg width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z"/> <line x1="9" y1="3" x2="15" y2="3" /> <line x1="10" y1="9" x2="14" y2="9" /> <path d="M10 3v6l-4 11a.7 .7 0 0 0 .5 1h11a.7 .7 0 0 0 .5 -1l-4 -11v-6" /></svg>""";
73+
public const string MagicWand = """<svg width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z"/> <polyline points="6 21 21 6 18 3 3 18 6 21" /> <line x1="15" y1="6" x2="18" y2="9" /> <path d="M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2" /> <path d="M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2" /></svg>""";
7374
}
7475

7576
/// <summary>

src/framework/Elsa.Studio.Core/Extensions/RenderTreeBuilderExtensions.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,28 @@ public static void CreateComponent<T>(this RenderTreeBuilder builder, ref int se
2525
builder.OpenComponent<T>(sequence++);
2626
builder.CloseComponent();
2727
}
28+
29+
/// <summary>
30+
/// Creates a component of the specified type at the specified sequence.
31+
/// </summary>
32+
/// <param name="builder">The <see cref="RenderTreeBuilder"/> to append the component to.</param>
33+
/// <param name="sequence">The sequence number for the component.</param>
34+
/// <param name="componentType">The type of the component to create.</param>
35+
public static void CreateComponent(this RenderTreeBuilder builder, Type componentType)
36+
{
37+
var sequence = 0;
38+
CreateComponent(builder, ref sequence, componentType);
39+
}
40+
41+
/// <summary>
42+
/// Creates a component of the specified type at the specified sequence.
43+
/// </summary>
44+
/// <param name="builder">The <see cref="RenderTreeBuilder"/> to append the component to.</param>
45+
/// <param name="sequence">The sequence number for the component.</param>
46+
/// <param name="componentType">The type of the component to create.</param>
47+
public static void CreateComponent(this RenderTreeBuilder builder, ref int sequence, Type componentType)
48+
{
49+
builder.OpenComponent(sequence++, componentType);
50+
builder.CloseComponent();
51+
}
2852
}

src/framework/Elsa.Studio.Core/MenuItemGroups.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33
namespace Elsa.Studio;
44

55
/// <summary>
6-
/// Represents the menu item groups.
6+
/// Provides predefined menu item groups for organizing application navigation.
77
/// </summary>
88
public static class MenuItemGroups
99
{
1010
/// <summary>
11-
/// Provides the general.
11+
/// Gets the general menu item group for common application features.
1212
/// </summary>
1313
public static readonly MenuItemGroup General = new("general", "General", 0f);
14+
1415
/// <summary>
15-
/// Provides the settings.
16+
/// Gets the settings menu item group for configuration and administrative features.
1617
/// </summary>
1718
public static readonly MenuItemGroup Settings = new("security", "Settings", 1000f);
1819
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using Elsa.Studio.Extensions;
2+
using Microsoft.AspNetCore.Components;
3+
4+
namespace Elsa.Studio.Models;
5+
6+
/// <summary>
7+
/// Represents an element in the application bar.
8+
/// Used to define components that can be rendered within the app bar with a specific order.
9+
/// </summary>
10+
/// <remarks>
11+
/// This class can be used to create custom app bar elements by specifying the order and the component to be rendered.
12+
/// The class can be instantiated directly or inherited to create specialized app bar elements.
13+
/// </remarks>
14+
public class AppBarElement
15+
{
16+
/// <summary>
17+
/// Gets or sets the order of the element within the application bar.
18+
/// </summary>
19+
/// <remarks>
20+
/// Controls the placement of the element by specifying its position relative to others.
21+
/// Lower values are placed earlier, and higher values are placed later in the sequence.
22+
/// </remarks>
23+
public virtual float Order { get; set; }
24+
25+
/// <summary>
26+
/// Gets or sets the component to be rendered in the application bar.
27+
/// </summary>
28+
/// <remarks>
29+
/// Represents the visual content of the app bar element. This content is defined as a render fragment,
30+
/// allowing for dynamic and customizable rendering within the user interface.
31+
/// </remarks>
32+
public virtual RenderFragment Component { get; set; } = null!;
33+
}
34+
35+
/// <summary>
36+
/// Represents an element in the application bar with a specific type constraint for its component.
37+
/// Used to define components of a specific type that can be rendered within the app bar.
38+
/// </summary>
39+
/// <typeparam name="T">The type of the component to be rendered, which must implement <see cref="IComponent"/>.</typeparam>
40+
/// <remarks>
41+
/// This generic specialization of the `AppBarElement` class enforces that only components of the specified type
42+
/// are allowed. The rendering logic uses the type parameter to instantiate the specified component.
43+
/// </remarks>
44+
public class AppBarElement<T> : AppBarElement where T : IComponent
45+
{
46+
/// <inheritdoc />
47+
public override RenderFragment Component { get; set; } = builder => builder.CreateComponent<T>();
48+
}
Lines changed: 46 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,60 @@
11
using Elsa.Studio.Contracts;
22
using Elsa.Studio.Extensions;
3+
using Elsa.Studio.Models;
34
using Microsoft.AspNetCore.Components;
45

56
namespace Elsa.Studio.Services;
67

7-
/// <summary>
8-
/// Provides the default implementation of the app bar service.
9-
/// </summary>
8+
/// <inheritdoc />
109
public class DefaultAppBarService : IAppBarService
1110
{
12-
private readonly ICollection<RenderFragment> _appBarItems = new List<RenderFragment>();
13-
private int _appBarSequence;
14-
15-
/// <summary>
16-
/// Occurs when the set of app bar items has changed.
17-
/// </summary>
11+
private readonly ICollection<AppBarElement> _elements = new List<AppBarElement>();
12+
13+
/// <inheritdoc />
1814
public event Action? AppBarItemsChanged;
19-
/// <summary>
20-
/// Gets the configured app bar items.
21-
/// </summary>
22-
public IEnumerable<RenderFragment> AppBarItems => _appBarItems.ToList();
23-
24-
/// <summary>
25-
/// Adds the specified component to the application bar.
26-
/// </summary>
27-
/// <typeparam name="T">The type of component to add.</typeparam>
15+
16+
/// <inheritdoc />
17+
public IEnumerable<AppBarElement> AppBarElements => _elements.OrderBy(x => x.Order).ToList();
18+
19+
/// <inheritdoc />
20+
public IEnumerable<RenderFragment> AppBarComponents => AppBarElements.Select(x => x.Component).ToList();
21+
22+
/// <inheritdoc />
2823
public void AddAppBarItem<T>() where T : IComponent
2924
{
30-
_appBarItems.Add(builder => builder.CreateComponent<T>(ref _appBarSequence));
25+
AddComponent<T>();
26+
}
27+
28+
/// <inheritdoc />
29+
public void AddComponent<T>(float? order = null) where T : IComponent
30+
{
31+
var element = new AppBarElement
32+
{
33+
Order = order ?? 0,
34+
Component = builder => builder.CreateComponent<T>()
35+
};
36+
37+
AddElement(element);
38+
}
39+
40+
/// <inheritdoc />
41+
public void AddElement<T>(float? order = null) where T : AppBarElement, new()
42+
{
43+
var element = new T();
44+
45+
if (order.HasValue)
46+
element.Order = order.Value;
47+
48+
AddElement(element);
49+
}
50+
51+
/// <inheritdoc />
52+
public void AddElement(AppBarElement element)
53+
{
54+
if (_elements.Contains(element))
55+
return;
56+
57+
_elements.Add(element);
3158
AppBarItemsChanged?.Invoke();
3259
}
3360
}

0 commit comments

Comments
 (0)