Browse Source

Merge branch 'dev' into blazor-ui-entit-actions-component

pull/5890/head
Ilkay Ilknur 6 years ago
parent
commit
c37cd73171
  1. 22
      framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs
  2. 6
      modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor.cs

22
framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs

@ -282,9 +282,7 @@ namespace Volo.Abp.BlazoriseUI
protected virtual async Task OpenCreateModalAsync() protected virtual async Task OpenCreateModalAsync()
{ {
await OnOpeningCreateModalAsync(); CreateValidationsRef?.ClearAll();
CreateValidationsRef.ClearAll();
await CheckCreatePolicyAsync(); await CheckCreatePolicyAsync();
@ -297,11 +295,6 @@ namespace Volo.Abp.BlazoriseUI
CreateModal.Show(); CreateModal.Show();
} }
protected virtual Task OnOpeningCreateModalAsync()
{
return Task.CompletedTask;
}
protected virtual Task CloseCreateModalAsync() protected virtual Task CloseCreateModalAsync()
{ {
CreateModal.Hide(); CreateModal.Hide();
@ -310,9 +303,7 @@ namespace Volo.Abp.BlazoriseUI
protected virtual async Task OpenEditModalAsync(TKey id) protected virtual async Task OpenEditModalAsync(TKey id)
{ {
await OnOpeningEditModalAsync(id); EditValidationsRef?.ClearAll();
EditValidationsRef.ClearAll();
await CheckUpdatePolicyAsync(); await CheckUpdatePolicyAsync();
@ -326,11 +317,6 @@ namespace Volo.Abp.BlazoriseUI
EditModal.Show(); EditModal.Show();
} }
protected virtual Task OnOpeningEditModalAsync(TKey id)
{
return Task.CompletedTask;
}
protected virtual TUpdateViewModel MapToEditingEntity(TGetOutputDto entityDto) protected virtual TUpdateViewModel MapToEditingEntity(TGetOutputDto entityDto)
{ {
return ObjectMapper.Map<TGetOutputDto, TUpdateViewModel>(entityDto); return ObjectMapper.Map<TGetOutputDto, TUpdateViewModel>(entityDto);
@ -364,7 +350,7 @@ namespace Volo.Abp.BlazoriseUI
protected virtual async Task CreateEntityAsync() protected virtual async Task CreateEntityAsync()
{ {
if (CreateValidationsRef.ValidateAll()) if (CreateValidationsRef?.ValidateAll() ?? false)
{ {
await OnCreatingEntityAsync(); await OnCreatingEntityAsync();
@ -391,7 +377,7 @@ namespace Volo.Abp.BlazoriseUI
protected virtual async Task UpdateEntityAsync() protected virtual async Task UpdateEntityAsync()
{ {
if (EditValidationsRef.ValidateAll()) if (EditValidationsRef?.ValidateAll() ?? false)
{ {
await OnUpdatingEntityAsync(); await OnUpdatingEntityAsync();

6
modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor.cs

@ -48,7 +48,7 @@ namespace Volo.Abp.Identity.Blazor.Pages.Identity
Roles = (await AppService.GetAssignableRolesAsync()).Items; Roles = (await AppService.GetAssignableRolesAsync()).Items;
} }
protected override async Task OnOpeningCreateModalAsync() protected override Task OnOpeningCreateModalAsync()
{ {
CreateModalSelectedTab = DefaultSelectedTab; CreateModalSelectedTab = DefaultSelectedTab;
@ -58,7 +58,7 @@ namespace Volo.Abp.Identity.Blazor.Pages.Identity
IsAssigned = x.IsDefault IsAssigned = x.IsDefault
}).ToArray(); }).ToArray();
await base.OnOpeningCreateModalAsync(); return base.OpenCreateModalAsync();
} }
protected override Task OnCreatingEntityAsync() protected override Task OnCreatingEntityAsync()
@ -81,7 +81,7 @@ namespace Volo.Abp.Identity.Blazor.Pages.Identity
IsAssigned = userRoleNames.Contains(x.Name) IsAssigned = userRoleNames.Contains(x.Name)
}).ToArray(); }).ToArray();
await base.OnOpeningEditModalAsync(id); await base.OpenEditModalAsync(id);
} }
protected override Task OnUpdatingEntityAsync() protected override Task OnUpdatingEntityAsync()

Loading…
Cancel
Save