Browse Source

Merge branch 'dev' into abpio-localization

pull/11481/head
berkansasmaz 5 years ago
parent
commit
ea94d5256c
No known key found for this signature in database GPG Key ID: 884D815C3F32BE00
  1. 2
      docs/en/Blog-Posts/2022-01-11 v5_1_Release_Stable/POST.md
  2. 15
      framework/src/Volo.Abp.EventBus.Rebus/Volo/Abp/EventBus/Rebus/AbpEventBusRebusModule.cs
  3. 13
      framework/src/Volo.Abp.EventBus.Rebus/Volo/Abp/EventBus/Rebus/AbpRebusEventBusOptions.cs
  4. 22
      framework/src/Volo.Abp.EventBus.Rebus/Volo/Abp/EventBus/Rebus/AbpRebusEventHandlerStep.cs
  5. 10
      framework/src/Volo.Abp.EventBus.Rebus/Volo/Abp/EventBus/Rebus/RebusDistributedEventBus.cs
  6. 8
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LanguageSwitch.razor
  7. 6
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LoginDisplay.razor
  8. 2
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/Branding.razor
  9. 4
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor
  10. 2
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/_Host.cshtml

2
docs/en/Blog-Posts/2022-01-11 v5_1_Release_Stable/POST.md

@ -104,6 +104,8 @@ Here are some other notable changes that come with this release:
* Support markdown in [CMS-Kit comments ](https://docs.abp.io/en/abp/latest/Modules/Cms-Kit/Comments)feature ([#10792](https://github.com/abpframework/abp/pull/10792))
* Used file scoped namespaces for all the ABP Framework source code :) ([#10552](https://github.com/abpframework/abp/pull/10696))
* Developers should control `EnableLegacyTimestampBehavior` when using PostgreSQL. [#11371](https://github.com/abpframework/abp/pull/11371) [#65](https://github.com/abpframework/eShopOnAbp/pull/65)
All issues & PRs in [5.1 milesone](https://github.com/abpframework/abp/milestone/60?closed=1).

15
framework/src/Volo.Abp.EventBus.Rebus/Volo/Abp/EventBus/Rebus/AbpEventBusRebusModule.cs

@ -1,5 +1,7 @@
using Microsoft.Extensions.DependencyInjection;
using Rebus.Handlers;
using Rebus.Pipeline;
using Rebus.Pipeline.Receive;
using Rebus.ServiceProvider;
using Volo.Abp.Modularity;
@ -21,6 +23,17 @@ public class AbpEventBusRebusModule : AbpModule
context.Services.AddRebus(configure =>
{
configure.Options(options =>
{
options.Decorate<IPipeline>(d =>
{
var step = new AbpRebusEventHandlerStep();
var pipeline = d.Get<IPipeline>();
return new PipelineStepInjector(pipeline).OnReceive(step, PipelineRelativePosition.After, typeof(ActivateHandlersStep));
});
});
preActions.Configure().Configurer?.Invoke(configure);
return configure;
});
@ -35,4 +48,4 @@ public class AbpEventBusRebusModule : AbpModule
.GetRequiredService<RebusDistributedEventBus>()
.Initialize();
}
}
}

13
framework/src/Volo.Abp.EventBus.Rebus/Volo/Abp/EventBus/Rebus/AbpRebusEventBusOptions.cs

@ -20,24 +20,13 @@ public class AbpRebusEventBusOptions
}
private Action<RebusConfigurer> _configurer;
[NotNull]
public Func<IBus, Type, object, Task> Publish {
get => _publish;
set => _publish = Check.NotNull(value, nameof(value));
}
private Func<IBus, Type, object, Task> _publish;
public Func<IBus, Type, object, Task> Publish { get; set; }
public AbpRebusEventBusOptions()
{
_publish = DefaultPublish;
_configurer = DefaultConfigure;
}
private async Task DefaultPublish(IBus bus, Type eventType, object eventData)
{
await bus.Advanced.Routing.Send(InputQueueName, eventData);
}
private void DefaultConfigure(RebusConfigurer configure)
{
configure.Subscriptions(s => s.StoreInMemory());

22
framework/src/Volo.Abp.EventBus.Rebus/Volo/Abp/EventBus/Rebus/AbpRebusEventHandlerStep.cs

@ -0,0 +1,22 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Rebus.Messages;
using Rebus.Pipeline;
using Rebus.Pipeline.Receive;
namespace Volo.Abp.EventBus.Rebus;
public class AbpRebusEventHandlerStep : IIncomingStep
{
public Task Process(IncomingStepContext context, Func<Task> next)
{
var message = context.Load<Message>();
var handlerInvokers = context.Load<HandlerInvokers>().ToList();
handlerInvokers.RemoveAll(x => x.Handler.GetType() == typeof(RebusDistributedEventHandlerAdapter<object>));
context.Save(new HandlerInvokers(message, handlerInvokers));
return next();
}
}

10
framework/src/Volo.Abp.EventBus.Rebus/Volo/Abp/EventBus/Rebus/RebusDistributedEventBus.cs

@ -148,9 +148,15 @@ public class RebusDistributedEventBus : DistributedEventBusBase, ISingletonDepen
await TriggerHandlersAsync(eventType, eventData);
}
protected override async Task PublishToEventBusAsync(Type eventType, object eventData)
protected async override Task PublishToEventBusAsync(Type eventType, object eventData)
{
await AbpRebusEventBusOptions.Publish(Rebus, eventType, eventData);
if (AbpRebusEventBusOptions.Publish != null)
{
await AbpRebusEventBusOptions.Publish(Rebus, eventType, eventData);
return;
}
await Rebus.Publish(eventData);
}
protected override void AddToUnitOfWork(IUnitOfWork unitOfWork, UnitOfWorkEventRecord eventRecord)

