Browse Source

Merge branch 'dev' into cmskit-widget-render

pull/13082/head
malik masis 4 years ago
parent
commit
209a88ea0e
  1. 6
      docs/en/CLI.md
  2. 1
      docs/en/Startup-Templates/Index.md
  3. 2
      docs/en/Tutorials/Todo/Single-Layer/Index.md
  4. BIN
      docs/en/Tutorials/Todo/Single-Layer/todo-single-layer-ui-initial.png
  5. 50
      docs/en/UI/Angular/Breadcrumb.md
  6. 2
      framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/Extensibility/BlazorServerLookupApiRequestService.cs
  7. 5
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpAspNetCoreComponentsWebModule.cs
  8. 6
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Security/AbpComponentsClaimsCache.cs
  9. 32
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Microsoft/AspNetCore/Components/WebAssembly/Hosting/AbpWebAssemblyHostBuilderExtensions.cs
  10. 38
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpAspNetCoreComponentsWebAssemblyModule.cs
  11. 5
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyCachedApplicationConfigurationClient.cs
  12. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo/Abp/AspNetCore/Mvc/Client/ICachedApplicationConfigurationClient.cs
  13. 14
      framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs
  14. 5
      framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs
  15. 4
      framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/CachedServiceProviderBase.cs
  16. 12
      framework/src/Volo.Abp.Core/Volo/Abp/IAsyncInitialize.cs
  17. 6
      framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/fa.json
  18. 26
      framework/test/Volo.Abp.Core.Tests/Volo/Abp/DependencyInjection/CachedServiceProvider_Tests.cs
  19. 11
      modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditLogInfoToAuditLogConverter.cs
  20. 4
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/Page.cs
  21. 7
      modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Scopes/AbpOpenIddictScopeCache.cs
  22. 7
      modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Scopes/AbpOpenIddictScopeStore.cs
  23. 3
      npm/ng-packs/.gitignore
  24. 2
      npm/ng-packs/package.json
  25. 2
      npm/ng-packs/packages/core/src/lib/directives/form-submit.directive.ts
  26. 2
      npm/ng-packs/packages/theme-shared/package.json
  27. 13805
      npm/ng-packs/yarn.lock

6
docs/en/CLI.md

