Browse Source

fix(elsa): Fix elsa module

- Fix the issue where the workflow editor cannot be opened
- Fix the issue where the workflow endpoint is not registered
- Fix the invalid HttpEndpoint workflow
pull/1384/head
colin 3 months ago
parent
commit
b69f360b90
  1. 8
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Bundling/AbpElsaScriptBundleContributor.cs
  2. 10
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Bundling/AbpElsaStyleBundleContributor.cs
  3. 11
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Pages/Elsa/Index.cshtml
  4. 1
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Server/LINGYUN/Abp/Elsa/AbpElsaServerModule.cs
  5. 1
      aspnet-core/services/LY.MicroService.Applications.Single/Program.cs
  6. 5
      aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/WorkflowManagementHttpApiHostModule.cs

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

@ -1,5 +1,4 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
@ -9,9 +8,6 @@ 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");
context.Files.AddIfNotContains("/_content/Elsa.Designer.Components.Web/monaco-editor/min/vs/loader.js");
}
}

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

@ -1,5 +1,4 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
@ -9,10 +8,7 @@ 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");
context.Files.AddIfNotContains("/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/assets/fonts/inter/inter.css");
context.Files.AddIfNotContains("/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/elsa-workflows-studio.css");
}
}

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

@ -10,7 +10,7 @@
@inject IHtmlLocalizer<ElsaResource> L
@{
var serverUrl = Configuration["Elsa:Server:BaseUrl"];
var basePath = Configuration["Hosting:BasePath"] ?? "";
var basePath = Request.PathBase.Value;
PageLayout.Content.Title = L["Elsa:Designer"].Value;
PageLayout.Content.BreadCrumb.Add(L["Elsa:Designer"].Value);
@ -25,9 +25,9 @@
<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>
<script type="module" src="/_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-root server-url="@serverUrl" monaco-lib-path="_content/Elsa.Designer.Components.Web/monaco-editor/min">
<elsa-studio-dashboard></elsa-studio-dashboard>
</elsa-studio-root>
@ -43,4 +43,9 @@
const elsa = e.detail;
elsa.pluginManager.registerPlugin(WebhooksPlugin);
});
// Some components publish DOM events that we can handle directly:
elsaStudioRoot.addEventListener('workflow-changed', e => {
console.log('Workflow model changed! New model: ${e.detail}');
})
</script>

1
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Server/LINGYUN/Abp/Elsa/AbpElsaServerModule.cs

@ -21,6 +21,7 @@ public class AbpElsaServerModule : AbpModule
.AddSingleton<ActivityBlueprintConverter>()
.AddScoped<IWorkflowBlueprintMapper, WorkflowBlueprintMapper>()
.AddSingleton<IEndpointContentSerializerSettingsProvider, EndpointContentSerializerSettingsProvider>()
.AddElsaApiEndpoints()
.AddSignalR();
PreConfigure<IMvcBuilder>(mvcBuilder =>

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

@ -72,5 +72,6 @@ app.UseAbpSwaggerUI(options =>
app.UseAuditing();
app.UseAbpSerilogEnrichers();
app.UseConfiguredEndpoints();
app.UseHttpActivities();
await app.RunAsync();

5
aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/WorkflowManagementHttpApiHostModule.cs

@ -1,5 +1,4 @@
using Elsa;
using LINGYUN.Abp.AspNetCore.HttpOverrides;
using LINGYUN.Abp.AspNetCore.HttpOverrides;
using LINGYUN.Abp.AspNetCore.Mvc.Localization;
using LINGYUN.Abp.AspNetCore.Mvc.Wrapper;
using LINGYUN.Abp.AuditLogging.Elasticsearch;
@ -146,7 +145,6 @@ public partial class WorkflowManagementHttpApiHostModule : AbpModule
app.MapAbpStaticAssets();
app.UseRouting();
app.UseCors();
app.UseElsaFeatures();
app.UseAuthentication();
app.UseJwtTokenMiddleware();
app.UseMultiTenancy();
@ -165,5 +163,6 @@ public partial class WorkflowManagementHttpApiHostModule : AbpModule
app.UseAuditing();
app.UseAbpSerilogEnrichers();
app.UseConfiguredEndpoints();
app.UseHttpActivities();
}
}

Loading…
Cancel
Save