|
|
|
@ -1,19 +1,18 @@ |
|
|
|
@page "/identity/users" |
|
|
|
@attribute [Authorize(IdentityPermissions.Users.Default)] |
|
|
|
@attribute [Authorize( IdentityPermissions.Users.Default )] |
|
|
|
@using Microsoft.AspNetCore.Authorization |
|
|
|
@using Microsoft.Extensions.Localization |
|
|
|
@using Volo.Abp.Identity.Localization |
|
|
|
@using Volo.Abp.PermissionManagement.Blazor.Components |
|
|
|
@inherits UserManagementBase |
|
|
|
@inject IStringLocalizer<IdentityResource> L |
|
|
|
|
|
|
|
@* ************************* PAGE HEADER ************************* *@ |
|
|
|
<Row> |
|
|
|
<Column ColumnSize="ColumnSize.Is6"> |
|
|
|
<h1>@L["Users"]</h1> |
|
|
|
</Column> |
|
|
|
<Column ColumnSize="ColumnSize.Is6"> |
|
|
|
@if (HasCreatePermission) |
|
|
|
@if ( HasCreatePermission ) |
|
|
|
{ |
|
|
|
<Paragraph Alignment="TextAlignment.Right"> |
|
|
|
<Button Color="Color.Primary" Clicked="OpenCreateModalAsync">@L["NewUser"]</Button> |
|
|
|
@ -30,7 +29,7 @@ |
|
|
|
ShowPager="true" |
|
|
|
PageSize="PageSize"> |
|
|
|
<DataGridColumns> |
|
|
|
@if (ShouldShowEntityActions) |
|
|
|
@if ( ShouldShowEntityActions ) |
|
|
|
{ |
|
|
|
<DataGridColumn Width="150px" TItem="IdentityUserDto" Field="@nameof(IdentityUserDto.UserName)" Sortable="false" Caption="@L["Actions"].Value"> |
|
|
|
<DisplayTemplate> |
|
|
|
@ -39,17 +38,17 @@ |
|
|
|
@L["Actions"] |
|
|
|
</DropdownToggle> |
|
|
|
<DropdownMenu> |
|
|
|
@if (HasUpdatePermission) |
|
|
|
@if ( HasUpdatePermission ) |
|
|
|
{ |
|
|
|
<DropdownItem Clicked="() => OpenEditModalAsync(context.As<IdentityUserDto>().Id)">@L["Edit"]</DropdownItem> |
|
|
|
} |
|
|
|
@if (HasManagePermissionsPermission) |
|
|
|
@if ( HasManagePermissionsPermission ) |
|
|
|
{ |
|
|
|
<DropdownItem Clicked="() => PermissionManagementModal.OpenAsync(PermissionProviderName, context.As<IdentityUserDto>().Id.ToString())">@L["Permissions"]</DropdownItem> |
|
|
|
} |
|
|
|
@if (HasDeletePermission) |
|
|
|
@if ( HasDeletePermission ) |
|
|
|
{ |
|
|
|
<DropdownDivider/> |
|
|
|
<DropdownDivider /> |
|
|
|
<DropdownItem Clicked="() => DeleteEntityAsync(context.As<IdentityUserDto>())">@L["Delete"]</DropdownItem> |
|
|
|
} |
|
|
|
</DropdownMenu> |
|
|
|
@ -76,17 +75,17 @@ |
|
|
|
</DataGrid> |
|
|
|
|
|
|
|
@* ************************* CREATE MODAL ************************* *@ |
|
|
|
@if (HasCreatePermission) |
|
|
|
@if ( HasCreatePermission ) |
|
|
|
{ |
|
|
|
<Modal @ref="CreateModal"> |
|
|
|
<ModalBackdrop/> |
|
|
|
<ModalBackdrop /> |
|
|
|
<ModalContent IsCentered="true"> |
|
|
|
<ModalHeader> |
|
|
|
<ModalTitle>@L["NewUser"]</ModalTitle> |
|
|
|
<CloseButton Clicked="CloseCreateModalAsync"/> |
|
|
|
<CloseButton Clicked="CloseCreateModalAsync" /> |
|
|
|
</ModalHeader> |
|
|
|
<ModalBody> |
|
|
|
<EditForm id="IdentityUserCreateForm" Model="@NewEntity" OnValidSubmit="CreateEntityAsync"> |
|
|
|
<Validations @ref="@CreateValidationsRef" Mode="ValidationMode.Auto" Model="@NewEntity" ValidateOnLoad="false"> |
|
|
|
<Tabs @bind-SelectedTab="@CreateModalSelectedTab"> |
|
|
|
<Items> |
|
|
|
<Tab Name="UserInformations">@L["UserInformations"]</Tab> |
|
|
|
@ -94,71 +93,107 @@ |
|
|
|
</Items> |
|
|
|
<Content> |
|
|
|
<TabPanel Name="UserInformations"> |
|
|
|
<Validation> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:UserName"]</FieldLabel> |
|
|
|
<TextEdit @bind-Text="NewEntity.UserName"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
</Validation> |
|
|
|
<Validation> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:Name"]</FieldLabel> |
|
|
|
<TextEdit @bind-Text="NewEntity.Name"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
</Validation> |
|
|
|
<Validation> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:Surname"]</FieldLabel> |
|
|
|
<TextEdit @bind-Text="NewEntity.Surname"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
</Validation> |
|
|
|
<Validation> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:Password"]</FieldLabel> |
|
|
|
<TextEdit Role="TextRole.Password" @bind-Text="NewEntity.Password"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
</Validation> |
|
|
|
<Validation> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:Email"]</FieldLabel> |
|
|
|
<TextEdit @bind-Text="NewEntity.Email"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
</Validation> |
|
|
|
<Validation> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:PhoneNumber"]</FieldLabel> |
|
|
|
<TextEdit @bind-Text="NewEntity.PhoneNumber"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
</Validation> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:UserName"]</FieldLabel> |
|
|
|
<TextEdit @bind-text="NewEntity.UserName"/> |
|
|
|
</Field> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:Name"]</FieldLabel> |
|
|
|
<TextEdit @bind-text="NewEntity.Name"/> |
|
|
|
</Field> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:Surname"]</FieldLabel> |
|
|
|
<TextEdit @bind-text="NewEntity.Surname"/> |
|
|
|
</Field> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:Password"]</FieldLabel> |
|
|
|
<TextEdit Role="TextRole.Password" @bind-text="NewEntity.Password"/> |
|
|
|
</Field> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:Email"]</FieldLabel> |
|
|
|
<TextEdit @bind-text="NewEntity.Email"/> |
|
|
|
</Field> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:PhoneNumber"]</FieldLabel> |
|
|
|
<TextEdit @bind-text="NewEntity.PhoneNumber"/> |
|
|
|
</Field> |
|
|
|
<Field> |
|
|
|
<Check TValue="bool" @bind-checked="@NewEntity.LockoutEnabled">@L["DisplayName:LockoutEnabled"]</Check> |
|
|
|
<Check TValue="bool" @bind-Checked="@NewEntity.LockoutEnabled">@L["DisplayName:LockoutEnabled"]</Check> |
|
|
|
</Field> |
|
|
|
</TabPanel> |
|
|
|
<TabPanel Name="Roles"> |
|
|
|
@if (NewUserRoles != null) |
|
|
|
@if ( NewUserRoles != null ) |
|
|
|
{ |
|
|
|
@foreach (var role in NewUserRoles) |
|
|
|
@foreach ( var role in NewUserRoles ) |
|
|
|
{ |
|
|
|
<Field> |
|
|
|
<input type="hidden" @bind-value="@role.Name"/> |
|
|
|
<Check TValue="bool" @bind-checked="@role.IsAssigned">@role.Name</Check> |
|
|
|
<input type="hidden" @bind-value="@role.Name" /> |
|
|
|
<Check TValue="bool" @bind-Checked="@role.IsAssigned">@role.Name</Check> |
|
|
|
</Field> |
|
|
|
} |
|
|
|
} |
|
|
|
</TabPanel> |
|
|
|
</Content> |
|
|
|
</Tabs> |
|
|
|
</EditForm> |
|
|
|
</Validations> |
|
|
|
</ModalBody> |
|
|
|
<ModalFooter> |
|
|
|
<Button Color="Color.Secondary" Clicked="CloseCreateModalAsync">@L["Cancel"]</Button> |
|
|
|
<Button form="IdentityUserCreateForm" Color="Color.Primary" Clicked="CreateEntityAsync">@L["Save"]</Button> |
|
|
|
<Button Color="Color.Primary" Clicked="CreateEntityAsync">@L["Save"]</Button> |
|
|
|
</ModalFooter> |
|
|
|
</ModalContent> |
|
|
|
</Modal> |
|
|
|
} |
|
|
|
|
|
|
|
@* ************************* EDIT MODAL ************************* *@ |
|
|
|
@if (HasUpdatePermission) |
|
|
|
@if ( HasUpdatePermission ) |
|
|
|
{ |
|
|
|
<Modal @ref="EditModal"> |
|
|
|
<ModalBackdrop/> |
|
|
|
<ModalBackdrop /> |
|
|
|
<ModalContent IsCentered="true"> |
|
|
|
<ModalHeader> |
|
|
|
<ModalTitle>@L["Edit"]</ModalTitle> |
|
|
|
<CloseButton Clicked="CloseEditModalAsync"/> |
|
|
|
<CloseButton Clicked="CloseEditModalAsync" /> |
|
|
|
</ModalHeader> |
|
|
|
<ModalBody> |
|
|
|
<EditForm id="IdentityUserEditForm" Model="@EditingEntity" OnValidSubmit="UpdateEntityAsync"> |
|
|
|
<input type="hidden" name="ConcurrencyStamp" @bind-value="EditingEntity.ConcurrencyStamp"/> |
|
|
|
<Validations @ref="@EditValidationsRef" Mode="ValidationMode.Auto" Model="@NewEntity" ValidateOnLoad="false"> |
|
|
|
<input type="hidden" name="ConcurrencyStamp" @bind-value="EditingEntity.ConcurrencyStamp" /> |
|
|
|
|
|
|
|
<Tabs @bind-SelectedTab="@EditModalSelectedTab"> |
|
|
|
<Items> |
|
|
|
@ -168,55 +203,89 @@ |
|
|
|
<Content> |
|
|
|
<TabPanel Name="UserInformations"> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:UserName"]</FieldLabel> |
|
|
|
<TextEdit @bind-text="EditingEntity.UserName"/> |
|
|
|
</Field> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:Name"]</FieldLabel> |
|
|
|
<TextEdit @bind-text="EditingEntity.Name"/> |
|
|
|
<Validation> |
|
|
|
<FieldLabel>@L["DisplayName:UserName"]</FieldLabel> |
|
|
|
<TextEdit @bind-Text="EditingEntity.UserName"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Validation> |
|
|
|
</Field> |
|
|
|
<Validation> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:Name"]</FieldLabel> |
|
|
|
<TextEdit @bind-Text="EditingEntity.Name"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
</Validation> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:Surname"]</FieldLabel> |
|
|
|
<TextEdit @bind-text="EditingEntity.Surname"/> |
|
|
|
</Field> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:Password"]</FieldLabel> |
|
|
|
<TextEdit Role="TextRole.Password" @bind-text="EditingEntity.Password"/> |
|
|
|
</Field> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:Email"]</FieldLabel> |
|
|
|
<TextEdit @bind-text="EditingEntity.Email"/> |
|
|
|
</Field> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:PhoneNumber"]</FieldLabel> |
|
|
|
<TextEdit @bind-text="EditingEntity.PhoneNumber"/> |
|
|
|
<TextEdit @bind-Text="EditingEntity.Surname"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
<Validation> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:Password"]</FieldLabel> |
|
|
|
<TextEdit Role="TextRole.Password" @bind-Text="EditingEntity.Password"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
</Validation> |
|
|
|
<Validation> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:Email"]</FieldLabel> |
|
|
|
<TextEdit @bind-Text="EditingEntity.Email"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
</Validation> |
|
|
|
<Validation> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:PhoneNumber"]</FieldLabel> |
|
|
|
<TextEdit @bind-Text="EditingEntity.PhoneNumber"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
</Validation> |
|
|
|
<Field> |
|
|
|
<Check TValue="bool" @bind-checked="EditingEntity.LockoutEnabled">@L["DisplayName:LockoutEnabled"]</Check> |
|
|
|
<Check TValue="bool" @bind-Checked="EditingEntity.LockoutEnabled">@L["DisplayName:LockoutEnabled"]</Check> |
|
|
|
</Field> |
|
|
|
</TabPanel> |
|
|
|
<TabPanel Name="Roles"> |
|
|
|
@if (EditUserRoles != null) |
|
|
|
@if ( EditUserRoles != null ) |
|
|
|
{ |
|
|
|
@foreach (var role in EditUserRoles) |
|
|
|
@foreach ( var role in EditUserRoles ) |
|
|
|
{ |
|
|
|
<Field> |
|
|
|
<input type="hidden" @bind-value="@role.Name"/> |
|
|
|
<Check TValue="bool" @bind-checked="@role.IsAssigned">@role.Name</Check> |
|
|
|
<input type="hidden" @bind-value="@role.Name" /> |
|
|
|
<Check TValue="bool" @bind-Checked="@role.IsAssigned">@role.Name</Check> |
|
|
|
</Field> |
|
|
|
} |
|
|
|
} |
|
|
|
</TabPanel> |
|
|
|
</Content> |
|
|
|
</Tabs> |
|
|
|
</EditForm> |
|
|
|
</Validations> |
|
|
|
</ModalBody> |
|
|
|
<ModalFooter> |
|
|
|
<Button Color="Color.Secondary" Clicked="CloseEditModalAsync">@L["Cancel"]</Button> |
|
|
|
<Button form="IdentityUserEditForm" Color="Color.Primary" Clicked="UpdateEntityAsync">@L["Save"]</Button> |
|
|
|
<Button Color="Color.Primary" Clicked="UpdateEntityAsync">@L["Save"]</Button> |
|
|
|
</ModalFooter> |
|
|
|
</ModalContent> |
|
|
|
</Modal> |
|
|
|
} |
|
|
|
|
|
|
|
<PermissionManagementModal @ref="PermissionManagementModal"/> |
|
|
|
<PermissionManagementModal @ref="PermissionManagementModal" /> |