@ -126,6 +126,9 @@ For more samples, go to [ABP CLI Create Solution Samples](CLI-New-Command-Sample
* `--database-provider` or `-d`: Specifies the database provider. Default provider is `ef`. Available providers: * `--database-provider` or `-d`: Specifies the database provider. Default provider is `ef`. Available providers:
* `ef`: Entity Framework Core. * `ef`: Entity Framework Core.
* `mongodb`: MongoDB. * `mongodb`: MongoDB.
* `--theme`: Specifes the theme. Default theme is `leptonx-lite`. Available themes:
* `leptonx-lite`: [LeptonX Lite Theme](/Themes/LeptonXLite/mvc.md).
* `basic`: [Basic Theme](/UI/AspNetCore/Basic-Theme.md).
* **`module`**: [Module template](Startup-Templates/Module.md). Additional options: * **`module`**: [Module template](Startup-Templates/Module.md). Additional options:
* `--no-ui`: Specifies to not include the UI. This makes possible to create service-only modules (a.k.a. microservices - without UI). * `--no-ui`: Specifies to not include the UI. This makes possible to create service-only modules (a.k.a. microservices - without UI).
* **`console`**: [Console template](Startup-Templates/Console.md). * **`console`**: [Console template](Startup-Templates/Console.md).
@ -138,6 +141,9 @@ For more samples, go to [ABP CLI Create Solution Samples](CLI-New-Command-Sample
* `--database-provider` or `-d`: Specifies the database provider. Default provider is `ef`. Available providers: * `--database-provider` or `-d`: Specifies the database provider. Default provider is `ef`. Available providers:
* `ef`: Entity Framework Core. * `ef`: Entity Framework Core.
* `mongodb`: MongoDB. * `mongodb`: MongoDB.
* `--theme`: Specifes the theme. Default theme is `leptonx-lite`. Available themes:
* `leptonx-lite`: [LeptonX Lite Theme](/Themes/LeptonXLite/mvc.md).
* `basic`: [Basic Theme](/UI/AspNetCore/Basic-Theme.md).
* `--output-folder` or `-o`: Specifies the output folder. Default value is the current directory. * `--output-folder` or `-o`: Specifies the output folder. Default value is the current directory.
* `--version` or `-v`: Specifies the ABP & template version. It can be a [release tag](https://github.com/abpframework/abp/releases) or a [branch name](https://github.com/abpframework/abp/branches). Uses the latest release if not specified. Most of the times, you will want to use the latest version. * `--version` or `-v`: Specifies the ABP & template version. It can be a [release tag](https://github.com/abpframework/abp/releases) or a [branch name](https://github.com/abpframework/abp/branches). Uses the latest release if not specified. Most of the times, you will want to use the latest version.
* `--preview`: Use latest preview version. * `--preview`: Use latest preview version.

1
docs/en/Startup-Templates/Index.md

@ -3,6 +3,7 @@
While you can start with an empty project and add needed packages manually, startup templates make easy and comfortable to start a new solution with the ABP framework. Click the name from the list below to see the documentation of the related startup template: While you can start with an empty project and add needed packages manually, startup templates make easy and comfortable to start a new solution with the ABP framework. Click the name from the list below to see the documentation of the related startup template:
* [**app**](Application.md): Application template. * [**app**](Application.md): Application template.
* [**app-nolayers**](Application-Single-Layer.md): Application (single layer) template.
* [**module**](Module.md): Module/service template. * [**module**](Module.md): Module/service template.
* [**console**](Console.md): Console template. * [**console**](Console.md): Console template.
* [**WPF**](WPF.md): WPF template. * [**WPF**](WPF.md): WPF template.

2
docs/en/Tutorials/Todo/Single-Layer/Index.md

@ -74,7 +74,7 @@ It is good to run the application before starting the development. The solution
Firstly, run the `TodoApp` project in your favorite IDE (or run the `dotnet run` CLI command on your project directory) to see the server-side HTTP API on [Swagger UI](https://swagger.io/tools/swagger-ui/): Firstly, run the `TodoApp` project in your favorite IDE (or run the `dotnet run` CLI command on your project directory) to see the server-side HTTP API on [Swagger UI](https://swagger.io/tools/swagger-ui/):
![todo-swagger-ui-initial](../todo-swagger-ui-initial.png) ![todo-swagger-ui-initial](./todo-single-layer-ui-initial.png)
You can explore and test your HTTP API with this UI. If it works, then we can run the Angular client application. You can explore and test your HTTP API with this UI. If it works, then we can run the Angular client application.

BIN
docs/en/Tutorials/Todo/Single-Layer/todo-single-layer-ui-initial.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

50
docs/en/UI/Angular/Breadcrumb.md

@ -0,0 +1,50 @@
## Breadcrumb Component
ABP provides a component that listens to the angular router's `NavigationEnd`
event and creates inputs for `BreadcrumbItemsComponent`. This component is used in
ABP components with [`PageComponent`](./Page-Component.md).
## Breadcrumb Items Component
`BreadcrumbItemsComponent` is used to display breadcrumb items. It can be useful
when you want to display breadcrumb items in a different way than the default.
### Usage
Example of overriding the default template of `PageComponent`:
```html
<abp-page title="Title">
<abp-page-breadcrumb-container>
<abp-breadcrumb-items [items]="breadCrumbItems"></abp-breadcrumb-items>
</abp-page-breadcrumb-container>
</abp-page>
```
```js
import { Component } from "@angular/core";
import { ABP } from "@abp/ng.core";
@Component({
/* component metadata */
})
export class YourComponent {
breadCrumbItems: ABP.Route[] = [
{
name: "Item 1",
},
{
name: "Item 2",
path: "/path",
},
];
}
```
### Inputs
- items: Partial<ABP.Route>[] : Array of ABP.Route objects. The source code of ABP.Route can be found in [github](https://github.com/abpframework/abp/blob/dev/npm/ng-packs/packages/core/src/lib/models/common.ts#L69).
## See Also
- [Page Component](./Page-Component.md)

2
framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/Extensibility/BlazorServerLookupApiRequestService.cs

@ -64,7 +64,7 @@ public class BlazorServerLookupApiRequestService : ILookupApiRequestService, ITr
client.BaseAddress = new Uri(baseUrl); client.BaseAddress = new Uri(baseUrl);
foreach (var header in HttpContextAccessor.HttpContext.Request.Headers) foreach (var header in HttpContextAccessor.HttpContext.Request.Headers)
{ {
requestMessage.Headers.Add(header.Key, header.Value.ToArray()); requestMessage.Headers.TryAddWithoutValidation(header.Key, header.Value.ToArray());
} }
} }
} }

5
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpAspNetCoreComponentsWebModule.cs

@ -13,11 +13,6 @@ namespace Volo.Abp.AspNetCore.Components.Web;
)] )]
public class AbpAspNetCoreComponentsWebModule : AbpModule public class AbpAspNetCoreComponentsWebModule : AbpModule
{ {
public override void PreConfigureServices(ServiceConfigurationContext context)
{
}
public override void ConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context)
{ {
context.Services.Replace(ServiceDescriptor.Transient<IComponentActivator, ServiceProviderComponentActivator>()); context.Services.Replace(ServiceDescriptor.Transient<IComponentActivator, ServiceProviderComponentActivator>());

6
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Security/AbpComponentsClaimsCache.cs

@ -7,11 +7,7 @@ using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Components.Web.Security; namespace Volo.Abp.AspNetCore.Components.Web.Security;
[ExposeServices( public class AbpComponentsClaimsCache : IScopedDependency
typeof(AbpComponentsClaimsCache),
typeof(IAsyncInitialize)
)]
public class AbpComponentsClaimsCache : IScopedDependency, IAsyncInitialize
{ {
public ClaimsPrincipal Principal { get; private set; } public ClaimsPrincipal Principal { get; private set; }

32
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Microsoft/AspNetCore/Components/WebAssembly/Hosting/AbpWebAssemblyHostBuilderExtensions.cs

@ -1,15 +1,12 @@
using System; using System;
using System.Globalization;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Threading.Tasks; using System.Threading.Tasks;
using JetBrains.Annotations; using JetBrains.Annotations;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AspNetCore.Components.Web;
using Volo.Abp.AspNetCore.Components.Web.DependencyInjection; using Volo.Abp.AspNetCore.Components.Web.DependencyInjection;
using Volo.Abp.AspNetCore.Components.WebAssembly; using Volo.Abp.AspNetCore.Components.WebAssembly;
using Volo.Abp.AspNetCore.Mvc.Client;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
@ -76,34 +73,5 @@ public static class AbpWebAssemblyHostBuilderExtensions
.GetRequiredService<IClientScopeServiceProviderAccessor>()).ServiceProvider = serviceProvider; .GetRequiredService<IClientScopeServiceProviderAccessor>()).ServiceProvider = serviceProvider;
await application.InitializeAsync(serviceProvider); await application.InitializeAsync(serviceProvider);
await InitializeModulesAsync(serviceProvider);
await SetCurrentLanguageAsync(serviceProvider);
}
private async static Task InitializeModulesAsync(IServiceProvider serviceProvider)
{
foreach (var service in serviceProvider.GetServices<IAsyncInitialize>())
{
await service.InitializeAsync();
}
}
private async static Task SetCurrentLanguageAsync(IServiceProvider serviceProvider)
{
var configurationClient = serviceProvider.GetRequiredService<ICachedApplicationConfigurationClient>();
var utilsService = serviceProvider.GetRequiredService<IAbpUtilsService>();
var configuration = await configurationClient.GetAsync();
var cultureName = configuration.Localization?.CurrentCulture?.CultureName;
if (!cultureName.IsNullOrEmpty())
{
var culture = new CultureInfo(cultureName);
CultureInfo.DefaultThreadCurrentCulture = culture;
CultureInfo.DefaultThreadCurrentUICulture = culture;
}
if (CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft)
{
await utilsService.AddClassToTagAsync("body", "rtl");
}
} }
} }

