Browse Source

fix(elsa): Fixed elsa-related errors

- Upgrade elsa 2.x to 2.15.2
- Redirecting the `Rebus.RabbitMq` package version resolves the compatibility issue of the` RabbitMQ.Client` 6.x
- Add `LINGYUN.Abp.Elsa.Designer`
pull/1258/head
colin 9 months ago
parent
commit
bfe98c3a06
  1. 7
      aspnet-core/LINGYUN.MicroService.SingleProject.sln
  2. 21
      aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/DataSeeder/ApplicationSingleDataSeederWorker.cs
  3. 2
      aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleMigrationsEntityFrameworkCoreModule.cs
  4. 73
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/AbpElsaDesignerModule.cs
  5. 33
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Areas/Elsa/ElsaAuthenticationContextController.cs
  6. 11
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Areas/Elsa/ElsaController.cs
  7. 25
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Areas/Elsa/ElsaUserInfoController.cs
  8. 14
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Areas/Elsa/ElsaUserLogoutController.cs
  9. 14
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Bundling/AbpElsaBundles.cs
  10. 17
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Bundling/AbpElsaScriptBundleContributor.cs
  11. 18
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Bundling/AbpElsaStyleBundleContributor.cs
  12. 3
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/FodyWeavers.xml
  13. 30
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/FodyWeavers.xsd
  14. 43
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/LINGYUN.Abp.Elsa.Designer.csproj
  15. 8
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Localization/Resources/en.json
  16. 8
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Localization/Resources/zh-Hans.json
  17. 31
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Navigation/AbpElsaDesignerContributor.cs
  18. 8
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Navigation/AbpElsaDesignerMenuNames.cs
  19. 46
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Pages/Elsa/Index.cshtml
  20. 4
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Pages/_ViewImports.cshtml
  21. 19
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Permissions/AbpElsaDesignerPermissionDefinitionProvider.cs
  22. 15
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Permissions/AbpElsaDesignerPermissionsNames.cs
  23. 12
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Properties/launchSettings.json
  24. 2
      aspnet-core/services/LY.MicroService.Applications.Single/Controllers/HomeController.cs
  25. 1
      aspnet-core/services/LY.MicroService.Applications.Single/GlobalUsings.cs
  26. 2
      aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj
  27. 2
      aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs
  28. 11
      aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs
  29. 2
      aspnet-core/services/LY.MicroService.Applications.Single/Views/Home/Index.cshtml
  30. 2
      aspnet-core/services/LY.MicroService.Applications.Single/Views/Home/Index.cshtml.cs
  31. 4
      aspnet-core/services/LY.MicroService.Applications.Single/Views/_ViewImports.cshtml

7
aspnet-core/LINGYUN.MicroService.SingleProject.sln

@ -692,6 +692,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Account.Web.OAu
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Account.OAuth", "modules\account\LINGYUN.Abp.Account.OAuth\LINGYUN.Abp.Account.OAuth.csproj", "{2E4C437A-989D-68D9-C5FB-1AE085B2CBC8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Elsa.Designer", "modules\elsa\LINGYUN.Abp.Elsa.Designer\LINGYUN.Abp.Elsa.Designer.csproj", "{C9756AD3-3AEA-4AA8-99E3-8305D37E0903}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -1842,6 +1844,10 @@ Global
{2E4C437A-989D-68D9-C5FB-1AE085B2CBC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E4C437A-989D-68D9-C5FB-1AE085B2CBC8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E4C437A-989D-68D9-C5FB-1AE085B2CBC8}.Release|Any CPU.Build.0 = Release|Any CPU
{C9756AD3-3AEA-4AA8-99E3-8305D37E0903}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C9756AD3-3AEA-4AA8-99E3-8305D37E0903}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C9756AD3-3AEA-4AA8-99E3-8305D37E0903}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C9756AD3-3AEA-4AA8-99E3-8305D37E0903}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -2179,6 +2185,7 @@ Global
{113167DA-602A-4EBE-9357-D83C090DBA3F} = {F3449D35-8671-4BF6-8D1B-EFBB8AFD61DD}
{2379F502-BBBD-4BF2-91F7-D0E5C61E91B7} = {4F837B81-EA7D-472A-8482-3D5A730DF810}
{2E4C437A-989D-68D9-C5FB-1AE085B2CBC8} = {4F837B81-EA7D-472A-8482-3D5A730DF810}
{C9756AD3-3AEA-4AA8-99E3-8305D37E0903} = {07DFEB1E-ED92-4E97-A801-FAB2D70F4F35}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {711A43C0-A2F8-4E5C-9B9F-F2551E4B3FF1}

