Skip to content

Commit

Permalink
⚡️ miscellaneous changes.
Browse files Browse the repository at this point in the history
1.  quick create definition from exists (copy)
2.  definition name set be uniqued when save
3 . definition import can choose whether to automatically layout
  • Loading branch information
jxnkwlp committed Nov 13, 2022
1 parent 0b47e45 commit 8517227
Show file tree
Hide file tree
Showing 43 changed files with 355 additions and 263 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [main, develop]
pull_request:
branches: [main, develop]
workflow_dispatch:

jobs:
build:
Expand All @@ -22,10 +23,13 @@ jobs:
restore-keys: |
${{ runner.os }}-node-
- name: Setup .NET
uses: actions/setup-dotnet@v1
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 5.0.x
dotnet-version: |
5.0.x
6.0.x
7.0.x
- name: Install Dotnet Tool
run: dotnet tool install -g Passingwind.Git-CI-Tools
Expand All @@ -39,11 +43,6 @@ jobs:
gitci version next --format json --output ./version.json --build-ver "${{env.GITHUB_SHA_SHORT}}"
ls ./
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x

- id: changes
uses: dorny/paths-filter@v2
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,15 @@ public override void ConfigureServices(ServiceConfigurationContext context)

Configure<AbpDbContextOptions>(options =>
{
options.PreConfigure(config =>
{
config.DbContextOptions.EnableDetailedErrors(true).EnableSensitiveDataLogging();
});

/* The main point to change your DBMS.
* See also DemoMigrationsDbContextFactory for EF Core tooling. */
options.UseSqlServer();

});
}
}
11 changes: 6 additions & 5 deletions demo-app/src/Demo.HttpApi.Host/Demo.HttpApi.Host.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="5.3.4" />
<PackageReference Include="Volo.Abp.Swashbuckle" Version="5.3.4" />
<PackageReference Include="Volo.Abp.MailKit" Version="5.3.4" />
<PackageReference Include="Owl.Abp.CultureMap" Version="2.2.0" />
</ItemGroup>

<ItemGroup>
Expand All @@ -35,22 +36,22 @@
<PackageReference Include="Elsa.Activities.Http" Version="2.9.1" />
<PackageReference Include="Elsa.Activities.UserTask" Version="2.9.1" />
<PackageReference Include="Elsa.Activities.BlobStorage" Version="2.9.1" />
<PackageReference Include="Elsa.Activities.File" Version="2.9.1" />
<PackageReference Include="Elsa.Activities.File" Version="2.9.1" />
<PackageReference Include="Elsa.Activities.Temporal.Hangfire" Version="2.9.1" />
<PackageReference Include="Elsa.Activities.Entity" Version="2.9.1" />
<PackageReference Include="Elsa.Activities.RabbitMq" Version="2.9.1" />
<PackageReference Include="Elsa.Activities.Sql" Version="2.9.1" />
<PackageReference Include="Elsa.Activities.Http.OpenApi" Version="2.9.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\Passingwind.Abp.ElsaModule.Activities\Passingwind.Abp.ElsaModule.Activities.csproj" />
<ProjectReference Include="..\..\..\src\Passingwind.Abp.ElsaModule.MongoDB\Passingwind.Abp.ElsaModule.MongoDB.csproj" />
<ItemGroup>
<ProjectReference Include="..\..\..\src\Passingwind.Abp.ElsaModule.Activities\Passingwind.Abp.ElsaModule.Activities.csproj" />
<ProjectReference Include="..\..\..\src\Passingwind.Abp.ElsaModule.MongoDB\Passingwind.Abp.ElsaModule.MongoDB.csproj" />
<ProjectReference Include="..\Demo.Application\Demo.Application.csproj" />
<ProjectReference Include="..\Demo.EntityFrameworkCore\Demo.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\Demo.HttpApi\Demo.HttpApi.csproj" />
</ItemGroup>


