Browse Source

Merge branch 'dev' into cli-nolayers-blazor-wasm

pull/15516/head
Yunus Emre Kalkan 3 years ago
parent
commit
94a0b9890a
  1. 13
      abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json
  2. 2
      docs/en/Customizing-Application-Modules-Extending-Entities.md
  3. 10
      docs/en/Getting-Started-Running-Solution.md
  4. 25
      docs/en/Migration-Guides/Abp-7_0.md
  5. 29
      docs/en/Tutorials/Part-10.md
  6. 2
      docs/en/Tutorials/Part-5.md
  7. BIN
      docs/en/Tutorials/images/blazor-edit-book-modal-2.png
  8. BIN
      docs/en/Tutorials/images/blazor-new-book-modal-2.png
  9. BIN
      docs/en/Tutorials/images/book-create-modal-with-author-2.png
  10. BIN
      docs/en/Tutorials/images/bookstore-added-authors-to-modals-2.png
  11. BIN
      docs/en/Tutorials/images/bookstore-angular-author-selection-2.png
  12. BIN
      docs/en/Tutorials/images/bookstore-confirmation-popup-2.png
  13. BIN
      docs/en/Tutorials/images/bookstore-final-actions-dropdown-2.png
  14. BIN
      docs/en/Tutorials/images/bookstore-new-book-form-v3.png
  15. BIN
      docs/en/images/bookstore-home-2.png
  16. BIN
      docs/en/images/bookstore-login-2.png
  17. 5
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationLocalizationAppService.cs
  18. 5
      framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs
  19. 3
      framework/src/Volo.Abp.Json.Newtonsoft/Volo/Abp/Json/Newtonsoft/AbpDateTimeConverter.cs
  20. 4
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogFeatureRepository.cs
  21. 4
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogPostRepository.cs
  22. 4
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml
  23. 5
      modules/feature-management/test/Volo.Abp.FeatureManagement.EntityFrameworkCore.Tests/Volo/Abp/FeatureManagement/EntityFrameworkCore/AbpFeatureManagementEntityFrameworkCoreTestModule.cs
  24. 3
      modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml
  25. 5
      modules/permission-management/test/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementEntityFrameworkCoreTestModule.cs
  26. 13
      npm/ng-packs/packages/components/tree/src/lib/components/tree.component.ts
  27. 2
      templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreTestModule.cs
  28. 3
      templates/module/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreTestModule.cs

13
abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json

@ -437,7 +437,16 @@
"IsStableVersion": "Stable Version",
"IsActive": "Active",
"NewVersion": "New Version",
"VersionHistoryDeletionConfirmationMessage": "Are you sure you want to delete this version?"
"VersionHistoryDeletionConfirmationMessage": "Are you sure you want to delete this version?",
"CreateAbpConsultantLogoInfo": "Maximum file size: <b>1MB</b> <br/> Supported file types: <b>jpg, jpeg, png, SVG, WebP</b>",
"UrlCode": "Url Code",
"Icon": "Icon",
"Clear": "Clear",
"Permission:AbpConsultant": "ABP Consultant",
"Menu:AbpConsultants": "ABP Consultants",
"CreateAbpConsultant": "Create ABP Consultant",
"UrlCodeIsNotAvailable": "Url code is used by another ABP Consultant.",
"AbpConsultants": "ABP Consultants",
"AbpConsultant": "ABP Consultant"
}
}

2
docs/en/Customizing-Application-Modules-Extending-Entities.md

@ -101,7 +101,7 @@ public class MyLocalIdentityUserChangeEventHandler :
````
* `EntityChangedEventData<T>` covers create, update and delete events for the given entity. If you need, you can subscribe to create, update and delete events individually (in the same class or different classes).
* This code will be executed **out of the local transaction**, because it listens the `EntityChanged` event. You can subscribe to the `EntityChangingEventData<T>` to perform your event handler in **the same local (in-process) transaction** if the current [unit of work](Unit-Of-Work.md) is transactional.
* This code will be executed in the **current unit of work**, the whole process becomes transactional.
> Reminder: This approach needs to change the `IdentityUser` entity in the same process contains the handler class. It perfectly works even for a clustered environment (when multiple instances of the same application are running on multiple servers).

10
docs/en/Getting-Started-Running-Solution.md

