From f63328aeb9f9e134a42bf1e9b45dec9d3bf59589 Mon Sep 17 00:00:00 2001 From: DavidEggenberger Date: Fri, 8 Mar 2024 22:28:23 +0100 Subject: [PATCH] call ModulesMiddleware from sharedFeaturesMiddleware --- ModularMonolith.sln | 2 +- .../Application/Commands/RemoveUserFromTenant.cs | 1 - .../Components/Modals/DefaultModalOptions.cs | 6 ++++++ .../Modals/DeletionReassuranceModal.razor | 1 + Source/Shared/Client/wwwroot/background.png | Bin 378 -> 0 bytes Source/Shared/Client/wwwroot/exampleJsInterop.js | 6 ------ .../Shared/Features/CQRS/Query/IQueryHandler.cs | 4 +--- Source/Shared/Features/Modules/Registrator.cs | 2 +- Source/Shared/Features/Registrator.cs | 4 +++- .../ExecutionContext/ServerExecutionContext.cs | 4 ---- Source/Web/Server/Startup.cs | 5 +---- 11 files changed, 14 insertions(+), 21 deletions(-) create mode 100644 Source/Shared/Client/Components/Modals/DefaultModalOptions.cs create mode 100644 Source/Shared/Client/Components/Modals/DeletionReassuranceModal.razor delete mode 100644 Source/Shared/Client/wwwroot/background.png delete mode 100644 Source/Shared/Client/wwwroot/exampleJsInterop.js diff --git a/ModularMonolith.sln b/ModularMonolith.sln index 9603f972..ecc191ce 100644 --- a/ModularMonolith.sln +++ b/ModularMonolith.sln @@ -45,7 +45,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Modules.Subscriptions.Integ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Web", "Web", "{079BF8CF-63EB-4836-ABB1-FD49B5EE5AD5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared.Client", "Source\Shared\Client\Shared.Client.csproj", "{FCC4866D-C903-4F2D-8A03-19AE86DA180B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shared.Client", "Source\Shared\Client\Shared.Client.csproj", "{FCC4866D-C903-4F2D-8A03-19AE86DA180B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Source/Modules/TenantIdentity/Features/DomainFeatures/TenantAggregate/Application/Commands/RemoveUserFromTenant.cs b/Source/Modules/TenantIdentity/Features/DomainFeatures/TenantAggregate/Application/Commands/RemoveUserFromTenant.cs index 6091e9e0..4aa6cbf6 100644 --- a/Source/Modules/TenantIdentity/Features/DomainFeatures/TenantAggregate/Application/Commands/RemoveUserFromTenant.cs +++ b/Source/Modules/TenantIdentity/Features/DomainFeatures/TenantAggregate/Application/Commands/RemoveUserFromTenant.cs @@ -1,6 +1,5 @@ using Modules.TenantIdentity.Features.Infrastructure.EFCore; using Shared.Features.CQRS.Command; -using Shared.Kernel.BuildingBlocks; using System.Threading; namespace Modules.TenantIdentity.Features.DomainFeatures.TenantAggregate.Application.Commands diff --git a/Source/Shared/Client/Components/Modals/DefaultModalOptions.cs b/Source/Shared/Client/Components/Modals/DefaultModalOptions.cs new file mode 100644 index 00000000..ddc607e2 --- /dev/null +++ b/Source/Shared/Client/Components/Modals/DefaultModalOptions.cs @@ -0,0 +1,6 @@ +namespace Shared.Client.Components.Modals +{ + public class DefaultModalOptions + { + } +} diff --git a/Source/Shared/Client/Components/Modals/DeletionReassuranceModal.razor b/Source/Shared/Client/Components/Modals/DeletionReassuranceModal.razor new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/Source/Shared/Client/Components/Modals/DeletionReassuranceModal.razor @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Source/Shared/Client/wwwroot/background.png b/Source/Shared/Client/wwwroot/background.png deleted file mode 100644 index e15a3bde6e2bdb380df6a0b46d7ed00bdeb0aaa8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 378 zcmeAS@N?(olHy`uVBq!ia0vp^x**KK1SGdsl%54rjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33 zJwr2>%=KS^ie7oTIEF;HpS|GCbyPusHSqiXaCu3qf)82(9Gq&mZq2{Kq}M*X&MWtJ zSi1Jo7ZzfImg%g=t(qo=wsSR2lZoP(Rj#3wacN=q0?Br(rXzgZEGK2$ID{|A=5S{xJEuzSH>!M+7wSY6hB<=-E^*n0W7 S8wY^CX7F_Nb6Mw<&;$S{dxtsz diff --git a/Source/Shared/Client/wwwroot/exampleJsInterop.js b/Source/Shared/Client/wwwroot/exampleJsInterop.js deleted file mode 100644 index ea8d76ad..00000000 --- a/Source/Shared/Client/wwwroot/exampleJsInterop.js +++ /dev/null @@ -1,6 +0,0 @@ -// This is a JavaScript module that is loaded on demand. It can export any number of -// functions, and may import other JavaScript modules if required. - -export function showPrompt(message) { - return prompt(message, 'Type anything here'); -} diff --git a/Source/Shared/Features/CQRS/Query/IQueryHandler.cs b/Source/Shared/Features/CQRS/Query/IQueryHandler.cs index d0faab23..ae0b6b39 100644 --- a/Source/Shared/Features/CQRS/Query/IQueryHandler.cs +++ b/Source/Shared/Features/CQRS/Query/IQueryHandler.cs @@ -1,6 +1,4 @@ -using Shared.Features.Server; - -namespace Shared.Features.CQRS.Query +namespace Shared.Features.CQRS.Query { public interface IQueryHandler where TQuery : IQuery { diff --git a/Source/Shared/Features/Modules/Registrator.cs b/Source/Shared/Features/Modules/Registrator.cs index c422022b..c9a90afa 100644 --- a/Source/Shared/Features/Modules/Registrator.cs +++ b/Source/Shared/Features/Modules/Registrator.cs @@ -33,7 +33,7 @@ public static void AddModules(this IServiceCollection services) services.RegisterCQRS(startupModules.Where(sm => sm.Startup.FeaturesAssembly is not null).Select(sm => sm.Startup.FeaturesAssembly).ToArray()); } - public static IApplicationBuilder UseModules(this IApplicationBuilder app, IHostEnvironment env) + public static IApplicationBuilder UseModulesMiddleware(this IApplicationBuilder app, IHostEnvironment env) { // Adds endpoints defined in modules var modules = app diff --git a/Source/Shared/Features/Registrator.cs b/Source/Shared/Features/Registrator.cs index d0ee5031..4ae5f5bb 100644 --- a/Source/Shared/Features/Registrator.cs +++ b/Source/Shared/Features/Registrator.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Shared.Features.CQRS; @@ -26,10 +27,11 @@ public static IServiceCollection AddSharedFeatures(this IServiceCollection servi return services; } - public static IApplicationBuilder UseSharedFeaturesMiddleware(this IApplicationBuilder app) + public static IApplicationBuilder UseSharedFeaturesMiddleware(this IApplicationBuilder app, IWebHostEnvironment env) { app.UseEFCoreMiddleware(); app.UseServerExecutionContextMiddleware(); + app.UseModulesMiddleware(env); return app; } diff --git a/Source/Shared/Features/Server/ExecutionContext/ServerExecutionContext.cs b/Source/Shared/Features/Server/ExecutionContext/ServerExecutionContext.cs index f486ac61..a5a8c5db 100644 --- a/Source/Shared/Features/Server/ExecutionContext/ServerExecutionContext.cs +++ b/Source/Shared/Features/Server/ExecutionContext/ServerExecutionContext.cs @@ -3,10 +3,6 @@ using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using Shared.Features.CQRS.Command; -using Shared.Features.CQRS.DomainEvent; -using Shared.Features.CQRS.IntegrationEvent; -using Shared.Features.CQRS.Query; using Shared.Kernel.BuildingBlocks; using Shared.Kernel.BuildingBlocks.Auth; using Shared.Kernel.Extensions.ClaimsPrincipal; diff --git a/Source/Web/Server/Startup.cs b/Source/Web/Server/Startup.cs index 31652a63..6928a9ab 100644 --- a/Source/Web/Server/Startup.cs +++ b/Source/Web/Server/Startup.cs @@ -10,7 +10,6 @@ using Shared.Features.Modules; using Shared.Features; using Modules.Subscription.Server; -using Shared.Features.Server.ExecutionContext; namespace Web.Server { @@ -67,9 +66,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseAuthorization(); app.UseBuildingBlocksMiddleware(); - app.UseSharedFeaturesMiddleware(); - - app.UseModules(env); + app.UseSharedFeaturesMiddleware(env); app.UseEndpoints(endpoints => {