21
aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/DataSeeder/ApplicationSingleDataSeederWorker.cs

@ -1,21 +0,0 @@
using Microsoft.Extensions.Hosting;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Data;
namespace LY.MicroService.Applications.Single.EntityFrameworkCore.DataSeeder;
public class ApplicationSingleDataSeederWorker : BackgroundService
{
protected IDataSeeder DataSeeder { get; }
public ApplicationSingleDataSeederWorker(IDataSeeder dataSeeder)
{
DataSeeder = dataSeeder;
}
protected async override Task ExecuteAsync(CancellationToken stoppingToken)
{
await DataSeeder.SeedAsync();
}
}

2
aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleMigrationsEntityFrameworkCoreModule.cs

@ -11,7 +11,6 @@ using LINGYUN.Abp.TextTemplating.EntityFrameworkCore;
using LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore;
using LINGYUN.Abp.WeChat;
using LINGYUN.Platform.EntityFrameworkCore;
using LY.MicroService.Applications.Single.EntityFrameworkCore.DataSeeder;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.FeatureManagement.EntityFrameworkCore;
using Volo.Abp.Modularity;
@ -45,6 +44,5 @@ public class SingleMigrationsEntityFrameworkCoreModule : AbpModule
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAbpDbContext<SingleMigrationsDbContext>();
context.Services.AddHostedService<ApplicationSingleDataSeederWorker>();
}
}

73
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/AbpElsaDesignerModule.cs

@ -0,0 +1,73 @@
using LINGYUN.Abp.Elsa.Designer.Bundling;
using LINGYUN.Abp.Elsa.Designer.Navigation;
using LINGYUN.Abp.Elsa.Localization;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Bundling;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.Elsa.Designer;
[DependsOn(typeof(AbpElsaModule))]
[DependsOn(typeof(AbpAspNetCoreMvcUiThemeSharedModule))]
public class AbpElsaDesignerModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
context.Services.PreConfigure<AbpMvcDataAnnotationsLocalizationOptions>(options =>
{
options.AddAssemblyResource(typeof(ElsaResource), typeof(AbpElsaDesignerModule).Assembly);
});
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpElsaDesignerModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpElsaDesignerModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<ElsaResource>()
.AddVirtualJson("/Localization/Resources");
});
Configure<AbpNavigationOptions>(options =>
{
options.MenuContributors.Add(new AbpElsaDesignerContributor());
});
Configure<AbpBundlingOptions>(options =>
{
options
.StyleBundles
.Add(AbpElsaBundles.Styles.Global, bundle =>
{
bundle
.AddBaseBundles(StandardBundles.Styles.Global)
.AddContributors(typeof(AbpElsaStyleBundleContributor));
});
options
.ScriptBundles
.Add(AbpElsaBundles.Scripts.Global, bundle =>
{
bundle
.AddBaseBundles(StandardBundles.Scripts.Global)
.AddContributors(typeof(AbpElsaScriptBundleContributor));
});
});
}
}

33
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Areas/Elsa/ElsaAuthenticationContextController.cs

@ -0,0 +1,33 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc;
namespace LINGYUN.Abp.Elsa.Designer.Areas.Elsa;
[ApiController]
[ApiVersion("1")]
[Route("v{apiVersion:apiVersion}/ElsaAuthentication/options")]
[Produces("application/json")]
public class ElsaAuthenticationContextController : AbpControllerBase
{
public static string CurrentTenantAccessorName { get; internal set; } = nameof(AbpTenantAccessor);
public static string TenantAccessorKeyName { get; internal set; } = "__tenant";
[AllowAnonymous]
[HttpGet]
[ProducesResponseType(StatusCodes.Status200OK)]
public IActionResult Handle()
{
return Ok(new
{
AuthenticationStyles = new List<string>
{
"ServerManagedCookie" // Cookie
},
CurrentTenantAccessorName,
TenantAccessorKeyName
});
}
}

11
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Areas/Elsa/ElsaController.cs

@ -0,0 +1,11 @@
using Microsoft.AspNetCore.Mvc;
namespace LINGYUN.Abp.Elsa.Designer.Areas.Elsa;
public class ElsaController : Controller
{
public IActionResult Index()
{
return View();
}
}

25
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Areas/Elsa/ElsaUserInfoController.cs