@ -113,11 +113,11 @@ This is the HTTP API that is used by the web application.
3. Lastly, ensure that the {{if UI=="MVC"}}`.Web`{{else}}`.Blazor`{{end}} project is the startup project and run the application which will open a **welcome** page in your browser
![mvc-tiered-app-home](images/bookstore-home.png)
![mvc-tiered-app-home](images/bookstore-home-2.png)
Click to the **login** button which will redirect you to the *authentication server* to login to the application:
![bookstore-login](images/bookstore-login.png)
![bookstore-login](images/bookstore-login-2.png)
{{ else # Tiered != "Yes" }}
@ -125,7 +125,7 @@ Ensure that the {{if UI=="MVC"}}`.Web`{{else}}`.Blazor`{{end}} project is the st
> Use Ctrl+F5 in Visual Studio (instead of F5) to run the application without debugging. If you don't have a debug purpose, this will be faster.
![bookstore-login](images/bookstore-login.png)
![bookstore-login](images/bookstore-login-2.png)
{{ end # Tiered }}
@ -171,7 +171,7 @@ Ensure that the `.Blazor` project is the startup project and run the application
Once the application starts, click to the **Login** link on to header, which redirects you to the authentication server to enter a username and password:
![bookstore-login](images/bookstore-login.png)
![bookstore-login](images/bookstore-login-2.png)
{{ else if UI == "NG" }}
@ -191,7 +191,7 @@ yarn start
It may take a longer time for the first build. Once it finishes, it opens the Angular UI in your default browser with the [localhost:4200](http://localhost:4200/) address.
![bookstore-login](images/bookstore-login.png)
![bookstore-login](images/bookstore-login-2.png)
{{ end }}

25
docs/en/Migration-Guides/Abp-7_0.md

@ -110,6 +110,31 @@ See https://github.com/abpframework/abp/pull/13845 for more info.
> You can ignore this if you don't use CMS Kit Module.
## Data migration environment
Please call `AddDataMigrationEnvironment` method in the migration project.
```cs
using (var application = await AbpApplicationFactory.CreateAsync<MyMigratorModule>(options =>
{
//...
options.AddDataMigrationEnvironment();
}))
{
//...
}
```
```cs
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDataMigrationEnvironment();
// Call AddDataMigrationEnvironment before AddApplicationAsync
await builder.AddApplicationAsync<MyMigratorModule>();
//...
```
See https://github.com/abpframework/abp/pull/13985 for more info.
## Devart.Data.Oracle.EFCore
The `Devart.Data.Oracle.EFCore` package do not yet support EF Core 7.0, If you use `AbpEntityFrameworkCoreOracleDevartModule(Volo.Abp.EntityFrameworkCore.Oracle.Devart)` may not work as expected, We will release new packages as soon as they are updated.

29
docs/en/Tutorials/Part-10.md

@ -1126,6 +1126,21 @@ protected override async Task OnInitializedAsync()
* It is essential to call the `base.OnInitializedAsync()` since `AbpCrudPageBase` has some initialization code to be executed.
Override the `OpenCreateModalAsync` method and adding the following code:
````csharp
protected override async Task OpenCreateModalAsync()
{
if (!authorList.Any())
{
throw new UserFriendlyException(message: L["AnAuthorIsRequiredForCreatingBook"]);
}
await base.OpenCreateModalAsync();
NewEntity.AuthorId = authorList.First().Id;
}
````
The final `@code` block should be the following:
````csharp
@ -1147,6 +1162,17 @@ The final `@code` block should be the following:
await base.OnInitializedAsync();
authorList = (await AppService.GetAuthorLookupAsync()).Items;
}
protected override async Task OpenCreateModalAsync()
{
if (!authorList.Any())
{
throw new UserFriendlyException(message: L["AnAuthorIsRequiredForCreatingBook"]);
}
await base.OpenCreateModalAsync();
NewEntity.AuthorId = authorList.First().Id;
}
}
````
@ -1156,7 +1182,6 @@ Finally, add the following `Field` definition into the `ModalBody` of the *Creat
<Field>
<FieldLabel>@L["Author"]</FieldLabel>
<Select TValue="Guid" @bind-SelectedValue="@NewEntity.AuthorId">
<SelectItem TValue="Guid" Value="Guid.Empty">@L["PickAnAuthor"]</SelectItem>
@foreach (var author in authorList)
{
<SelectItem TValue="Guid" Value="@author.Id">
@ -1170,7 +1195,7 @@ Finally, add the following `Field` definition into the `ModalBody` of the *Creat
This requires to add a new localization key to the `en.json` file:
````js
"PickAnAuthor": "Pick an author"
"AnAuthorIsRequiredForCreatingBook": "An author is required to create a book"
````
You can run the application to see the *Author Selection* while creating a new book:

2
docs/en/Tutorials/Part-5.md

@ -374,7 +374,7 @@ Open the `/src/app/book/book.component.html` file and replace the create button
Books table in the book management page has an actions button for each row. The actions button includes *Edit* and *Delete* actions:
![bookstore-edit-delete-actions](images/bookstore-edit-delete-actions.png)
![bookstore-edit-delete-actions](images/bookstore-edit-delete-actions-2.png)
We should hide an action if the current user has not granted for the related permission.

BIN
docs/en/Tutorials/images/blazor-edit-book-modal-2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 45 KiB

BIN
docs/en/Tutorials/images/blazor-new-book-modal-2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

BIN
docs/en/Tutorials/images/book-create-modal-with-author-2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

BIN
docs/en/Tutorials/images/bookstore-added-authors-to-modals-2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 48 KiB

BIN
docs/en/Tutorials/images/bookstore-angular-author-selection-2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 43 KiB

BIN
docs/en/Tutorials/images/bookstore-confirmation-popup-2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 29 KiB

BIN
docs/en/Tutorials/images/bookstore-final-actions-dropdown-2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 24 KiB

BIN
docs/en/Tutorials/images/bookstore-new-book-form-v3.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 38 KiB

BIN
docs/en/images/bookstore-home-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

BIN
docs/en/images/bookstore-login-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

5
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationLocalizationAppService.cs

@ -26,6 +26,11 @@ public class AbpApplicationLocalizationAppService :
public async Task<ApplicationLocalizationDto> GetAsync(ApplicationLocalizationRequestDto input)
{
if (!CultureHelper.IsValidCultureCode(input.CultureName))
{
throw new AbpException("The selected culture is not valid! Make sure you enter a valid culture name.");
}
using (CultureHelper.Use(input.CultureName))
{
var resources = LocalizationOptions

5
framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs

@ -227,6 +227,11 @@ public abstract class AbpDbContext<TDbContext> : DbContext, IAbpEfCoreDbContext,
ChangeTracker.Tracked += ChangeTracker_Tracked;
ChangeTracker.StateChanged += ChangeTracker_StateChanged;
if (UnitOfWorkManager is AlwaysDisableTransactionsUnitOfWorkManager)
{
Database.AutoTransactionBehavior = AutoTransactionBehavior.Never;
}
}
protected virtual void ChangeTracker_Tracked(object sender, EntityTrackedEventArgs e)

3
framework/src/Volo.Abp.Json.Newtonsoft/Volo/Abp/Json/Newtonsoft/AbpDateTimeConverter.cs

@ -6,12 +6,13 @@ using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Reflection;
using Volo.Abp.Timing;
namespace Volo.Abp.Json.Newtonsoft;
public class AbpDateTimeConverter : DateTimeConverterBase
public class AbpDateTimeConverter : DateTimeConverterBase, ITransientDependency
{
private readonly string _dateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK";
private readonly DateTimeStyles _dateTimeStyles = DateTimeStyles.RoundtripKind;

4
modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogFeatureRepository.cs

@ -10,9 +10,9 @@ using Volo.CmsKit.EntityFrameworkCore;
namespace Volo.CmsKit.Blogs;
public class EfCoreBlogFeatureRepository : EfCoreRepository<CmsKitDbContext, BlogFeature, Guid>, IBlogFeatureRepository
public class EfCoreBlogFeatureRepository : EfCoreRepository<ICmsKitDbContext, BlogFeature, Guid>, IBlogFeatureRepository
{
public EfCoreBlogFeatureRepository(IDbContextProvider<CmsKitDbContext> dbContextProvider) : base(dbContextProvider)
public EfCoreBlogFeatureRepository(IDbContextProvider<ICmsKitDbContext> dbContextProvider) : base(dbContextProvider)
{
}

4
modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogPostRepository.cs

@ -16,12 +16,12 @@ using Volo.CmsKit.Users;
namespace Volo.CmsKit.Blogs;
public class EfCoreBlogPostRepository : EfCoreRepository<CmsKitDbContext, BlogPost, Guid>, IBlogPostRepository
public class EfCoreBlogPostRepository : EfCoreRepository<ICmsKitDbContext, BlogPost, Guid>, IBlogPostRepository
{
private EntityTagManager _entityTagManager;
public EfCoreBlogPostRepository(
IDbContextProvider<CmsKitDbContext> dbContextProvider,
IDbContextProvider<ICmsKitDbContext> dbContextProvider,
EntityTagManager entityTagManager) : base(dbContextProvider)
{
_entityTagManager = entityTagManager;

4
modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml

@ -112,8 +112,8 @@
@if (Model.VersionSelectItems.Any())
{
<div class="col">
<div class="@(Model.LanguageSelectListItems.Count > 1 ? "pe-0" : "")">
<div class="docs-version @(Model.LanguageSelectListItems.Count > 1 ? "pe-1" : "")">
<div class="@(Model.VersionSelectItems.Count > 1 ? "pe-0" : "")">
<div class="docs-version @(Model.VersionSelectItems.Count > 1 ? "pe-1" : "")">
<span>@L["Version"]</span>
<div class="version-select">
<div class="input-group">

5
modules/feature-management/test/Volo.Abp.FeatureManagement.EntityFrameworkCore.Tests/Volo/Abp/FeatureManagement/EntityFrameworkCore/AbpFeatureManagementEntityFrameworkCoreTestModule.cs

@ -28,10 +28,7 @@ public class AbpFeatureManagementEntityFrameworkCoreTestModule : AbpModule
});
});
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
context.Services.AddAlwaysDisableUnitOfWorkTransaction();
}
private static SqliteConnection CreateDatabaseAndGetConnection()

3
modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml

@ -1,4 +1,5 @@
@page
@using System.Web;
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal
@using Volo.Abp.Localization
@ -12,7 +13,7 @@
<form method="post" asp-page="/AbpPermissionManagement/PermissionManagementModal" data-script-class="abp.modals.PermissionManagement" id="PermissionManagementForm">
<abp-modal size="Large">
<abp-modal-header title="@(L["Permissions"].Value) - @Model.EntityDisplayName"></abp-modal-header>
<abp-modal-header title="@(L["Permissions"].Value) - @(HttpUtility.HtmlEncode(Model.EntityDisplayName))"></abp-modal-header>
<abp-modal-body class="custom-scroll-container">
<abp-input asp-for="SelectAllInAllTabs" check-box-hidden-input-render-mode="CheckBoxHiddenInputRenderMode.None" label="@L["SelectAllInAllTabs"].Value"/>
<hr class="mt-2 mb-2"/>

5
modules/permission-management/test/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementEntityFrameworkCoreTestModule.cs

@ -26,9 +26,6 @@ public class AbpPermissionManagementEntityFrameworkCoreTestModule : AbpModule
});
});
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; //EF in-memory database does not support transactions
});
context.Services.AddAlwaysDisableUnitOfWorkTransaction();
}
}

