From c5483b4f24053b76fb192ad8fa3501f6bb758828 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 28 Apr 2022 08:53:05 +0800 Subject: [PATCH 01/15] Remove `FormTenantResolveContributor` from the `AbpTenantResolveOptions`. --- .../AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyModule.cs | 1 - .../AspNetCore/MultiTenancy/FormTenantResolveContributor.cs | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyModule.cs b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyModule.cs index ad36cf0f11..e0d8ecd806 100644 --- a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyModule.cs @@ -15,7 +15,6 @@ public class AbpAspNetCoreMultiTenancyModule : AbpModule Configure(options => { options.TenantResolvers.Add(new QueryStringTenantResolveContributor()); - options.TenantResolvers.Add(new FormTenantResolveContributor()); options.TenantResolvers.Add(new RouteTenantResolveContributor()); options.TenantResolvers.Add(new HeaderTenantResolveContributor()); options.TenantResolvers.Add(new CookieTenantResolveContributor()); diff --git a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/FormTenantResolveContributor.cs b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/FormTenantResolveContributor.cs index 67ef0a4c2c..d55343c94c 100644 --- a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/FormTenantResolveContributor.cs +++ b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/FormTenantResolveContributor.cs @@ -1,10 +1,11 @@ -using System.Linq; +using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Volo.Abp.MultiTenancy; namespace Volo.Abp.AspNetCore.MultiTenancy; +[Obsolete("This may make some features of ASP NET Core unavailable, Will be removed in future versions.")] public class FormTenantResolveContributor : HttpTenantResolveContributorBase { public const string ContributorName = "Form"; From 624f31bbbd8e2b605523282fbc2c1f034ac70f3c Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 28 Apr 2022 09:19:07 +0800 Subject: [PATCH 02/15] Update Multi-Tenancy.md --- docs/en/Multi-Tenancy.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/en/Multi-Tenancy.md b/docs/en/Multi-Tenancy.md index 2603cb0436..44537aad0a 100644 --- a/docs/en/Multi-Tenancy.md +++ b/docs/en/Multi-Tenancy.md @@ -203,7 +203,6 @@ The following resolvers are provided and configured by default; * `CurrentUserTenantResolveContributor`: Gets the tenant id from claims of the current user, if the current user has logged in. **This should always be the first contributor for the security**. * `QueryStringTenantResolveContributor`: Tries to find current tenant id from query string parameters. The parameter name is `__tenant` by default. -* `FormTenantResolveContributor`:Tries to find current tenant id from form parameters. The parameter name is `__tenant` by default. * `RouteTenantResolveContributor`: Tries to find current tenant id from route (URL path). The variable name is `__tenant` by default. If you defined a route with this variable, then it can determine the current tenant from the route. * `HeaderTenantResolveContributor`: Tries to find current tenant id from HTTP headers. The header name is `__tenant` by default. * `CookieTenantResolveContributor`: Tries to find current tenant id from cookie values. The cookie name is `__tenant` by default. From 4a50dfd8d300985f592d4c49b5d23f1c33b44f6c Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 28 Apr 2022 09:19:10 +0800 Subject: [PATCH 03/15] Update Multi-Tenancy.md --- docs/zh-Hans/Multi-Tenancy.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/zh-Hans/Multi-Tenancy.md b/docs/zh-Hans/Multi-Tenancy.md index 8e92d10673..d29defa53b 100644 --- a/docs/zh-Hans/Multi-Tenancy.md +++ b/docs/zh-Hans/Multi-Tenancy.md @@ -306,7 +306,6 @@ Volo.Abp.AspNetCore.MultiTenancy 添加了下面这些租户解析器,从当前W * **CurrentUserTenantResolveContributor**: 如果当前用户已登录,从当前用户的声明中获取租户Id. **出于安全考虑,应该始终将其做为第一个Contributor**. * **QueryStringTenantResolveContributor**: 尝试从query string参数中获取当前租户,默认参数名为"__tenant". -* **FormTenantResolveContributor**: 尝试从form参数中获取当前租户,默认参数名为"__tenant". * **RouteTenantResolveContributor**:尝试从当前路由中获取(URL路径),默认是变量名是"__tenant".所以,如果你的路由中定义了这个变量,就可以从路由中确定当前租户. * **HeaderTenantResolveContributor**: 尝试从HTTP header中获取当前租户,默认的header名称是"__tenant". * **CookieTenantResolveContributor**: 尝试从当前cookie中获取当前租户.默认的Cookie名称是"__tenant". From edd5ff09a414ede67113922cf939dbd976003566 Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Sun, 26 Jun 2022 13:30:41 +0300 Subject: [PATCH 04/15] Add missing Page-Layout to the menu of docs --- docs/en/docs-nav.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index 2d1348f695..363658c530 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -825,6 +825,10 @@ "text": "Page Header", "path": "UI/Blazor/Page-Header.md" }, + { + "text": "Page Header", + "path": "UI/Blazor/Page-Layout.md" + }, { "text": "Toolbars", "path": "UI/Blazor/Toolbars.md" From e75b99c07b80fc963768013582ab5d427a5246eb Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Sun, 26 Jun 2022 13:32:47 +0300 Subject: [PATCH 05/15] Update docs-nav.json --- docs/en/docs-nav.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index 363658c530..c4b06bdb78 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -826,7 +826,7 @@ "path": "UI/Blazor/Page-Header.md" }, { - "text": "Page Header", + "text": "Page Layout", "path": "UI/Blazor/Page-Layout.md" }, { From f88e4cc48fb0993ef32101a69f9d3c1766a6912c Mon Sep 17 00:00:00 2001 From: Salih Date: Wed, 31 Aug 2022 16:19:37 +0300 Subject: [PATCH 06/15] delete forgotten comment lines in doc module --- .../Pages/Docs/Admin/Documents/Index.cshtml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml index c740a7ab07..9e846f24a9 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml @@ -59,11 +59,6 @@ id="Version" name="Version" class="form-select"> - - @* @foreach (var version in Model.FilterItems.Versions) *@ - @* { *@ - @* *@ - @* } *@ @@ -87,11 +82,6 @@ id="LanguageCode" name="LanguageCode" class="form-select"> - - @* @foreach (var language in Model.FilterItems.Versions) *@ - @* { *@ - @* *@ - @* } *@ From 021a2d7e604870d0a43a9d61d7fa6604e9bf9835 Mon Sep 17 00:00:00 2001 From: Salih Date: Wed, 31 Aug 2022 16:51:21 +0300 Subject: [PATCH 07/15] Update tr.json --- .../Localization/Resources/Docs/ApplicationContracts/tr.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/tr.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/tr.json index cfd58936d7..dade32b970 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/tr.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/tr.json @@ -48,7 +48,7 @@ "Search": "Arama", "StartDate": "Başlangıç tarihi", "EndDate": "Bitiş tarihi", - "CreationTime": "oluşturma zamanı", + "CreationTime": "Oluşturma Zamanı", "LastUpdateTime": "Son Güncelleme", "LastSignificantUpdateTime": "Son önemli güncelleme", "Version": "Sürüm", From 6dc86702c9871142ee6d421be7d7df3c12a1487b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Wed, 31 Aug 2022 16:35:23 +0300 Subject: [PATCH 08/15] remove initialize in AbpAspNetCoreMvcClientModule --- .../Mvc/Client/AbpAspNetCoreMvcClientModule.cs | 13 +------------ .../MvcCachedApplicationConfigurationClient.cs | 6 ------ 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs index 7c21b9fe09..ae5421d947 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs @@ -1,8 +1,5 @@ -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; using Volo.Abp.EventBus; using Volo.Abp.Modularity; -using Volo.Abp.Threading; namespace Volo.Abp.AspNetCore.Mvc.Client; @@ -12,13 +9,5 @@ namespace Volo.Abp.AspNetCore.Mvc.Client; )] public class AbpAspNetCoreMvcClientModule : AbpModule { - public override void OnApplicationInitialization(ApplicationInitializationContext context) - { - AsyncHelper.RunSync(() => OnApplicationInitializationAsync(context)); - } - - public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context) - { - await context.ServiceProvider.GetRequiredService().InitializeAsync(); - } + } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs index 59690b2d03..7bb2e67b49 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs @@ -30,11 +30,6 @@ public class MvcCachedApplicationConfigurationClient : ICachedApplicationConfigu Cache = cache; } - public async Task InitializeAsync() - { - await GetAsync(); - } - public async Task GetAsync() { var cacheKey = CreateCacheKey(); @@ -45,7 +40,6 @@ public class MvcCachedApplicationConfigurationClient : ICachedApplicationConfigu return configuration; } - configuration = await Cache.GetOrAddAsync( cacheKey, async () => await ApplicationConfigurationAppService.GetAsync(), From 0a760984102be866d13038e0d1fca9de45d37159 Mon Sep 17 00:00:00 2001 From: Mateus Delgado Date: Thu, 1 Sep 2022 10:07:46 -0300 Subject: [PATCH 09/15] Fix typo on RabbitMQ Docs fix typo refering to ConnectionFactory. --- docs/en/Distributed-Event-Bus-RabbitMQ-Integration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/Distributed-Event-Bus-RabbitMQ-Integration.md b/docs/en/Distributed-Event-Bus-RabbitMQ-Integration.md index 3d99e1e3cf..251a84510b 100644 --- a/docs/en/Distributed-Event-Bus-RabbitMQ-Integration.md +++ b/docs/en/Distributed-Event-Bus-RabbitMQ-Integration.md @@ -86,7 +86,7 @@ Defining multiple connections is allowed. In this case, you can specify the conn This allows you to use multiple RabbitMQ server in your application, but select one of them for the event bus. -You can use any of the [ConnectionFactry](http://rabbitmq.github.io/rabbitmq-dotnet-client/api/RabbitMQ.Client.ConnectionFactory.html#properties) properties as the connection properties. +You can use any of the [ConnectionFactory](http://rabbitmq.github.io/rabbitmq-dotnet-client/api/RabbitMQ.Client.ConnectionFactory.html#properties) properties as the connection properties. **Example: Specify the connection port** @@ -151,4 +151,4 @@ Configure(options => }); ```` -Using these options classes can be combined with the `appsettings.json` way. Configuring an option property in the code overrides the value in the configuration file. \ No newline at end of file +Using these options classes can be combined with the `appsettings.json` way. Configuring an option property in the code overrides the value in the configuration file. From d8c233e94587fa6543206dea8f2e1d9e3a6f2133 Mon Sep 17 00:00:00 2001 From: Engincan VESKE Date: Thu, 1 Sep 2022 20:50:10 +0300 Subject: [PATCH 10/15] Implement layout hooks for blazor --- .../Components/LayoutHooks/LayoutHook.razor | 7 ++++ .../LayoutHooks/LayoutHook.razor.cs | 39 +++++++++++++++++++ .../Layout/StandardLayouts.cs | 8 ++++ .../UI/Components/LayoutHook/Default.cshtml | 3 +- .../LayoutHook/LayoutHookViewComponent.cs | 1 + .../Ui/LayoutHooks}/AbpLayoutHookOptions.cs | 2 +- .../Abp/Ui/LayoutHooks}/LayoutHookInfo.cs | 4 +- .../Ui/LayoutHooks}/LayoutHookViewModel.cs | 2 +- .../Volo/Abp/Ui/LayoutHooks}/LayoutHooks.cs | 2 +- .../Themes/Basic/MainLayout.razor | 5 ++- .../Themes/Basic/Layouts/Account.cshtml | 1 + .../Themes/Basic/Layouts/Application.cshtml | 1 + .../Themes/Basic/Layouts/Empty.cshtml | 1 + 13 files changed, 68 insertions(+), 8 deletions(-) create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/LayoutHooks/LayoutHook.razor create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/LayoutHooks/LayoutHook.razor.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/StandardLayouts.cs rename framework/src/{Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook => Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks}/AbpLayoutHookOptions.cs (89%) rename framework/src/{Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook => Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks}/LayoutHookInfo.cs (84%) rename framework/src/{Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook => Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks}/LayoutHookViewModel.cs (79%) rename framework/src/{Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook => Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks}/LayoutHooks.cs (88%) diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/LayoutHooks/LayoutHook.razor b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/LayoutHooks/LayoutHook.razor new file mode 100644 index 0000000000..f512232b86 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/LayoutHooks/LayoutHook.razor @@ -0,0 +1,7 @@ +@if (LayoutHookViewModel.Hooks.Any()) +{ + foreach (var hook in LayoutHookViewModel.Hooks) + { + + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/LayoutHooks/LayoutHook.razor.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/LayoutHooks/LayoutHook.razor.cs new file mode 100644 index 0000000000..18fbcd89c2 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/LayoutHooks/LayoutHook.razor.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Components; +using Microsoft.Extensions.Options; +using Volo.Abp.Ui.LayoutHooks; + +namespace Volo.Abp.AspNetCore.Components.Web.Theming.Components.LayoutHooks; + +public partial class LayoutHook : ComponentBase +{ + [Parameter] + public string Name { get; set; } + + [Parameter] + public string Layout { get; set; } + + [Inject] + protected IOptions LayoutHookOptions { get; set; } + + protected LayoutHookViewModel LayoutHookViewModel { get; private set; } + + protected override Task OnInitializedAsync() + { + if (LayoutHookOptions.Value.Hooks.TryGetValue(Name, out var layoutHooks)) + { + layoutHooks = layoutHooks + .WhereIf(string.IsNullOrWhiteSpace(Layout), x => x.Layout == Layout) + .ToList(); + } + + layoutHooks ??= new List(); + + LayoutHookViewModel = new LayoutHookViewModel(layoutHooks.ToArray(), Layout); + + return Task.CompletedTask; + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/StandardLayouts.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/StandardLayouts.cs new file mode 100644 index 0000000000..f56dae9f03 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/StandardLayouts.cs @@ -0,0 +1,8 @@ +namespace Volo.Abp.AspNetCore.Components.Web.Theming.Layout; + +public static class StandardLayouts +{ + public const string Main = "Main"; + public const string TopMenu = "TopMenu"; + public const string SideMenu = "SideMenu"; +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/Default.cshtml index 61e9afbf6e..34536ec373 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/Default.cshtml +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/Default.cshtml @@ -1,5 +1,4 @@ -@using Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook -@model LayoutHookViewModel +@model Volo.Abp.Ui.LayoutHooks.LayoutHookViewModel @if (Model.Hooks.Any()) { foreach (var hook in Model.Hooks) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewComponent.cs index 45eaa2b6a3..5bd18e4c31 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewComponent.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewComponent.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; +using Volo.Abp.Ui.LayoutHooks; namespace Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/AbpLayoutHookOptions.cs b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/AbpLayoutHookOptions.cs similarity index 89% rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/AbpLayoutHookOptions.cs rename to framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/AbpLayoutHookOptions.cs index 68851c1860..d5ba4aa239 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/AbpLayoutHookOptions.cs +++ b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/AbpLayoutHookOptions.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook; +namespace Volo.Abp.Ui.LayoutHooks; public class AbpLayoutHookOptions { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookInfo.cs b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/LayoutHookInfo.cs similarity index 84% rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookInfo.cs rename to framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/LayoutHookInfo.cs index e2bb26dac5..db4ca39466 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookInfo.cs +++ b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/LayoutHookInfo.cs @@ -1,11 +1,11 @@ using System; -namespace Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook; +namespace Volo.Abp.Ui.LayoutHooks; public class LayoutHookInfo { /// - /// ViewComponent type. + /// Component type. /// public Type ComponentType { get; } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewModel.cs b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/LayoutHookViewModel.cs similarity index 79% rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewModel.cs rename to framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/LayoutHookViewModel.cs index fbc73d8dad..107ad6990a 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewModel.cs +++ b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/LayoutHookViewModel.cs @@ -1,4 +1,4 @@ -namespace Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook; +namespace Volo.Abp.Ui.LayoutHooks; public class LayoutHookViewModel { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHooks.cs b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/LayoutHooks.cs similarity index 88% rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHooks.cs rename to framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/LayoutHooks.cs index 588872c46b..fafab40161 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHooks.cs +++ b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/LayoutHooks.cs @@ -1,4 +1,4 @@ -namespace Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook; +namespace Volo.Abp.Ui.LayoutHooks; public static class LayoutHooks { diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/MainLayout.razor b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/MainLayout.razor index 01500c8801..05edf4f1f6 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/MainLayout.razor +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/MainLayout.razor @@ -1,4 +1,5 @@ -@using Volo.Abp.AspNetCore.Components.Web.Theming.Components; +@using Volo.Abp.Ui.LayoutHooks +@using Volo.Abp.AspNetCore.Components.Web.Theming.Layout @inherits LayoutComponentBase
+ @Body + diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Account.cshtml b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Account.cshtml index f71171912c..5e2ca98ba7 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Account.cshtml +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Account.cshtml @@ -12,6 +12,7 @@ @using Volo.Abp.MultiTenancy @using Volo.Abp.Localization @using Volo.Abp.Ui.Branding +@using Volo.Abp.Ui.LayoutHooks @inject IBrandingProvider BrandingProvider @inject IOptions MultiTenancyOptions @inject ICurrentTenant CurrentTenant diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Application.cshtml b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Application.cshtml index 23c19c077d..42f2b2ead2 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Application.cshtml +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Application.cshtml @@ -8,6 +8,7 @@ @using Volo.Abp.AspNetCore.Mvc.UI.Widgets.Components.WidgetStyles @using Volo.Abp.Localization @using Volo.Abp.Ui.Branding +@using Volo.Abp.Ui.LayoutHooks @inject IBrandingProvider BrandingProvider @inject IPageLayout PageLayout @{ diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Empty.cshtml b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Empty.cshtml index 70c7d5e1e8..6d3461be43 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Empty.cshtml +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Empty.cshtml @@ -7,6 +7,7 @@ @using Volo.Abp.AspNetCore.Mvc.UI.Widgets.Components.WidgetStyles @using Volo.Abp.Localization @using Volo.Abp.Ui.Branding +@using Volo.Abp.Ui.LayoutHooks @inject IBrandingProvider BrandingProvider @inject IPageLayout PageLayout @{ From 0bfce28af10ac9ba4ab369a45f418a5e8cfbfef5 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Fri, 2 Sep 2022 10:17:40 +0800 Subject: [PATCH 11/15] Add Theme to Symbols --- .../Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs | 8 ++++++-- .../Templates/Microservice/MicroserviceTemplateBase.cs | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs index 2d7da80211..16bea2740f 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs @@ -194,12 +194,16 @@ public abstract class AppTemplateBase : TemplateInfo return; } + if (context.BuildArgs.Theme != Theme.NotSpecified) + { + context.Symbols.Add(context.BuildArgs.Theme.Value.ToString().ToUpper()); + } + if (context.BuildArgs.Theme == Theme.LeptonX) { - context.Symbols.Add("LEPTONX"); steps.Add(new ChangeThemeStyleStep()); } - + if (IsDefaultThemeForTemplate(context.BuildArgs.Theme.Value)) { return; diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceTemplateBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceTemplateBase.cs index c6a15389ef..319326f3d4 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceTemplateBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceTemplateBase.cs @@ -35,10 +35,14 @@ public abstract class MicroserviceTemplateBase : TemplateInfo { return; } + + if (context.BuildArgs.Theme != Theme.NotSpecified) + { + context.Symbols.Add(context.BuildArgs.Theme.Value.ToString().ToUpper()); + } if (context.BuildArgs.Theme == Theme.LeptonX) { - context.Symbols.Add("LEPTONX"); steps.Add(new ChangeThemeStyleStep()); return; } From 6be5c286d5eec9d2efdf5819a2e4f3dbce8be111 Mon Sep 17 00:00:00 2001 From: Engincan VESKE Date: Fri, 2 Sep 2022 08:43:46 +0300 Subject: [PATCH 12/15] fix build problem on cms-kit module --- .../cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs | 2 +- modules/docs/src/Volo.Docs.Web/DocsWebModule.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs index 88b01c8ae9..3ce96f1a86 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs @@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AspNetCore.Mvc.Localization; -using Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook; +using Volo.Abp.Ui.LayoutHooks; using Volo.Abp.AutoMapper; using Volo.Abp.GlobalFeatures; using Volo.Abp.Http.ProxyScripting.Generators.JQuery; diff --git a/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs b/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs index 42c1717690..ddc40b36a1 100644 --- a/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs +++ b/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs @@ -5,7 +5,7 @@ using Microsoft.Extensions.Options; using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; using Volo.Abp.AspNetCore.Mvc.UI.Bundling; -using Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook; +using Volo.Abp.Ui.LayoutHooks; using Volo.Abp.AspNetCore.Mvc.UI.Packages; using Volo.Abp.AspNetCore.Mvc.UI.Packages.Prismjs; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; From 0ec95e4c8343880e6fcc76d0342bf99e6ce10344 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Fri, 2 Sep 2022 16:12:30 +0800 Subject: [PATCH 13/15] Fix Kafka connection problem --- framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/ConsumerPool.cs | 2 +- framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/ProducerPool.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/ConsumerPool.cs b/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/ConsumerPool.cs index 7147c81271..7c73df0d51 100644 --- a/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/ConsumerPool.cs +++ b/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/ConsumerPool.cs @@ -37,7 +37,7 @@ public class ConsumerPool : IConsumerPool, ISingletonDependency return Consumers.GetOrAdd( connectionName, connection => new Lazy>(() => { - var config = new ConsumerConfig(Options.Connections.GetOrDefault(connection)) + var config = new ConsumerConfig(Options.Connections.GetOrDefault(connection).ToDictionary(k => k.Key, v => v.Value)) { GroupId = groupId, EnableAutoCommit = false diff --git a/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/ProducerPool.cs b/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/ProducerPool.cs index 691a29c1d2..ac2edf31a7 100644 --- a/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/ProducerPool.cs +++ b/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/ProducerPool.cs @@ -39,7 +39,7 @@ public class ProducerPool : IProducerPool, ISingletonDependency return Producers.GetOrAdd( connectionName, connection => new Lazy>(() => { - var producerConfig = new ProducerConfig(Options.Connections.GetOrDefault(connection)); + var producerConfig = new ProducerConfig(Options.Connections.GetOrDefault(connection).ToDictionary(k => k.Key, v => v.Value)); Options.ConfigureProducer?.Invoke(producerConfig); return new ProducerBuilder(producerConfig).Build(); From 80a9177d84d17007b381037805f6366766e9a786 Mon Sep 17 00:00:00 2001 From: Engincan VESKE Date: Fri, 2 Sep 2022 13:22:13 +0300 Subject: [PATCH 14/15] rename layout name (main to application) --- .../Layout/StandardLayouts.cs | 4 +--- .../Themes/Basic/MainLayout.razor | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/StandardLayouts.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/StandardLayouts.cs index f56dae9f03..ea73a5673f 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/StandardLayouts.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/StandardLayouts.cs @@ -2,7 +2,5 @@ public static class StandardLayouts { - public const string Main = "Main"; - public const string TopMenu = "TopMenu"; - public const string SideMenu = "SideMenu"; + public const string Application = "Application"; } \ No newline at end of file diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/MainLayout.razor b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/MainLayout.razor index 05edf4f1f6..3565d6add5 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/MainLayout.razor +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/MainLayout.razor @@ -19,9 +19,9 @@
- + @Body - + From 59a47eb4ff808db0ddc9fa7282be0f3322e06fc0 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 2 Sep 2022 14:55:27 +0300 Subject: [PATCH 15/15] Cli: Renamed ICmdHelper.OpenWebPage to ICmdHelper.Open --- .../Abp/Cli/Commands/ProjectCreationCommandBase.cs | 4 ++-- .../Abp/Cli/ProjectModification/SolutionModuleAdder.cs | 2 +- .../Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/CmdHelper.cs | 10 +++++----- .../Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ICmdHelper.cs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs index 646d8d4c08..813900ba18 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs @@ -333,14 +333,14 @@ public abstract class ProjectCreationCommandBase var tieredYesNo = tiered ? "yes" : "no"; var url = $"https://{urlPrefix}.abp.io/project-created-success?ui={uiFramework:g}&db={databaseProvider:g}&tiered={tieredYesNo}"; - CmdHelper.OpenWebPage(url); + CmdHelper.Open(url); } protected void OpenMicroserviceDocumentPage() { var url = "https://docs.abp.io/en/commercial/latest/startup-templates/microservice/index"; - CmdHelper.OpenWebPage(url); + CmdHelper.Open(url); } protected bool GetCreateSolutionFolderPreference(CommandLineArgs commandLineArgs) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs index 7f2831351a..ed90d16cfd 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs @@ -153,7 +153,7 @@ public class SolutionModuleAdder : ITransientDependency var documentationLink = module.GetFirstDocumentationLinkOrNull(); if (documentationLink != null) { - CmdHelper.OpenWebPage(documentationLink); + CmdHelper.Open(documentationLink); } return module; diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/CmdHelper.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/CmdHelper.cs index 95eaa8136c..32c1acf5be 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/CmdHelper.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/CmdHelper.cs @@ -18,20 +18,20 @@ public class CmdHelper : ICmdHelper, ITransientDependency CliOptions = cliOptions.Value; } - public void OpenWebPage(string url) + public void Open(string pathOrUrl) { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - url = url.Replace("&", "^&"); - Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") { CreateNoWindow = true }); + pathOrUrl = pathOrUrl.Replace("&", "^&"); + Process.Start(new ProcessStartInfo("cmd", $"/c start {pathOrUrl}") { CreateNoWindow = true }); } else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) { - Process.Start("xdg-open", url); + Process.Start("xdg-open", pathOrUrl); } else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { - Process.Start("open", url); + Process.Start("open", pathOrUrl); } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ICmdHelper.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ICmdHelper.cs index f96697b1cc..2f71bda7b5 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ICmdHelper.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ICmdHelper.cs @@ -4,7 +4,7 @@ namespace Volo.Abp.Cli.Utils; public interface ICmdHelper { - void OpenWebPage(string url); + void Open(string pathOrUrl); void Run(string file, string arguments);