@ -0,0 +1,25 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
namespace LINGYUN.Abp.Elsa.Designer.Areas.Elsa;
[ApiController]
[ApiVersion("1")]
[Route("v{apiVersion:apiVersion}/ElsaAuthentication/UserInfo")]
[Produces("application/json")]
public class ElsaUserInfoController : AbpControllerBase
{
[HttpGet]
[ProducesResponseType(StatusCodes.Status200OK)]
public virtual IActionResult Handle()
{
return Ok(
new {
IsAuthenticated = CurrentUser.IsAuthenticated,
name = CurrentUser.Name ?? CurrentUser.UserName,
tenantId = CurrentUser.TenantId
});
}
}

14
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Areas/Elsa/ElsaUserLogoutController.cs

@ -0,0 +1,14 @@
using Microsoft.AspNetCore.Mvc;
namespace LINGYUN.Abp.Elsa.Designer.Areas.Elsa;
[Route("v{apiVersion:apiVersion}/ElsaAuthentication/logout")]
[Produces("application/json")]
public class ElsaUserLogoutController : Controller
{
[HttpGet]
public IActionResult Handle()
{
return Redirect("/Account/Logout");
}
}

14
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Bundling/AbpElsaBundles.cs

@ -0,0 +1,14 @@
namespace LINGYUN.Abp.Elsa.Designer.Bundling;
public static class AbpElsaBundles
{
public static class Styles
{
public const string Global = "Elsa.Designer";
}
public static class Scripts
{
public const string Global = "Elsa.Designer";
}
}

17
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Bundling/AbpElsaScriptBundleContributor.cs

@ -0,0 +1,17 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace LINGYUN.Abp.Elsa.Designer.Bundling;
public class AbpElsaScriptBundleContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
var basePath = configuration["Hosting:BasePath"] ?? "";
context.Files.AddIfNotContains($"{basePath}/_content/Elsa.Designer.Components.Web/monaco-editor/min/vs/loader.js");
}
}

18
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Bundling/AbpElsaStyleBundleContributor.cs

@ -0,0 +1,18 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace LINGYUN.Abp.Elsa.Designer.Bundling;
public class AbpElsaStyleBundleContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
var basePath = configuration["Hosting:BasePath"] ?? "";
context.Files.AddIfNotContains($"{basePath}/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/assets/fonts/inter/inter.css");
context.Files.AddIfNotContains($"{basePath}/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/elsa-workflows-studio.css");
}
}

3
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/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.Elsa.Designer/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>

43
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/LINGYUN.Abp.Elsa.Designer.csproj

@ -0,0 +1,43 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<AssemblyName>LINGYUN.Abp.Elsa.Designer</AssemblyName>
<PackageId>LINGYUN.Abp.Elsa.Designer</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
<RootNamespace>LINGYUN.Abp.Elsa.Designer</RootNamespace>
<OutputType>Library</OutputType>
<IsPackable>true</IsPackable>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\**\*.js" />
<EmbeddedResource Include="Pages\**\*.css" />
<EmbeddedResource Include="Components\**\*.js" />
<EmbeddedResource Include="Components\**\*.css" />
<EmbeddedResource Include="Localization\**\*.json" />
<Content Remove="Components\**\*.js" />
<Content Remove="Components\**\*.css" />
<Content Remove="Localization\**\*.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared" />
<PackageReference Include="Elsa.Designer.Components.Web" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Elsa\LINGYUN.Abp.Elsa.csproj" />
</ItemGroup>
</Project>

8
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Localization/Resources/en.json

@ -0,0 +1,8 @@
{
"culture": "en",
"texts": {
"Permission:ElsaDesigner": "Elsa Designer",
"Permission:ElsaDesigner:View": "View",
"Elsa:Designer": "Elsa Designer"
}
}

8
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Localization/Resources/zh-Hans.json

@ -0,0 +1,8 @@
{
"culture": "zh-Hans",
"texts": {
"Permission:ElsaDesigner": "Elsa工作流设计器",
"Permission:ElsaDesigner:View": "查看",
"Elsa:Designer": "Elsa工作流设计器"
}
}

31
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Navigation/AbpElsaDesignerContributor.cs

