Skip to content

Commit

Permalink
Update to ABP 4.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wakuflair committed Dec 24, 2020
1 parent 39df544 commit 2cdea32
Show file tree
Hide file tree
Showing 73 changed files with 3,833 additions and 6,861 deletions.
10 changes: 5 additions & 5 deletions angular/package.json
Expand Up @@ -12,11 +12,11 @@
},
"private": true,
"dependencies": {
"@abp/ng.account": "~3.3.0",
"@abp/ng.theme.basic": "~3.3.0",
"@abp/ng.identity": "~3.3.0",
"@abp/ng.tenant-management": "~3.3.0",
"@abp/ng.setting-management": "~3.3.0",
"@abp/ng.account": "~3.3.2",
"@abp/ng.theme.basic": "~4.0.2",
"@abp/ng.identity": "~4.0.2",
"@abp/ng.tenant-management": "~4.0.2",
"@abp/ng.setting-management": "~4.0.2",
"@angular/animations": "~8.2.14",
"@angular/common": "~8.2.14",
"@angular/compiler": "~8.2.14",
Expand Down
5 changes: 5 additions & 0 deletions sample/MyAbpApp/.prettierrc
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"useTabs": false,
"tabWidth": 4
}
6 changes: 6 additions & 0 deletions sample/MyAbpApp/NuGet.Config
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="BlazoriseMyGet" value="https://www.myget.org/F/blazorise/api/v3/index.json" />
</packageSources>
</configuration>
2 changes: 1 addition & 1 deletion sample/MyAbpApp/common.props
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>1.0.0</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<NoWarn>$(NoWarn);CS1591;CS0436</NoWarn>
<AbpProjectType>app</AbpProjectType>
</PropertyGroup>
</Project>
Expand Up @@ -12,12 +12,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Volo.Abp.ObjectExtending" Version="3.3.0" />
<PackageReference Include="Volo.Abp.Account.Application.Contracts" Version="3.3.0" />
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="3.3.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="3.3.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Application.Contracts" Version="3.3.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="3.3.0" />
<PackageReference Include="Volo.Abp.ObjectExtending" Version="4.0.2" />
<PackageReference Include="Volo.Abp.Account.Application.Contracts" Version="4.0.2" />
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="4.0.2" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="4.0.2" />
<PackageReference Include="Volo.Abp.TenantManagement.Application.Contracts" Version="4.0.2" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="4.0.2" />
</ItemGroup>

</Project>
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>MyAbpApp</RootNamespace>
</PropertyGroup>

Expand All @@ -14,12 +14,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Volo.Abp.Account.Application" Version="3.3.0" />
<PackageReference Include="Volo.Abp.Emailing" Version="3.3.0" />
<PackageReference Include="Volo.Abp.Identity.Application" Version="3.3.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="3.3.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Application" Version="3.3.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application" Version="3.3.0" />
<PackageReference Include="Volo.Abp.Account.Application" Version="4.0.2" />
<PackageReference Include="Volo.Abp.Emailing" Version="4.0.2" />
<PackageReference Include="Volo.Abp.Identity.Application" Version="4.0.2" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="4.0.2" />
<PackageReference Include="Volo.Abp.TenantManagement.Application" Version="4.0.2" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application" Version="4.0.2" />
</ItemGroup>

</Project>
@@ -0,0 +1,2 @@
using System.Runtime.CompilerServices;
[assembly:InternalsVisibleToAttribute("MyAbpApp.Application.Tests")]
Expand Up @@ -4,7 +4,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -20,13 +20,14 @@

<ItemGroup>
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Volo.Abp.Autofac" Version="3.3.0" />
<PackageReference Include="Volo.Abp.Autofac" Version="4.0.2" />
<ProjectReference Include="..\MyAbpApp.Application.Contracts\MyAbpApp.Application.Contracts.csproj" />
<ProjectReference Include="..\MyAbpApp.EntityFrameworkCore.DbMigrations\MyAbpApp.EntityFrameworkCore.DbMigrations.csproj" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions sample/MyAbpApp/src/MyAbpApp.DbMigrator/Program.cs
Expand Up @@ -22,8 +22,8 @@ static async Task Main(string[] args)
.MinimumLevel.Override("MyAbpApp", LogEventLevel.Information)
#endif
.Enrich.FromLogContext()
.WriteTo.File(Path.Combine(Directory.GetCurrentDirectory(), "Logs/logs.txt"))
.WriteTo.Console()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
.WriteTo.Async(c => c.Console())
.CreateLogger();

