Browse Source

Merge branch 'rel-3.3' into dev

pull/5908/head
Halil İbrahim Kalkan 6 years ago
parent
commit
ee42f87a86
  1. 2
      docs/en/Module-Development-Basics.md
  2. 14
      framework/src/Volo.Abp.Core/Volo/Abp/Reflection/ReflectionHelper.cs
  3. 2
      framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/CrudAppService.cs
  4. 47
      framework/test/Volo.Abp.Core.Tests/Volo/Abp/Reflection/ReflectionHelper_Tests.cs
  5. 2
      modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityUserAppService.cs
  6. 4
      modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs
  7. 4
      modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json
  8. 6
      modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/tr.json
  9. 4
      modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hans.json
  10. 4
      modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hant.json

2
docs/en/Module-Development-Basics.md

@ -57,7 +57,7 @@ public class BlogModule : AbpModule
} }
```` ````
See Configuration (TODO: link) document for more about the configuration system. See the [Configuration](Configuration.md) document for more about the configuration system.
#### Pre & Post Configure Services #### Pre & Post Configure Services

14
framework/src/Volo.Abp.Core/Volo/Abp/Reflection/ReflectionHelper.cs

@ -134,7 +134,7 @@ namespace Volo.Abp.Reflection
var currentType = objectType; var currentType = objectType;
var objectPath = currentType.FullName; var objectPath = currentType.FullName;
var absolutePropertyPath = propertyPath; var absolutePropertyPath = propertyPath;
if (absolutePropertyPath.StartsWith(objectPath)) if (objectPath != null && absolutePropertyPath.StartsWith(objectPath))
{ {
absolutePropertyPath = absolutePropertyPath.Replace(objectPath + ".", ""); absolutePropertyPath = absolutePropertyPath.Replace(objectPath + ".", "");
} }
@ -142,8 +142,16 @@ namespace Volo.Abp.Reflection
foreach (var propertyName in absolutePropertyPath.Split('.')) foreach (var propertyName in absolutePropertyPath.Split('.'))
{ {
var property = currentType.GetProperty(propertyName); var property = currentType.GetProperty(propertyName);
value = property.GetValue(value, null); if (property != null)
currentType = property.PropertyType; {
value = property.GetValue(value, null);
currentType = property.PropertyType;
}
else
{
value = null;
break;
}
} }
return value; return value;

2
framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/CrudAppService.cs

@ -57,7 +57,7 @@ namespace Volo.Abp.Application.Services
protected override Task<TEntityDto> MapToGetListOutputDtoAsync(TEntity entity) protected override Task<TEntityDto> MapToGetListOutputDtoAsync(TEntity entity)
{ {
return base.MapToGetOutputDtoAsync(entity); return MapToGetOutputDtoAsync(entity);
} }
protected override TEntityDto MapToGetListOutputDto(TEntity entity) protected override TEntityDto MapToGetListOutputDto(TEntity entity)

47
framework/test/Volo.Abp.Core.Tests/Volo/Abp/Reflection/ReflectionHelper_Tests.cs

@ -1,4 +1,5 @@
using System.Linq; using System;
using System.Linq;
using Shouldly; using Shouldly;
using Xunit; using Xunit;
@ -8,6 +9,50 @@ namespace Volo.Abp.Reflection
{ {
//TODO: ... //TODO: ...
class GetValueByPathTestClass
{
public string Name { get; set; }
public int Count { get; set; }
public DateTime Time { get; set; }
public GetValueByPathTestChildrenClass Children { get; set; }
}
class GetValueByPathTestChildrenClass
{
public string Name { get; set; }
public int Count { get; set; }
}
[Fact]
public void GetValueByPath_Test()
{
var value = new GetValueByPathTestClass
{
Name = "test",
Count = 8,
Time = DateTime.Parse("2020-01-01"),
Children = new GetValueByPathTestChildrenClass
{
Name = "test-children",
Count = 9,
}
};
ReflectionHelper.GetValueByPath(value, value.GetType(), "Name").ShouldBe("test");
ReflectionHelper.GetValueByPath(value, value.GetType(), "Volo.Abp.Reflection.ReflectionHelper_Tests+GetValueByPathTestClass.Name").ShouldBe("test");
ReflectionHelper.GetValueByPath(value, value.GetType(), "Count").ShouldBe(8);
ReflectionHelper.GetValueByPath(value, value.GetType(), "Time").ShouldBe(DateTime.Parse("2020-01-01"));
ReflectionHelper.GetValueByPath(value, value.GetType(), "Children.Name").ShouldBe("test-children");
ReflectionHelper.GetValueByPath(value, value.GetType(), "Children.Count").ShouldBe(9);
ReflectionHelper.GetValueByPath(value, value.GetType(), "Volo.Abp.Reflection.ReflectionHelper_Tests+GetValueByPathTestClass.Children.Name").ShouldBe("test-children");
ReflectionHelper.GetValueByPath(value, value.GetType(), "Children.NotExist").ShouldBeNull();
ReflectionHelper.GetValueByPath(value, value.GetType(), "NotExist").ShouldBeNull();
}
[Fact] [Fact]
public void GetPublicConstantsRecursively_Test() public void GetPublicConstantsRecursively_Test()

2
modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityUserAppService.cs

@ -19,7 +19,7 @@ namespace Volo.Abp.Identity
Task UpdateRolesAsync(Guid id, IdentityUserUpdateRolesDto input); Task UpdateRolesAsync(Guid id, IdentityUserUpdateRolesDto input);
Task<IdentityUserDto> FindByUsernameAsync(string username); Task<IdentityUserDto> FindByUsernameAsync(string userName);
Task<IdentityUserDto> FindByEmailAsync(string email); Task<IdentityUserDto> FindByEmailAsync(string email);
} }