@ -0,0 +1,31 @@
using LINGYUN.Abp.Elsa.Designer.Permissions;
using LINGYUN.Abp.Elsa.Localization;
using System.Threading.Tasks;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.UI.Navigation;
namespace LINGYUN.Abp.Elsa.Designer.Navigation;
public class AbpElsaDesignerContributor : IMenuContributor
{
public virtual Task ConfigureMenuAsync(MenuConfigurationContext context)
{
if (context.Menu.Name != StandardMenus.Main)
{
return Task.CompletedTask;
}
var l = context.GetLocalizer<ElsaResource>();
context.Menu.AddItem(
new ApplicationMenuItem(
AbpElsaDesignerMenuNames.Index,
l["Elsa:Designer"],
url: "~/Elsa",
icon: "fa fa-code-fork",
order: 1000, null)
.RequirePermissions(AbpElsaDesignerPermissionsNames.View)
);
return Task.CompletedTask;
}
}

8
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Navigation/AbpElsaDesignerMenuNames.cs

@ -0,0 +1,8 @@
namespace LINGYUN.Abp.Elsa.Designer.Navigation;
public class AbpElsaDesignerMenuNames
{
public const string GroupName = "ElsaDesigner";
public const string Index = GroupName + ".Index";
}

46
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Pages/Elsa/Index.cshtml

@ -0,0 +1,46 @@
@page
@using LINGYUN.Abp.Elsa.Localization;
@using LINGYUN.Abp.Elsa.Designer.Bundling;
@using LINGYUN.Abp.Elsa.Designer.Navigation;
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@using Microsoft.AspNetCore.Mvc.Localization
@using Microsoft.Extensions.Configuration
@inject IPageLayout PageLayout
@inject IConfiguration Configuration;
@inject IHtmlLocalizer<ElsaResource> L
@{
var serverUrl = Configuration["Elsa:Server:BaseUrl"];
var basePath = Configuration["Hosting:BasePath"] ?? "";
PageLayout.Content.Title = L["Elsa:Designer"].Value;
PageLayout.Content.BreadCrumb.Add(L["Elsa:Designer"].Value);
PageLayout.Content.MenuItemName = AbpElsaDesignerMenuNames.Index;
}
@section styles {
<abp-style-bundle name="@AbpElsaBundles.Styles.Global" />
}
@section scripts {
<abp-script-bundle name="@AbpElsaBundles.Scripts.Global" />
}
<script type="module" src="@basePath/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/elsa-workflows-studio.esm.js"></script>
<elsa-studio-root server-url="@serverUrl" base-path="@basePath" monaco-lib-path="@basePath.TrimStart('/')/_content/Elsa.Designer.Components.Web/monaco-editor/min">
<elsa-studio-dashboard></elsa-studio-dashboard>
</elsa-studio-root>
<script type="module">
// Import publicly exposed services.
import { WebhooksPlugin } from "@basePath/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/index.esm.js";
// Get a handle to the elsa-studio-root element.
const elsaStudioRoot = document.querySelector('elsa-studio-root');
// Configure Elsa during the 'initializing' event.
elsaStudioRoot.addEventListener('initializing', e => {
const elsa = e.detail;
elsa.pluginManager.registerPlugin(WebhooksPlugin);
});
</script>

4
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Pages/_ViewImports.cshtml

@ -0,0 +1,4 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling

19
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Permissions/AbpElsaDesignerPermissionDefinitionProvider.cs

@ -0,0 +1,19 @@
using LINGYUN.Abp.Elsa.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
namespace LINGYUN.Abp.Elsa.Designer.Permissions;
public class AbpElsaDesignerPermissionDefinitionProvider : PermissionDefinitionProvider
{
public override void Define(IPermissionDefinitionContext context)
{
var elsa = context.AddGroup(AbpElsaDesignerPermissionsNames.GroupName, L("Permission:ElsaDesigner"));
elsa.AddPermission(AbpElsaDesignerPermissionsNames.View, L("Permission:ElsaDesigner:View"));
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<ElsaResource>(name);
}
}

15
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Permissions/AbpElsaDesignerPermissionsNames.cs

@ -0,0 +1,15 @@
using Volo.Abp.Reflection;
namespace LINGYUN.Abp.Elsa.Designer.Permissions;
public static class AbpElsaDesignerPermissionsNames
{
public const string GroupName = "Abp.Elsa.Designer";
public const string View = GroupName + ".View";
public static string[] GetAll()
{
return ReflectionHelper.GetPublicConstantsRecursively(typeof(AbpElsaDesignerPermissionsNames));
}
}

12
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Properties/launchSettings.json