8
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LanguageSwitch.razor

@ -30,7 +30,7 @@
CultureInfo.CurrentCulture.Name,
CultureInfo.CurrentUICulture.Name
);
if (currentLanguage == null)
{
var localizationOptions = await RequestLocalizationOptionsProvider.GetLocalizationOptionsAsync();
@ -56,10 +56,10 @@
private void ChangeLanguage(LanguageInfo language)
{
var relativeUrl = NavigationManager.Uri.RemovePreFix(NavigationManager.BaseUri).EnsureStartsWith('/');
var relativeUrl = NavigationManager.Uri.RemovePreFix(NavigationManager.BaseUri).EnsureStartsWith('/').EnsureStartsWith('~');
NavigationManager.NavigateTo(
$"/Abp/Languages/Switch?culture={language.CultureName}&uiCulture={language.UiCultureName}&returnUrl={relativeUrl}",
$"Abp/Languages/Switch?culture={language.CultureName}&uiCulture={language.UiCultureName}&returnUrl={relativeUrl}",
forceLoad: true
);
}

6
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LoginDisplay.razor

@ -26,13 +26,13 @@
{
@foreach (var menuItem in Menu.Items)
{
<a class="dropdown-item" href="@menuItem.Url?.TrimStart('~')" target="@menuItem.Target">@menuItem.DisplayName</a>
<a class="dropdown-item" href="@menuItem.Url?.TrimStart('/', '~')" target="@menuItem.Target">@menuItem.DisplayName</a>
}
}
</DropdownMenu>
</Dropdown>
</Authorized>
<NotAuthorized>
<a class="nav-link" href="/Account/Login">@L["Login"]</a>
<a class="nav-link" href="Account/Login">@L["Login"]</a>
</NotAuthorized>
</AuthorizeView>
</AuthorizeView>

2
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/Branding.razor

@ -3,7 +3,7 @@
<a class="navbar-brand" href="">
@if (!BrandingProvider.LogoUrl.IsNullOrWhiteSpace())
{
<img src="@BrandingProvider.LogoUrl" alt="@BrandingProvider.AppName" >
<img src="@BrandingProvider.LogoUrl.TrimStart('/', '~')" alt="@BrandingProvider.AppName">
}
@BrandingProvider.AppName
</a>

4
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor

@ -12,10 +12,10 @@
<h1>Welcome to the Application</h1>
<p class="lead px-lg-5 mx-lg-5">@L["LongWelcomeMessage"]</p>
@if (!CurrentUser.IsAuthenticated)
{
<a class="btn btn-primary" href="/Account/Login" ><i class="fa fa-sign-in"></i> @L["Login"]</a>
<a class="btn btn-primary" href="Account/Login" ><i class="fa fa-sign-in"></i> @L["Login"]</a>
}
</div>

2
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/_Host.cshtml

@ -16,7 +16,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MyCompanyName.MyProjectName.Blazor.Server</title>
<base href="~/" />
<abp-style-bundle name="@BlazorBasicThemeBundles.Styles.Global" />
</head>
<body class="abp-application-layout bg-light @rtl">

Loading…
Cancel
Save