From bf9b0544eb5d1585d6f38f01fc6d492446e2afbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Wed, 24 Feb 2021 11:54:04 +0300 Subject: [PATCH] Made blazor server side basic theme (initially) working --- ...pAspNetCoreComponentsUIBasicThemeModule.cs | 13 +++ .../AbpAspNetCoreComponentsUiThemingModule.cs | 15 ++++ .../Hosting/AbpComponentsBuilderExtensions.cs | 90 ------------------- .../Volo.Abp.AspNetCore.Components.UI.csproj | 7 +- .../UI/AbpAspNetCoreComponentsUIModule.cs | 65 ++++++-------- ...ntsCachedApplicationConfigurationClient.cs | 67 -------------- .../UI/ComponentsCurrentPrincipalAccessor.cs | 23 ----- .../UserExceptionInformer.cs | 9 +- .../ComponentsCurrentTenantAccessor.cs | 11 --- .../ComponentsRemoteTenantStore.cs | 70 --------------- .../ComponentsRemoteTenantStoreCache.cs | 35 -------- .../ApplicationConfigurationCache.cs | 2 +- .../AbpBlazoriseModule.cs | 7 +- .../Volo.Abp.BlazoriseUI.csproj | 2 + .../AbpBlazorServerDemo.csproj | 1 + .../AbpBlazorServerDemoModule.cs | 14 ++- .../AbpBlazorServerDemo/App.razor | 10 --- .../AbpBlazorServerDemo/Pages/_Host.cshtml | 1 + 18 files changed, 83 insertions(+), 359 deletions(-) create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.UI.BasicTheme/AbpAspNetCoreComponentsUIBasicThemeModule.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.UI.Theming/AbpAspNetCoreComponentsUiThemingModule.cs delete mode 100644 framework/src/Volo.Abp.AspNetCore.Components.UI/Microsoft/AspNetCore/Components/WebAssembly/Hosting/AbpComponentsBuilderExtensions.cs delete mode 100644 framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/ComponentsCachedApplicationConfigurationClient.cs delete mode 100644 framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/ComponentsCurrentPrincipalAccessor.cs delete mode 100644 framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/MultiTenancy/ComponentsCurrentTenantAccessor.cs delete mode 100644 framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/MultiTenancy/ComponentsRemoteTenantStore.cs delete mode 100644 framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/MultiTenancy/ComponentsRemoteTenantStoreCache.cs rename framework/src/{Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI => Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly}/ApplicationConfigurationCache.cs (90%) delete mode 100644 test/BlazorServerSide/AbpBlazorServerDemo/App.razor diff --git a/framework/src/Volo.Abp.AspNetCore.Components.UI.BasicTheme/AbpAspNetCoreComponentsUIBasicThemeModule.cs b/framework/src/Volo.Abp.AspNetCore.Components.UI.BasicTheme/AbpAspNetCoreComponentsUIBasicThemeModule.cs new file mode 100644 index 0000000000..3f35c1cbf3 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.UI.BasicTheme/AbpAspNetCoreComponentsUIBasicThemeModule.cs @@ -0,0 +1,13 @@ +using Volo.Abp.AspNetCore.Components.UI.Theming; +using Volo.Abp.Modularity; + +namespace Volo.Abp.AspNetCore.Components.UI.BasicTheme +{ + [DependsOn( + typeof(AbpAspNetCoreComponentsUiThemingModule) + )] + public class AbpAspNetCoreComponentsUiBasicThemeModule : AbpModule + { + + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Components.UI.Theming/AbpAspNetCoreComponentsUiThemingModule.cs b/framework/src/Volo.Abp.AspNetCore.Components.UI.Theming/AbpAspNetCoreComponentsUiThemingModule.cs new file mode 100644 index 0000000000..dc45937a6a --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.UI.Theming/AbpAspNetCoreComponentsUiThemingModule.cs @@ -0,0 +1,15 @@ +using Volo.Abp.BlazoriseUI; +using Volo.Abp.Modularity; +using Volo.Abp.UI.Navigation; + +namespace Volo.Abp.AspNetCore.Components.UI.Theming +{ + [DependsOn( + typeof(AbpBlazoriseUIModule), + typeof(AbpUiNavigationModule) + )] + public class AbpAspNetCoreComponentsUiThemingModule : AbpModule + { + + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Components.UI/Microsoft/AspNetCore/Components/WebAssembly/Hosting/AbpComponentsBuilderExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Components.UI/Microsoft/AspNetCore/Components/WebAssembly/Hosting/AbpComponentsBuilderExtensions.cs deleted file mode 100644 index 8d5512899f..0000000000 --- a/framework/src/Volo.Abp.AspNetCore.Components.UI/Microsoft/AspNetCore/Components/WebAssembly/Hosting/AbpComponentsBuilderExtensions.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Globalization; -using System.Runtime.CompilerServices; -using System.Threading.Tasks; -using JetBrains.Annotations; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp; -using Volo.Abp.AspNetCore.Components.UI; -using Volo.Abp.AspNetCore.Components.UI.DependencyInjection; -using Volo.Abp.AspNetCore.Mvc.Client; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Modularity; - -namespace Microsoft.AspNetCore.Components.UI.Hosting -{ - public static class AbpComponentsBuilderExtensions - { - //public static IAbpApplicationWithExternalServiceProvider AddApplication( - // [NotNull] this IServiceCollection services - // /*Action options*/) - // where TStartupModule : IAbpModule - //{ - // Check.NotNull(services, nameof(services)); - - // // Related this commit(https://github.com/dotnet/aspnetcore/commit/b99d805bc037fcac56afb79abeb7d5a43141c85e) - // // Microsoft.AspNetCore.Blazor.BuildTools has been removed in net 5.0. - // // This call may be removed when we find a suitable solution. - // // System.Runtime.CompilerServices.AsyncStateMachineAttribute - // Castle.DynamicProxy.Generators.AttributesToAvoidReplicating.Add(); - - // services.AddSingleton(builder.Configuration); - // services.AddSingleton(builder); - - // var application = services.AddApplication(opts => - // { - // options?.Invoke(new AbpAspNetCoreApplicationCreationOptions(builder, opts)); - // }); - - // return application; - //} - - public static async Task InitializeAsync( - [NotNull] this IAbpApplicationWithExternalServiceProvider application, - [NotNull] IServiceProvider serviceProvider) - { - Check.NotNull(application, nameof(application)); - Check.NotNull(serviceProvider, nameof(serviceProvider)); - - var serviceProviderAccessor = (ComponentsClientScopeServiceProviderAccessor) - serviceProvider.GetRequiredService(); - serviceProviderAccessor.ServiceProvider = serviceProvider; - - application.Initialize(serviceProvider); - - using (var scope = serviceProvider.CreateScope()) - { - await InitializeModulesAsync(scope.ServiceProvider); - await SetCurrentLanguageAsync(scope); - } - } - - private static async Task InitializeModulesAsync(IServiceProvider serviceProvider) - { - foreach (var service in serviceProvider.GetServices()) - { - await service.InitializeAsync(); - } - } - - private static async Task SetCurrentLanguageAsync(IServiceScope scope) - { - var configurationClient = scope.ServiceProvider.GetRequiredService(); - var utilsService = scope.ServiceProvider.GetRequiredService(); - var configuration = configurationClient.Get(); - var cultureName = configuration.Localization?.CurrentCulture?.CultureName; - if (!cultureName.IsNullOrEmpty()) - { - var culture = new CultureInfo(cultureName); - CultureInfo.DefaultThreadCurrentCulture = culture; - CultureInfo.DefaultThreadCurrentUICulture = culture; - } - - if (CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft) - { - await utilsService.AddClassToTagAsync("body", "rtl"); - } - } - } -} diff --git a/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo.Abp.AspNetCore.Components.UI.csproj b/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo.Abp.AspNetCore.Components.UI.csproj index e2fad1891a..89205fefb9 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo.Abp.AspNetCore.Components.UI.csproj +++ b/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo.Abp.AspNetCore.Components.UI.csproj @@ -16,7 +16,6 @@ - @@ -26,9 +25,5 @@ - - - - - + diff --git a/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/AbpAspNetCoreComponentsUIModule.cs b/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/AbpAspNetCoreComponentsUIModule.cs index 5e44d6b09e..87b70ae1cb 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/AbpAspNetCoreComponentsUIModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/AbpAspNetCoreComponentsUIModule.cs @@ -1,41 +1,30 @@ -//using Microsoft.AspNetCore.Components; -//using Microsoft.Extensions.DependencyInjection; -//using Microsoft.Extensions.DependencyInjection.Extensions; -//using Microsoft.Extensions.Logging; -//using Volo.Abp.AspNetCore.Components.DependencyInjection; -//using Volo.Abp.AspNetCore.Components.UI.ExceptionHandling; -//using Volo.Abp.AspNetCore.Mvc.Client; -//using Volo.Abp.Http.Client; -//using Volo.Abp.Modularity; -//using Volo.Abp.UI; +using Microsoft.AspNetCore.Components; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; +using Volo.Abp.AspNetCore.Components.DependencyInjection; +using Volo.Abp.Modularity; +using Volo.Abp.UI; -//namespace Volo.Abp.AspNetCore.Components.UI -//{ -// [DependsOn( -// typeof(AbpAspNetCoreMvcClientCommonModule), -// typeof(AbpUiModule), -// typeof(AbpAspNetCoreComponentsModule) -// )] -// public class AbpAspNetCoreComponentsUIModule : AbpModule -// { -// public override void PreConfigureServices(ServiceConfigurationContext context) -// { -// PreConfigure(options => -// { -// options.ProxyClientBuildActions.Add((_, builder) => -// { -// builder.AddHttpMessageHandler(); -// }); -// }); -// } +namespace Volo.Abp.AspNetCore.Components.UI +{ + [DependsOn( + typeof(AbpUiModule), + typeof(AbpAspNetCoreComponentsModule) + )] + public class AbpAspNetCoreComponentsUIModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { -// public override void ConfigureServices(ServiceConfigurationContext context) -// { -// context.Services.Replace(ServiceDescriptor.Transient()); + } -// //context.Services -// // .GetHostBuilder().Logging -// // .AddProvider(new AbpExceptionHandlingLoggerProvider(context.Services)); -// } -// } -//} + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.Replace(ServiceDescriptor.Transient()); + + //context.Services + // .GetHostBuilder().Logging + // .AddProvider(new AbpExceptionHandlingLoggerProvider(context.Services)); + } + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/ComponentsCachedApplicationConfigurationClient.cs b/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/ComponentsCachedApplicationConfigurationClient.cs deleted file mode 100644 index 807e759e96..0000000000 --- a/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/ComponentsCachedApplicationConfigurationClient.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System.Threading.Tasks; -using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; -using Volo.Abp.AspNetCore.Mvc.Client; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Http.Client.DynamicProxying; -using Volo.Abp.MultiTenancy; - -namespace Volo.Abp.AspNetCore.Components.UI -{ - [ExposeServices( - typeof(ComponentsCachedApplicationConfigurationClient), - typeof(ICachedApplicationConfigurationClient), - typeof(IAsyncInitialize) - )] - public class ComponentsCachedApplicationConfigurationClient : ICachedApplicationConfigurationClient, ITransientDependency - { - protected IHttpClientProxy Proxy { get; } - - protected ApplicationConfigurationCache Cache { get; } - - protected ICurrentTenantAccessor CurrentTenantAccessor { get; } - - public ComponentsCachedApplicationConfigurationClient( - IHttpClientProxy proxy, - ApplicationConfigurationCache cache, - ICurrentTenantAccessor currentTenantAccessor) - { - Proxy = proxy; - Cache = cache; - CurrentTenantAccessor = currentTenantAccessor; - } - - public virtual async Task InitializeAsync() - { - var configurationDto = await Proxy.Service.GetAsync(); - - Cache.Set(configurationDto); - - CurrentTenantAccessor.Current = new BasicTenantInfo( - configurationDto.CurrentTenant.Id, - configurationDto.CurrentTenant.Name - ); - } - - public virtual Task GetAsync() - { - return Task.FromResult(GetConfigurationByChecking()); - } - - public virtual ApplicationConfigurationDto Get() - { - return GetConfigurationByChecking(); - } - - private ApplicationConfigurationDto GetConfigurationByChecking() - { - var configuration = Cache.Get(); - if (configuration == null) - { - throw new AbpException( - $"{nameof(ComponentsCachedApplicationConfigurationClient)} should be initialized before using it."); - } - - return configuration; - } - } -} diff --git a/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/ComponentsCurrentPrincipalAccessor.cs b/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/ComponentsCurrentPrincipalAccessor.cs deleted file mode 100644 index 234d318a7d..0000000000 --- a/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/ComponentsCurrentPrincipalAccessor.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Security.Claims; -using Volo.Abp.AspNetCore.Components.UI.Security; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Security.Claims; - -namespace Volo.Abp.AspNetCore.Components.UI -{ - public class ComponentsCurrentPrincipalAccessor : CurrentPrincipalAccessorBase, ITransientDependency - { - protected AbpComponentsClaimsCache ClaimsCache { get; } - - public ComponentsCurrentPrincipalAccessor( - AbpComponentsClaimsCache claimsCache) - { - ClaimsCache = claimsCache; - } - - protected override ClaimsPrincipal GetClaimsPrincipal() - { - return ClaimsCache.Principal; - } - } -} diff --git a/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/ExceptionHandling/UserExceptionInformer.cs b/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/ExceptionHandling/UserExceptionInformer.cs index bd106f23ef..29f989cb8a 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/ExceptionHandling/UserExceptionInformer.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/ExceptionHandling/UserExceptionInformer.cs @@ -5,7 +5,6 @@ using Volo.Abp.AspNetCore.Components.Messages; using Volo.Abp.AspNetCore.ExceptionHandling; using Volo.Abp.DependencyInjection; using Volo.Abp.Http; -using Volo.Abp.Http.Client; namespace Volo.Abp.AspNetCore.Components.UI.ExceptionHandling { @@ -41,10 +40,10 @@ namespace Volo.Abp.AspNetCore.Components.UI.ExceptionHandling protected virtual RemoteServiceErrorInfo GetErrorInfo(UserExceptionInformerContext context) { - if (context.Exception is AbpRemoteCallException remoteCallException) - { - return remoteCallException.Error; - } + // if (context.Exception is AbpRemoteCallException remoteCallException) + // { + // return remoteCallException.Error; + // } return ExceptionToErrorInfoConverter.Convert(context.Exception, false); } diff --git a/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/MultiTenancy/ComponentsCurrentTenantAccessor.cs b/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/MultiTenancy/ComponentsCurrentTenantAccessor.cs deleted file mode 100644 index c344380976..0000000000 --- a/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/MultiTenancy/ComponentsCurrentTenantAccessor.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Volo.Abp.DependencyInjection; -using Volo.Abp.MultiTenancy; - -namespace Volo.Abp.AspNetCore.Components.UI.MultiTenancy -{ - [Dependency(ReplaceServices = true)] - public class ComponentsCurrentTenantAccessor : ICurrentTenantAccessor, ISingletonDependency - { - public BasicTenantInfo Current { get; set; } - } -} diff --git a/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/MultiTenancy/ComponentsRemoteTenantStore.cs b/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/MultiTenancy/ComponentsRemoteTenantStore.cs deleted file mode 100644 index adb85f4235..0000000000 --- a/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/MultiTenancy/ComponentsRemoteTenantStore.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using System.Threading.Tasks; -using Volo.Abp.AspNetCore.Mvc.MultiTenancy; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Http.Client.DynamicProxying; -using Volo.Abp.MultiTenancy; -using Volo.Abp.Threading; - -namespace Volo.Abp.AspNetCore.Components.UI.MultiTenancy -{ - public class ComponentsRemoteTenantStore : ITenantStore, ITransientDependency - { - protected IHttpClientProxy Proxy { get; } - protected ComponentsRemoteTenantStoreCache Cache { get; } - - public ComponentsRemoteTenantStore( - IHttpClientProxy proxy, - ComponentsRemoteTenantStoreCache cache) - { - Proxy = proxy; - Cache = cache; - } - - public async Task FindAsync(string name) - { - var cached = Cache.Find(name); - if (cached != null) - { - return cached; - } - - var tenant = CreateTenantConfiguration(await Proxy.Service.FindTenantByNameAsync(name)); - Cache.Set(tenant); - return tenant; - } - - public async Task FindAsync(Guid id) - { - var cached = Cache.Find(id); - if (cached != null) - { - return cached; - } - - var tenant = CreateTenantConfiguration(await Proxy.Service.FindTenantByIdAsync(id)); - Cache.Set(tenant); - return tenant; - } - - public TenantConfiguration Find(string name) - { - return AsyncHelper.RunSync(() => FindAsync(name)); - } - - public TenantConfiguration Find(Guid id) - { - return AsyncHelper.RunSync(() => FindAsync(id)); - } - - protected virtual TenantConfiguration CreateTenantConfiguration(FindTenantResultDto tenantResultDto) - { - if (!tenantResultDto.Success || tenantResultDto.TenantId == null) - { - return null; - } - - return new TenantConfiguration(tenantResultDto.TenantId.Value, tenantResultDto.Name); - } - } -} diff --git a/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/MultiTenancy/ComponentsRemoteTenantStoreCache.cs b/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/MultiTenancy/ComponentsRemoteTenantStoreCache.cs deleted file mode 100644 index 00c240e03b..0000000000 --- a/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/MultiTenancy/ComponentsRemoteTenantStoreCache.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Volo.Abp.DependencyInjection; -using Volo.Abp.MultiTenancy; - -namespace Volo.Abp.AspNetCore.Components.UI.MultiTenancy -{ - public class ComponentsRemoteTenantStoreCache : IScopedDependency - { - protected readonly List CachedTenants = new List(); - - public virtual TenantConfiguration Find(string name) - { - return CachedTenants.FirstOrDefault(t => t.Name == name); - } - - public virtual TenantConfiguration Find(Guid id) - { - return CachedTenants.FirstOrDefault(t => t.Id == id); - } - - public virtual void Set(TenantConfiguration tenant) - { - var existingTenant = Find(tenant.Id); - if (existingTenant != null) - { - existingTenant.Name = tenant.Name; - return; - } - - CachedTenants.Add(tenant); - } - } -} diff --git a/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/ApplicationConfigurationCache.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/ApplicationConfigurationCache.cs similarity index 90% rename from framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/ApplicationConfigurationCache.cs rename to framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/ApplicationConfigurationCache.cs index 3e83044c21..ffbcf4e973 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.UI/Volo/Abp/AspNetCore/Components/UI/ApplicationConfigurationCache.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/ApplicationConfigurationCache.cs @@ -1,7 +1,7 @@ using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; using Volo.Abp.DependencyInjection; -namespace Volo.Abp.AspNetCore.Components.UI +namespace Volo.Abp.AspNetCore.Components.WebAssembly { public class ApplicationConfigurationCache : ISingletonDependency { diff --git a/framework/src/Volo.Abp.BlazoriseUI/AbpBlazoriseModule.cs b/framework/src/Volo.Abp.BlazoriseUI/AbpBlazoriseModule.cs index 3e83f784cd..6b21b5c870 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/AbpBlazoriseModule.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/AbpBlazoriseModule.cs @@ -1,13 +1,16 @@ using Blazorise; using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AspNetCore.Components; +using Volo.Abp.Application; using Volo.Abp.AspNetCore.Components.UI; +using Volo.Abp.Authorization; using Volo.Abp.Modularity; namespace Volo.Abp.BlazoriseUI { [DependsOn( - typeof(AbpAspNetCoreComponentsModule) + typeof(AbpAspNetCoreComponentsUIModule), + typeof(AbpDddApplicationContractsModule), + typeof(AbpAuthorizationModule) )] public class AbpBlazoriseUIModule : AbpModule { diff --git a/framework/src/Volo.Abp.BlazoriseUI/Volo.Abp.BlazoriseUI.csproj b/framework/src/Volo.Abp.BlazoriseUI/Volo.Abp.BlazoriseUI.csproj index f2ef147188..acc021cf75 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Volo.Abp.BlazoriseUI.csproj +++ b/framework/src/Volo.Abp.BlazoriseUI/Volo.Abp.BlazoriseUI.csproj @@ -9,6 +9,8 @@ + + diff --git a/test/BlazorServerSide/AbpBlazorServerDemo/AbpBlazorServerDemo.csproj b/test/BlazorServerSide/AbpBlazorServerDemo/AbpBlazorServerDemo.csproj index 0b47b4b837..2ae68afb25 100644 --- a/test/BlazorServerSide/AbpBlazorServerDemo/AbpBlazorServerDemo.csproj +++ b/test/BlazorServerSide/AbpBlazorServerDemo/AbpBlazorServerDemo.csproj @@ -14,6 +14,7 @@ + diff --git a/test/BlazorServerSide/AbpBlazorServerDemo/AbpBlazorServerDemoModule.cs b/test/BlazorServerSide/AbpBlazorServerDemo/AbpBlazorServerDemoModule.cs index 0fa053a616..ea967a0d61 100644 --- a/test/BlazorServerSide/AbpBlazorServerDemo/AbpBlazorServerDemoModule.cs +++ b/test/BlazorServerSide/AbpBlazorServerDemo/AbpBlazorServerDemoModule.cs @@ -5,11 +5,13 @@ using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Volo.Abp; +using Volo.Abp.AspNetCore.Components.UI.BasicTheme; using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; using Volo.Abp.Autofac; using Volo.Abp.BlazoriseUI; using Volo.Abp.Modularity; +using Volo.Abp.AspNetCore.Components.UI.Theming.Routing; namespace AbpBlazorServerDemo { @@ -17,13 +19,15 @@ namespace AbpBlazorServerDemo typeof(AbpAutofacModule), typeof(AbpAspNetCoreMvcModule), typeof(AbpAspNetCoreMvcUiBasicThemeModule), - typeof(AbpBlazoriseUIModule) + typeof(AbpBlazoriseUIModule), + typeof(AbpAspNetCoreComponentsUiBasicThemeModule) )] public class AbpBlazorServerDemoModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { ConfigureBlazorise(context); + ConfigureRouter(context); context.Services.AddServerSideBlazor(); context.Services.AddSingleton(); } @@ -34,6 +38,14 @@ namespace AbpBlazorServerDemo .AddBootstrapProviders() .AddFontAwesomeIcons(); } + + private void ConfigureRouter(ServiceConfigurationContext context) + { + Configure(options => + { + options.AppAssembly = typeof(AbpBlazorServerDemoModule).Assembly; + }); + } public override void OnApplicationInitialization(ApplicationInitializationContext context) { diff --git a/test/BlazorServerSide/AbpBlazorServerDemo/App.razor b/test/BlazorServerSide/AbpBlazorServerDemo/App.razor deleted file mode 100644 index 3a2af53024..0000000000 --- a/test/BlazorServerSide/AbpBlazorServerDemo/App.razor +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -

Sorry, there's nothing at this address.

-
-
-
diff --git a/test/BlazorServerSide/AbpBlazorServerDemo/Pages/_Host.cshtml b/test/BlazorServerSide/AbpBlazorServerDemo/Pages/_Host.cshtml index 093a8b5cd7..a1fd72bec6 100644 --- a/test/BlazorServerSide/AbpBlazorServerDemo/Pages/_Host.cshtml +++ b/test/BlazorServerSide/AbpBlazorServerDemo/Pages/_Host.cshtml @@ -1,4 +1,5 @@ @page "/" +@using Volo.Abp.AspNetCore.Components.UI.BasicTheme.Themes.Basic @namespace AbpBlazorServerDemo.Pages @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @{