File tree Expand file tree Collapse file tree
src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending
test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "permissions" : {
3- "allow" : [
4- " Bash(yarn nx g:*)" ,
5- " Bash(npx vitest:*)" ,
6- " Bash(xargs:*)" ,
7- " Bash(dotnet build:*)" ,
8- " Bash(git show:*)"
9- ]
3+ "allow" : []
104 }
115}
Original file line number Diff line number Diff line change @@ -147,8 +147,8 @@ protected virtual ExtensionPropertyDto CreateExtensionPropertyDto(
147147 {
148148 GlobalFeatures = new ExtensionPropertyGlobalFeaturePolicyDto
149149 {
150- Features = propertyConfig . Policy . Features . Features ,
151- RequiresAll = propertyConfig . Policy . Features . RequiresAll
150+ Features = propertyConfig . Policy . GlobalFeatures . Features ,
151+ RequiresAll = propertyConfig . Policy . GlobalFeatures . RequiresAll
152152 } ,
153153 Features = new ExtensionPropertyFeaturePolicyDto
154154 {
Original file line number Diff line number Diff line change 1+ using Shouldly ;
2+ using Volo . Abp . ObjectExtending ;
3+ using Volo . Abp . ObjectExtending . Modularity ;
4+ using Xunit ;
5+
6+ namespace Volo . Abp . AspNetCore . Mvc . ApplicationConfigurations . ObjectExtending ;
7+
8+ public class CachedObjectExtensionsDtoService_Tests
9+ {
10+ private const string ModuleName = "CachedObjectExtensionsDtoServiceTestModule" ;
11+ private const string EntityName = "TestEntity" ;
12+
13+ [ Fact ]
14+ public void Should_Keep_The_Feature_And_Global_Feature_Policies_Apart ( )
15+ {
16+ ObjectExtensionManager . Instance . Modules ( )
17+ . ConfigureModule < ModuleExtensionConfiguration > ( ModuleName , module =>
18+ {
19+ module . ConfigureEntity ( EntityName , entity =>
20+ {
21+ entity . AddOrUpdateProperty < string > ( "TestProperty" , property =>
22+ {
23+ property . Policy . Features . Features = [ "TestFeature" ] ;
24+ property . Policy . Features . RequiresAll = true ;
25+ property . Policy . GlobalFeatures . Features = [ "TestGlobalFeature" ] ;
26+ property . Policy . GlobalFeatures . RequiresAll = false ;
27+ } ) ;
28+ } ) ;
29+ } ) ;
30+
31+ var service = new CachedObjectExtensionsDtoService ( new ExtensionPropertyAttributeDtoFactory ( ) ) ;
32+
33+ var policy = service . Get ( )
34+ . Modules [ ModuleName ]
35+ . Entities [ EntityName ]
36+ . Properties [ "TestProperty" ]
37+ . Policy ;
38+
39+ policy . Features . Features . ShouldBe ( [ "TestFeature" ] ) ;
40+ policy . Features . RequiresAll . ShouldBeTrue ( ) ;
41+ policy . GlobalFeatures . Features . ShouldBe ( [ "TestGlobalFeature" ] ) ;
42+ policy . GlobalFeatures . RequiresAll . ShouldBeFalse ( ) ;
43+ }
44+ }
You can’t perform that action at this time.
0 commit comments