38
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpAspNetCoreComponentsWebAssemblyModule.cs

@ -1,10 +1,15 @@
using Microsoft.Extensions.DependencyInjection; using System;
using System.Globalization;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Volo.Abp.AspNetCore.Components.Web; using Volo.Abp.AspNetCore.Components.Web;
using Volo.Abp.AspNetCore.Components.Web.ExceptionHandling; using Volo.Abp.AspNetCore.Components.Web.ExceptionHandling;
using Volo.Abp.AspNetCore.Components.Web.Security;
using Volo.Abp.AspNetCore.Mvc.Client; using Volo.Abp.AspNetCore.Mvc.Client;
using Volo.Abp.Http.Client; using Volo.Abp.Http.Client;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.Threading;
using Volo.Abp.UI; using Volo.Abp.UI;
namespace Volo.Abp.AspNetCore.Components.WebAssembly; namespace Volo.Abp.AspNetCore.Components.WebAssembly;
@ -33,4 +38,35 @@ public class AbpAspNetCoreComponentsWebAssemblyModule : AbpModule
.GetHostBuilder().Logging .GetHostBuilder().Logging
.AddProvider(new AbpExceptionHandlingLoggerProvider(context.Services)); .AddProvider(new AbpExceptionHandlingLoggerProvider(context.Services));
} }
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
AsyncHelper.RunSync(() => OnApplicationInitializationAsync(context));
}
public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context)
{
await context.ServiceProvider.GetRequiredService<WebAssemblyCachedApplicationConfigurationClient>().InitializeAsync();
await context.ServiceProvider.GetRequiredService<AbpComponentsClaimsCache>().InitializeAsync();
await SetCurrentLanguageAsync(context.ServiceProvider);
}
private async static Task SetCurrentLanguageAsync(IServiceProvider serviceProvider)
{
var configurationClient = serviceProvider.GetRequiredService<ICachedApplicationConfigurationClient>();
var utilsService = serviceProvider.GetRequiredService<IAbpUtilsService>();
var configuration = await configurationClient.GetAsync();
var cultureName = configuration.Localization?.CurrentCulture?.CultureName;
if (!cultureName.IsNullOrEmpty())
{
var culture = new CultureInfo(cultureName);
CultureInfo.DefaultThreadCurrentCulture = culture;
CultureInfo.DefaultThreadCurrentUICulture = culture;
}
if (CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft)
{
await utilsService.AddClassToTagAsync("body", "rtl");
}
}
} }