13
npm/ng-packs/packages/components/tree/src/lib/components/tree.component.ts

@ -4,13 +4,13 @@ import {
EventEmitter,
Inject,
Input,
OnInit,
Optional,
Output,
TemplateRef,
ViewEncapsulation,
OnInit,
} from '@angular/core';
import { NzFormatBeforeDropEvent, NzFormatEmitEvent } from 'ng-zorro-antd/tree';
import { NzFormatBeforeDropEvent, NzFormatEmitEvent, NzTreeNode } from 'ng-zorro-antd/tree';
import { of } from 'rxjs';
import { TreeNodeTemplateDirective } from '../templates/tree-node-template.directive';
import { ExpandedIconTemplateDirective } from '../templates/expanded-icon-template.directive';
@ -77,11 +77,16 @@ export class TreeComponent implements OnInit {
this.subscriptionService.addOne(loaded$);
}
onSelectedNodeChange(node) {
onSelectedNodeChange(node: NzTreeNode) {
this.selectedNode = node.origin.entity;
if (this.changeCheckboxWithNode) {
let newVal;
if (node.isChecked) {
newVal = this.checkedKeys.filter(x => x !== node.key);
} else {
newVal = [...this.checkedKeys, node.key];
}
this.selectedNodeChange.emit(node);
const newVal = [...this.checkedKeys, node.key];
this.checkedKeys = newVal;
this.checkedKeysChange.emit(newVal);
} else {

2
templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreTestModule.cs

@ -7,6 +7,7 @@ using Volo.Abp;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Sqlite;
using Volo.Abp.Modularity;
using Volo.Abp.Uow;
namespace MyCompanyName.MyProjectName.EntityFrameworkCore;
@ -21,6 +22,7 @@ public class MyProjectNameEntityFrameworkCoreTestModule : AbpModule
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAlwaysDisableUnitOfWorkTransaction();
ConfigureInMemorySqlite(context.Services);
}

3
templates/module/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreTestModule.cs

@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore.Storage;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Sqlite;
using Volo.Abp.Modularity;
using Volo.Abp.Uow;
namespace MyCompanyName.MyProjectName.EntityFrameworkCore;
@ -17,6 +18,8 @@ public class MyProjectNameEntityFrameworkCoreTestModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAlwaysDisableUnitOfWorkTransaction();
var sqliteConnection = CreateDatabaseAndGetConnection();
Configure<AbpDbContextOptions>(options =>

Loading…
Cancel
Save