Browse Source

Merge branch 'rel-3.3' into dev

pull/5908/head
Halil İbrahim Kalkan 6 years ago
parent
commit
ee42f87a86
  1. 4
      docs/en/Module-Development-Basics.md
  2. 16
      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. 49
      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

4
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
@ -139,4 +139,4 @@ A depended module may depend on another module, but you only need to define your
There are **two types of modules.** They don't have any structural difference but categorized by functionality and purpose:
- **Framework modules**: These are **core modules of the framework** like caching, emailing, theming, security, serialization, validation, EF Core integration, MongoDB integration... etc. They do not have application/business functionalities but makes your daily development easier by providing common infrastructure, integration and abstractions.
- **Application modules**: These modules implement **specific application/business functionalities** like blogging, document management, identity management, tenant management... etc. They generally have their own entities, services, APIs and UI components. See [pre-built application modules](Modules/Index.md).
- **Application modules**: These modules implement **specific application/business functionalities** like blogging, document management, identity management, tenant management... etc. They generally have their own entities, services, APIs and UI components. See [pre-built application modules](Modules/Index.md).

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

@ -124,7 +124,7 @@ namespace Volo.Abp.Reflection
? customAttributes.Concat(declaringTypeCustomAttributes).Distinct()
: customAttributes;
}
/// <summary>
/// Gets value of a property by it's full path from given object
/// </summary>
@ -134,7 +134,7 @@ namespace Volo.Abp.Reflection
var currentType = objectType;
var objectPath = currentType.FullName;
var absolutePropertyPath = propertyPath;
if (absolutePropertyPath.StartsWith(objectPath))
if (objectPath != null && absolutePropertyPath.StartsWith(objectPath))
{
absolutePropertyPath = absolutePropertyPath.Replace(objectPath + ".", "");
}
@ -142,8 +142,16 @@ namespace Volo.Abp.Reflection
foreach (var propertyName in absolutePropertyPath.Split('.'))
{
var property = currentType.GetProperty(propertyName);
value = property.GetValue(value, null);
currentType = property.PropertyType;
if (property != null)
{
value = property.GetValue(value, null);
currentType = property.PropertyType;
}
else
{
value = null;
break;
}
}
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)
{
return base.MapToGetOutputDtoAsync(entity);
return MapToGetOutputDtoAsync(entity);
}
protected override TEntityDto MapToGetListOutputDto(TEntity entity)

49
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 Xunit;
@ -8,6 +9,50 @@ namespace Volo.Abp.Reflection
{
//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]
public void GetPublicConstantsRecursively_Test()
@ -99,4 +144,4 @@ namespace Volo.Abp.Reflection
}
}
}
}

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<IdentityUserDto> FindByUsernameAsync(string username);
Task<IdentityUserDto> FindByUsernameAsync(string userName);
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)]
public virtual async Task<IdentityUserDto> FindByUsernameAsync(string username)
public virtual async Task<IdentityUserDto> FindByUsernameAsync(string userName)
{
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:UserLookup": "User lookup",
"Feature:IdentityGroup": "Identity",
"Feature:TwoFactor": "Two Factor",
"Feature:TwoFactorDescription": "Two Factor",
"Feature:TwoFactor": "Two factor behaviour",
"Feature:TwoFactorDescription": "Set two factor behaviour. Optional values: Optional,Disabled,Forced",
"Feature:TwoFactor.Optional": "Optional",
"Feature:TwoFactor.Disabled": "Disabled",
"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",
"Feature:IdentityGroup": "Kimlik",
"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.Disabled": "Devre dışı",
"Feature:TwoFactor.Forced": "Zorunlu",
"Feature:TwoFactor.Disabled": "Asla",
"Feature:TwoFactor.Forced": "Her zaman",
"DisplayName:Abp.Identity.Password.RequiredLength": "Uzunluk gerekli",
"DisplayName:Abp.Identity.Password.RequiredUniqueChars": "Tekil 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:UserLookup": "用户查询",
"Feature:IdentityGroup": "身份标识",
"Feature:TwoFactor": "双因素身份验证",
"Feature:TwoFactorDescription": "双因素身份验证",
"Feature:TwoFactor": "双因素身份验证行为",
"Feature:TwoFactorDescription": "设置双因素身份验证行为. 可选值:可选,禁用,强制启用",
"Feature:TwoFactor.Optional": "可选",
"Feature:TwoFactor.Disabled": "禁用",
"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:UserLookup": "使用者查詢",
"Feature:IdentityGroup": "身份識別",
"Feature:TwoFactor": "雙因素",
"Feature:TwoFactorDescription": "雙因素",
"Feature:TwoFactor": "雙因素身份驗證行為",
"Feature:TwoFactorDescription": "設置雙因素身份驗證行為. 可選值:可選,禁用,強制啟用",
"Feature:TwoFactor.Optional": "選用",
"Feature:TwoFactor.Disabled": "關閉",
"Feature:TwoFactor.Forced": "強制啟用",

Loading…
Cancel
Save