5
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyCachedApplicationConfigurationClient.cs

@ -7,11 +7,6 @@ using Volo.Abp.MultiTenancy;
namespace Volo.Abp.AspNetCore.Components.WebAssembly; namespace Volo.Abp.AspNetCore.Components.WebAssembly;
[ExposeServices(
typeof(WebAssemblyCachedApplicationConfigurationClient),
typeof(ICachedApplicationConfigurationClient),
typeof(IAsyncInitialize)
)]
public class WebAssemblyCachedApplicationConfigurationClient : ICachedApplicationConfigurationClient, ITransientDependency public class WebAssemblyCachedApplicationConfigurationClient : ICachedApplicationConfigurationClient, ITransientDependency
{ {
protected AbpApplicationConfigurationClientProxy ApplicationConfigurationAppService { get; } protected AbpApplicationConfigurationClientProxy ApplicationConfigurationAppService { get; }

2
framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo/Abp/AspNetCore/Mvc/Client/ICachedApplicationConfigurationClient.cs

@ -3,7 +3,7 @@ using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations;
namespace Volo.Abp.AspNetCore.Mvc.Client; namespace Volo.Abp.AspNetCore.Mvc.Client;
public interface ICachedApplicationConfigurationClient : IAsyncInitialize public interface ICachedApplicationConfigurationClient
{ {
Task<ApplicationConfigurationDto> GetAsync(); Task<ApplicationConfigurationDto> GetAsync();

14
framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs

@ -1,5 +1,8 @@
using Volo.Abp.EventBus; using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.EventBus;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.Threading;
namespace Volo.Abp.AspNetCore.Mvc.Client; namespace Volo.Abp.AspNetCore.Mvc.Client;
@ -9,4 +12,13 @@ namespace Volo.Abp.AspNetCore.Mvc.Client;
)] )]
public class AbpAspNetCoreMvcClientModule : AbpModule 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<MvcCachedApplicationConfigurationClient>().InitializeAsync();
}
} }