<ItemGroup>
<Compile Remove="Logs\**" />
Expand Down
18 changes: 17 additions & 1 deletion demo-app/src/Demo.HttpApi.Host/DemoHttpApiHostModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
using Microsoft.Extensions.Hosting;
using Microsoft.OpenApi.Models;
using Newtonsoft.Json.Serialization;
using Owl.Abp.CultureMap;
using Passingwind.Abp.ElsaModule;
using Passingwind.Abp.ElsaModule.Activities;
using Passingwind.Abp.ElsaModule.Services;
Expand Down Expand Up @@ -349,6 +350,21 @@ private void ConfigureLocalization()
options.Languages.Add(new LanguageInfo("en", "en", "English"));
options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文"));
});

Configure<OwlCultureMapOptions>(options =>
{
var zhHansCultureMapInfo = new CultureMapInfo
{
TargetCulture = "zh-Hans",
SourceCultures = new List<string>
{
"zh", "zh-CN"
}
};

options.CulturesMaps.Add(zhHansCultureMapInfo);
options.UiCulturesMaps.Add(zhHansCultureMapInfo);
});
}

private void ConfigureDataProtection(
Expand Down Expand Up @@ -398,7 +414,7 @@ public override void OnApplicationInitialization(ApplicationInitializationContex
}

app.UseForwardedHeaders();
app.UseAbpRequestLocalization();
app.UseOwlRequestLocalization();
app.UseCorrelationId();
app.UseStatusCodePages();
app.UseStaticFiles();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public virtual async Task<WorkflowDefinitionVersionDto> CreateAsync(WorkflowDefi
);
defintion.SetVersion(1, null);

// check name
await _workflowDefinitionManager.CheckNameExistsAsync(defintion);

WorkflowDefinitionVersion version = await _workflowDefinitionManager.CreateDefinitionVersionAsync(
defintion.Id,
CurrentTenant.Id,
Expand Down Expand Up @@ -257,6 +260,9 @@ public virtual async Task<WorkflowDefinitionVersionDto> UpdateAsync(Guid id, Wor
defintion.Variables = input.Definition.Variables;
await _workflowDefinitionRepository.UpdateAsync(defintion);

// check name
await _workflowDefinitionManager.CheckNameExistsAsync(defintion);

var dto = ObjectMapper.Map<WorkflowDefinitionVersion, WorkflowDefinitionVersionDto>(currentVersion);
dto.Definition = ObjectMapper.Map<WorkflowDefinition, WorkflowDefinitionDto>(defintion);
return dto;
Expand All @@ -276,6 +282,9 @@ public virtual async Task<WorkflowDefinitionDto> UpdateDefinitionAsync(Guid id,
entity.ContextOptions = input.ContextOptions;
entity.Variables = input.Variables;

// check name
await _workflowDefinitionManager.CheckNameExistsAsync(entity);

await _workflowDefinitionRepository.UpdateAsync(entity);

return ObjectMapper.Map<WorkflowDefinition, WorkflowDefinitionDto>(entity);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
namespace Passingwind.Abp.ElsaModule;
using Elsa.Models;

namespace Passingwind.Abp.ElsaModule;

public static class ElsaModuleErrorCodes
{
//Add your business exception error codes here...
public const string WorkflowDefinitionNameExists = "ElsaModule:WorkflowDefinition:NameExists";
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"culture": "en",
"texts": {
"MyAccount": "My account",
"SamplePageMessage": "A sample page for the ElsaModule module"
"MyAccount": "My account",
"SamplePageMessage": "A sample page for the ElsaModule module",
"ElsaModule:WorkflowDefinition:NameExists": "Workflow definition name '{name}' exists"
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"culture": "zh-Hans",
"texts": {
"MyAccount": "我的账户",
"SamplePageMessage": "ElsaModule模块的示例页面"
"SamplePageMessage": "ElsaModule模块的示例页面",
"ElsaModule:WorkflowDefinition:NameExists": "定义名称'{name}'已经存在"
}
}

This file was deleted.

Loading

0 comments on commit 8517227

Please sign in to comment.