diff --git a/common.props b/common.props
index b79d4aa..6f03b79 100644
--- a/common.props
+++ b/common.props
@@ -1,7 +1,7 @@
latest
- 0.1.0
+ 0.2.0
$(NoWarn);CS1591;CS0436
module
true
diff --git a/docs/README.md b/docs/README.md
index 5f3e6a5..adcfcd1 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -1,2 +1,43 @@
# Abp.DynamicMenu
+
+[](https://abp.io)
+[](https://www.nuget.org/packages/EasyAbp.Abp.DynamicMenu.Domain.Shared)
+[](https://www.nuget.org/packages/EasyAbp.Abp.DynamicMenu.Domain.Shared)
+[](https://www.github.com/EasyAbp/Abp.DynamicMenu)
+
An abp module that dynamically creates menu items for ABP UI projects in runtime.
+
+## Online Demo
+
+We have launched an online demo for this module: [https://dynamicmenu.samples.easyabp.io](https://dynamicmenu.samples.easyabp.io)
+
+
+
+## Installation
+
+1. Install the following NuGet packages. ([see how](https://github.com/EasyAbp/EasyAbpGuide/blob/master/docs/How-To.md#add-nuget-packages))
+
+ * EasyAbp.Abp.DynamicMenu.Application
+ * EasyAbp.Abp.DynamicMenu.Application.Contracts
+ * EasyAbp.Abp.DynamicMenu.Domain
+ * EasyAbp.Abp.DynamicMenu.Domain.Shared
+ * EasyAbp.Abp.DynamicMenu.EntityFrameworkCore
+ * EasyAbp.Abp.DynamicMenu.HttpApi
+ * EasyAbp.Abp.DynamicMenu.HttpApi.Client
+ * EasyAbp.Abp.DynamicMenu.Web
+
+1. Add `DependsOn(typeof(AbpDynamicMenuXxxModule))` attribute to configure the module dependencies. ([see how](https://github.com/EasyAbp/EasyAbpGuide/blob/master/docs/How-To.md#add-module-dependencies))
+
+1. Add `builder.ConfigureAbpDynamicMenu();` to the `OnModelCreating()` method in **MyProjectMigrationsDbContext.cs**.
+
+1. Add EF Core migrations and update your database. See: [ABP document](https://docs.abp.io/en/abp/latest/Tutorials/Part-1?UI=MVC&DB=EF#add-database-migration).
+
+## Usage
+
+1. Create a dynamic menu item on the management page.
+
+2. Refresh the page and you can see the menu item you just created.
+
+## Road map
+
+- [ ] More customizable options for menu items.
diff --git a/docs/images/demo.gif b/docs/images/demo.gif
new file mode 100644
index 0000000..10e3215
Binary files /dev/null and b/docs/images/demo.gif differ
diff --git a/host/EasyAbp.Abp.DynamicMenu.Blazor.Server.Host/DynamicMenuBlazorHostModule.cs b/host/EasyAbp.Abp.DynamicMenu.Blazor.Server.Host/DynamicMenuBlazorHostModule.cs
index c2b5998..dfc84a8 100644
--- a/host/EasyAbp.Abp.DynamicMenu.Blazor.Server.Host/DynamicMenuBlazorHostModule.cs
+++ b/host/EasyAbp.Abp.DynamicMenu.Blazor.Server.Host/DynamicMenuBlazorHostModule.cs
@@ -51,9 +51,8 @@
namespace EasyAbp.Abp.DynamicMenu.Blazor.Server.Host
{
[DependsOn(
- typeof(DynamicMenuEntityFrameworkCoreModule),
- typeof(DynamicMenuApplicationModule),
typeof(DynamicMenuHttpApiModule),
+ typeof(DynamicMenuHostSharedModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAutofacModule),
typeof(AbpSwashbuckleModule),
diff --git a/host/EasyAbp.Abp.DynamicMenu.Blazor.Server.Host/EasyAbp.Abp.DynamicMenu.Blazor.Server.Host.csproj b/host/EasyAbp.Abp.DynamicMenu.Blazor.Server.Host/EasyAbp.Abp.DynamicMenu.Blazor.Server.Host.csproj
index f9c5f7e..65bcce7 100644
--- a/host/EasyAbp.Abp.DynamicMenu.Blazor.Server.Host/EasyAbp.Abp.DynamicMenu.Blazor.Server.Host.csproj
+++ b/host/EasyAbp.Abp.DynamicMenu.Blazor.Server.Host/EasyAbp.Abp.DynamicMenu.Blazor.Server.Host.csproj
@@ -21,7 +21,6 @@
-
@@ -46,7 +45,6 @@
-
diff --git a/host/EasyAbp.Abp.DynamicMenu.Blazor.Server.Host/EntityFrameworkCore/UnifiedDbContext.cs b/host/EasyAbp.Abp.DynamicMenu.Blazor.Server.Host/EntityFrameworkCore/UnifiedDbContext.cs
index 93e20b5..1b8f1ab 100644
--- a/host/EasyAbp.Abp.DynamicMenu.Blazor.Server.Host/EntityFrameworkCore/UnifiedDbContext.cs
+++ b/host/EasyAbp.Abp.DynamicMenu.Blazor.Server.Host/EntityFrameworkCore/UnifiedDbContext.cs
@@ -28,7 +28,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.ConfigureIdentity();
modelBuilder.ConfigureFeatureManagement();
modelBuilder.ConfigureTenantManagement();
- modelBuilder.ConfigureDynamicMenu();
+ modelBuilder.ConfigureAbpDynamicMenu();
}
}
}
diff --git a/host/EasyAbp.Abp.DynamicMenu.Host.Shared/DemoDataSeedContributor.cs b/host/EasyAbp.Abp.DynamicMenu.Host.Shared/DemoDataSeedContributor.cs
new file mode 100644
index 0000000..37f9076
--- /dev/null
+++ b/host/EasyAbp.Abp.DynamicMenu.Host.Shared/DemoDataSeedContributor.cs
@@ -0,0 +1,40 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using EasyAbp.Abp.DynamicMenu.MenuItems;
+using Volo.Abp.Data;
+using Volo.Abp.DependencyInjection;
+using Volo.Abp.Uow;
+
+namespace EasyAbp.Abp.DynamicMenu
+{
+ public class DemoDataSeedContributor : IDataSeedContributor, ITransientDependency
+ {
+ private readonly IMenuItemRepository _menuItemRepository;
+
+ public DemoDataSeedContributor(IMenuItemRepository menuItemRepository)
+ {
+ _menuItemRepository = menuItemRepository;
+ }
+
+ [UnitOfWork]
+ public async Task SeedAsync(DataSeedContext context)
+ {
+ if (await _menuItemRepository.FindAsync(x => x.Name == "DemoMenu") != null)
+ {
+ return;
+ }
+
+ var subItems = new List
diff --git a/host/EasyAbp.Abp.DynamicMenu.Web.Unified/DynamicMenuWebUnifiedModule.cs b/host/EasyAbp.Abp.DynamicMenu.Web.Unified/DynamicMenuWebUnifiedModule.cs
index 1a38f61..56467ce 100644
--- a/host/EasyAbp.Abp.DynamicMenu.Web.Unified/DynamicMenuWebUnifiedModule.cs
+++ b/host/EasyAbp.Abp.DynamicMenu.Web.Unified/DynamicMenuWebUnifiedModule.cs
@@ -42,8 +42,7 @@ namespace EasyAbp.Abp.DynamicMenu
{
[DependsOn(
typeof(DynamicMenuWebModule),
- typeof(DynamicMenuApplicationModule),
- typeof(DynamicMenuEntityFrameworkCoreModule),
+ typeof(DynamicMenuHostSharedModule),
typeof(AbpAuditLoggingEntityFrameworkCoreModule),
typeof(AbpAutofacModule),
typeof(AbpAccountWebModule),
@@ -65,7 +64,7 @@ namespace EasyAbp.Abp.DynamicMenu
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule)
- )]
+ )]
public class DynamicMenuWebUnifiedModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
diff --git a/host/EasyAbp.Abp.DynamicMenu.Web.Unified/EasyAbp.Abp.DynamicMenu.Web.Unified.csproj b/host/EasyAbp.Abp.DynamicMenu.Web.Unified/EasyAbp.Abp.DynamicMenu.Web.Unified.csproj
index dc06d28..a2c37a2 100644
--- a/host/EasyAbp.Abp.DynamicMenu.Web.Unified/EasyAbp.Abp.DynamicMenu.Web.Unified.csproj
+++ b/host/EasyAbp.Abp.DynamicMenu.Web.Unified/EasyAbp.Abp.DynamicMenu.Web.Unified.csproj
@@ -40,8 +40,6 @@
-
-
diff --git a/host/EasyAbp.Abp.DynamicMenu.Web.Unified/EntityFrameworkCore/UnifiedDbContext.cs b/host/EasyAbp.Abp.DynamicMenu.Web.Unified/EntityFrameworkCore/UnifiedDbContext.cs
index 9bdb868..29474f9 100644
--- a/host/EasyAbp.Abp.DynamicMenu.Web.Unified/EntityFrameworkCore/UnifiedDbContext.cs
+++ b/host/EasyAbp.Abp.DynamicMenu.Web.Unified/EntityFrameworkCore/UnifiedDbContext.cs
@@ -27,7 +27,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.ConfigureIdentity();
modelBuilder.ConfigureFeatureManagement();
modelBuilder.ConfigureTenantManagement();
- modelBuilder.ConfigureDynamicMenu();
+ modelBuilder.ConfigureAbpDynamicMenu();
}
}
}
diff --git a/src/EasyAbp.Abp.DynamicMenu.Application/EasyAbp/Abp/DynamicMenu/MenuItems/ExceededMenuLevelLimitException.cs b/src/EasyAbp.Abp.DynamicMenu.Application/EasyAbp/Abp/DynamicMenu/MenuItems/ExceededMenuLevelLimitException.cs
new file mode 100644
index 0000000..9038725
--- /dev/null
+++ b/src/EasyAbp.Abp.DynamicMenu.Application/EasyAbp/Abp/DynamicMenu/MenuItems/ExceededMenuLevelLimitException.cs
@@ -0,0 +1,13 @@
+using Volo.Abp;
+
+namespace EasyAbp.Abp.DynamicMenu.MenuItems
+{
+ public sealed class ExceededMenuLevelLimitException : BusinessException
+ {
+ public ExceededMenuLevelLimitException(int maxLevel)
+ : base("EasyAbp.Abp.DynamicMenu:ExceededMenuLevelLimit")
+ {
+ Data["MaxLevel"] = maxLevel;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/EasyAbp.Abp.DynamicMenu.Application/EasyAbp/Abp/DynamicMenu/MenuItems/MenuItemAppService.cs b/src/EasyAbp.Abp.DynamicMenu.Application/EasyAbp/Abp/DynamicMenu/MenuItems/MenuItemAppService.cs
index 9cf4fc6..b9e203d 100644
--- a/src/EasyAbp.Abp.DynamicMenu.Application/EasyAbp/Abp/DynamicMenu/MenuItems/MenuItemAppService.cs
+++ b/src/EasyAbp.Abp.DynamicMenu.Application/EasyAbp/Abp/DynamicMenu/MenuItems/MenuItemAppService.cs
@@ -1,3 +1,5 @@
+using System;
+using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EasyAbp.Abp.DynamicMenu.Permissions;
@@ -40,7 +42,7 @@ protected override async Task