Browse Source
Merge pull request #20208 from abpframework/entityactions
Disabled actions button if there is no action
pull/20211/head
oykuermann
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
6 additions and
1 deletions
-
framework/src/Volo.Abp.BlazoriseUI/Components/EntityActions.razor
-
framework/src/Volo.Abp.BlazoriseUI/Components/EntityActions.razor.cs
|
|
|
@ -2,7 +2,7 @@ |
|
|
|
<CascadingValue Value="this" IsFixed="true"> |
|
|
|
@if ( Type == ActionType.Dropdown ) |
|
|
|
{ |
|
|
|
<Dropdown Disabled=@Disabled> |
|
|
|
<Dropdown Disabled="@DisabledOrNoActions()"> |
|
|
|
@if ( HasPrimaryAction ) |
|
|
|
{ |
|
|
|
<Button Block="true" |
|
|
|
|
|
|
|
@ -42,6 +42,11 @@ public partial class EntityActions<TItem> : ComponentBase |
|
|
|
{ |
|
|
|
Actions.Add(action); |
|
|
|
} |
|
|
|
|
|
|
|
private bool DisabledOrNoActions() |
|
|
|
{ |
|
|
|
return Disabled || !Actions.Any(t => t is { Visible: true, HasPermission: true }); |
|
|
|
} |
|
|
|
|
|
|
|
protected override void OnInitialized() |
|
|
|
{ |
|
|
|
|