File tree Expand file tree Collapse file tree
src/IoTHub.Portal.Client/Components/Roles Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323 <MudSelectItem Value =" @act" >@act </MudSelectItem >
2424 }
2525 </MudSelect >
26- <MudButton Variant =" Variant.Outlined" Disabled =" string.IsNullOrEmpty(resourceFilter) && string.IsNullOrEmpty(actionFilter)" OnClick =" ClearFilters" >Réinitialiser</MudButton >
26+ <MudButton Variant =" Variant.Outlined" Disabled =" string.IsNullOrEmpty(resourceFilter) && string.IsNullOrEmpty(actionFilter)" OnClick =" ClearFilters" >Clear</MudButton >
27+ <MudButton Variant =" Variant.Filled" OnClick =" SelectAll" >Select All</MudButton >
2728 <MudSpacer />
2829 <MudChip Color =" Color.Primary" Variant =" Variant.Outlined" >@FilteredPermissions.Count() / @AllPermissions.Length </MudChip >
2930 </MudStack >
6162@code {
6263 [Parameter ] public RoleDetailsModel Role { get ; set ; } = default ! ;
6364 [Parameter ] public EventCallback OnSaved { get ; set ; }
64- [Parameter ] public bool IsEdit { get ; set ; } = false ;
65+ [Parameter ] public bool IsEdit { get ; set ; }
6566
6667 private MudForm form = default ! ;
67- private bool isProcessing = false ;
68- private string ButtonText => IsEdit ? " Enregistrer " : " Créer " ;
68+ private bool isProcessing ;
69+ private string ButtonText => " Save " ;
6970
7071 private HashSet <string > SelectedPermissions { get ; set ; } = new ();
7172 private string [] AllPermissions = Array .Empty <string >();
100101 actionFilter = null ;
101102 }
102103
104+ private void SelectAll ()
105+ {
106+ foreach (var permission in FilteredPermissions )
107+ {
108+ _ = SelectedPermissions .Add (permission );
109+ }
110+ }
111+
103112 protected override async Task OnParametersSetAsync ()
104113 {
105114 if (Role ? .Actions != null && Role .Actions .Any ())
You can’t perform that action at this time.
0 commit comments