4
modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs

@ -135,10 +135,10 @@ namespace Volo.Abp.Identity
} }
[Authorize(IdentityPermissions.Users.Default)] [Authorize(IdentityPermissions.Users.Default)]
public virtual async Task<IdentityUserDto> FindByUsernameAsync(string username) public virtual async Task<IdentityUserDto> FindByUsernameAsync(string userName)
{ {
return ObjectMapper.Map<IdentityUser, IdentityUserDto>( return ObjectMapper.Map<IdentityUser, IdentityUserDto>(
await UserManager.FindByNameAsync(username) await UserManager.FindByNameAsync(userName)
); );
} }

4
modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json

@ -79,8 +79,8 @@
"Permission:UserManagement": "User management", "Permission:UserManagement": "User management",
"Permission:UserLookup": "User lookup", "Permission:UserLookup": "User lookup",
"Feature:IdentityGroup": "Identity", "Feature:IdentityGroup": "Identity",
"Feature:TwoFactor": "Two Factor", "Feature:TwoFactor": "Two factor behaviour",
"Feature:TwoFactorDescription": "Two Factor", "Feature:TwoFactorDescription": "Set two factor behaviour. Optional values: Optional,Disabled,Forced",
"Feature:TwoFactor.Optional": "Optional", "Feature:TwoFactor.Optional": "Optional",
"Feature:TwoFactor.Disabled": "Disabled", "Feature:TwoFactor.Disabled": "Disabled",
"Feature:TwoFactor.Forced": "Forced", "Feature:TwoFactor.Forced": "Forced",

6
modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/tr.json

@ -78,10 +78,10 @@
"Permission:UserLookup": "Kullanıcı sorgulama", "Permission:UserLookup": "Kullanıcı sorgulama",
"Feature:IdentityGroup": "Kimlik", "Feature:IdentityGroup": "Kimlik",
"Feature:TwoFactor": "İki faktörlü kimlik doğrulama", "Feature:TwoFactor": "İki faktörlü kimlik doğrulama",
"Feature:TwoFactorDescription": "İki faktörlü kimlik doğrulama", "Feature:TwoFactorDescription": "İki faktörlü kimlik doğrulamanın talep edileceği durumu seçin",
"Feature:TwoFactor.Optional": "İsteğe bağlı", "Feature:TwoFactor.Optional": "İsteğe bağlı",
"Feature:TwoFactor.Disabled": "Devre dışı", "Feature:TwoFactor.Disabled": "Asla",
"Feature:TwoFactor.Forced": "Zorunlu", "Feature:TwoFactor.Forced": "Her zaman",
"DisplayName:Abp.Identity.Password.RequiredLength": "Uzunluk gerekli", "DisplayName:Abp.Identity.Password.RequiredLength": "Uzunluk gerekli",
"DisplayName:Abp.Identity.Password.RequiredUniqueChars": "Tekil karakter gerekli", "DisplayName:Abp.Identity.Password.RequiredUniqueChars": "Tekil karakter gerekli",
"DisplayName:Abp.Identity.Password.RequireNonAlphanumeric": "Alfasayısal olmayan karakter gerekli", "DisplayName:Abp.Identity.Password.RequireNonAlphanumeric": "Alfasayısal olmayan karakter gerekli",

4
modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hans.json

@ -79,8 +79,8 @@
"Permission:UserManagement": "用户管理", "Permission:UserManagement": "用户管理",
"Permission:UserLookup": "用户查询", "Permission:UserLookup": "用户查询",
"Feature:IdentityGroup": "身份标识", "Feature:IdentityGroup": "身份标识",
"Feature:TwoFactor": "双因素身份验证", "Feature:TwoFactor": "双因素身份验证行为",
"Feature:TwoFactorDescription": "双因素身份验证", "Feature:TwoFactorDescription": "设置双因素身份验证行为. 可选值:可选,禁用,强制启用",
"Feature:TwoFactor.Optional": "可选", "Feature:TwoFactor.Optional": "可选",
"Feature:TwoFactor.Disabled": "禁用", "Feature:TwoFactor.Disabled": "禁用",
"Feature:TwoFactor.Forced": "强制启用", "Feature:TwoFactor.Forced": "强制启用",

4
modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hant.json

@ -79,8 +79,8 @@
"Permission:UserManagement": "使用者管理", "Permission:UserManagement": "使用者管理",
"Permission:UserLookup": "使用者查詢", "Permission:UserLookup": "使用者查詢",
"Feature:IdentityGroup": "身份識別", "Feature:IdentityGroup": "身份識別",
"Feature:TwoFactor": "雙因素", "Feature:TwoFactor": "雙因素身份驗證行為",
"Feature:TwoFactorDescription": "雙因素", "Feature:TwoFactorDescription": "設置雙因素身份驗證行為. 可選值:可選,禁用,強制啟用",
"Feature:TwoFactor.Optional": "選用", "Feature:TwoFactor.Optional": "選用",
"Feature:TwoFactor.Disabled": "關閉", "Feature:TwoFactor.Disabled": "關閉",
"Feature:TwoFactor.Forced": "強制啟用", "Feature:TwoFactor.Forced": "強制啟用",

Loading…
Cancel
Save