@ -0,0 +1,12 @@
{
"profiles": {
"LINGYUN.Abp.Elsa.Designer": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:59137;http://localhost:59139"
}
}
}

2
aspnet-core/services/LY.MicroService.Applications.Single/Controllers/HomeController.cs

@ -6,6 +6,6 @@ public class HomeController : Controller
{
public IActionResult Index()
{
return Redirect("/swagger");
return View();
}
}

1
aspnet-core/services/LY.MicroService.Applications.Single/GlobalUsings.cs

@ -201,6 +201,7 @@ global using Volo.Abp.SettingManagement.EntityFrameworkCore;
global using Volo.Abp.SettingManagement.Localization;
global using Volo.Abp.SettingManagement.Web;
global using Volo.Abp.Sms;
global using Volo.Abp.Swashbuckle;
global using Volo.Abp.Threading;
global using Volo.Abp.UI.Navigation.Urls;
global using Volo.Abp.VirtualFileExplorer.Web;

2
aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj

@ -20,7 +20,6 @@
<PackageReference Include="Elsa.Activities.Http" />
<PackageReference Include="Elsa.Activities.UserTask" />
<PackageReference Include="Elsa.Activities.Temporal.Quartz" />
<!--<PackageReference Include="Elsa.Designer.Components.Web" />-->
<PackageReference Include="Elsa.Webhooks.Api" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" />
<PackageReference Include="OpenIddict.Validation.DataProtection" />
@ -155,6 +154,7 @@
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.Elsa.Activities.Sms\LINGYUN.Abp.Elsa.Activities.Sms.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.Elsa.Activities.Webhooks\LINGYUN.Abp.Elsa.Activities.Webhooks.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.Elsa.Activities\LINGYUN.Abp.Elsa.Activities.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.Elsa.Designer\LINGYUN.Abp.Elsa.Designer.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.Elsa.EntityFrameworkCore\LINGYUN.Abp.Elsa.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.Elsa.Server\LINGYUN.Abp.Elsa.Server.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.Elsa\LINGYUN.Abp.Elsa.csproj" />

2
aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs

@ -286,6 +286,8 @@ public partial class MicroServiceApplicationsSingleModule
// // can also be used to control the format of the API version in route templates
// options.SubstituteApiVersionInUrl = true;
//});
services.AddRazorPages();
services.AddControllersWithViews().AddNewtonsoftJson();
}
private void ConfigureKestrelServer(IConfiguration configuration, IWebHostEnvironment environment)

11
aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs

@ -1,4 +1,4 @@
using Volo.Abp.Swashbuckle;
using LINGYUN.Abp.Elsa.Designer;
namespace LY.MicroService.Applications.Single;
@ -362,6 +362,8 @@ namespace LY.MicroService.Applications.Single;
typeof(AbpElsaActivitiesModule),
// Elsa工作流模块 实体框架
typeof(AbpElsaEntityFrameworkCoreModule),
// Elsa工作流设计器模块
typeof(AbpElsaDesignerModule),
// 数据导出模块 MiniExcel集成
typeof(AbpExporterMiniExcelModule),
@ -439,4 +441,11 @@ public partial class MicroServiceApplicationsSingleModule : AbpModule
ConfigureSingleModule(context.Services, hostingEnvironment.IsDevelopment());
}
public async override Task OnPostApplicationInitializationAsync(ApplicationInitializationContext context)
{
await context.ServiceProvider
.GetRequiredService<IDataSeeder>()
.SeedAsync();
}
}

2
aspnet-core/services/LY.MicroService.Applications.Single/Pages/Index.cshtml → aspnet-core/services/LY.MicroService.Applications.Single/Views/Home/Index.cshtml

@ -1,5 +1,5 @@
@page
@using LY.MicroService.Applications.Single.Pages
@using LY.MicroService.Applications.Single.Pages.Home
@using Volo.Abp.Users
@model IndexModel
@inject ICurrentUser CurrentUser

2
aspnet-core/services/LY.MicroService.Applications.Single/Pages/Index.cshtml.cs → aspnet-core/services/LY.MicroService.Applications.Single/Views/Home/Index.cshtml.cs

@ -1,6 +1,6 @@
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
namespace LY.MicroService.Applications.Single.Pages
namespace LY.MicroService.Applications.Single.Pages.Home
{
public class IndexModel : AbpPageModel
{

4
aspnet-core/services/LY.MicroService.Applications.Single/Views/_ViewImports.cshtml

@ -0,0 +1,4 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling
Loading…
Cancel
Save