5
framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs

@ -11,11 +11,6 @@ using Volo.Abp.Users;
namespace Volo.Abp.AspNetCore.Mvc.Client; namespace Volo.Abp.AspNetCore.Mvc.Client;
[ExposeServices(
typeof(MvcCachedApplicationConfigurationClient),
typeof(ICachedApplicationConfigurationClient),
typeof(IAsyncInitialize)
)]
public class MvcCachedApplicationConfigurationClient : ICachedApplicationConfigurationClient, ITransientDependency public class MvcCachedApplicationConfigurationClient : ICachedApplicationConfigurationClient, ITransientDependency
{ {
protected IHttpContextAccessor HttpContextAccessor { get; } protected IHttpContextAccessor HttpContextAccessor { get; }

4
framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/CachedServiceProviderBase.cs

@ -12,10 +12,10 @@ public abstract class CachedServiceProviderBase
{ {
_serviceProvider = serviceProvider; _serviceProvider = serviceProvider;
_cachedServices = new ConcurrentDictionary<Type, Lazy<object>>(); _cachedServices = new ConcurrentDictionary<Type, Lazy<object>>();
_cachedServices.TryAdd(typeof(IServiceProvider), new Lazy<object>(() => this)); _cachedServices.TryAdd(typeof(IServiceProvider), new Lazy<object>(() => _serviceProvider));
} }
public object GetService(Type serviceType) public virtual object GetService(Type serviceType)
{ {
return _cachedServices.GetOrAdd( return _cachedServices.GetOrAdd(
serviceType, serviceType,

12
framework/src/Volo.Abp.Core/Volo/Abp/IAsyncInitialize.cs

@ -1,12 +0,0 @@
using System.Threading.Tasks;
namespace Volo.Abp;
/// <summary>
/// IMPORTANT: THIS IS AN INTERNAL CLASS TO BE USED BY THE ABP FRAMEWORK.
/// IT WILL BE REMOVED IN THE FUTURE VERSIONS. DON'T USE IT!
/// </summary>
public interface IAsyncInitialize //TODO: Remove once we have async module initialization
{
Task InitializeAsync();
}

6
framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/fa.json

@ -1,6 +0,0 @@
{
"culture": "fa",
"texts": {
"Menu:Administration": "مدیریت"
}
}

26
framework/test/Volo.Abp.Core.Tests/Volo/Abp/DependencyInjection/CachedServiceProvider_Tests.cs

@ -1,4 +1,5 @@
using Microsoft.Extensions.DependencyInjection; using System;
using Microsoft.Extensions.DependencyInjection;
using Shouldly; using Shouldly;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.Testing.Utils; using Volo.Abp.Testing.Utils;
@ -20,6 +21,9 @@ public class CachedServiceProvider_Tests
var transientTestService1 = cachedServiceProvider1.GetRequiredService<TransientTestService>(); var transientTestService1 = cachedServiceProvider1.GetRequiredService<TransientTestService>();
var transientTestService2 = cachedServiceProvider2.GetRequiredService<TransientTestService>(); var transientTestService2 = cachedServiceProvider2.GetRequiredService<TransientTestService>();
transientTestService1.ShouldBeSameAs(transientTestService2); transientTestService1.ShouldBeSameAs(transientTestService2);
var cachedServiceProvider3 = cachedServiceProvider1.GetRequiredService<IServiceProvider>().GetRequiredService<ICachedServiceProvider>();
cachedServiceProvider3.ShouldBeSameAs(cachedServiceProvider1);
} }
using (var application = AbpApplicationFactory.Create<TestModule>()) using (var application = AbpApplicationFactory.Create<TestModule>())
@ -49,20 +53,26 @@ public class CachedServiceProvider_Tests
{ {
void TestResolvingServices(IServiceScope scope) void TestResolvingServices(IServiceScope scope)
{ {
var cachedServiceProvider1 = scope.ServiceProvider.GetRequiredService<ITransientCachedServiceProvider>(); var transientCachedServiceProvider1 = scope.ServiceProvider.GetRequiredService<ITransientCachedServiceProvider>();
var transientTestService1_1 = cachedServiceProvider1.GetRequiredService<TransientTestService>(); var transientTestService1_1 = transientCachedServiceProvider1.GetRequiredService<TransientTestService>();
var transientTestService1_2 = cachedServiceProvider1.GetRequiredService<TransientTestService>(); var transientTestService1_2 = transientCachedServiceProvider1.GetRequiredService<TransientTestService>();
transientTestService1_1.ShouldBeSameAs(transientTestService1_2); transientTestService1_1.ShouldBeSameAs(transientTestService1_2);
var cachedServiceProvider2 = scope.ServiceProvider.GetRequiredService<ITransientCachedServiceProvider>(); var transientCachedServiceProvider2 = scope.ServiceProvider.GetRequiredService<ITransientCachedServiceProvider>();
cachedServiceProvider1.ShouldNotBeSameAs(cachedServiceProvider2); transientCachedServiceProvider1.ShouldNotBeSameAs(transientCachedServiceProvider2);
var transientTestService2_1 = cachedServiceProvider2.GetRequiredService<TransientTestService>(); var transientTestService2_1 = transientCachedServiceProvider2.GetRequiredService<TransientTestService>();
var transientTestService2_2 = cachedServiceProvider2.GetRequiredService<TransientTestService>(); var transientTestService2_2 = transientCachedServiceProvider2.GetRequiredService<TransientTestService>();
transientTestService2_1.ShouldBeSameAs(transientTestService2_2); transientTestService2_1.ShouldBeSameAs(transientTestService2_2);
transientTestService1_1.ShouldNotBeSameAs(transientTestService2_1); transientTestService1_1.ShouldNotBeSameAs(transientTestService2_1);
var transientCachedServiceProvider1_1 = transientCachedServiceProvider1.GetRequiredService<IServiceProvider>().GetRequiredService<ITransientCachedServiceProvider>();
var transientCachedServiceProvider1_2 = transientCachedServiceProvider1.GetRequiredService<IServiceProvider>().GetRequiredService<ITransientCachedServiceProvider>();
transientCachedServiceProvider1_1.ShouldNotBeSameAs(transientCachedServiceProvider1);
transientCachedServiceProvider1_2.ShouldNotBeSameAs(transientCachedServiceProvider1);
transientCachedServiceProvider1_1.ShouldNotBeSameAs(transientCachedServiceProvider1_2);
} }
using (var application = AbpApplicationFactory.Create<TestModule>()) using (var application = AbpApplicationFactory.Create<TestModule>())

11
modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditLogInfoToAuditLogConverter.cs

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Options;
using Volo.Abp.AspNetCore.ExceptionHandling; using Volo.Abp.AspNetCore.ExceptionHandling;
using Volo.Abp.Auditing; using Volo.Abp.Auditing;
using Volo.Abp.Data; using Volo.Abp.Data;
@ -17,12 +18,14 @@ public class AuditLogInfoToAuditLogConverter : IAuditLogInfoToAuditLogConverter,
protected IGuidGenerator GuidGenerator { get; } protected IGuidGenerator GuidGenerator { get; }
protected IExceptionToErrorInfoConverter ExceptionToErrorInfoConverter { get; } protected IExceptionToErrorInfoConverter ExceptionToErrorInfoConverter { get; }
protected IJsonSerializer JsonSerializer { get; } protected IJsonSerializer JsonSerializer { get; }
protected AbpExceptionHandlingOptions ExceptionHandlingOptions { get; }
public AuditLogInfoToAuditLogConverter(IGuidGenerator guidGenerator, IExceptionToErrorInfoConverter exceptionToErrorInfoConverter, IJsonSerializer jsonSerializer) public AuditLogInfoToAuditLogConverter(IGuidGenerator guidGenerator, IExceptionToErrorInfoConverter exceptionToErrorInfoConverter, IJsonSerializer jsonSerializer, IOptions<AbpExceptionHandlingOptions> exceptionHandlingOptions)
{ {
GuidGenerator = guidGenerator; GuidGenerator = guidGenerator;
ExceptionToErrorInfoConverter = exceptionToErrorInfoConverter; ExceptionToErrorInfoConverter = exceptionToErrorInfoConverter;
JsonSerializer = jsonSerializer; JsonSerializer = jsonSerializer;
ExceptionHandlingOptions = exceptionHandlingOptions.Value;
} }
public virtual Task<AuditLog> ConvertAsync(AuditLogInfo auditLogInfo) public virtual Task<AuditLog> ConvertAsync(AuditLogInfo auditLogInfo)
@ -50,7 +53,11 @@ public class AuditLogInfoToAuditLogConverter : IAuditLogInfoToAuditLogConverter,
.ToList() .ToList()
?? new List<AuditLogAction>(); ?? new List<AuditLogAction>();
var remoteServiceErrorInfos = auditLogInfo.Exceptions?.Select(exception => ExceptionToErrorInfoConverter.Convert(exception, true)) var remoteServiceErrorInfos = auditLogInfo.Exceptions?.Select(exception => ExceptionToErrorInfoConverter.Convert(exception, options =>
{
options.SendExceptionsDetailsToClients = ExceptionHandlingOptions.SendExceptionsDetailsToClients;
options.SendStackTraceToClients = ExceptionHandlingOptions.SendStackTraceToClients;
}))
?? new List<RemoteServiceErrorInfo>(); ?? new List<RemoteServiceErrorInfo>();
var exceptions = remoteServiceErrorInfos.Any() var exceptions = remoteServiceErrorInfos.Any()

4
modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/Page.cs

@ -49,7 +49,9 @@ public class Page : FullAuditedAggregateRoot<Guid>, IMultiTenant
internal virtual void SetSlug(string slug) internal virtual void SetSlug(string slug)
{ {
Slug = Check.NotNullOrEmpty(slug, nameof(slug), PageConsts.MaxSlugLength); Slug = SlugNormalizer.Normalize(
Check.NotNullOrEmpty(slug, nameof(slug), PageConsts.MaxSlugLength)
);
} }
public virtual void SetContent(string content) public virtual void SetContent(string content)

7
modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Scopes/AbpOpenIddictScopeCache.cs

@ -63,7 +63,12 @@ public class AbpOpenIddictScopeCacheAbpOpenIddictAuthorizationCache : AbpOpenIdd
public virtual async IAsyncEnumerable<OpenIddictScopeModel> FindByNamesAsync(ImmutableArray<string> names, [EnumeratorCancellation] CancellationToken cancellationToken) public virtual async IAsyncEnumerable<OpenIddictScopeModel> FindByNamesAsync(ImmutableArray<string> names, [EnumeratorCancellation] CancellationToken cancellationToken)
{ {
Check.NotNullOrEmpty(names, nameof(names)); Check.NotNull(names, nameof(names));
foreach (var name in names)
{
Check.NotNullOrEmpty(name, nameof(name));
}
// Note: this method is only partially cached. // Note: this method is only partially cached.
await foreach (var scope in Store.FindByNamesAsync(names, cancellationToken)) await foreach (var scope in Store.FindByNamesAsync(names, cancellationToken))

7
modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Scopes/AbpOpenIddictScopeStore.cs

@ -39,7 +39,7 @@ public class AbpOpenIddictScopeStore : AbpOpenIddictStoreBase<IOpenIddictScopeRe
Check.NotNull(scope, nameof(scope)); Check.NotNull(scope, nameof(scope));
await Repository.InsertAsync(scope.ToEntity(), autoSave: true, cancellationToken: cancellationToken); await Repository.InsertAsync(scope.ToEntity(), autoSave: true, cancellationToken: cancellationToken);
scope = (await Repository.FindAsync(scope.Id, cancellationToken: cancellationToken)).ToModel(); scope = (await Repository.FindAsync(scope.Id, cancellationToken: cancellationToken)).ToModel();
} }
@ -66,7 +66,8 @@ public class AbpOpenIddictScopeStore : AbpOpenIddictStoreBase<IOpenIddictScopeRe
public virtual async IAsyncEnumerable<OpenIddictScopeModel> FindByNamesAsync(ImmutableArray<string> names, [EnumeratorCancellation] CancellationToken cancellationToken) public virtual async IAsyncEnumerable<OpenIddictScopeModel> FindByNamesAsync(ImmutableArray<string> names, [EnumeratorCancellation] CancellationToken cancellationToken)
{ {
Check.NotNullOrEmpty(names, nameof(names)); Check.NotNull(names, nameof(names));
foreach (var name in names) foreach (var name in names)
{ {
Check.NotNullOrEmpty(name, nameof(name)); Check.NotNullOrEmpty(name, nameof(name));
@ -384,7 +385,7 @@ public class AbpOpenIddictScopeStore : AbpOpenIddictStoreBase<IOpenIddictScopeRe
var entity = await Repository.GetAsync(scope.Id, cancellationToken: cancellationToken); var entity = await Repository.GetAsync(scope.Id, cancellationToken: cancellationToken);
await Repository.UpdateAsync(scope.ToEntity(entity), autoSave: true, cancellationToken: cancellationToken); await Repository.UpdateAsync(scope.ToEntity(entity), autoSave: true, cancellationToken: cancellationToken);
scope = (await Repository.FindAsync(entity.Id, cancellationToken: cancellationToken)).ToModel(); scope = (await Repository.FindAsync(entity.Id, cancellationToken: cancellationToken)).ToModel();
} }
} }

3
npm/ng-packs/.gitignore

@ -44,6 +44,9 @@ npm-debug.log
yarn-error.log yarn-error.log
testem.log testem.log
/typings /typings
yarn.lock
package-lock.json
# System Files # System Files
.DS_Store .DS_Store

2
npm/ng-packs/package.json

@ -71,7 +71,7 @@
"@fortawesome/fontawesome-free": "^5.15.4", "@fortawesome/fontawesome-free": "^5.15.4",
"@ng-bootstrap/ng-bootstrap": "~12.0.0-beta.4", "@ng-bootstrap/ng-bootstrap": "~12.0.0-beta.4",
"@ngneat/spectator": "^10.0.0", "@ngneat/spectator": "^10.0.0",
"@ngx-validate/core": "^0.1.1", "@ngx-validate/core": "^0.1.2",
"@nrwl/angular": "13.10.3", "@nrwl/angular": "13.10.3",
"@nrwl/cli": "13.10.3", "@nrwl/cli": "13.10.3",
"@nrwl/cypress": "13.10.3", "@nrwl/cypress": "13.10.3",

2
npm/ng-packs/packages/core/src/lib/directives/form-submit.directive.ts

@ -28,7 +28,7 @@ export class FormSubmitDirective implements OnInit {
notValidateOnSubmit: string | boolean; notValidateOnSubmit: string | boolean;
@Input() @Input()
markAsDirtyWhenSubmit = true markAsDirtyWhenSubmit = true;
@Output() readonly ngSubmit = new EventEmitter(); @Output() readonly ngSubmit = new EventEmitter();

2
npm/ng-packs/packages/theme-shared/package.json

@ -10,7 +10,7 @@
"@abp/ng.core": "~5.3.0-rc.3", "@abp/ng.core": "~5.3.0-rc.3",
"@fortawesome/fontawesome-free": "^5.15.4", "@fortawesome/fontawesome-free": "^5.15.4",
"@ng-bootstrap/ng-bootstrap": "~12.0.0-beta.4", "@ng-bootstrap/ng-bootstrap": "~12.0.0-beta.4",
"@ngx-validate/core": "^0.1.1", "@ngx-validate/core": "^0.1.2",
"@popperjs/core": "~2.11.2", "@popperjs/core": "~2.11.2",
"@swimlane/ngx-datatable": "^19.0.0", "@swimlane/ngx-datatable": "^19.0.0",
"bootstrap": "^5.1.1", "bootstrap": "^5.1.1",

13805
npm/ng-packs/yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save