diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Server/Volo.Abp.AspNetCore.Components.Server.csproj b/framework/src/Volo.Abp.AspNetCore.Components.Server/Volo.Abp.AspNetCore.Components.Server.csproj index 050c438d11..86d870d2ca 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.Server/Volo.Abp.AspNetCore.Components.Server.csproj +++ b/framework/src/Volo.Abp.AspNetCore.Components.Server/Volo.Abp.AspNetCore.Components.Server.csproj @@ -12,6 +12,8 @@ + + diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/AbpAspNetCoreComponentsServerModule.cs b/framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/AbpAspNetCoreComponentsServerModule.cs index dfd3cafce2..58398b651a 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/AbpAspNetCoreComponentsServerModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/AbpAspNetCoreComponentsServerModule.cs @@ -5,8 +5,10 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.FileProviders; using Volo.Abp.AspNetCore.Auditing; using Volo.Abp.AspNetCore.Components.Web; +using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.SignalR; using Volo.Abp.AspNetCore.Uow; +using Volo.Abp.EventBus; using Volo.Abp.Http.Client; using Volo.Abp.Modularity; @@ -15,7 +17,9 @@ namespace Volo.Abp.AspNetCore.Components.Server [DependsOn( typeof(AbpHttpClientModule), typeof(AbpAspNetCoreComponentsWebModule), - typeof(AbpAspNetCoreSignalRModule) + typeof(AbpAspNetCoreSignalRModule), + typeof(AbpEventBusModule), + typeof(AbpAspNetCoreMvcContractsModule) )] public class AbpAspNetCoreComponentsServerModule : AbpModule { diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/Configuration/BlazorServerCurrentApplicationConfigurationCacheResetService.cs b/framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/Configuration/BlazorServerCurrentApplicationConfigurationCacheResetService.cs new file mode 100644 index 0000000000..1e3cd857e5 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/Configuration/BlazorServerCurrentApplicationConfigurationCacheResetService.cs @@ -0,0 +1,29 @@ +using System.Threading.Tasks; +using Volo.Abp.AspNetCore.Components.Web.Configuration; +using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EventBus.Local; + +namespace Volo.Abp.AspNetCore.Components.Server.Configuration +{ + [Dependency(ReplaceServices = true)] + public class BlazorServerCurrentApplicationConfigurationCacheResetService : + ICurrentApplicationConfigurationCacheResetService, + ITransientDependency + { + private readonly ILocalEventBus _localEventBus; + + public BlazorServerCurrentApplicationConfigurationCacheResetService( + ILocalEventBus localEventBus) + { + _localEventBus = localEventBus; + } + + public async Task ResetAsync() + { + await _localEventBus.PublishAsync( + new CurrentApplicationConfigurationCacheResetEventData() + ); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Configuration/ICurrentApplicationConfigurationCacheResetService.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Configuration/ICurrentApplicationConfigurationCacheResetService.cs new file mode 100644 index 0000000000..b1da30825d --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Configuration/ICurrentApplicationConfigurationCacheResetService.cs @@ -0,0 +1,9 @@ +using System.Threading.Tasks; + +namespace Volo.Abp.AspNetCore.Components.Web.Configuration +{ + public interface ICurrentApplicationConfigurationCacheResetService + { + Task ResetAsync(); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Configuration/NullCurrentApplicationConfigurationCacheResetService.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Configuration/NullCurrentApplicationConfigurationCacheResetService.cs new file mode 100644 index 0000000000..6eeb0e9471 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Configuration/NullCurrentApplicationConfigurationCacheResetService.cs @@ -0,0 +1,13 @@ +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.AspNetCore.Components.Web.Configuration +{ + public class NullCurrentApplicationConfigurationCacheResetService : ICurrentApplicationConfigurationCacheResetService, ISingletonDependency + { + public Task ResetAsync() + { + return Task.CompletedTask; + } + } +} \ No newline at end of file diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components/FeatureManagementModal.razor.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components/FeatureManagementModal.razor.cs index e9c83c007c..b60d156e78 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components/FeatureManagementModal.razor.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components/FeatureManagementModal.razor.cs @@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Components; using Microsoft.Extensions.Localization; using Microsoft.Extensions.Options; using Volo.Abp.AspNetCore.Components.Messages; +using Volo.Abp.AspNetCore.Components.Web.Configuration; using Volo.Abp.Features; using Volo.Abp.Localization; using Volo.Abp.Validation.StringValues; @@ -23,6 +24,8 @@ namespace Volo.Abp.FeatureManagement.Blazor.Components [Inject] protected IStringLocalizerFactory HtmlLocalizerFactory { get; set; } [Inject] protected IOptions LocalizationOptions { get; set; } + + [Inject] private ICurrentApplicationConfigurationCacheResetService CurrentApplicationConfigurationCacheResetService { get; set; } protected Modal Modal; @@ -101,6 +104,8 @@ namespace Volo.Abp.FeatureManagement.Blazor.Components await FeatureAppService.UpdateAsync(ProviderName, ProviderKey, features); + await CurrentApplicationConfigurationCacheResetService.ResetAsync(); + await InvokeAsync(Modal.Hide); } catch (Exception ex) diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor/Components/PermissionManagementModal.razor.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor/Components/PermissionManagementModal.razor.cs index 55d2b36ed6..ffa4a06440 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor/Components/PermissionManagementModal.razor.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor/Components/PermissionManagementModal.razor.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Threading.Tasks; using Blazorise; using Microsoft.AspNetCore.Components; +using Volo.Abp.AspNetCore.Components.Web.Configuration; using Volo.Abp.PermissionManagement.Localization; namespace Volo.Abp.PermissionManagement.Blazor.Components @@ -11,6 +12,7 @@ namespace Volo.Abp.PermissionManagement.Blazor.Components public partial class PermissionManagementModal { [Inject] private IPermissionAppService PermissionAppService { get; set; } + [Inject] private ICurrentApplicationConfigurationCacheResetService CurrentApplicationConfigurationCacheResetService { get; set; } private Modal _modal; @@ -133,6 +135,8 @@ namespace Volo.Abp.PermissionManagement.Blazor.Components await PermissionAppService.UpdateAsync(_providerName, _providerKey, updateDto); + await CurrentApplicationConfigurationCacheResetService.ResetAsync(); + await InvokeAsync(_modal.Hide); } catch (Exception ex) diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor.cs index fcafbce576..7ad7058d3f 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor.cs @@ -3,6 +3,7 @@ using System.Threading.Tasks; using Blazorise; using Microsoft.AspNetCore.Components; using Volo.Abp.AspNetCore.Components.Messages; +using Volo.Abp.AspNetCore.Components.Web.Configuration; using Volo.Abp.SettingManagement.Localization; namespace Volo.Abp.SettingManagement.Blazor.Pages.SettingManagement.EmailSettingGroup @@ -11,6 +12,9 @@ namespace Volo.Abp.SettingManagement.Blazor.Pages.SettingManagement.EmailSetting { [Inject] protected IEmailSettingsAppService EmailSettingsAppService { get; set; } + + [Inject] + private ICurrentApplicationConfigurationCacheResetService CurrentApplicationConfigurationCacheResetService { get; set; } [Inject] protected IUiMessageService UiMessageService { get; set; } @@ -42,6 +46,8 @@ namespace Volo.Abp.SettingManagement.Blazor.Pages.SettingManagement.EmailSetting try { await EmailSettingsAppService.UpdateAsync(ObjectMapper.Map(EmailSettings)); + + await CurrentApplicationConfigurationCacheResetService.ResetAsync(); await UiMessageService.Success(L["SuccessfullySaved"]); }