diff --git a/.github/workflows/admin-sample.cd.yml b/.github/workflows/admin-sample.cd.yml index 85dd1d8159..01b756685f 100644 --- a/.github/workflows/admin-sample.cd.yml +++ b/.github/workflows/admin-sample.cd.yml @@ -120,11 +120,6 @@ jobs: - name: Install wasm run: cd src && dotnet workload install wasm-tools - - name: Enable WebInteropApp route - run: | - # Uncomment the Route attribute for WebInteropApp component as noted in the WebInteropApp.razor's comments - sed -i 's/@\* @attribute \[Route("web-interop-app")\] \*@/@attribute [Route("web-interop-app")]/' AdminPanel/src/Client/AdminPanel.Client.Core/Components/WebInteropApp.razor - - name: Generate CSS/JS files run: dotnet build AdminPanel/src/Client/AdminPanel.Client.Core/AdminPanel.Client.Core.csproj -t:BeforeBuildTasks -p:Version="${{ vars.APP_VERSION}}" --no-restore -c Release diff --git a/.github/workflows/todo-sample.cd.yml b/.github/workflows/todo-sample.cd.yml index f1d68f1d1f..5fad567a66 100644 --- a/.github/workflows/todo-sample.cd.yml +++ b/.github/workflows/todo-sample.cd.yml @@ -151,11 +151,6 @@ jobs: - name: Install wasm run: cd src && dotnet workload install wasm-tools - - name: Enable WebInteropApp route - run: | - # Uncomment the Route attribute for WebInteropApp component as noted in the WebInteropApp.razor's comments - sed -i 's/@\* @attribute \[Route("web-interop-app")\] \*@/@attribute [Route("web-interop-app")]/' TodoSample/src/Client/TodoSample.Client.Core/Components/WebInteropApp.razor - - name: Generate CSS/JS files run: dotnet build TodoSample/src/Client/TodoSample.Client.Core/TodoSample.Client.Core.csproj -t:BeforeBuildTasks -p:Version="${{ vars.APP_VERSION}}" --no-restore -c Release @@ -203,11 +198,6 @@ jobs: - name: Install wasm run: cd src && dotnet workload install wasm-tools - - name: Enable WebInteropApp route - run: | - # Uncomment the Route attribute for WebInteropApp component as noted in the WebInteropApp.razor's comments - sed -i 's/@\* @attribute \[Route("web-interop-app")\] \*@/@attribute [Route("web-interop-app")]/' TodoSample/src/Client/TodoSample.Client.Core/Components/WebInteropApp.razor - - name: Configure bswup # Always AlwaysPrerender is the last item, so overriding it has the desired effect run: | sed -i "s/\/\/ self.mode = 'AlwaysPrerender'/self.mode = 'FullOffline'/g" TodoSample/src/Client/TodoSample.Client.Web/wwwroot/service-worker.published.js @@ -259,11 +249,6 @@ jobs: - name: Install wasm run: cd src && dotnet workload install wasm-tools - - name: Enable WebInteropApp route - run: | - # Uncomment the Route attribute for WebInteropApp component as noted in the WebInteropApp.razor's comments - sed -i 's/@\* @attribute \[Route("web-interop-app")\] \*@/@attribute [Route("web-interop-app")]/' TodoSample/src/Client/TodoSample.Client.Core/Components/WebInteropApp.razor - - name: Generate CSS/JS files run: dotnet build TodoSample/src/Client/TodoSample.Client.Core/TodoSample.Client.Core.csproj -t:BeforeBuildTasks -p:Version="${{ vars.APP_VERSION}}" --no-restore -c Release diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Scripts/WebInteropApp.ts b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Scripts/WebInteropApp.ts index f0b16458eb..aa747d0590 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Scripts/WebInteropApp.ts +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Scripts/WebInteropApp.ts @@ -1,4 +1,4 @@ -// Read Components/WebInteropApp.razor comments. +// Read Client.web/wwwroot/web-interop-app.html comments. declare class BitButil { static webAuthn: { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/Contracts/IExternalNavigationService.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/Contracts/IExternalNavigationService.cs index 1b2b63d5b8..d2ffe4befa 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/Contracts/IExternalNavigationService.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/Contracts/IExternalNavigationService.cs @@ -1,6 +1,6 @@ namespace Boilerplate.Client.Core.Services.Contracts; -// Check out WebInteropApp.razor's comments. +// Check out Client.web/wwwroot/web-interop-app.html's comments. public interface IExternalNavigationService { Task NavigateToAsync(string url); diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Boilerplate.Client.Maui.csproj b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Boilerplate.Client.Maui.csproj index 46ee91df1c..6fc8bc7a34 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Boilerplate.Client.Maui.csproj +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Boilerplate.Client.Maui.csproj @@ -119,6 +119,10 @@ + + PreserveNewest + + diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiLocalHttpServer.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiLocalHttpServer.cs index 2d9fdf3fe8..cb6ab8791d 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiLocalHttpServer.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiLocalHttpServer.cs @@ -8,10 +8,9 @@ namespace Boilerplate.Client.Maui.Services; -// Checkout WebInteropApp.razor's comments. +// Checkout Client.web/wwwroot/web-interop-app.html's comments. public partial class MauiLocalHttpServer : ILocalHttpServer { - [AutoInject] private HtmlRenderer htmlRenderer; [AutoInject] private PubSubService pubSubService; [AutoInject] private IExceptionHandler exceptionHandler; @@ -143,13 +142,6 @@ await MainThread.InvokeOnMainThreadAsync(() => await GoBackToApp(); })) - .WithModule(new ActionModule("/web-interop-app", HttpVerbs.Get, async ctx => - { - var html = await htmlRenderer.Dispatcher.InvokeAsync(async () => - (await htmlRenderer.RenderComponentAsync()).ToHtmlString()); - - await ctx.SendStringAsync(html, "text/html", Encoding.UTF8); - })) .OnAny(async ctx => { var ctxImplementation = (IHttpContextImpl)ctx; diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiWebAuthnService.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiWebAuthnService.cs index 7d8e5e3978..43a1f68bf4 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiWebAuthnService.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiWebAuthnService.cs @@ -15,7 +15,7 @@ public override async ValueTask GetWebAuthnCredential(JsonElement o ((MauiLocalHttpServer)localHttpServer).WebAuthnService = this; - await externalNavigationService.NavigateToAsync($"http://localhost:{localHttpServer.Port}/web-interop-app?actionName=GetWebAuthnCredential"); + await externalNavigationService.NavigateToAsync($"http://localhost:{localHttpServer.Port}/{PageUrls.WebInteropApp}?actionName=GetWebAuthnCredential"); return await GetWebAuthnCredentialTcs.Task; } @@ -30,7 +30,7 @@ public override async ValueTask CreateWebAuthnCredential(JsonElemen ((MauiLocalHttpServer)localHttpServer).WebAuthnService = this; - await externalNavigationService.NavigateToAsync($"http://localhost:{localHttpServer.Port}/web-interop-app?actionName=CreateWebAuthnCredential"); + await externalNavigationService.NavigateToAsync($"http://localhost:{localHttpServer.Port}/{PageUrls.WebInteropApp}?actionName=CreateWebAuthnCredential"); return await CreateWebAuthnCredentialTcs.Task; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js index 4fa84656da..b4b2b2153b 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js @@ -97,7 +97,7 @@ self.serverHandledUrls = [ /\/products.xml/, //#endif /\/sitemap_index.xml/, - /\/web-interop-app/ + /\/web-interop-app.html/ ]; // self.mode = 'FullOffline'; // Traditional PWA app that **first** downloads all assets and **then** runs the app. diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/WebInteropApp.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/web-interop-app.html similarity index 83% rename from src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/WebInteropApp.razor rename to src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/web-interop-app.html index 520ee3772a..f515d03d51 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/WebInteropApp.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/web-interop-app.html @@ -1,6 +1,4 @@ -@*+:cnd:noEmit*@ -@* -Most web features like animations, videos, or Google reCAPTCHA work fine in Blazor Hybrid. + @@ -86,7 +78,7 @@ animation: rotate-three 1s linear infinite; } - @@keyframes rotate-one { + @keyframes rotate-one { 0% { transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg); } @@ -96,7 +88,7 @@ } } - @@keyframes rotate-two { + @keyframes rotate-two { 0% { transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg); } @@ -106,7 +98,7 @@ } } - @@keyframes rotate-three { + @keyframes rotate-three { 0% { transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg); } @@ -116,15 +108,10 @@ } } - - @*#if (appInsights == true)*@ - - - - @*#endif*@ -
@Localizer[nameof(AppStrings.PleaseWait)]
+
Please wait
+
diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Boilerplate.Client.Windows.csproj b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Boilerplate.Client.Windows.csproj index 060b2e12e6..f4babaa16a 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Boilerplate.Client.Windows.csproj +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Boilerplate.Client.Windows.csproj @@ -49,6 +49,9 @@ PreserveNewest + + PreserveNewest + diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsLocalHttpServer.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsLocalHttpServer.cs index 6ef15864f6..b663e880b5 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsLocalHttpServer.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsLocalHttpServer.cs @@ -8,10 +8,9 @@ namespace Boilerplate.Client.Windows.Services; -// Checkout WebInteropApp.razor's comments. +// Checkout Client.web/wwwroot/web-interop-app.html's comments. public partial class WindowsLocalHttpServer : ILocalHttpServer { - [AutoInject] private HtmlRenderer htmlRenderer; [AutoInject] private PubSubService pubSubService; [AutoInject] private IExceptionHandler exceptionHandler; [AutoInject] private ClientWindowsSettings clientWindowsSettings; @@ -111,13 +110,6 @@ async Task GoBackToApp() await GoBackToApp(); })) - .WithModule(new ActionModule("/web-interop-app", HttpVerbs.Get, async ctx => - { - var html = await htmlRenderer.Dispatcher.InvokeAsync(async () => - (await htmlRenderer.RenderComponentAsync()).ToHtmlString()); - - await ctx.SendStringAsync(html, "text/html", Encoding.UTF8); - })) .OnAny(async ctx => { var ctxImplementation = (IHttpContextImpl)ctx; diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsWebAuthnService.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsWebAuthnService.cs index 40770c34b1..8d8f846c5b 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsWebAuthnService.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsWebAuthnService.cs @@ -16,7 +16,7 @@ public override async ValueTask GetWebAuthnCredential(JsonElement o ((WindowsLocalHttpServer)localHttpServer).WebAuthnService = this; - await externalNavigationService.NavigateToAsync($"http://localhost:{localHttpServer.Port}/web-interop-app?actionName=GetWebAuthnCredential"); + await externalNavigationService.NavigateToAsync($"http://localhost:{localHttpServer.Port}/{PageUrls.WebInteropApp}?actionName=GetWebAuthnCredential"); return await GetWebAuthnCredentialTcs.Task; } @@ -32,7 +32,7 @@ public override async ValueTask CreateWebAuthnCredential(JsonElemen ((WindowsLocalHttpServer)localHttpServer).WebAuthnService = this; - await externalNavigationService.NavigateToAsync($"http://localhost:{localHttpServer.Port}/web-interop-app?actionName=CreateWebAuthnCredential"); + await externalNavigationService.NavigateToAsync($"http://localhost:{localHttpServer.Port}/{PageUrls.WebInteropApp}?actionName=CreateWebAuthnCredential"); return await CreateWebAuthnCredentialTcs.Task; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.SocialSignIn.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.SocialSignIn.cs index e338aa6417..2791010560 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.SocialSignIn.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.SocialSignIn.cs @@ -99,10 +99,10 @@ public async Task SocialSignInCallback(string? returnUrl = null, i await Request.HttpContext.SignOutAsync(IdentityConstants.ExternalScheme); // We'll handle sign-in with the following redirects, so no external identity cookie is needed. } - var redirectRelativeUrl = $"web-interop-app?actionName=SocialSignInCallback&url={Uri.EscapeDataString(signInPageUri!)}&localHttpPort={localHttpPort}"; + var redirectRelativeUrl = $"{PageUrls.WebInteropApp}?actionName=SocialSignInCallback&url={Uri.EscapeDataString(signInPageUri!)}&localHttpPort={localHttpPort}"; if (localHttpPort is not null) - return Redirect(new Uri(new Uri($"http://localhost:{localHttpPort}"), redirectRelativeUrl).ToString()); // Check out WebInteropApp.razor's comments. + return Redirect(new Uri(new Uri($"http://localhost:{localHttpPort}"), redirectRelativeUrl).ToString()); // Check out Client.web/wwwroot/web-interop-app.html's comments. return Redirect(new Uri(Request.HttpContext.Request.GetWebAppUrl(), redirectRelativeUrl).ToString()); } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/appsettings.json b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/appsettings.json index 2dbba4a35a..e5c3334b0e 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/appsettings.json +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/appsettings.json @@ -16,8 +16,6 @@ //#if (filesStorage == "AzureBlobStorage") "azureblobstorage": "UseDevelopmentStorage=true", //#elif (filesStorage == "S3") - "smtp": "Endpoint=smtp://smtp.ethereal.email:587;UserName=madisen7@ethereal.email;Password=QYcYfjBXjqxMAZfZya", - "smtp_Comment": "You can also use https://ethereal.email/create for testing purposes.", "s3": "Endpoint=http://localhost:9000;AccessKey=minioadmin;SecretKey=minioadmin;", "s3__MinIOSample": "Endpoint=http://localhost:9000;AccessKey=minioadmin;SecretKey=minioadmin;", "s3__ContaboSample": "Endpoint=https://eu2.contabostorage.com;BucketName=files;Region=eu2;AccessKey=XXX;SecretKey=XXX;", @@ -25,6 +23,8 @@ "s3__DigitalOceanSample": "Endpoint=https://ams3.digitaloceanspaces.com;BucketName=myBucketName;Region=ams3;AccessKey=XXX;SecretKey=XXX;", "s3__CloudflareR2Sample": "Not supported yet: https://github.com/robinrodricks/FluentStorage/issues/114", //#endif + "smtp": "Endpoint=smtp://smtp.ethereal.email:587;UserName=madisen7@ethereal.email;Password=QYcYfjBXjqxMAZfZya", + "smtp_Comment": "You can also use https://ethereal.email/create for testing purposes.", "ConnectionStrings_Comment": "The ConnectionStrings section contains database connection strings used by the application." }, //#if (signalR == true) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Endpoints/WebInteropAppEndpoint.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Endpoints/WebInteropAppEndpoint.cs deleted file mode 100644 index ce4d8c3cc0..0000000000 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Endpoints/WebInteropAppEndpoint.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Boilerplate.Shared.Attributes; -using Boilerplate.Client.Core.Components; -using Microsoft.AspNetCore.Components.Web; - -namespace Boilerplate.Server.Web.Endpoints; - -public static partial class WebInteropAppEndpoint -{ - public static WebApplication UseWebInteropApp(this WebApplication app) - { - app.MapGet("/web-interop-app", [AppResponseCache(SharedMaxAge = 3600 * 24 * 7, MaxAge = 60 * 5)] async ([FromServices] HtmlRenderer renderer, HttpContext context) => - { - // For more details, Check out WebInteropApp's comments. - var html = await renderer.Dispatcher.InvokeAsync(async () => - (await renderer.RenderComponentAsync()).ToHtmlString()); - return Results.Content(html, "text/html"); - }).CacheOutput("AppResponseCachePolicy").WithTags("WebInteropApp"); - - return app; - } -} diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs index 0b65a163e8..e6dfad17a4 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs @@ -14,7 +14,6 @@ using Boilerplate.Server.Api.Filters; using Boilerplate.Server.Api.Services; //#endif -using Boilerplate.Server.Web.Endpoints; namespace Boilerplate.Server.Web; @@ -155,7 +154,6 @@ public static void ConfigureMiddlewares(this WebApplication app) //#endif app.UseSiteMap(); - app.UseWebInteropApp(); // Handle the rest of requests with blazor var blazorApp = app.MapRazorComponents() diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/PageUrls.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/PageUrls.cs index d6adcb67ce..1fc6c9f9ea 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/PageUrls.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/PageUrls.cs @@ -44,4 +44,6 @@ public static partial class PageUrls //#if (offlineDb == true) public const string OfflineDatabaseDemo = "/offline-database-demo"; //#endif + + public const string WebInteropApp = "/web-interop-app.html"; }