await CreateHostBuilder(args).RunConsoleAsync();
Expand Down
14 changes: 12 additions & 2 deletions sample/MyAbpApp/src/MyAbpApp.DbMigrator/appsettings.json
Expand Up @@ -7,11 +7,21 @@
"MyAbpApp_Web": {
"ClientId": "MyAbpApp_Web",
"ClientSecret": "1q2w3e*",
"RootUrl": "https://localhost:44372"
"RootUrl": "https://localhost:44336"
},
"MyAbpApp_App": {
"ClientId": "MyAbpApp_App",
"ClientSecret": "1q2w3e*"
"ClientSecret": "1q2w3e*",
"RootUrl": "http://localhost:4200"
},
"MyAbpApp_Blazor": {
"ClientId": "MyAbpApp_Blazor",
"RootUrl": "https://localhost:44307"
},
"MyAbpApp_Swagger": {
"ClientId": "MyAbpApp_Swagger",
"ClientSecret": "1q2w3e*",
"RootUrl": "https://localhost:44319"
}
}
}
Expand Down
13 changes: 13 additions & 0 deletions sample/MyAbpApp/src/MyAbpApp.DbMigrator/tempkey.rsa
@@ -0,0 +1,13 @@
{
"KeyId": "f788zGVUZh9H-HbWL1S-Mg",
"Parameters": {
"D": "F19hbC5PLO872DszGiJnVoU55ee7XGXmNf0KEKndJ/uGBv5lWklXA0QF80h1ytWXde0jV5isQPB1t7mPhRQlDoDTkywLi1CeOgBPbxzHEfLjZZ5c4olfeX0IJX9BDqgUntY0H1a/+Om/eDu4OZUz3EIJFFZBgz46YZSyTT6ZDvAEdpC/o66sNJmxvJIp+8zVoVDSqBUzxmc+oEamXLg7r2jdymxJMxau1kQFxEGLOrJnNxGsEe8UrYA3qSsm8m/Xg4uOh7RYgnuEEt88+KTvRq+CAMWhN3YNLtOJ3NmXowwE7e1Ma+jih9+UVfxZn14P5+SOJbQ2bYV2sCV+2vBiCQ==",
"DP": "oPiGO/qdOQfFEAS9fMInQnsrNylIZVpDYEVoDJ6/jQfE/IpuwxGcmsaGvCob3SKxZiJRLCWpwJYo1hCh/JOSVGWMkVyELky56nbbkkV5ymKLSGZ4JoetdQs+GchnPdR+k2P9Ij1Kjk13ylubN3htzNhcBASJpOfSEv5pPVzGKX0=",
"DQ": "z6imxLABHkyftbfUUtpeOlPanEHgpuIjmUdp3T1Ju1jziE63UEhuj0GPAXOF17uYxixwYE8JhOJ7+TyIK9oZeI3zH2OzJqQh8f5PCQ/E+0ULXZDeNV/ShDLCTufu3Fis9Rt64uTp/H/l21oMQ79jc0ysa8DTz1ReJLRc5qjL41U=",
"Exponent": "AQAB",
"InverseQ": "ieZcvSt5XYukKJKhXpv5Dm/1RD7iH88cZnhLSTEVTMoOUHoYWmApY5pNLGahbfjA9bxnkBWDYex/i7wE9uNNY5CsA6ovUaQLVJDt3kHvR9W+9QtN8D6jjG2TuRbbOdEg4RqhfjUaDfDIgTJX2Wxc8U98FOvOyGw1HzwUPFZKecM=",
"Modulus": "vk4z1Bmtmbo+gxITcY+FIlXzcO2wTOGlOXK5GMYj/6PUMFt7lbqkc72AkPsrAo5/JE8LYLhWj7fzSKbjvtowHCz5m2t+FlUYmuiKpvvnJsTqvQrckNlbZ1nm071q5PhP3Dar/OksfBhPtAX+c3+NjDnM/w53ccJJNaBDO/s9JYoN7vH5n6ed1pMSK71hmg4MPsxChcnc1f1PpnG2mqyJ253+GEUbj/kRyeBSmCCr9aadov2ZzxIKVaFNagJEHOzanQmorSLpP25GfOHCuy27Zkef94V/qU9elzjbH4uIKslVGx5T6H99TYh0sUGu11NytYJa5WNAZWow95CzurC2vw==",
"P": "4GMCQy+XTNzR5TsgFcdAZv2K6TcQR13fHVvPoxQp/b32V5YUJOBFEUAtqociy5ro4+KzpXP5WPSk1ZtznGKuNZyLq8gTnhpB3rwd0sdo4zxKnQ5nu+n1UhlhWNxg5A9V5TaciUAyPrHWJfLoYTQWygNTgJELQH5zZXi2ihC2uiU=",
"Q": "2R36pamnLAJggkPJxiW5qH6HizZ+bkQVg0BBftMLzkAM8Y9CwTW75GRUzGEJFpMckkw0GZSYb1Uwl3DVUpkcQ8LZ91IPYdPpDlYUshhIxl184M55pnO14besKxJtMZ64zhHKVAR2pBMO0n6W4/1iBXkkQqyPViJxdfvXPJMBbhM="
}
}
Expand Up @@ -9,14 +9,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Volo.Abp.Identity.Domain.Shared" Version="3.3.0" />
<PackageReference Include="Volo.Abp.IdentityServer.Domain.Shared" Version="3.3.0" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Domain.Shared" Version="3.3.0" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain.Shared" Version="3.3.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Domain.Shared" Version="3.3.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.Domain.Shared" Version="3.3.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Shared" Version="3.3.0" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain.Shared" Version="3.3.0" />
<PackageReference Include="Volo.Abp.Identity.Domain.Shared" Version="4.0.2" />
<PackageReference Include="Volo.Abp.IdentityServer.Domain.Shared" Version="4.0.2" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Domain.Shared" Version="4.0.2" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain.Shared" Version="4.0.2" />
<PackageReference Include="Volo.Abp.TenantManagement.Domain.Shared" Version="4.0.2" />
<PackageReference Include="Volo.Abp.FeatureManagement.Domain.Shared" Version="4.0.2" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Shared" Version="4.0.2" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain.Shared" Version="4.0.2" />
</ItemGroup>

