From c5208070c43ec8f1611ad5075ad41626ca614310 Mon Sep 17 00:00:00 2001 From: Ilkay Ilknur Date: Thu, 4 Mar 2021 14:10:09 +0300 Subject: [PATCH] add icon and color options for entity actions --- .../Components/Extensibility/EntityActions/EntityAction.cs | 4 +++- .../Components/AbpExtensibleDataGrid.razor | 4 ++++ .../src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor | 4 ++++ .../src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs | 3 +++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/Extensibility/EntityActions/EntityAction.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/Extensibility/EntityActions/EntityAction.cs index 245edfd04c..fbc0ba2d73 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/Extensibility/EntityActions/EntityAction.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/Extensibility/EntityActions/EntityAction.cs @@ -3,13 +3,15 @@ using System.Threading.Tasks; namespace Volo.Abp.AspNetCore.Components.Extensibility.EntityActions { - public class EntityAction:IEquatable + public class EntityAction : IEquatable { public string Text { get; set; } public Func Clicked { get; set; } public string RequiredPolicy { get; set; } public Func ConfirmationMessage { get; set; } public bool Primary { get; set; } + public object Color { get; set; } + public string Icon { get; set; } public bool Equals(EntityAction other) { return string.Equals(Text, other?.Text, StringComparison.OrdinalIgnoreCase); diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor index 718974c81e..c363b5d750 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor @@ -25,6 +25,8 @@ { @@ -35,6 +37,8 @@ } diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor index 99e0383fdc..1312e1b2ae 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor @@ -15,6 +15,10 @@ else + @if(!string.IsNullOrEmpty(Icon)) + { + + } @Text } diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs index 7f0edf3b4a..35f832f97f 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs @@ -32,6 +32,9 @@ namespace Volo.Abp.BlazoriseUI.Components [Parameter] public Func ConfirmationMessage { get; set; } + [Parameter] + public string Icon { get; set; } + [CascadingParameter] public EntityActions ParentActions { get; set; }