Merge branch 'dev' into localization-v7

pull/13845/head
Halil İbrahim Kalkan 3 years ago
commit 2000c96ffc

@ -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**
@ -152,4 +152,4 @@ Configure<AbpRabbitMqEventBusOptions>(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.
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.

@ -222,7 +222,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.

@ -851,6 +851,10 @@
"text": "Page Header",
"path": "UI/Blazor/Page-Header.md"
},
{
"text": "Page Layout",
"path": "UI/Blazor/Page-Layout.md"
},
{
"text": "Toolbars",
"path": "UI/Blazor/Toolbars.md"

@ -322,7 +322,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".

@ -0,0 +1,7 @@
@if (LayoutHookViewModel.Hooks.Any())
{
foreach (var hook in LayoutHookViewModel.Hooks)
{
<DynamicComponent Type="@hook.ComponentType" />
}
}

@ -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<AbpLayoutHookOptions> 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<LayoutHookInfo>();
LayoutHookViewModel = new LayoutHookViewModel(layoutHooks.ToArray(), Layout);
return Task.CompletedTask;
}
}

@ -0,0 +1,6 @@
namespace Volo.Abp.AspNetCore.Components.Web.Theming.Layout;
public static class StandardLayouts
{
public const string Application = "Application";
}

@ -15,7 +15,6 @@ public class AbpAspNetCoreMultiTenancyModule : AbpModule
Configure<AbpTenantResolveOptions>(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());

@ -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";

@ -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)

@ -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;

@ -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)

@ -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;

@ -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;
}

@ -153,7 +153,7 @@ public class SolutionModuleAdder : ITransientDependency
var documentationLink = module.GetFirstDocumentationLinkOrNull();
if (documentationLink != null)
{
CmdHelper.OpenWebPage(documentationLink);
CmdHelper.Open(documentationLink);
}
return module;

@ -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);
}
}

@ -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);

@ -37,7 +37,7 @@ public class ConsumerPool : IConsumerPool, ISingletonDependency
return Consumers.GetOrAdd(
connectionName, connection => new Lazy<IConsumer<string, byte[]>>(() =>
{
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

@ -39,7 +39,7 @@ public class ProducerPool : IProducerPool, ISingletonDependency
return Producers.GetOrAdd(
connectionName, connection => new Lazy<IProducer<string, byte[]>>(() =>
{
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<string, byte[]>(producerConfig).Build();

@ -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
{

@ -1,11 +1,11 @@
using System;
namespace Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook;
namespace Volo.Abp.Ui.LayoutHooks;
public class LayoutHookInfo
{
/// <summary>
/// ViewComponent type.
/// Component type.
/// </summary>
public Type ComponentType { get; }

@ -1,4 +1,4 @@
namespace Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook;
namespace Volo.Abp.Ui.LayoutHooks;
public class LayoutHookViewModel
{

@ -1,4 +1,4 @@
namespace Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook;
namespace Volo.Abp.Ui.LayoutHooks;
public static class LayoutHooks
{

@ -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
<nav class="navbar navbar-expand-md navbar-dark bg-dark shadow-sm flex-column flex-md-row mb-4" id="main-navbar" style="min-height: 4rem;">
<div class="container">
@ -18,7 +19,9 @@
</nav>
<div class="container">
<PageAlert />
<LayoutHook Name="@LayoutHooks.Body.First" Layout="@StandardLayouts.Application" />
@Body
<LayoutHook Name="@LayoutHooks.Body.Last" Layout="@StandardLayouts.Application" />
<DynamicLayoutComponent />
<UiMessageAlert />
<UiNotificationAlert />

@ -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<AbpMultiTenancyOptions> MultiTenancyOptions
@inject ICurrentTenant CurrentTenant

@ -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
@{

@ -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
@{

@ -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;

@ -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",

@ -59,11 +59,6 @@
id="Version"
name="Version"
class="form-select">
<option></option>
@* @foreach (var version in Model.FilterItems.Versions) *@
@* { *@
@* <option value="@version.Version" style="display: none;" data-project-id="@version.ProjectId" data-language-code="@version.LanguageCode">@version.Version</option> *@
@* } *@
</select>
</div>
</abp-column>
@ -87,11 +82,6 @@
id="LanguageCode"
name="LanguageCode"
class="form-select">
<option></option>
@* @foreach (var language in Model.FilterItems.Versions) *@
@* { *@
@* <option value="@language.LanguageCode" style="display: none;" data-project-id="@language.ProjectId" d>@language.LanguageCode</option> *@
@* } *@
</select>
</div>
</abp-column>

@ -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;

Loading…
Cancel
Save