<ItemGroup>
Expand All @@ -27,7 +27,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="3.1.8" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Expand Up @@ -7,6 +7,7 @@
using Volo.Abp.Identity;
using Volo.Abp.IdentityServer;
using Volo.Abp.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement;
using Volo.Abp.SettingManagement;
Expand All @@ -31,7 +32,8 @@ public class MyAbpAppDomainSharedModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
MyAbpAppModulePropertyConfigurator.Configure();
MyAbpAppGlobalFeatureConfigurator.Configure();
MyAbpAppModuleExtensionConfigurator.Configure();
}

public override void ConfigureServices(ServiceConfigurationContext context)
Expand All @@ -54,6 +56,11 @@ public override void ConfigureServices(ServiceConfigurationContext context)
options.DefaultResourceType = typeof(MyAbpAppResource);
});

Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace("MyAbpApp", typeof(MyAbpAppResource));
});
}
}
}
@@ -0,0 +1,23 @@
using Volo.Abp.Threading;

namespace MyAbpApp
{
public static class MyAbpAppGlobalFeatureConfigurator
{
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();

public static void Configure()
{
OneTimeRunner.Run(() =>
{
/* You can configure (enable/disable) global features of the used modules here.
*
* YOU CAN SAFELY DELETE THIS CLASS AND REMOVE ITS USAGES IF YOU DON'T NEED TO IT!
*
* Please refer to the documentation to lear more about the Global Features System:
* https://docs.abp.io/en/abp/latest/Global-Features
*/
});
}
}
}
@@ -1,11 +1,11 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Identity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.Threading;

namespace MyAbpApp
{
public static class MyAbpAppModulePropertyConfigurator
public static class MyAbpAppModuleExtensionConfigurator
{
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();

Expand All @@ -14,6 +14,7 @@ public static void Configure()
OneTimeRunner.Run(() =>
{
ConfigureExistingProperties();
ConfigureExtraProperties();
});
}

Expand All @@ -23,13 +24,49 @@ private static void ConfigureExistingProperties()
* entities defined in the modules used by your application.
*
* Example: Change user and role name max lengths
IdentityUserConsts.MaxNameLength = 99;
IdentityRoleConsts.MaxNameLength = 99;
* Notice: It is not suggested to change property lengths
* unless you really need it. Go with the standard values wherever possible.
*
* If you are using EF Core, you will need to run the add-migration command after your changes.
*/
}

private static void ConfigureExtraProperties()
{
/* You can configure extra properties for the
* entities defined in the modules used by your application.
*
* This class can be used to define these extra properties
* with a high level, easy to use API.
*
* Example: Add a new property to the user entity of the identity module
ObjectExtensionManager.Instance.Modules()
.ConfigureIdentity(identity =>
{
identity.ConfigureUser(user =>
{
user.AddOrUpdateProperty<string>( //property type: string
"SocialSecurityNumber", //property name
property =>
{
//validation rules
property.Attributes.Add(new RequiredAttribute());
property.Attributes.Add(new StringLengthAttribute(64) {MinimumLength = 4});
//...other configurations for this property
}
);
});
});
* See the documentation for more:
* https://docs.abp.io/en/latest/Module-Entity-Extensions
*/
}
}
}
}
Expand Up @@ -47,22 +47,20 @@ public async Task MigrateAsync()
var migratedDatabaseSchemas = new HashSet<string>();
foreach (var tenant in tenants)
{
if (!tenant.ConnectionStrings.Any())
{
continue;
}

using (_currentTenant.Change(tenant.Id))
{
var tenantConnectionStrings = tenant.ConnectionStrings
.Select(x => x.Value)
.ToList();

if (!migratedDatabaseSchemas.IsSupersetOf(tenantConnectionStrings))
if (tenant.ConnectionStrings.Any())
{
await MigrateDatabaseSchemaAsync(tenant);
var tenantConnectionStrings = tenant.ConnectionStrings
.Select(x => x.Value)
.ToList();

if (!migratedDatabaseSchemas.IsSupersetOf(tenantConnectionStrings))
{
await MigrateDatabaseSchemaAsync(tenant);

migratedDatabaseSchemas.AddIfNotContains(tenantConnectionStrings);
migratedDatabaseSchemas.AddIfNotContains(tenantConnectionStrings);
}
}

await SeedDataAsync(tenant);
Expand Down Expand Up @@ -92,4 +90,4 @@ private async Task SeedDataAsync(Tenant tenant = null)
await _dataSeeder.SeedAsync(tenant?.Id);
}
}
}
}

0 comments on commit 2cdea32

Please sign in to comment.