Browse Source
Merge pull request #25341 from abpframework/auto-merge/rel-10-2/4531
Merge branch rel-10.3 with rel-10.2
pull/25342/head
Volosoft Agent
3 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
22 additions and
3 deletions
-
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Bundling/AbpScripts.razor
-
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Bundling/AbpStyles.razor
-
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Bundling/ComponentBundleUrlBuilder.cs
-
framework/test/Volo.Abp.AspNetCore.Components.Web.Theming.Tests/Volo/Abp/AspNetCore/Components/Web/Theming/Bundling/ComponentBundleUrlBuilder_Tests.cs
|
|
|
@ -45,7 +45,7 @@ |
|
|
|
{ |
|
|
|
if (OperatingSystem.IsBrowser() && WebAssemblyScriptFiles != null) |
|
|
|
{ |
|
|
|
ScriptFiles = WebAssemblyScriptFiles; |
|
|
|
ScriptFiles = await ResolveAsync(WebAssemblyScriptFiles); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -46,7 +46,7 @@ |
|
|
|
StyleFiles = scriptFiles; |
|
|
|
if (OperatingSystem.IsBrowser() && StyleFiles != null && WebAssemblyStyleFiles != null) |
|
|
|
{ |
|
|
|
StyleFiles.AddIfNotContains(WebAssemblyStyleFiles); |
|
|
|
StyleFiles.AddIfNotContains(await ResolveAsync(WebAssemblyStyleFiles)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -59,7 +59,7 @@ |
|
|
|
{ |
|
|
|
_hasRemoveServerStyle = true; |
|
|
|
await Task.Delay(3000); |
|
|
|
StyleFiles = WebAssemblyStyleFiles; |
|
|
|
StyleFiles = await ResolveAsync(WebAssemblyStyleFiles); |
|
|
|
StateHasChanged(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -34,6 +34,11 @@ public class ComponentBundleUrlBuilder : IComponentBundleUrlBuilder, ITransientD |
|
|
|
return Task.FromResult(fileName); |
|
|
|
} |
|
|
|
|
|
|
|
if (fileName.StartsWith(normalized, StringComparison.Ordinal)) |
|
|
|
{ |
|
|
|
return Task.FromResult(fileName); |
|
|
|
} |
|
|
|
|
|
|
|
return Task.FromResult(normalized + fileName.RemovePreFix("/")); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -102,4 +102,18 @@ public class ComponentBundleUrlBuilder_Tests |
|
|
|
(await _builder.BuildAsync("/__bundles/Global.css", appBasePath: " ", navigationBaseUri: "https://localhost/foo/")) |
|
|
|
.ShouldBe("/foo/__bundles/Global.css"); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public async Task Should_Be_Idempotent_For_Already_Prefixed_FileName() |
|
|
|
{ |
|
|
|
(await _builder.BuildAsync("/foo/__bundles/Global.css", appBasePath: "/foo", navigationBaseUri: null)) |
|
|
|
.ShouldBe("/foo/__bundles/Global.css"); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public async Task Should_Be_Idempotent_When_PathBase_Resolved_From_NavigationBaseUri() |
|
|
|
{ |
|
|
|
(await _builder.BuildAsync("/foo/__bundles/Global.css", appBasePath: null, navigationBaseUri: "https://localhost/foo/")) |
|
|
|
.ShouldBe("/foo/__bundles/Global.css"); |
|
|
|
} |
|
|
|
} |
|
|
|
|