Browse Source
Merge pull request #24318 from abpframework/auto-merge/rel-9-3/4172
Merge branch rel-10.0 with rel-9.3
pull/24319/head
Ma Liming
2 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
35 additions and
2 deletions
-
framework/src/Volo.Abp.BlazoriseUI/Components/ObjectExtending/ExtensionProperties.razor.cs
-
framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/Modularity/ExtensionPropertyUiFormConfiguration.cs
-
framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/Modularity/ModuleExtensionConfigurationHelper.cs
-
framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ObjectExtensionPropertyInfo.cs
|
|
|
@ -1,5 +1,6 @@ |
|
|
|
using System; |
|
|
|
using System.Collections.Immutable; |
|
|
|
using System.Linq; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.AspNetCore.Components; |
|
|
|
using Microsoft.Extensions.Localization; |
|
|
|
@ -29,8 +30,13 @@ public partial class ExtensionProperties<TEntityType, TResourceType> : Component |
|
|
|
|
|
|
|
public ImmutableList<ObjectExtensionPropertyInfo> Properties { get; set; } = ImmutableList<ObjectExtensionPropertyInfo>.Empty; |
|
|
|
|
|
|
|
protected async override Task OnInitializedAsync() |
|
|
|
protected override async Task OnInitializedAsync() |
|
|
|
{ |
|
|
|
Properties = await ObjectExtensionManager.Instance.GetPropertiesAndCheckPolicyAsync<TEntityType>(ServiceProvider); |
|
|
|
Properties = |
|
|
|
(await ObjectExtensionManager.Instance.GetPropertiesAndCheckPolicyAsync<TEntityType>(ServiceProvider)) |
|
|
|
.Where(p => ModalType == ExtensionPropertyModalType.CreateModal |
|
|
|
? p.UI.CreateModal.IsVisible |
|
|
|
: p.UI.EditModal.IsVisible) |
|
|
|
.ToImmutableList(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -6,4 +6,9 @@ public class ExtensionPropertyUiFormConfiguration |
|
|
|
/// Default: true.
|
|
|
|
/// </summary>
|
|
|
|
public bool IsVisible { get; set; } = true; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Default: false.
|
|
|
|
/// </summary>
|
|
|
|
public bool IsReadOnly { get; set; } = false; |
|
|
|
} |
|
|
|
|
|
|
|
@ -175,6 +175,10 @@ public static class ModuleExtensionConfigurationHelper |
|
|
|
property.DefaultValueFactory = propertyConfig.DefaultValueFactory; |
|
|
|
property.Lookup = propertyConfig.UI.Lookup; |
|
|
|
property.UI.Order = propertyConfig.UI.Order; |
|
|
|
property.UI.CreateModal.IsVisible = propertyConfig.UI.OnCreateForm.IsVisible; |
|
|
|
property.UI.CreateModal.IsReadOnly = propertyConfig.UI.OnCreateForm.IsReadOnly; |
|
|
|
property.UI.EditModal.IsVisible = propertyConfig.UI.OnEditForm.IsVisible; |
|
|
|
property.UI.EditModal.IsReadOnly = propertyConfig.UI.OnEditForm.IsReadOnly; |
|
|
|
property.Policy = propertyConfig.Policy; |
|
|
|
foreach (var configuration in propertyConfig.Configuration) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -90,16 +90,34 @@ public class ObjectExtensionPropertyInfo : IHasNameWithLocalizableDisplayName, I |
|
|
|
{ |
|
|
|
public int Order { get; set; } |
|
|
|
|
|
|
|
public ExtensionPropertyUICreateModal CreateModal { get; set; } |
|
|
|
|
|
|
|
public ExtensionPropertyUIEditModal EditModal { get; set; } |
|
|
|
|
|
|
|
public ExtensionPropertyUI() |
|
|
|
{ |
|
|
|
CreateModal = new ExtensionPropertyUICreateModal(); |
|
|
|
EditModal = new ExtensionPropertyUIEditModal(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public class ExtensionPropertyUICreateModal |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Default: true.
|
|
|
|
/// </summary>
|
|
|
|
public bool IsVisible { get; set; } = true; |
|
|
|
|
|
|
|
public bool IsReadOnly { get; set; } |
|
|
|
} |
|
|
|
|
|
|
|
public class ExtensionPropertyUIEditModal |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Default: true.
|
|
|
|
/// </summary>
|
|
|
|
public bool IsVisible { get; set; } = true; |
|
|
|
|
|
|
|
public bool IsReadOnly { get; set; } |
|
|
|
} |
|
|
|
} |
|
|
|
|