Browse Source

Show indeterminate state on mud "Select All in This Tab" checkbox

Top-level "Select All in All Tabs" already used `Indeterminate` to show
a partial-grant state. The per-tab "Select All in This Tab" checkbox
was a plain two-state binding to `Permissions.All(x => x.IsGranted)`,
so a tab with some (but not all) permissions granted rendered as
unchecked - reading as "no permissions granted" to QA.

Bind `Indeterminate` to "any granted but not all granted" to match the
top-level behavior.
pull/25393/head
maliming 5 months ago
parent
commit
93144f8faa
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 3
      modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor.MudBlazor/Components/PermissionManagementModal.razor

3
modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor.MudBlazor/Components/PermissionManagementModal.razor

@ -41,10 +41,11 @@
{ {
<MudTabPanel Text="@($"{group.DisplayName} ({group.Permissions.Count(x => x.IsGranted)})")"> <MudTabPanel Text="@($"{group.DisplayName} ({group.Permissions.Count(x => x.IsGranted)})")">
<div> <div>
<MudCheckBox Color="Color.Primary" UncheckedColor="Color.Default" <MudCheckBox Color="Color.Primary" UncheckedColor="Color.Default"
T="bool" T="bool"
Disabled="@(IsPermissionGroupDisabled(group))" Disabled="@(IsPermissionGroupDisabled(group))"
Value="@(group.Permissions.All(x => x.IsGranted))" Value="@(group.Permissions.All(x => x.IsGranted))"
Indeterminate="@(group.Permissions.Any(x => x.IsGranted) && !group.Permissions.All(x => x.IsGranted))"
ValueChanged="@(async (bool b) => await GroupGrantAllChanged(b, group))" ValueChanged="@(async (bool b) => await GroupGrantAllChanged(b, group))"
Label="@L["SelectAllInThisTab"]" /> Label="@L["SelectAllInThisTab"]" />
<MudDivider Class="my-2" /> <MudDivider Class="my-2" />

Loading…
Cancel
Save