Browse Source

feat: Add Elsa Labels Module

pull/1568/head
colin 2 weeks ago
parent
commit
60051f8d75
  1. 2
      Directory.Packages.props
  2. 2
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj
  3. 6
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.Configure.cs
  4. 4
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.cs
  5. 3
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/FodyWeavers.xml
  6. 30
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/FodyWeavers.xsd
  7. 24
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/LINGYUN.Abp.ElsaNext.Labels.csproj
  8. 17
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/LINGYUN/Abp/ElsaNext/Labels/AbpElsaNextLabelsModule.cs
  9. 49
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/AbpElsaNextStudioLabelsBlazorModule.cs
  10. 3
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/FodyWeavers.xml
  11. 30
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/FodyWeavers.xsd
  12. 31
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor.csproj
  13. 25
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/Localization/Resources/LabelsBlazor/en.json
  14. 25
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/Localization/Resources/LabelsBlazor/zh-Hans.json
  15. 27
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/Navigation/ElsaStudioLabelsMenuContributor.cs
  16. 5
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/_Imports.razor

2
Directory.Packages.props

@ -256,6 +256,7 @@
<PackageVersion Include="Elsa.ExternalAuthentication.Persistence.EFCore.Sqlite" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Http" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Identity" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Labels" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.OpenTelemetry" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Scheduling.Quartz" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Scheduling.Quartz.EFCore.Sqlite" Version="$(ElsaNextPackageVersion)" />
@ -283,6 +284,7 @@
<PackageVersion Include="Elsa.Studio.Diagnostics.StructuredLogs.Dashboard" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.DomInterop" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Http.Webhooks" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Labels" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Login.BlazorServer" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Login.BlazorWasm" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Login" Version="$(ElsaNextPackageVersion)" />

2
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj

@ -89,6 +89,7 @@
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Agents.Blazor\LINGYUN.Abp.ElsaNext.Agents.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.BlobStoring\LINGYUN.Abp.ElsaNext.BlobStoring.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Email\LINGYUN.Abp.ElsaNext.Email.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Labels\LINGYUN.Abp.ElsaNext.Labels.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Notifications\LINGYUN.Abp.ElsaNext.Notifications.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Secrets.Blazor\LINGYUN.Abp.ElsaNext.Secrets.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Server\LINGYUN.Abp.ElsaNext.Server.csproj" />
@ -97,6 +98,7 @@
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Studio.Diagnostics.OpenTelemetry.Blazor\LINGYUN.Abp.ElsaNext.Studio.Diagnostics.OpenTelemetry.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Studio.Diagnostics.StructuredLogs.Blazor\LINGYUN.Abp.ElsaNext.Studio.Diagnostics.StructuredLogs.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Studio.Identity.Blazor\LINGYUN.Abp.ElsaNext.Studio.Identity.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor\LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Studio.Notifications.Blazor\LINGYUN.Abp.ElsaNext.Studio.Notifications.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Studio.Saas.Blazor\LINGYUN.Abp.ElsaNext.Studio.Saas.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Studio.Webhooks.Blazor\LINGYUN.Abp.ElsaNext.Studio.Webhooks.Blazor.csproj" />

6
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());

4
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),

3
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

24
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/LINGYUN.Abp.ElsaNext.Labels.csproj

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<AssemblyName>LINGYUN.Abp.ElsaNext.Labels</AssemblyName>
<PackageId>LINGYUN.Abp.ElsaNext.Labels</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Elsa.Labels" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.ElsaNext\LINGYUN.Abp.ElsaNext.csproj" />
</ItemGroup>
</Project>

17
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<IModule>(elsa =>
{
elsa.UseLabels();
});
}
}

49
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<AbpRouterOptions>(options =>
{
options.AdditionalAssemblies.Add(typeof(Elsa.Studio.Labels.Feature).Assembly);
});
Configure<AbpNavigationOptions>(options =>
{
options.MenuContributors.Add(new ElsaStudioLabelsMenuContributor());
});
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpElsaNextStudioLabelsBlazorModule>("LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor");
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<ElsaNextResource>()
.AddVirtualJson("/Localization/Resources/LabelsBlazor");
});
var elsaNextStudioBlazoeOptions = context.Services.ExecutePreConfiguredActions<AbpElsaNextStudioBlazorOptions>();
context.Services.AddLabelsModule(elsaNextStudioBlazoeOptions.BackendApiConfig);
}
}

3
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

31
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor.csproj

@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor</AssemblyName>
<PackageId>LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
</PropertyGroup>
<ItemGroup>
<Content Remove="Localization\Resources\LabelsBlazor\*.json" />
<EmbeddedResource Include="Localization\Resources\LabelsBlazor\*.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Elsa.Studio.Labels" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.ElsaNext.Labels\LINGYUN.Abp.ElsaNext.Labels.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.ElsaNext.Studio.Blazor\LINGYUN.Abp.ElsaNext.Studio.Blazor.csproj" />
</ItemGroup>
</Project>

25
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"
}
}

25
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": "确定"
}
}

27
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<ElsaNextResource>();
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;
}
}

5
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
Loading…
Cancel
Save