From 60051f8d755b0f949f9b2e4fa999853421d00632 Mon Sep 17 00:00:00 2001 From: colin Date: Fri, 11 Sep 2026 15:56:33 +0800 Subject: [PATCH] feat: Add Elsa Labels Module --- Directory.Packages.props | 2 + ...UN.Abp.MicroService.WorkflowService.csproj | 2 + .../WorkflowServiceModule.Configure.cs | 6 +++ .../WorkflowServiceModule.cs | 4 ++ .../FodyWeavers.xml | 3 ++ .../FodyWeavers.xsd | 30 ++++++++++++ .../LINGYUN.Abp.ElsaNext.Labels.csproj | 24 +++++++++ .../Labels/AbpElsaNextLabelsModule.cs | 17 +++++++ .../AbpElsaNextStudioLabelsBlazorModule.cs | 49 +++++++++++++++++++ .../FodyWeavers.xml | 3 ++ .../FodyWeavers.xsd | 30 ++++++++++++ ...N.Abp.ElsaNext.Studio.Labels.Blazor.csproj | 31 ++++++++++++ .../Resources/LabelsBlazor/en.json | 25 ++++++++++ .../Resources/LabelsBlazor/zh-Hans.json | 25 ++++++++++ .../ElsaStudioLabelsMenuContributor.cs | 27 ++++++++++ .../_Imports.razor | 5 ++ 16 files changed, 283 insertions(+) create mode 100644 aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/FodyWeavers.xml create mode 100644 aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/FodyWeavers.xsd create mode 100644 aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/LINGYUN.Abp.ElsaNext.Labels.csproj create mode 100644 aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/LINGYUN/Abp/ElsaNext/Labels/AbpElsaNextLabelsModule.cs create mode 100644 aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/AbpElsaNextStudioLabelsBlazorModule.cs create mode 100644 aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/FodyWeavers.xml create mode 100644 aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/FodyWeavers.xsd create mode 100644 aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor.csproj create mode 100644 aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/Localization/Resources/LabelsBlazor/en.json create mode 100644 aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/Localization/Resources/LabelsBlazor/zh-Hans.json create mode 100644 aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/Navigation/ElsaStudioLabelsMenuContributor.cs create mode 100644 aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/_Imports.razor diff --git a/Directory.Packages.props b/Directory.Packages.props index 79c7488ee..78f1efe86 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -256,6 +256,7 @@ + @@ -283,6 +284,7 @@ + diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj index 24fea9115..89a66b7c6 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj @@ -89,6 +89,7 @@ + @@ -97,6 +98,7 @@ + diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.Configure.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.Configure.cs index 8fae4cdf1..ae24f9e1d 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.Configure.cs +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.Configure.cs @@ -3,6 +3,7 @@ using Elsa.Agents; using Elsa.Extensions; using Elsa.Features.Services; using Elsa.Persistence.EFCore.Extensions; +using Elsa.Persistence.EFCore.Modules.Labels; using Elsa.Persistence.EFCore.Modules.Management; using Elsa.Persistence.EFCore.Modules.Runtime; using Elsa.Secrets.Persistence.EFCore.Extensions; @@ -174,6 +175,11 @@ public partial class WorkflowServiceModule agent.UseEntityFrameworkCore(ef => ef.UseSqlite()); }); + elsa.UseLabels(label => + { + label.UseEntityFrameworkCore(ef => ef.UseSqlite()); + }); + elsa.UseSecrets(secret => { secret.UseEntityFrameworkCore(ef => ef.UseSqlite()); diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.cs index 1faded37d..ad2d1d861 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.cs +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.cs @@ -9,6 +9,7 @@ using LINGYUN.Abp.Dynamic.Definitions; using LINGYUN.Abp.ElsaNext.Agents.Blazor; using LINGYUN.Abp.ElsaNext.BlobStoring; using LINGYUN.Abp.ElsaNext.Email; +using LINGYUN.Abp.ElsaNext.Labels; using LINGYUN.Abp.ElsaNext.Notifications; using LINGYUN.Abp.ElsaNext.Secrets.Blazor; using LINGYUN.Abp.ElsaNext.Server; @@ -17,6 +18,7 @@ using LINGYUN.Abp.ElsaNext.Studio.Dashboard.Blazor; using LINGYUN.Abp.ElsaNext.Studio.Diagnostics.OpenTelemetry.Blazor; using LINGYUN.Abp.ElsaNext.Studio.Diagnostics.StructuredLogs.Blazor; using LINGYUN.Abp.ElsaNext.Studio.Identity.Blazor; +using LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor; using LINGYUN.Abp.ElsaNext.Studio.Notifications.Blazor; using LINGYUN.Abp.ElsaNext.Studio.Saas.Blazor; using LINGYUN.Abp.ElsaNext.Studio.Webhooks.Blazor; @@ -65,6 +67,7 @@ namespace LINGYUN.Abp.MicroService.WorkflowService; typeof(AbpBlobStoringBlobManagementModule), typeof(AbpElsaNextBlobStoringModule), typeof(AbpElsaNextEmailModule), + typeof(AbpElsaNextLabelsModule), typeof(AbpElsaNextNotificationsModule), typeof(AbpElsaNextWebhooksModule), typeof(AbpElsaNextServerModule), @@ -75,6 +78,7 @@ namespace LINGYUN.Abp.MicroService.WorkflowService; typeof(AbpElsaNextStudioDiagnosticsOpenTelemetryBlazorModule), typeof(AbpElsaNextStudioDiagnosticsStructuredLogsBlazorModule), typeof(AbpElsaNextStudioIdentityBlazorModule), + typeof(AbpElsaNextStudioLabelsBlazorModule), typeof(AbpElsaNextStudioNotificationsBlazorModule), typeof(AbpElsaNextStudioSaasBlazorModule), typeof(AbpElsaNextStudioWebhooksBlazorModule), diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/FodyWeavers.xml b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/FodyWeavers.xml new file mode 100644 index 000000000..5d6962159 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/FodyWeavers.xsd b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/FodyWeavers.xsd new file mode 100644 index 000000000..3f3946e28 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/LINGYUN.Abp.ElsaNext.Labels.csproj b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/LINGYUN.Abp.ElsaNext.Labels.csproj new file mode 100644 index 000000000..12c98db78 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/LINGYUN.Abp.ElsaNext.Labels.csproj @@ -0,0 +1,24 @@ + + + + + + + net10.0 + LINGYUN.Abp.ElsaNext.Labels + LINGYUN.Abp.ElsaNext.Labels + false + false + false + + + + + + + + + + + + diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/LINGYUN/Abp/ElsaNext/Labels/AbpElsaNextLabelsModule.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/LINGYUN/Abp/ElsaNext/Labels/AbpElsaNextLabelsModule.cs new file mode 100644 index 000000000..1274c678f --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/LINGYUN/Abp/ElsaNext/Labels/AbpElsaNextLabelsModule.cs @@ -0,0 +1,17 @@ +using Elsa.Extensions; +using Elsa.Features.Services; +using Volo.Abp.Modularity; + +namespace LINGYUN.Abp.ElsaNext.Labels; + +[DependsOn(typeof(AbpElsaNextModule))] +public class AbpElsaNextLabelsModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(elsa => + { + elsa.UseLabels(); + }); + } +} diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/AbpElsaNextStudioLabelsBlazorModule.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/AbpElsaNextStudioLabelsBlazorModule.cs new file mode 100644 index 000000000..c7412f3ef --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/AbpElsaNextStudioLabelsBlazorModule.cs @@ -0,0 +1,49 @@ +using Elsa.Studio.Labels; +using LINGYUN.Abp.ElsaNext.Labels; +using LINGYUN.Abp.ElsaNext.Localization; +using LINGYUN.Abp.ElsaNext.Studio.Blazor; +using LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor.Navigation; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AspNetCore.Components.Web.Theming.MudBlazor.Routing; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.UI.Navigation; +using Volo.Abp.VirtualFileSystem; + +namespace LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor; + +[DependsOn( + typeof(AbpElsaNextLabelsModule), + typeof(AbpElsaNextStudioBlazorModule))] +public class AbpElsaNextStudioLabelsBlazorModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Configuration.GetSection("Elsa:Studio"); + + Configure(options => + { + options.AdditionalAssemblies.Add(typeof(Elsa.Studio.Labels.Feature).Assembly); + }); + + Configure(options => + { + options.MenuContributors.Add(new ElsaStudioLabelsMenuContributor()); + }); + + Configure(options => + { + options.FileSets.AddEmbedded("LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor"); + }); + + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/Localization/Resources/LabelsBlazor"); + }); + var elsaNextStudioBlazoeOptions = context.Services.ExecutePreConfiguredActions(); + + context.Services.AddLabelsModule(elsaNextStudioBlazoeOptions.BackendApiConfig); + } +} diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/FodyWeavers.xml b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/FodyWeavers.xml new file mode 100644 index 000000000..5d6962159 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/FodyWeavers.xsd b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/FodyWeavers.xsd new file mode 100644 index 000000000..3f3946e28 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor.csproj b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor.csproj new file mode 100644 index 000000000..d330e39ce --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor.csproj @@ -0,0 +1,31 @@ + + + + + + + net10.0 + enable + enable + LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor + LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor + false + false + false + + + + + + + + + + + + + + + + + diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/Localization/Resources/LabelsBlazor/en.json b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/Localization/Resources/LabelsBlazor/en.json new file mode 100644 index 000000000..5df48ba44 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/Localization/Resources/LabelsBlazor/en.json @@ -0,0 +1,25 @@ +{ + "culture": "en", + "texts": { + "Menu:Labels": "Labels", + "Labels": "Labels", + "The name of the label.": "The name of the label.", + "The name of the new label.": "The name of the new label.", + "A description about the label.": "A description about the label.", + "A brief description of the label.": "A brief description of the label.", + "The color of the label.": "The color of the label.", + "No Labels found": "No Labels found", + "Label": "Label", + "Bulk actions": "Bulk actions", + "Delete": "Delete", + "Create Label": "Create Label", + "General": "General", + "Name": "Name", + "Description": "Description", + "Color": "Color", + "Loading": "Loading", + "Save": "Save", + "Cancel": "Cancel", + "Ok": "Ok" + } +} diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/Localization/Resources/LabelsBlazor/zh-Hans.json b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/Localization/Resources/LabelsBlazor/zh-Hans.json new file mode 100644 index 000000000..4682c89f1 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/Localization/Resources/LabelsBlazor/zh-Hans.json @@ -0,0 +1,25 @@ +{ + "culture": "zh-Hans", + "texts": { + "Menu:Labels": "标签", + "Labels": "标签", + "The name of the label.": "标签名称。", + "The name of the new label.": "新标签的名称。", + "A description about the label.": "标签说明。", + "A brief description of the label.": "标签的简要说明。", + "The color of the label.": "标签的颜色。", + "No Labels found": "未找到标签", + "Label": "标签", + "Bulk actions": "批量操作", + "Delete": "删除", + "Create Label": "创建标签", + "General": "通用", + "Name": "名称", + "Description": "说明", + "Color": "颜色", + "Loading": "加载中", + "Save": "保存", + "Cancel": "取消", + "Ok": "确定" + } +} diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/Navigation/ElsaStudioLabelsMenuContributor.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/Navigation/ElsaStudioLabelsMenuContributor.cs new file mode 100644 index 000000000..7edb090d1 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/Navigation/ElsaStudioLabelsMenuContributor.cs @@ -0,0 +1,27 @@ +using LINGYUN.Abp.ElsaNext.Localization; +using LINGYUN.Abp.ElsaNext.Studio.Blazor.Navigation; +using Volo.Abp.UI.Navigation; + +namespace LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor.Navigation; + +public class ElsaStudioLabelsMenuContributor : IMenuContributor +{ + public Task ConfigureMenuAsync(MenuConfigurationContext context) + { + if (context.Menu.Name == StandardMenus.Main) + { + var menu = context.Menu; + var l = context.GetLocalizer(); + + var group = menu.GetMenuItemOrNull(ElsaStudioMenus.GroupName); + group?.AddItem(new ApplicationMenuItem( + ElsaStudioMenus.GroupName + ".Labels", + l["Menu:Labels"], + url: "/labels", + icon: "fa fa-tags", + order: 200)); + } + + return Task.CompletedTask; + } +} diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/_Imports.razor b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/_Imports.razor new file mode 100644 index 000000000..6a4064616 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/_Imports.razor @@ -0,0 +1,5 @@ +@using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Components.Web +@using Elsa.Studio.Components +@using Elsa.Studio.Localization +@using MudBlazor