From 5e84aee2084bdb1c174c69468d0054e0d2655505 Mon Sep 17 00:00:00 2001 From: Super Date: Fri, 21 Feb 2025 02:42:27 +0800 Subject: [PATCH 1/8] Remove the cache prefix configuration from the CmsKit module --- .../src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs index fd2984a3b4..8132202717 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs @@ -79,11 +79,6 @@ public class CmsKitPublicWebModule : AbpModule options.DisableModule(CmsKitPublicRemoteServiceConsts.ModuleName); }); - Configure(options => - { - options.KeyPrefix = "CmsKit:"; - }); - if (GlobalFeatureManager.Instance.IsEnabled()) { Configure(options => From f97e5d9747fe9ce2c98fda3a79aa8228751cb440 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Tue, 11 Mar 2025 14:57:56 +0800 Subject: [PATCH 2/8] Make Bundling system support MAUI Blazor --- Directory.Packages.props | 2 + build/common.ps1 | 5 + framework/Volo.Abp.sln | 15 ++ .../Volo.Abp.AspNetCore.Bundling.csproj | 19 ++ .../Bundling/AbpAspNetCoreBundlingModule.cs | 15 ++ .../Abp/AspNetCore}/Bundling/BundleCache.cs | 3 +- .../AspNetCore}/Bundling/BundleCacheItem.cs | 3 +- .../AspNetCore/Bundling/BundleManagerBase.cs | 248 ++++++++++++++++++ .../Abp/AspNetCore}/Bundling/BundleResult.cs | 2 +- .../Abp/AspNetCore}/Bundling/BundlerBase.cs | 14 +- .../AspNetCore}/Bundling/BundlerContext.cs | 2 +- .../Abp/AspNetCore}/Bundling/IBundleCache.cs | 2 +- .../AspNetCore}/Bundling/IBundleManager.cs | 3 +- .../Volo/Abp/AspNetCore}/Bundling/IBundler.cs | 4 +- .../AspNetCore}/Bundling/IBundlerContext.cs | 2 +- .../Bundling/Scripts/IScriptBundler.cs | 6 + .../Bundling/Styles/IStyleBundler.cs | 6 + ...tCoreComponentsMauiBlazorBundlingModule.cs | 106 ++++++++ .../AbpBlazorWebView.cs | 13 + .../BundleManager.cs | 125 +++++++++ .../IMauiBlazorContentFileProvide.cs | 8 + .../MauiBlazorBundlerBase.cs | 26 ++ .../MauiBlazorContentFileProvider.cs | 65 +++++ .../Scripts/ScriptBundler.cs | 28 ++ .../Styles/StyleBundler.cs | 40 +++ ...Core.Components.MauiBlazor.Bundling.csproj | 41 +++ .../BlazorServerComponentBundleManager.cs | 2 +- .../Bundling/AbpBundleContributorOptions.cs | 6 +- ...Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj | 1 + .../AbpAspNetCoreMvcUiBundlingModule.cs | 4 +- .../Mvc/UI/Bundling/BundleManager.cs | 233 ++-------------- .../Mvc/UI/Bundling/MvcUiBundlerBase.cs | 25 ++ .../Mvc/UI/Bundling/Scripts/IScriptBundler.cs | 6 - .../Mvc/UI/Bundling/Scripts/ScriptBundler.cs | 8 +- .../Mvc/UI/Bundling/Styles/IStyleBundler.cs | 6 - .../Mvc/UI/Bundling/Styles/StyleBundler.cs | 11 +- .../TagHelpers/AbpTagHelperResourceService.cs | 1 + .../TagHelpers/AbpTagHelperScriptService.cs | 1 + .../TagHelpers/AbpTagHelperStyleService.cs | 1 + nupkg/common.ps1 | 2 + 40 files changed, 861 insertions(+), 249 deletions(-) create mode 100644 framework/src/Volo.Abp.AspNetCore.Bundling/Volo.Abp.AspNetCore.Bundling.csproj create mode 100644 framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/AbpAspNetCoreBundlingModule.cs rename framework/src/{Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI => Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore}/Bundling/BundleCache.cs (88%) rename framework/src/{Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI => Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore}/Bundling/BundleCacheItem.cs (79%) create mode 100644 framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleManagerBase.cs rename framework/src/{Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI => Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore}/Bundling/BundleResult.cs (75%) rename framework/src/{Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI => Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore}/Bundling/BundlerBase.cs (93%) rename framework/src/{Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI => Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore}/Bundling/BundlerContext.cs (91%) rename framework/src/{Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI => Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore}/Bundling/IBundleCache.cs (78%) rename framework/src/{Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI => Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore}/Bundling/IBundleManager.cs (76%) rename framework/src/{Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI => Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore}/Bundling/IBundler.cs (58%) rename framework/src/{Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI => Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore}/Bundling/IBundlerContext.cs (81%) create mode 100644 framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/Scripts/IScriptBundler.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/Styles/IStyleBundler.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/AbpAspNetCoreComponentsMauiBlazorBundlingModule.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/AbpBlazorWebView.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/BundleManager.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/IMauiBlazorContentFileProvide.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/MauiBlazorBundlerBase.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/MauiBlazorContentFileProvider.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Scripts/ScriptBundler.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Styles/StyleBundler.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling.csproj rename framework/src/{Volo.Abp.AspNetCore.Mvc.UI.Bundling => Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions}/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpBundleContributorOptions.cs (93%) create mode 100644 framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/MvcUiBundlerBase.cs delete mode 100644 framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Scripts/IScriptBundler.cs delete mode 100644 framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Styles/IStyleBundler.cs diff --git a/Directory.Packages.props b/Directory.Packages.props index 2b76545050..5edba60ff5 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -61,6 +61,8 @@ + + diff --git a/build/common.ps1 b/build/common.ps1 index 85f18edb21..e2ba5c5566 100644 --- a/build/common.ps1 +++ b/build/common.ps1 @@ -23,6 +23,11 @@ $solutionPaths = @( "../modules/blob-storing-database" ) + # Remove MAUI related projects if not on Windows +if ($env:OS -ne "Windows_NT") { + dotnet sln ../framework/Volo.Abp.sln remove ../framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling.csproj +} + if ($full -eq "-f") { # List of additional solutions required for full build diff --git a/framework/Volo.Abp.sln b/framework/Volo.Abp.sln index c3ca5b63b2..c0454d3edf 100644 --- a/framework/Volo.Abp.sln +++ b/framework/Volo.Abp.sln @@ -470,6 +470,7 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Bundling", "src\Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Bundling\Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Bundling.csproj", "{2F9BA650-395C-4BE0-8CCB-9978E753562A}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling", "src\Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling\Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling.csproj", "{7ADB6D92-82CC-4A2A-8BCF-FC6C6308796D}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.BlobStoring.Google", "src\Volo.Abp.BlobStoring.Google\Volo.Abp.BlobStoring.Google.csproj", "{DEEB5200-BBF9-464D-9B7E-8FC035A27E94}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.BlobStoring.Google.Tests", "test\Volo.Abp.BlobStoring.Google.Tests\Volo.Abp.BlobStoring.Google.Tests.csproj", "{40FB8907-9CF7-44D0-8B5F-538AC6DAF8B9}" @@ -480,6 +481,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Sms.TencentCloud", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Sms.TencentCloud.Tests", "test\Volo.Abp.Sms.TencenCloud.Tests\Volo.Abp.Sms.TencentCloud.Tests.csproj", "{C753DDD6-5699-45F8-8669-08CE0BB816DE}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Bundling", "src\Volo.Abp.AspNetCore.Bundling\Volo.Abp.AspNetCore.Bundling.csproj", "{75AA8A90-B3F6-43DF-ADA7-0990DEF44E2C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling", "src\Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling\Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling.csproj", "{70720321-DED4-464F-B913-BDA5BBDD7982}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1434,6 +1439,14 @@ Global {C753DDD6-5699-45F8-8669-08CE0BB816DE}.Debug|Any CPU.Build.0 = Debug|Any CPU {C753DDD6-5699-45F8-8669-08CE0BB816DE}.Release|Any CPU.ActiveCfg = Release|Any CPU {C753DDD6-5699-45F8-8669-08CE0BB816DE}.Release|Any CPU.Build.0 = Release|Any CPU + {75AA8A90-B3F6-43DF-ADA7-0990DEF44E2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {75AA8A90-B3F6-43DF-ADA7-0990DEF44E2C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {75AA8A90-B3F6-43DF-ADA7-0990DEF44E2C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {75AA8A90-B3F6-43DF-ADA7-0990DEF44E2C}.Release|Any CPU.Build.0 = Release|Any CPU + {70720321-DED4-464F-B913-BDA5BBDD7982}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {70720321-DED4-464F-B913-BDA5BBDD7982}.Debug|Any CPU.Build.0 = Debug|Any CPU + {70720321-DED4-464F-B913-BDA5BBDD7982}.Release|Any CPU.ActiveCfg = Release|Any CPU + {70720321-DED4-464F-B913-BDA5BBDD7982}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1676,6 +1689,8 @@ Global {E50739A7-5E2F-4EB5-AEA9-554115CB9613} = {447C8A77-E5F0-4538-8687-7383196D04EA} {BE7109C5-7368-4688-8557-4A15D3F4776A} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} {C753DDD6-5699-45F8-8669-08CE0BB816DE} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {75AA8A90-B3F6-43DF-ADA7-0990DEF44E2C} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {70720321-DED4-464F-B913-BDA5BBDD7982} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5} diff --git a/framework/src/Volo.Abp.AspNetCore.Bundling/Volo.Abp.AspNetCore.Bundling.csproj b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo.Abp.AspNetCore.Bundling.csproj new file mode 100644 index 0000000000..2654005740 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo.Abp.AspNetCore.Bundling.csproj @@ -0,0 +1,19 @@ + + + + + + + net9.0 + enable + Nullable + + + + + + + + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/AbpAspNetCoreBundlingModule.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/AbpAspNetCoreBundlingModule.cs new file mode 100644 index 0000000000..5e4967719f --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/AbpAspNetCoreBundlingModule.cs @@ -0,0 +1,15 @@ +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.Minify; +using Volo.Abp.Modularity; +using Volo.Abp.VirtualFileSystem; + +namespace Volo.Abp.AspNetCore.Bundling; + +[DependsOn( + typeof(AbpAspNetCoreMvcUiBundlingAbstractionsModule), + typeof(AbpMinifyModule), + typeof(AbpVirtualFileSystemModule) +)] +public class AbpAspNetCoreBundlingModule : AbpModule +{ +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleCache.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleCache.cs similarity index 88% rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleCache.cs rename to framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleCache.cs index e00bc84d6c..5ade7fc088 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleCache.cs +++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleCache.cs @@ -1,9 +1,10 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; using Volo.Abp.DependencyInjection; -namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling; +namespace Volo.Abp.AspNetCore.Bundling; public class BundleCache : IBundleCache, ISingletonDependency { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleCacheItem.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleCacheItem.cs similarity index 79% rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleCacheItem.cs rename to framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleCacheItem.cs index f6830cbd74..f75f8b66db 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleCacheItem.cs +++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleCacheItem.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; -namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling; +namespace Volo.Abp.AspNetCore.Bundling; public class BundleCacheItem { diff --git a/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleManagerBase.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleManagerBase.cs new file mode 100644 index 0000000000..8563918113 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleManagerBase.cs @@ -0,0 +1,248 @@ +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Extensions.FileProviders; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using Microsoft.Extensions.Options; +using Volo.Abp.AspNetCore.Bundling.Scripts; +using Volo.Abp.AspNetCore.Bundling.Styles; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.VirtualFileSystem; + +namespace Volo.Abp.AspNetCore.Bundling; + +public abstract class BundleManagerBase : IBundleManager +{ + public ILogger Logger { get; set; } + + protected readonly AbpBundlingOptions Options; + protected readonly AbpBundleContributorOptions ContributorOptions; + protected readonly IScriptBundler ScriptBundler; + protected readonly IStyleBundler StyleBundler; + protected readonly IServiceProvider ServiceProvider; + protected readonly IDynamicFileProvider DynamicFileProvider; + protected readonly IBundleCache BundleCache; + + public BundleManagerBase( + IOptions options, + IOptions contributorOptions, + IScriptBundler scriptBundler, + IStyleBundler styleBundler, + IServiceProvider serviceProvider, + IDynamicFileProvider dynamicFileProvider, + IBundleCache bundleCache) + { + Options = options.Value; + ContributorOptions = contributorOptions.Value; + ScriptBundler = scriptBundler; + ServiceProvider = serviceProvider; + DynamicFileProvider = dynamicFileProvider; + BundleCache = bundleCache; + StyleBundler = styleBundler; + + Logger = NullLogger.Instance; + } + + public virtual async Task> GetStyleBundleFilesAsync(string bundleName) + { + return await GetBundleFilesAsync(Options.StyleBundles, bundleName, StyleBundler); + } + + public virtual async Task> GetScriptBundleFilesAsync(string bundleName) + { + return await GetBundleFilesAsync(Options.ScriptBundles, bundleName, ScriptBundler); + } + + protected virtual async Task> GetBundleFilesAsync(BundleConfigurationCollection bundles, + string bundleName, IBundler bundler) + { + var files = new List(); + + var contributors = GetContributors(bundles, bundleName); + var bundleFiles = await GetBundleFilesAsync(contributors); + var dynamicResources = await GetDynamicResourcesAsync(contributors); + + if (!IsBundlingEnabled()) + { + return bundleFiles.Union(dynamicResources).ToImmutableList(); + } + + var localBundleFiles = new List(); + foreach (var bundleFile in bundleFiles) + { + if (!bundleFile.IsExternalFile) + { + localBundleFiles.Add(bundleFile.FileName); + } + else + { + if (localBundleFiles.Count != 0) + { + files.AddRange(AddToBundleCache(bundleName, bundler, localBundleFiles).Files); + localBundleFiles.Clear(); + } + + files.Add(bundleFile); + } + } + + if (localBundleFiles.Count != 0) + { + files.AddRange(AddToBundleCache(bundleName, bundler, localBundleFiles).Files); + } + + return files.Union(dynamicResources).ToImmutableList(); + } + + private BundleCacheItem AddToBundleCache(string bundleName, IBundler bundler, List bundleFiles) + { + var bundleRelativePath = + Options.BundleFolderName.EnsureEndsWith('/') + + bundleName + "." + bundleFiles.JoinAsString("|").ToMd5() + "." + bundler.FileExtension; + + return BundleCache.GetOrAdd(bundleRelativePath, () => + { + var cacheValue = new BundleCacheItem( + new List { new BundleFile("/" + bundleRelativePath) } + ); + + WatchChanges(cacheValue, bundleFiles, bundleRelativePath); + + var bundleResult = bundler.Bundle( + new BundlerContext( + bundleRelativePath, + bundleFiles, + IsMinficationEnabled() + ) + ); + + SaveBundleResult(bundleRelativePath, bundleResult); + + return cacheValue; + }); + } + + private void WatchChanges(BundleCacheItem cacheValue, List files, string bundleRelativePath) + { + lock (cacheValue.WatchDisposeHandles) + { + foreach (var file in files) + { + var watchDisposeHandle = GetFileProvider().Watch(file).RegisterChangeCallback(_ => + { + lock (cacheValue.WatchDisposeHandles) + { + cacheValue.WatchDisposeHandles.ForEach(h => h.Dispose()); + cacheValue.WatchDisposeHandles.Clear(); + } + + BundleCache.Remove(bundleRelativePath); + DynamicFileProvider.Delete("/wwwroot/" + bundleRelativePath); //TODO: get rid of wwwroot! + }, null); + + cacheValue.WatchDisposeHandles.Add(watchDisposeHandle); + } + } + } + + protected virtual void SaveBundleResult(string bundleRelativePath, BundleResult bundleResult) + { + var fileName = bundleRelativePath.Substring(bundleRelativePath.IndexOf('/') + 1); + + DynamicFileProvider.AddOrUpdate( + new InMemoryFileInfo( + "/wwwroot/" + bundleRelativePath, //TODO: get rid of wwwroot! + Encoding.UTF8.GetBytes(bundleResult.Content), + fileName + ) + ); + } + + public abstract bool IsBundlingEnabled(); + + + protected abstract bool IsMinficationEnabled(); + + protected virtual async Task> GetBundleFilesAsync(List contributors) + { + var context = CreateBundleConfigurationContext(); + + foreach (var contributor in contributors) + { + await contributor.PreConfigureBundleAsync(context); + } + + foreach (var contributor in contributors) + { + await contributor.ConfigureBundleAsync(context); + } + + foreach (var contributor in contributors) + { + await contributor.PostConfigureBundleAsync(context); + } + + return context.Files; + } + + protected virtual async Task> GetDynamicResourcesAsync(List contributors) + { + var context = CreateBundleConfigurationContext(); + + foreach (var contributor in contributors) + { + await contributor.ConfigureDynamicResourcesAsync(context); + } + + return context.Files; + } + + protected virtual BundleConfigurationContext CreateBundleConfigurationContext() + { + return new BundleConfigurationContext(ServiceProvider, GetFileProvider(), + Options.Parameters); + } + + protected abstract IFileProvider GetFileProvider(); + + protected virtual List GetContributors(BundleConfigurationCollection bundles, string bundleName) + { + var contributors = new List(); + + AddContributorsWithBaseBundles(contributors, bundles, bundleName); + + for (var i = 0; i < contributors.Count; ++i) + { + var extensions = ContributorOptions.Extensions(contributors[i].GetType()).GetAll(); + if (extensions.Count > 0) + { + contributors.InsertRange(i + 1, extensions); + i += extensions.Count; + } + } + + return contributors; + } + + protected virtual void AddContributorsWithBaseBundles(List contributors, + BundleConfigurationCollection bundles, string bundleName) + { + var bundleConfiguration = bundles.Get(bundleName); + + foreach (var baseBundleName in bundleConfiguration.BaseBundles) + { + AddContributorsWithBaseBundles(contributors, bundles, baseBundleName); //Recursive call + } + + var selfContributors = bundleConfiguration.Contributors.GetAll(); + + if (selfContributors.Any()) + { + contributors.AddRange(selfContributors); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleResult.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleResult.cs similarity index 75% rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleResult.cs rename to framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleResult.cs index eb44dd585e..60ac2c0bc6 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleResult.cs +++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundleResult.cs @@ -1,4 +1,4 @@ -namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling; +namespace Volo.Abp.AspNetCore.Bundling; public class BundleResult { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundlerBase.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundlerBase.cs similarity index 93% rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundlerBase.cs rename to framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundlerBase.cs index 4b0efe54ab..b52b9c204f 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundlerBase.cs +++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundlerBase.cs @@ -1,31 +1,27 @@ using System; using System.Text; -using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; using Volo.Abp.DependencyInjection; using Volo.Abp.Minify; -namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling; +namespace Volo.Abp.AspNetCore.Bundling; public abstract class BundlerBase : IBundler, ITransientDependency { private static string[] _minFileSuffixes = { "min", "prod" }; public ILogger Logger { get; set; } - - protected IWebHostEnvironment HostEnvironment { get; } protected IMinifier Minifier { get; } protected AbpBundlingOptions BundlingOptions { get; } protected BundlerBase( - IWebHostEnvironment hostEnvironment, IMinifier minifier, IOptions bundlingOptions) { - HostEnvironment = hostEnvironment; Minifier = minifier; BundlingOptions = bundlingOptions.Value; @@ -123,7 +119,7 @@ public abstract class BundlerBase : IBundler, ITransientDependency protected virtual IFileInfo GetFileInfo(IBundlerContext context, string file) { - var fileInfo = HostEnvironment.WebRootFileProvider.GetFileInfo(file); + var fileInfo = FindFileInfo(file); if (!fileInfo.Exists) { @@ -150,7 +146,7 @@ public abstract class BundlerBase : IBundler, ITransientDependency { foreach (var suffix in _minFileSuffixes) { - var fileInfo = HostEnvironment.WebRootFileProvider.GetFileInfo( + var fileInfo = FindFileInfo( $"{file.RemovePostFix($".{FileExtension}")}.{suffix}.{FileExtension}" ); @@ -163,6 +159,8 @@ public abstract class BundlerBase : IBundler, ITransientDependency return null; } + protected abstract IFileInfo FindFileInfo(string file); + protected virtual string ProcessBeforeAddingToTheBundle(IBundlerContext context, string filePath, string fileContent) { return fileContent; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundlerContext.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundlerContext.cs similarity index 91% rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundlerContext.cs rename to framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundlerContext.cs index 9c9c60a9eb..e39fa90880 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundlerContext.cs +++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/BundlerContext.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling; +namespace Volo.Abp.AspNetCore.Bundling; public class BundlerContext : IBundlerContext { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundleCache.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundleCache.cs similarity index 78% rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundleCache.cs rename to framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundleCache.cs index 9c2f19d4ca..6f80d23a60 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundleCache.cs +++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundleCache.cs @@ -1,6 +1,6 @@ using System; -namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling; +namespace Volo.Abp.AspNetCore.Bundling; public interface IBundleCache { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundleManager.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundleManager.cs similarity index 76% rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundleManager.cs rename to framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundleManager.cs index 067554e102..3c3a50ece1 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundleManager.cs +++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundleManager.cs @@ -1,7 +1,8 @@ using System.Collections.Generic; using System.Threading.Tasks; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; -namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling; +namespace Volo.Abp.AspNetCore.Bundling; public interface IBundleManager { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundler.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundler.cs similarity index 58% rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundler.cs rename to framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundler.cs index 9f396767ee..68e50f4ec7 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundler.cs +++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundler.cs @@ -1,4 +1,6 @@ -namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; + +namespace Volo.Abp.AspNetCore.Bundling; public interface IBundler { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundlerContext.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundlerContext.cs similarity index 81% rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundlerContext.cs rename to framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundlerContext.cs index d59bc154b5..83d49df220 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/IBundlerContext.cs +++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/IBundlerContext.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling; +namespace Volo.Abp.AspNetCore.Bundling; public interface IBundlerContext { diff --git a/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/Scripts/IScriptBundler.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/Scripts/IScriptBundler.cs new file mode 100644 index 0000000000..2af5f655a7 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/Scripts/IScriptBundler.cs @@ -0,0 +1,6 @@ +namespace Volo.Abp.AspNetCore.Bundling.Scripts; + +public interface IScriptBundler : IBundler +{ + +} diff --git a/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/Styles/IStyleBundler.cs b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/Styles/IStyleBundler.cs new file mode 100644 index 0000000000..c8fe1cbf2a --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Bundling/Volo/Abp/AspNetCore/Bundling/Styles/IStyleBundler.cs @@ -0,0 +1,6 @@ +namespace Volo.Abp.AspNetCore.Bundling.Styles; + +public interface IStyleBundler : IBundler +{ + +} diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/AbpAspNetCoreComponentsMauiBlazorBundlingModule.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/AbpAspNetCoreComponentsMauiBlazorBundlingModule.cs new file mode 100644 index 0000000000..2ffa74b833 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/AbpAspNetCoreComponentsMauiBlazorBundlingModule.cs @@ -0,0 +1,106 @@ +using System.Text; +using Microsoft.Extensions.FileProviders; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; +using Volo.Abp.AspNetCore.Bundling; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.Bundling.Styles; +using Volo.Abp.Modularity; +using Volo.Abp.Threading; +using Volo.Abp.VirtualFileSystem; + +namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling; + +[DependsOn( + typeof(AbpAspNetCoreComponentsMauiBlazorModule), + typeof(AbpAspNetCoreBundlingModule) +)] +public class AbpAspNetCoreComponentsMauiBlazorBundlingModule : AbpModule +{ + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + AsyncHelper.RunSync(() => OnApplicationInitializationAsync(context)); + } + + public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context) + { + await InitialGlobalAssetsAsync(context); + } + + protected virtual async Task InitialGlobalAssetsAsync(ApplicationInitializationContext context) + { + var bundlingOptions = context.ServiceProvider.GetRequiredService>().Value; + var logger = context.ServiceProvider.GetRequiredService>(); + if (!bundlingOptions.GlobalAssets.Enabled) + { + return; + } + + var bundleManager = context.ServiceProvider.GetRequiredService(); + var mauiBlazorContentFileProvider = context.ServiceProvider.GetRequiredService(); + var dynamicFileProvider = context.ServiceProvider.GetRequiredService(); + if (!bundlingOptions.GlobalAssets.GlobalStyleBundleName.IsNullOrWhiteSpace()) + { + var styleFiles = await bundleManager.GetStyleBundleFilesAsync(bundlingOptions.GlobalAssets.GlobalStyleBundleName); + var styles = string.Empty; + foreach (var file in styleFiles) + { + var fileInfo = mauiBlazorContentFileProvider.GetFileInfo(file.FileName); + if (!fileInfo.Exists) + { + logger.LogError($"Could not find the file: {file.FileName}"); + continue; + } + + var fileContent = await fileInfo.ReadAsStringAsync(); + if (!bundleManager.IsBundlingEnabled()) + { + fileContent = CssRelativePath.Adjust(fileContent, + file.FileName, + Path.Combine(Directory.GetCurrentDirectory(), "wwwroot")); + + styles += $"/*{file.FileName}*/{Environment.NewLine}{fileContent}{Environment.NewLine}{Environment.NewLine}"; + } + else + { + styles += $"{fileContent}{Environment.NewLine}{Environment.NewLine}"; + } + } + + dynamicFileProvider.AddOrUpdate( + new InMemoryFileInfo("/wwwroot/" + bundlingOptions.GlobalAssets.CssFileName, + Encoding.UTF8.GetBytes(styles), + bundlingOptions.GlobalAssets.CssFileName)); + } + + if (!bundlingOptions.GlobalAssets.GlobalScriptBundleName.IsNullOrWhiteSpace()) + { + var scriptFiles = await bundleManager.GetScriptBundleFilesAsync(bundlingOptions.GlobalAssets.GlobalScriptBundleName); + var scripts = string.Empty; + foreach (var file in scriptFiles) + { + var fileInfo = mauiBlazorContentFileProvider.GetFileInfo(file.FileName); + if (!fileInfo.Exists) + { + logger.LogError($"Could not find the file: {file.FileName}"); + continue; + } + + var fileContent = await fileInfo.ReadAsStringAsync(); + if (!bundleManager.IsBundlingEnabled()) + { + scripts += $"{fileContent.EnsureEndsWith(';')}{Environment.NewLine}{Environment.NewLine}"; + } + else + { + scripts += $"//{file.FileName}{Environment.NewLine}{fileContent.EnsureEndsWith(';')}{Environment.NewLine}{Environment.NewLine}"; + } + } + + dynamicFileProvider.AddOrUpdate( + new InMemoryFileInfo("/wwwroot/" + bundlingOptions.GlobalAssets.JavaScriptFileName, + Encoding.UTF8.GetBytes(scripts), + bundlingOptions.GlobalAssets.JavaScriptFileName)); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/AbpBlazorWebView.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/AbpBlazorWebView.cs new file mode 100644 index 0000000000..dce9f6d644 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/AbpBlazorWebView.cs @@ -0,0 +1,13 @@ +using Microsoft.AspNetCore.Components.WebView.Maui; +using Microsoft.Extensions.FileProviders; +using Volo.Abp.VirtualFileSystem; + +namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling; + +public class AbpBlazorWebView : BlazorWebView +{ + public override IFileProvider CreateFileProvider(string contentRootDir) + { + return new CompositeFileProvider(Handler!.GetRequiredService(), base.CreateFileProvider(contentRootDir)); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/BundleManager.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/BundleManager.cs new file mode 100644 index 0000000000..3d8b0ab938 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/BundleManager.cs @@ -0,0 +1,125 @@ +using Microsoft.Extensions.FileProviders; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; +using Volo.Abp.AspNetCore.Bundling; +using Volo.Abp.AspNetCore.Bundling.Scripts; +using Volo.Abp.AspNetCore.Bundling.Styles; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.DependencyInjection; +using Volo.Abp.VirtualFileSystem; + +namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling; + +public class BundleManager : BundleManagerBase, ITransientDependency +{ + protected IMauiBlazorContentFileProvider MauiBlazorContentFileProvider { get; } + + public BundleManager( + IOptions options, + IOptions contributorOptions, + IScriptBundler scriptBundler, + IStyleBundler styleBundler, + IServiceProvider serviceProvider, + IDynamicFileProvider dynamicFileProvider, + IBundleCache bundleCache, + IMauiBlazorContentFileProvider mauiBlazorContentFileProvider) : base( + options, + contributorOptions, + scriptBundler, + styleBundler, + serviceProvider, + dynamicFileProvider, + bundleCache) + { + MauiBlazorContentFileProvider = mauiBlazorContentFileProvider; + } + + public override bool IsBundlingEnabled() + { + switch (Options.Mode) + { + case BundlingMode.None: + return false; + case BundlingMode.Bundle: + case BundlingMode.BundleAndMinify: + return true; + case BundlingMode.Auto: + return !IsDebug(); + default: + throw new AbpException($"Unhandled {nameof(BundlingMode)}: {Options.Mode}"); + } + } + + protected async override Task> GetBundleFilesAsync(List contributors) + { + var files = await base.GetBundleFilesAsync(contributors); + + foreach (var file in files) + { + await CopyFileToAppDataDirectoryAsync(file); + } + + return files; + } + + protected virtual async Task CopyFileToAppDataDirectoryAsync(BundleFile file) + { + if (file.IsExternalFile) + { + return; + } + + var fileName = Path.Combine("wwwroot", file.FileName); + if(MauiBlazorContentFileProvider.GetFileInfo(fileName).Exists) + { + return; + } + + try + { + await using var inputStream = await FileSystem.Current.OpenAppPackageFileAsync(fileName); + var targetFile = Path.Combine(FileSystem.Current.AppDataDirectory, fileName); + var fileDirectory = Path.GetDirectoryName(targetFile)!; + if (!Path.Exists(fileDirectory)) + { + Directory.CreateDirectory(fileDirectory); + } + await using var outputStream = File.Create(targetFile); + await inputStream.CopyToAsync(outputStream); + } + catch (Exception e) + { + Logger.LogError($"Could not copy the file to the app data directory: {fileName}", e); + } + } + + protected override bool IsMinficationEnabled() + { + switch (Options.Mode) + { + case BundlingMode.None: + case BundlingMode.Bundle: + return false; + case BundlingMode.BundleAndMinify: + return true; + case BundlingMode.Auto: + return !IsDebug(); + default: + throw new AbpException($"Unhandled {nameof(BundlingMode)}: {Options.Mode}"); + } + } + + protected virtual bool IsDebug() + { + #if DEBUG + return true; + #else + retur false; + #endif + } + + protected override IFileProvider GetFileProvider() + { + return MauiBlazorContentFileProvider; + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/IMauiBlazorContentFileProvide.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/IMauiBlazorContentFileProvide.cs new file mode 100644 index 0000000000..4c7a50a339 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/IMauiBlazorContentFileProvide.cs @@ -0,0 +1,8 @@ +using Microsoft.Extensions.FileProviders; + +namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling; + +public interface IMauiBlazorContentFileProvider : IFileProvider +{ + string ContentRootPath { get; } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/MauiBlazorBundlerBase.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/MauiBlazorBundlerBase.cs new file mode 100644 index 0000000000..b02c80435a --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/MauiBlazorBundlerBase.cs @@ -0,0 +1,26 @@ +using Microsoft.Extensions.FileProviders; +using Microsoft.Extensions.Options; +using Volo.Abp.AspNetCore.Bundling; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.Minify; + +namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling; + +public abstract class MauiBlazorBundlerBase : BundlerBase +{ + protected IMauiBlazorContentFileProvider MauiBlazorContentFileProvider { get; } + + public MauiBlazorBundlerBase( + IMauiBlazorContentFileProvider mauiBlazorContentFileProvider, + IMinifier minifier, + IOptions bundlingOptions) : base(minifier, + bundlingOptions) + { + MauiBlazorContentFileProvider = mauiBlazorContentFileProvider; + } + + protected override IFileInfo FindFileInfo(string file) + { + return MauiBlazorContentFileProvider.GetFileInfo(file); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/MauiBlazorContentFileProvider.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/MauiBlazorContentFileProvider.cs new file mode 100644 index 0000000000..a9ee633e6c --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/MauiBlazorContentFileProvider.cs @@ -0,0 +1,65 @@ +using Microsoft.Extensions.FileProviders; +using Microsoft.Extensions.Primitives; +using Microsoft.Maui.Controls.PlatformConfiguration; +using Volo.Abp.DependencyInjection; +using Volo.Abp.VirtualFileSystem; + +namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling; + +public class MauiBlazorContentFileProvider : IMauiBlazorContentFileProvider, ISingletonDependency +{ + private readonly IVirtualFileProvider _virtualFileProvider; + private readonly IFileProvider _fileProvider; + private string _rootPath = "/wwwroot"; + + public MauiBlazorContentFileProvider(IVirtualFileProvider virtualFileProvider) + { + _virtualFileProvider = virtualFileProvider; + _fileProvider = CreateFileProvider(); + } + + public string ContentRootPath => FileSystem.Current.AppDataDirectory; + + public IFileInfo GetFileInfo(string subpath) + { + if (string.IsNullOrEmpty(subpath)) + { + return new NotFoundFileInfo(subpath); + } + + var fileInfo = _fileProvider.GetFileInfo(subpath); + return fileInfo.Exists ? fileInfo : _fileProvider.GetFileInfo( _rootPath + subpath.EnsureStartsWith('/')); + } + + public IDirectoryContents GetDirectoryContents(string subpath) + { + if (string.IsNullOrEmpty(subpath)) + { + return NotFoundDirectoryContents.Singleton; + } + + var directory = _fileProvider.GetDirectoryContents(subpath); + return directory.Exists ? directory : _fileProvider.GetDirectoryContents( _rootPath + subpath.EnsureStartsWith('/')); + } + + public IChangeToken Watch(string filter) + { + return new CompositeChangeToken( + [ + _fileProvider.Watch(_rootPath + filter), + _fileProvider.Watch(filter) + ] + ); + } + + protected virtual IFileProvider CreateFileProvider() + { + var assetsDirectory = Path.Combine(ContentRootPath, _rootPath.TrimStart('/')); + if (!Path.Exists(assetsDirectory)) + { + Directory.CreateDirectory(assetsDirectory); + } + + return new CompositeFileProvider(new PhysicalFileProvider(assetsDirectory), _virtualFileProvider); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Scripts/ScriptBundler.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Scripts/ScriptBundler.cs new file mode 100644 index 0000000000..8e3d36b5da --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Scripts/ScriptBundler.cs @@ -0,0 +1,28 @@ +using Microsoft.Extensions.Options; +using Volo.Abp.AspNetCore.Bundling; +using Volo.Abp.AspNetCore.Bundling.Scripts; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.Minify.Scripts; + +namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling.Scripts; + +public class ScriptBundler : MauiBlazorBundlerBase, IScriptBundler +{ + public override string FileExtension => "js"; + + public ScriptBundler( + IMauiBlazorContentFileProvider mauiBlazorContentFileProvider, + IJavascriptMinifier minifier, + IOptions bundlingOptions) + : base( + mauiBlazorContentFileProvider, + minifier, + bundlingOptions) + { + } + + protected override string ProcessBeforeAddingToTheBundle(IBundlerContext context, string filePath, string fileContent) + { + return fileContent.EnsureEndsWith(';') + Environment.NewLine; + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Styles/StyleBundler.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Styles/StyleBundler.cs new file mode 100644 index 0000000000..f617c21761 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Styles/StyleBundler.cs @@ -0,0 +1,40 @@ +using Microsoft.Extensions.Options; +using Volo.Abp.AspNetCore.Bundling; +using Volo.Abp.AspNetCore.Bundling.Styles; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.Bundling.Styles; +using Volo.Abp.Minify.Styles; + +namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling.Styles; + +public class StyleBundler : MauiBlazorBundlerBase, IStyleBundler +{ + private readonly IMauiBlazorContentFileProvider _mauiBlazorContentFileProvider; + public override string FileExtension => "css"; + + public StyleBundler( + IMauiBlazorContentFileProvider mauiBlazorContentFileProvider, + ICssMinifier minifier, + IOptions bundlingOptions) + : base( + mauiBlazorContentFileProvider, + minifier, + bundlingOptions) + { + _mauiBlazorContentFileProvider = mauiBlazorContentFileProvider; + } + + public string GetAbsolutePath(string relativePath) + { + return Path.Combine(_mauiBlazorContentFileProvider.ContentRootPath, "wwwroot", relativePath.RemovePreFix("/")).Replace("file://", ""); + } + + protected override string ProcessBeforeAddingToTheBundle(IBundlerContext context, string filePath, string fileContent) + { + return CssRelativePath.Adjust( + fileContent, + GetAbsolutePath(filePath), + GetAbsolutePath(context.BundleRelativePath) + ); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling.csproj b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling.csproj new file mode 100644 index 0000000000..6591bd5359 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling.csproj @@ -0,0 +1,41 @@ + + + + + + + + net9.0-android;net9.0-ios;net9.0-maccatalyst + $(TargetFrameworks);net9.0-windows10.0.19041.0 + + + true + true + enable + enable + + 15.0 + 15.0 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Bundling/BlazorServerComponentBundleManager.cs b/framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Bundling/BlazorServerComponentBundleManager.cs index 9ba0baff2d..98ca1b54a4 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Bundling/BlazorServerComponentBundleManager.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Bundling/BlazorServerComponentBundleManager.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Volo.Abp.AspNetCore.Bundling; using Volo.Abp.AspNetCore.Components.Web.Theming.Bundling; -using Volo.Abp.AspNetCore.Mvc.UI.Bundling; using Volo.Abp.DependencyInjection; namespace Volo.Abp.AspNetCore.Components.Server.Theming.Bundling; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpBundleContributorOptions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpBundleContributorOptions.cs similarity index 93% rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpBundleContributorOptions.cs rename to framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpBundleContributorOptions.cs index 79a6272e89..dfc706607e 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpBundleContributorOptions.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpBundleContributorOptions.cs @@ -1,6 +1,6 @@ -using System; +using System; using System.Collections.Concurrent; -using JetBrains.Annotations; +using System.Diagnostics.CodeAnalysis; namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling; @@ -27,4 +27,4 @@ public class AbpBundleContributorOptions _ => new BundleContributorCollection() ); } -} +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj index fd3995f797..aadb26f388 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj @@ -19,6 +19,7 @@ + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpAspNetCoreMvcUiBundlingModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpAspNetCoreMvcUiBundlingModule.cs index 2292c93a53..13b157748b 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpAspNetCoreMvcUiBundlingModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpAspNetCoreMvcUiBundlingModule.cs @@ -7,6 +7,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; +using Volo.Abp.AspNetCore.Bundling; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; using Volo.Abp.AspNetCore.VirtualFileSystem; using Volo.Abp.Bundling.Styles; @@ -21,8 +22,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling; [DependsOn( typeof(AbpAspNetCoreMvcUiBootstrapModule), - typeof(AbpMinifyModule), - typeof(AbpAspNetCoreMvcUiBundlingAbstractionsModule) + typeof(AbpAspNetCoreBundlingModule) )] public class AbpAspNetCoreMvcUiBundlingModule : AbpModule { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleManager.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleManager.cs index 9ac43585c0..c28c19a716 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleManager.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleManager.cs @@ -9,6 +9,10 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; +using Microsoft.Extensions.FileProviders; +using Volo.Abp.AspNetCore.Bundling; +using Volo.Abp.AspNetCore.Bundling.Scripts; +using Volo.Abp.AspNetCore.Bundling.Styles; using Volo.Abp.AspNetCore.Mvc.UI.Bundling.Scripts; using Volo.Abp.AspNetCore.Mvc.UI.Bundling.Styles; using Volo.Abp.AspNetCore.Mvc.UI.Resources; @@ -17,162 +21,47 @@ using Volo.Abp.VirtualFileSystem; namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling; -public class BundleManager : IBundleManager, ITransientDependency +public class BundleManager : BundleManagerBase, ITransientDependency { - public ILogger Logger { get; set; } - - protected readonly AbpBundlingOptions Options; - protected readonly AbpBundleContributorOptions ContributorOptions; - protected readonly IWebHostEnvironment HostingEnvironment; - protected readonly IScriptBundler ScriptBundler; - protected readonly IStyleBundler StyleBundler; - protected readonly IServiceProvider ServiceProvider; - protected readonly IDynamicFileProvider DynamicFileProvider; - protected readonly IBundleCache BundleCache; - protected readonly IWebRequestResources RequestResources; - public BundleManager( IOptions options, IOptions contributorOptions, - IScriptBundler scriptBundler, + IScriptBundler scriptBundler, IStyleBundler styleBundler, - IWebHostEnvironment hostingEnvironment, IServiceProvider serviceProvider, IDynamicFileProvider dynamicFileProvider, IBundleCache bundleCache, - IWebRequestResources requestResources) + IWebHostEnvironment hostingEnvironment, + IWebRequestResources requestResources) : base( + options, + contributorOptions, + scriptBundler, + styleBundler, + serviceProvider, + dynamicFileProvider, + bundleCache) { - Options = options.Value; - ContributorOptions = contributorOptions.Value; HostingEnvironment = hostingEnvironment; - ScriptBundler = scriptBundler; - ServiceProvider = serviceProvider; - DynamicFileProvider = dynamicFileProvider; - BundleCache = bundleCache; RequestResources = requestResources; - StyleBundler = styleBundler; - - Logger = NullLogger.Instance; - } - - public virtual async Task> GetStyleBundleFilesAsync(string bundleName) - { - return await GetBundleFilesAsync(Options.StyleBundles, bundleName, StyleBundler); - } - - public virtual async Task> GetScriptBundleFilesAsync(string bundleName) - { - return await GetBundleFilesAsync(Options.ScriptBundles, bundleName, ScriptBundler); - } - - protected virtual async Task> GetBundleFilesAsync(BundleConfigurationCollection bundles, string bundleName, IBundler bundler) - { - var files = new List(); - - var contributors = GetContributors(bundles, bundleName); - var bundleFiles = RequestResources.TryAdd(await GetBundleFilesAsync(contributors)); - var dynamicResources = RequestResources.TryAdd(await GetDynamicResourcesAsync(contributors)); - - if (!IsBundlingEnabled()) - { - return bundleFiles.Union(dynamicResources).ToImmutableList(); - } - - var localBundleFiles = new List(); - foreach (var bundleFile in bundleFiles) - { - if (!bundleFile.IsExternalFile) - { - localBundleFiles.Add(bundleFile.FileName); - } - else - { - if (localBundleFiles.Count != 0) - { - files.AddRange(AddToBundleCache(bundleName, bundler, localBundleFiles).Files); - localBundleFiles.Clear(); - } - - files.Add(bundleFile); - } - } - - if (localBundleFiles.Count != 0) - { - files.AddRange(AddToBundleCache(bundleName, bundler, localBundleFiles).Files); - } - - return files.Union(dynamicResources).ToImmutableList(); } - private BundleCacheItem AddToBundleCache(string bundleName, IBundler bundler, List bundleFiles) - { - var bundleRelativePath = - Options.BundleFolderName.EnsureEndsWith('/') + - bundleName + "." + bundleFiles.JoinAsString("|").ToMd5() + "." + bundler.FileExtension; - - return BundleCache.GetOrAdd(bundleRelativePath, () => - { - var cacheValue = new BundleCacheItem( - new List - { - new BundleFile("/" + bundleRelativePath) - } - ); - - WatchChanges(cacheValue, bundleFiles, bundleRelativePath); + protected IWebHostEnvironment HostingEnvironment { get; } - var bundleResult = bundler.Bundle( - new BundlerContext( - bundleRelativePath, - bundleFiles, - IsMinficationEnabled() - ) - ); + protected IWebRequestResources RequestResources { get; } - SaveBundleResult(bundleRelativePath, bundleResult); - return cacheValue; - }); - } - private void WatchChanges(BundleCacheItem cacheValue, List files, string bundleRelativePath) + protected async override Task> GetBundleFilesAsync(List contributors) { - lock (cacheValue.WatchDisposeHandles) - { - foreach (var file in files) - { - var watchDisposeHandle = HostingEnvironment.WebRootFileProvider.Watch(file).RegisterChangeCallback(_ => - { - lock (cacheValue.WatchDisposeHandles) - { - cacheValue.WatchDisposeHandles.ForEach(h => h.Dispose()); - cacheValue.WatchDisposeHandles.Clear(); - } - - BundleCache.Remove(bundleRelativePath); - DynamicFileProvider.Delete("/wwwroot/" + bundleRelativePath); //TODO: get rid of wwwroot! - }, null); - - cacheValue.WatchDisposeHandles.Add(watchDisposeHandle); - } - } + return RequestResources.TryAdd(await base.GetBundleFilesAsync(contributors)); } - protected virtual void SaveBundleResult(string bundleRelativePath, BundleResult bundleResult) + protected async override Task> GetDynamicResourcesAsync(List contributors) { - var fileName = bundleRelativePath.Substring(bundleRelativePath.IndexOf('/') + 1); - - DynamicFileProvider.AddOrUpdate( - new InMemoryFileInfo( - "/wwwroot/" + bundleRelativePath, //TODO: get rid of wwwroot! - Encoding.UTF8.GetBytes(bundleResult.Content), - fileName - ) - ); + return RequestResources.TryAdd(await base.GetDynamicResourcesAsync(contributors)); } - public virtual bool IsBundlingEnabled() + public override bool IsBundlingEnabled() { switch (Options.Mode) { @@ -188,7 +77,7 @@ public class BundleManager : IBundleManager, ITransientDependency } } - protected virtual bool IsMinficationEnabled() + protected override bool IsMinficationEnabled() { switch (Options.Mode) { @@ -204,78 +93,8 @@ public class BundleManager : IBundleManager, ITransientDependency } } - protected async Task> GetBundleFilesAsync(List contributors) - { - var context = CreateBundleConfigurationContext(); - - foreach (var contributor in contributors) - { - await contributor.PreConfigureBundleAsync(context); - } - - foreach (var contributor in contributors) - { - await contributor.ConfigureBundleAsync(context); - } - - foreach (var contributor in contributors) - { - await contributor.PostConfigureBundleAsync(context); - } - - return context.Files; - } - - protected virtual async Task> GetDynamicResourcesAsync(List contributors) - { - var context = CreateBundleConfigurationContext(); - - foreach (var contributor in contributors) - { - await contributor.ConfigureDynamicResourcesAsync(context); - } - - return context.Files; - } - - protected virtual BundleConfigurationContext CreateBundleConfigurationContext() - { - return new BundleConfigurationContext(ServiceProvider, HostingEnvironment.WebRootFileProvider, Options.Parameters); - } - - protected virtual List GetContributors(BundleConfigurationCollection bundles, string bundleName) - { - var contributors = new List(); - - AddContributorsWithBaseBundles(contributors, bundles, bundleName); - - for (var i = 0; i < contributors.Count; ++i) - { - var extensions = ContributorOptions.Extensions(contributors[i].GetType()).GetAll(); - if (extensions.Count > 0) - { - contributors.InsertRange(i + 1, extensions); - i += extensions.Count; - } - } - - return contributors; - } - - protected virtual void AddContributorsWithBaseBundles(List contributors, BundleConfigurationCollection bundles, string bundleName) + protected override IFileProvider GetFileProvider() { - var bundleConfiguration = bundles.Get(bundleName); - - foreach (var baseBundleName in bundleConfiguration.BaseBundles) - { - AddContributorsWithBaseBundles(contributors, bundles, baseBundleName); //Recursive call - } - - var selfContributors = bundleConfiguration.Contributors.GetAll(); - - if (selfContributors.Any()) - { - contributors.AddRange(selfContributors); - } + return HostingEnvironment.WebRootFileProvider; } -} +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/MvcUiBundlerBase.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/MvcUiBundlerBase.cs new file mode 100644 index 0000000000..87ba769f75 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/MvcUiBundlerBase.cs @@ -0,0 +1,25 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.FileProviders; +using Microsoft.Extensions.Options; +using Volo.Abp.AspNetCore.Bundling; +using Volo.Abp.Minify; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling; + +public abstract class MvcUiBundlerBase : BundlerBase +{ + protected IWebHostEnvironment WebHostingEnvironment { get; } + + protected MvcUiBundlerBase( + IWebHostEnvironment webHostingEnvironment, + IMinifier minifier, + IOptions bundlingOptions) : base(minifier, bundlingOptions) + { + WebHostingEnvironment = webHostingEnvironment; + } + + protected override IFileInfo FindFileInfo(string file) + { + return WebHostingEnvironment.WebRootFileProvider.GetFileInfo(file); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Scripts/IScriptBundler.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Scripts/IScriptBundler.cs deleted file mode 100644 index a0204fdb87..0000000000 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Scripts/IScriptBundler.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.Scripts; - -public interface IScriptBundler : IBundler -{ - -} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Scripts/ScriptBundler.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Scripts/ScriptBundler.cs index 7e3360e4c8..8f48ad31e8 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Scripts/ScriptBundler.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Scripts/ScriptBundler.cs @@ -1,20 +1,22 @@ using System; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Options; +using Volo.Abp.AspNetCore.Bundling; +using Volo.Abp.AspNetCore.Bundling.Scripts; using Volo.Abp.Minify.Scripts; namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.Scripts; -public class ScriptBundler : BundlerBase, IScriptBundler +public class ScriptBundler : MvcUiBundlerBase, IScriptBundler { public override string FileExtension => "js"; public ScriptBundler( - IWebHostEnvironment hostEnvironment, + IWebHostEnvironment hostingEnvironment, IJavascriptMinifier minifier, IOptions bundlingOptions) : base( - hostEnvironment, + hostingEnvironment, minifier, bundlingOptions) { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Styles/IStyleBundler.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Styles/IStyleBundler.cs deleted file mode 100644 index 1550730d38..0000000000 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Styles/IStyleBundler.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.Styles; - -public interface IStyleBundler : IBundler -{ - -} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Styles/StyleBundler.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Styles/StyleBundler.cs index b20e9af7ee..9d6277fa8e 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Styles/StyleBundler.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Styles/StyleBundler.cs @@ -2,27 +2,28 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Options; -using Volo.Abp.AspNetCore.VirtualFileSystem; +using Volo.Abp.AspNetCore.Bundling; +using Volo.Abp.AspNetCore.Bundling.Styles; using Volo.Abp.Bundling.Styles; using Volo.Abp.Minify.Styles; namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.Styles; -public class StyleBundler : BundlerBase, IStyleBundler +public class StyleBundler : MvcUiBundlerBase, IStyleBundler { private readonly IWebHostEnvironment _hostingEnvironment; public override string FileExtension => "css"; public StyleBundler( - IWebHostEnvironment hostEnvironment, + IWebHostEnvironment hostingEnvironment, ICssMinifier minifier, IOptions bundlingOptions) : base( - hostEnvironment, + hostingEnvironment, minifier, bundlingOptions) { - _hostingEnvironment = hostEnvironment; + _hostingEnvironment = hostingEnvironment; } public string GetAbsolutePath(string relativePath) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperResourceService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperResourceService.cs index 7939cb7912..b83d090f11 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperResourceService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperResourceService.cs @@ -10,6 +10,7 @@ using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; +using Volo.Abp.AspNetCore.Bundling; using Volo.Abp.DependencyInjection; namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperScriptService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperScriptService.cs index c8486ebadd..c4701aa7d5 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperScriptService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperScriptService.cs @@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Razor.TagHelpers; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Options; +using Volo.Abp.AspNetCore.Bundling; namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperStyleService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperStyleService.cs index bcfd7d95e2..1ed3a76fe1 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperStyleService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperStyleService.cs @@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Razor.TagHelpers; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Options; +using Volo.Abp.AspNetCore.Bundling; using Volo.Abp.AspNetCore.Security; namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers; diff --git a/nupkg/common.ps1 b/nupkg/common.ps1 index 4233ce7b59..afaa62a32f 100644 --- a/nupkg/common.ps1 +++ b/nupkg/common.ps1 @@ -99,6 +99,7 @@ $projects = ( "framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect", "framework/src/Volo.Abp.AspNetCore.Abstractions", "framework/src/Volo.Abp.AspNetCore", + "framework/src/Volo.Abp.AspNetCore.Bundling", "framework/src/Volo.Abp.AspNetCore.Mvc.Dapr", "framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus", "framework/src/Volo.Abp.AspNetCore.Components", @@ -111,6 +112,7 @@ $projects = ( "framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Bundling", "framework/src/Volo.Abp.AspNetCore.Components.Server", "framework/src/Volo.Abp.AspNetCore.Components.Server.Theming", + "framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Bundling", "framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming", "framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling", "framework/src/Volo.Abp.AspNetCore.MultiTenancy", From 364093b4e32ae6972f845ea21ab99cdbe84ac6e3 Mon Sep 17 00:00:00 2001 From: EngincanV Date: Wed, 19 Mar 2025 09:54:22 +0300 Subject: [PATCH 3/8] Explain data deletion process briefly in the GDPR Module doc --- docs/en/modules/gdpr.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/en/modules/gdpr.md b/docs/en/modules/gdpr.md index 76875e0403..c94fcbb4a0 100644 --- a/docs/en/modules/gdpr.md +++ b/docs/en/modules/gdpr.md @@ -48,7 +48,14 @@ The "Personal Data" page is used to manage personal data requests. You can view ![gdpr](../images/gdpr-personal-data-page.png) -To see the other features of the GDPR module, visit [the module description page](https://abp.io/modules/Volo.Gdpr). +The GDPR module is designed for distributed architectures. When a user requests their personal data, the module publishes two events: + +- `GdprUserDataRequestedEto`: Triggers personal data collectors to prepare user data +- `GdprUserDataDeletionRequestedEto`: Triggers personal data collectors to delete user data + +You can subscribe to these events to implement custom data collection and deletion logic in your modules. See the [Distributed Events](#distributed-events) section for more details. + +> To see the other features of the GDPR module, visit [the module description page](https://abp.io/modules/Volo.Gdpr). ## Options @@ -227,8 +234,13 @@ This [Event Transfer Object](../framework/infrastructure/event-bus/distributed#e ### GdprUserDataPreparedEto -This [Event Transfer Object](../framework/infrastructure/event-bus/distributed#event-transfer-object) is used to save the collected personal data into a single JSON file by module. +This [Event Transfer Object](../framework/infrastructure/event-bus/distributed#event-transfer-object) is used to save the collected personal data into a single JSON file per module. Typically, you don't need to implement this event handler since the module already has an implementation that returns the collected data within a zip file containing multiple JSON files, with each file containing data collected from a specific module. + +### GdprUserDataDeletionRequestedEto + +This [Event Transfer Object](../framework/infrastructure/event-bus/distributed#event-transfer-object) is published when a user requests to permanently delete their personal data and account. By default, only the `IdentityGdprEventHandler` in the [Identity Pro Module](../modules/identity-pro) subscribes to this event to anonymize the user's data and delete their account (using soft-delete unless configured otherwise). +If you want to delete additional sensitive user data stored in other modules, you can subscribe to this event and implement custom deletion (or anonymization) logic in those modules. ## Cookie Consent From f1049f63a14ecab440a87e0f9dccc91605b88e1c Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Wed, 19 Mar 2025 21:18:19 +0800 Subject: [PATCH 4/8] Add error codes and localization for static claim type restrictions --- .../Volo/Abp/Identity/IdentityErrorCodes.cs | 2 ++ .../Volo/Abp/Identity/Localization/ar.json | 2 ++ .../Volo/Abp/Identity/Localization/cs.json | 2 ++ .../Volo/Abp/Identity/Localization/de.json | 2 ++ .../Volo/Abp/Identity/Localization/el.json | 2 ++ .../Volo/Abp/Identity/Localization/en-GB.json | 2 ++ .../Volo/Abp/Identity/Localization/en.json | 2 ++ .../Volo/Abp/Identity/Localization/es.json | 2 ++ .../Volo/Abp/Identity/Localization/fa.json | 2 ++ .../Volo/Abp/Identity/Localization/fi.json | 2 ++ .../Volo/Abp/Identity/Localization/fr.json | 2 ++ .../Volo/Abp/Identity/Localization/hi.json | 2 ++ .../Volo/Abp/Identity/Localization/hr.json | 4 +++- .../Volo/Abp/Identity/Localization/hu.json | 4 +++- .../Volo/Abp/Identity/Localization/is.json | 4 +++- .../Volo/Abp/Identity/Localization/it.json | 4 +++- .../Volo/Abp/Identity/Localization/nl.json | 4 +++- .../Volo/Abp/Identity/Localization/pl-PL.json | 4 +++- .../Volo/Abp/Identity/Localization/pt-BR.json | 4 +++- .../Volo/Abp/Identity/Localization/ro-RO.json | 4 +++- .../Volo/Abp/Identity/Localization/ru.json | 4 +++- .../Volo/Abp/Identity/Localization/sk.json | 4 +++- .../Volo/Abp/Identity/Localization/sl.json | 2 ++ .../Volo/Abp/Identity/Localization/sv.json | 2 ++ .../Volo/Abp/Identity/Localization/tr.json | 4 +++- .../Volo/Abp/Identity/Localization/vi.json | 2 ++ .../Volo/Abp/Identity/Localization/zh-Hans.json | 2 ++ .../Volo/Abp/Identity/Localization/zh-Hant.json | 4 +++- .../Volo/Abp/Identity/IdentityClaimTypeManager.cs | 6 +++--- 29 files changed, 71 insertions(+), 15 deletions(-) diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityErrorCodes.cs b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityErrorCodes.cs index aedec65862..4710c62f90 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityErrorCodes.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityErrorCodes.cs @@ -12,4 +12,6 @@ public static class IdentityErrorCodes public const string CanNotChangeTwoFactor = "Volo.Abp.Identity:010008"; public const string YouCannotDelegateYourself = "Volo.Abp.Identity:010009"; public const string ClaimNameExist = "Volo.Abp.Identity:010021"; + public const string CanNotUpdateStaticClaimType = "Volo.Abp.Identity:010022"; + public const string CanNotDeleteStaticClaimType = "Volo.Abp.Identity:010023"; } diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/ar.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/ar.json index e898146bda..bfbd43a9d7 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/ar.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/ar.json @@ -77,6 +77,8 @@ "Volo.Abp.Identity:010008": "لا يجوز تغيير إعداد عاملين.", "Volo.Abp.Identity:010009": "لا يمكنك تفويض نفسك.", "Volo.Abp.Identity:010021": "الاسم {0} موجود بالفعل.", + "Volo.Abp.Identity:010022": "لا يمكن تحديث نوع المطابقة.", + "Volo.Abp.Identity:010023": "لا يمكن حذف نوع المطابقة.", "Identity.OrganizationUnit.MaxUserMembershipCount": "العدد الأقصى المسموح به لعضوية الوحدة التنظيمية للمستخدم", "ThisUserIsNotActiveMessage": "هذا المستخدم غير نشط.", "Permission:IdentityManagement": "إدارة الهوية", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/cs.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/cs.json index e6e1fd4f40..deea27dd17 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/cs.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/cs.json @@ -77,6 +77,8 @@ "Volo.Abp.Identity:010008": "Není povoleno měnit nastavení dvou faktorů.", "Volo.Abp.Identity:010009": "Nemůžete delegovat své vlastní oprávnění.", "Volo.Abp.Identity:010021": "Název '{0}' již existuje.", + "Volo.Abp.Identity:010022": "Nelze aktualizovat statický typ deklarace.", + "Volo.Abp.Identity:010023": "Nelze smazat statický typ deklarace.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Maximální povolený počet členů organizační jednotky pro uživatele", "ThisUserIsNotActiveMessage": "Tento uživatel není aktivní.", "Permission:IdentityManagement": "Správa identit", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/de.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/de.json index c633851683..5987f215d7 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/de.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/de.json @@ -77,6 +77,8 @@ "Volo.Abp.Identity:010008": "Die Zwei-Faktor-Einstellung dürfen nicht geändert werden.", "Volo.Abp.Identity:010009": "Sie können sich nicht selbst delegieren.", "Volo.Abp.Identity:010021": "Der Name existiert bereits {0}", + "Volo.Abp.Identity:010022": "Der Name kann nicht aktualisiert werden.", + "Volo.Abp.Identity:010023": "Der Name kann nicht gelöscht werden.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Maximal zulässige Anzahl an Mitgliedschaften in Organisationseinheiten für einen Benutzer", "ThisUserIsNotActiveMessage": "Dieser Benutzer ist nicht aktiv.", "Permission:IdentityManagement": "Identitätsverwaltung", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/el.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/el.json index fe9ac05d5a..b3b040cb91 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/el.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/el.json @@ -76,6 +76,8 @@ "Volo.Abp.Identity:010008": "Δεν επιτρέπεται η αλλαγή της ρύθμισης δύο παραγόντων.", "Volo.Abp.Identity:010009": "Δεν μπορείτε να αναθέσετε την εξουσιοδότησή σας σε εσάς ίδιο.", "Volo.Abp.Identity:010021": "Το όνομα '{0}' υπάρχει ήδη.", + "Volo.Abp.Identity:010022": "Δεν μπορείτε να ενημερώσετε ένα στατικό τύπο δήλωσης.", + "Volo.Abp.Identity:010023": "Δεν μπορείτε να διαγράψετε ένα στατικό τύπο δήλωσης.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Μέγιστος επιτρεπόμενος αριθμός μελών μονάδας οργανισμού για έναν χρήστη", "ThisUserIsNotActiveMessage": "Αυτός ο χρήστης δεν είναι ενεργός.", "Permission:IdentityManagement": "Διαχείριση ταυτότητας", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en-GB.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en-GB.json index 915f0dd461..b7d30bb30a 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en-GB.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en-GB.json @@ -76,6 +76,8 @@ "Volo.Abp.Identity:010008": "Changing the two factor setting is not allowed.", "Volo.Abp.Identity:010009": "You cannot delegate yourself!", "Volo.Abp.Identity:010021": "Name exist: '{0}'", + "Volo.Abp.Identity:010022": "Can not update a static ClaimType.", + "Volo.Abp.Identity:010023": "Can not delete a static ClaimType.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Maximum allowed organisation unit membership count for a user", "Permission:IdentityManagement": "Identity management", "Permission:RoleManagement": "Role management", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json index 97aafcdb8e..266ce50b5a 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json @@ -77,6 +77,8 @@ "Volo.Abp.Identity:010008": "It's not allowed to change two factor setting.", "Volo.Abp.Identity:010009": "You can not delegate yourself.", "Volo.Abp.Identity:010021": "Name exist: '{0}'.", + "Volo.Abp.Identity:010022": "Can not update a static ClaimType.", + "Volo.Abp.Identity:010023": "Can not delete a static ClaimType.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Maximum allowed organization unit membership count for a user", "ThisUserIsNotActiveMessage": "This user is not active.", "Permission:IdentityManagement": "Identity management", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/es.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/es.json index fb5edbc2ac..861ffe10b0 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/es.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/es.json @@ -77,6 +77,8 @@ "Volo.Abp.Identity:010008": "No está permitido cambiar la configuración de autenticación de dos pasos.", "Volo.Abp.Identity:010009": "No puedes delegar tu propia cuenta!", "Volo.Abp.Identity:010021": "Ya existe un con el nombre '{0}'", + "Volo.Abp.Identity:010022": "No se puede actualizar un tipo de reclamación estática.", + "Volo.Abp.Identity:010023": "No se puede borrar un tipo de reclamación estática.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Número máximo de unidades organizativas por usuario", "ThisUserIsNotActiveMessage": "Este usuario no está activo.", "Permission:IdentityManagement": "Gestión de identidades", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/fa.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/fa.json index 3482c2120e..b733dbd4eb 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/fa.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/fa.json @@ -77,6 +77,8 @@ "Volo.Abp.Identity:010008": "تغییر دادن تنظیمات دو مرحله ای مجاز نمی باشد.", "Volo.Abp.Identity:010009": "شما نمی توانید خودتان را معرفی کنید.", "Volo.Abp.Identity:010021": "نام {0} قبلاً استفاده گردیده است.", + "Volo.Abp.Identity:010022": "نمی توان نام نقش/وظیفه را تغییر داد.", + "Volo.Abp.Identity:010023": "نمی توان نقش/وظیفه را حذف کرد.", "Identity.OrganizationUnit.MaxUserMembershipCount": "حداکثر تعداد مجاز عضویت در یک واحد سازمان برای یک کاربر", "ThisUserIsNotActiveMessage": "این کاربر غیرفعال میباشد.", "Permission:IdentityManagement": "مدیریت هویت", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/fi.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/fi.json index cf3d33c34f..1ad2950b8e 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/fi.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/fi.json @@ -77,6 +77,8 @@ "Volo.Abp.Identity:010008": "Kahden tekijän asetusta ei saa muuttaa.", "Volo.Abp.Identity:010009": "Et voi delegoida itseäsi.", "Volo.Abp.Identity:010021": "{0} on jo olemassa.", + "Volo.Abp.Identity:010022": "Staattista väittämätunnusta ei voi päivittää.", + "Volo.Abp.Identity:010023": "Staattista väittämätunnusta ei voi poistaa.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Suurin sallittu organisaatioyksikön jäsenmäärä käyttäjälle", "ThisUserIsNotActiveMessage": "Tämä käyttäjä ei ole aktiivinen.", "Permission:IdentityManagement": "Identiteetin hallinta", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/fr.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/fr.json index d7c8788585..39c5a3a71d 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/fr.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/fr.json @@ -77,6 +77,8 @@ "Volo.Abp.Identity:010008": "Il n’est pas permis de changer deux facteurs de réglage.", "Volo.Abp.Identity:010009": "Vous ne pouvez pas vous déléguer vous-même.", "Volo.Abp.Identity:010021" : "Le nom '{0}' existe déjà.", + "Volo.Abp.Identity:010022": "Vous ne pouvez pas modifier un type de revendication statique.", + "Volo.Abp.Identity:010023": "Vous ne pouvez pas supprimer un type de revendication statique.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Nombre maximal d’adhésions autorisées à l’unité d’organisation pour un utilisateur", "ThisUserIsNotActiveMessage": "Cet utilisateur n'est pas actif.", "Permission:IdentityManagement": "Gestion de l’identité", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/hi.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/hi.json index 0c945fc6bd..760ae275de 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/hi.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/hi.json @@ -77,6 +77,8 @@ "Volo.Abp.Identity:010008": "इसे दो कारक सेटिंग बदलने की अनुमति नहीं है।", "Volo.Abp.Identity:010009": "आप अपने आप को अधिकृत नहीं कर सकते हैं!", "Volo.Abp.Identity:010021" : "नाम '{0}' पहले से ही लिया गया है।", + "Volo.Abp.Identity:010022": "स्थैतिक भूमिकाओं का नाम नहीं बदला जा सकता है।", + "Volo.Abp.Identity:010023": "स्थैतिक भूमिकाओं को हटाया नहीं जा सकता।", "Identity.OrganizationUnit.MaxUserMembershipCount": "उपयोगकर्ता के लिए अधिकतम अनुमत संगठन इकाई सदस्यता गणना", "ThisUserIsNotActiveMessage": "यह उपयोगकर्ता सक्रिय नहीं है।", "Permission:IdentityManagement": "पहचान प्रबंधन", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/hr.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/hr.json index 92d4b74973..5af46488f3 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/hr.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/hr.json @@ -76,7 +76,9 @@ "Volo.Abp.Identity:010007": "Ne možete promijeniti postavku dva faktora.", "Volo.Abp.Identity:010008": "Nije dopušteno mijenjati postavke dvofaktorske autentifikacije.", "Volo.Abp.Identity:010009": "Ne možete delegirati sami sebi.", - "Volo.Abp.Identity:010021" : "Naziv '{0}' već postoji.", + "Volo.Abp.Identity:010021": "Naziv '{0}' već postoji.", + "Volo.Abp.Identity:010022": "Ne možete ažurirati statički tip deklaracije.", + "Volo.Abp.Identity:010023": "Ne možete izbrisati statički tip deklaracije.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Maksimalni dopušteni broj članstva u organizacijskoj jedinici za korisnika", "ThisUserIsNotActiveMessage": "Ovaj korisnik nije aktivan.", "Permission:IdentityManagement": "Upravljanje identitetom", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/hu.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/hu.json index e65fdd805e..4c9ee448eb 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/hu.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/hu.json @@ -76,7 +76,9 @@ "Volo.Abp.Identity:010007": "Nem változtathatja meg a kétlépcsős bejelentkezés beállítását.", "Volo.Abp.Identity:010008": "Kétlépcsős bejelentkezés beállítás megváltoztatása nem megengedett.", "Volo.Abp.Identity:010009": "Nem adhatja át a saját jogosultságait.", - "Volo.Abp.Identity:010021" : "'{0}' nevű már létezik.", + "Volo.Abp.Identity:010021": "'{0}' nevű már létezik.", + "Volo.Abp.Identity:010022": "Nem lehet frissíteni a statikus jogosultság típusát.", + "Volo.Abp.Identity:010023": "Nem lehet törölni a statikus jogosultság típusát.", "Identity.OrganizationUnit.MaxUserMembershipCount": "A maximálisan megengedett szervezeti egység tagsági szám egy felhasználó számára", "ThisUserIsNotActiveMessage": "Ez a felhasználó nem aktív.", "Permission:IdentityManagement": "Identitáskezelés", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/is.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/is.json index 38fa84db3d..013bce103e 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/is.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/is.json @@ -76,7 +76,9 @@ "Volo.Abp.Identity:010007": "Þú getur ekki breytt tveggja þátta stillingu þinni.", "Volo.Abp.Identity:010008": "Það er ekki leyfilegt að breyta tvíþátta stillingu.", "Volo.Abp.Identity:010009": "Þú getur ekki delegað þér sjálfum.", - "Volo.Abp.Identity:010021" : "Nafnið '{0}' er þegar í notkun.", + "Volo.Abp.Identity:010021": "Nafnið '{0}' er þegar í notkun.", + "Volo.Abp.Identity:010022": "Ekki er hægt að breyta static hlutverk.", + "Volo.Abp.Identity:010023": "Ekki er hægt að eyða static hlutverkum.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Hámarks leyfileg fjöldi aðildar að skipulagseiningu fyrir notanda", "ThisUserIsNotActiveMessage": "Þessi notandi er ekki virkur.", "Permission:IdentityManagement": "Auðkenninga umsjón", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/it.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/it.json index bf8eb97e59..00d5c139b9 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/it.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/it.json @@ -76,7 +76,9 @@ "Volo.Abp.Identity:010007": "Non puoi modificare l'impostazione dei due fattori.", "Volo.Abp.Identity:010008": "Non è consentito modificare l'impostazione a due fattori.", "Volo.Abp.Identity:010009": "Non puoi delegare te stesso.", - "Volo.Abp.Identity:010021" : "Il nome '{0}' è già in uso.", + "Volo.Abp.Identity:010021": "Il nome '{0}' è già in uso.", + "Volo.Abp.Identity:010022": "Non puoi modificare il tipo di richiesta statica.", + "Volo.Abp.Identity:010023": "Non puoi eliminare il tipo di richiesta statica.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Numero massimo consentito di membri dell'unità organizzativa per un utente", "ThisUserIsNotActiveMessage": "Questo utente non è attivo.", "Permission:IdentityManagement": "Gestione identità", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/nl.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/nl.json index 9a4928c4c0..f7fab35933 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/nl.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/nl.json @@ -76,7 +76,9 @@ "Volo.Abp.Identity:010007": "U kunt uw instelling voor tweefactor authenticatie niet wijzigen.", "Volo.Abp.Identity:010008": "Het is niet toegestaan om de instelling van tweefactor authenticatie te wijzigen.", "Volo.Abp.Identity:010009": "U kunt uzelf niet delegeren.", - "Volo.Abp.Identity:010021" : "Er bestaat al een met de naam '{0}'.", + "Volo.Abp.Identity:010021": "Er bestaat al een met de naam '{0}'.", + "Volo.Abp.Identity:010022": "Kan de naam van een statische claim niet wijzigen.", + "Volo.Abp.Identity:010023": "Kan de naam van een statische claim niet verwijderen.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Maximaal toegestande aantal lidmaatschappen van organisatie-eenheden voor een gebruiker", "ThisUserIsNotActiveMessage": "Deze gebruiker is niet actief.", "Permission:IdentityManagement": "Identiteitsbeheer", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/pl-PL.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/pl-PL.json index 6e2d4d1406..8d794777ee 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/pl-PL.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/pl-PL.json @@ -76,7 +76,9 @@ "Volo.Abp.Identity:010007": "Nie możesz zmienić ustawienia dwóch czynników.", "Volo.Abp.Identity:010008": "Nie wolno zmieniać ustawienia dwuczynnikowego.", "Volo.Abp.Identity:010009": "Nie możesz delegować swoich uprawnień.", - "Volo.Abp.Identity:010021" : "Nazwa '{0}' już istnieje.", + "Volo.Abp.Identity:010021": "Nazwa '{0}' już istnieje.", + "Volo.Abp.Identity:010022": "Nie można zmienić typu statycznej deklaracji.", + "Volo.Abp.Identity:010023": "Nie można usunąć typu statycznej deklaracji.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Maksymalna dozwolona liczba członków jednostki organizacyjnej dla użytkownika", "ThisUserIsNotActiveMessage": "Ten użytkownik nie jest aktywny.", "Permission:IdentityManagement": "Zarządzanie tożsamością", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/pt-BR.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/pt-BR.json index 54c4ee1a20..b8c4a0fdb7 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/pt-BR.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/pt-BR.json @@ -76,7 +76,9 @@ "Volo.Abp.Identity:010007": "Você não pode alterar sua configuração de dois fatores.", "Volo.Abp.Identity:010008": "Não é permitido alterar a configuração de dois fatores.", "Volo.Abp.Identity:010009": "Você não pode delegar a si mesmo.", - "Volo.Abp.Identity:010021" : "Já existe um(a) {0} com o nome.", + "Volo.Abp.Identity:010021": "Já existe um(a) {0} com o nome.", + "Volo.Abp.Identity:010022": "Não é possível alterar o tipo de declaração estática.", + "Volo.Abp.Identity:010023": "Não é possível excluir o tipo de declaração estática.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Contagem máxima permitida de membros da unidade organizacional para um usuário", "ThisUserIsNotActiveMessage": "Este usuário não está ativo.", "Permission:IdentityManagement": "Acessos", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/ro-RO.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/ro-RO.json index 59e5db1aa7..2cde7af570 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/ro-RO.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/ro-RO.json @@ -76,7 +76,9 @@ "Volo.Abp.Identity:010007": "Nu vă puteţi schimba setările de autentificare în doi paşi.", "Volo.Abp.Identity:010008": "Nu este permisă modificarea setărilor autentificării în doi paşi.", "Volo.Abp.Identity:010009": "Nu vă puteţi delega singur.", - "Volo.Abp.Identity:010021" : "Numele '{0}' este deja luat.", + "Volo.Abp.Identity:010021": "Numele '{0}' este deja luat.", + "Volo.Abp.Identity:010022": "Nu poate fi schimbată tipul de declaraţie statică.", + "Volo.Abp.Identity:010023": "Nu poate fi ştersă declaraţia statică.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Numărul maxim de unităţi organizaţionale permise pentru un utilizator", "ThisUserIsNotActiveMessage": "Acest utilizator nu este activ.", "Permission:IdentityManagement": "Administrare identităţii", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/ru.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/ru.json index e9a89171d3..8345df27b8 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/ru.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/ru.json @@ -76,7 +76,9 @@ "Volo.Abp.Identity:010007": "Вы не можете изменить настройку двух факторов.", "Volo.Abp.Identity:010008": "Изменение двухфакторной настройки не допускается.", "Volo.Abp.Identity:010009": "Вы не можете делегировать свои собственные права.", - "Volo.Abp.Identity:010021" : "Имя '{0}' уже существует.", + "Volo.Abp.Identity:010021": "Имя '{0}' уже существует.", + "Volo.Abp.Identity:010022": "Невозможно изменить тип статической декларации.", + "Volo.Abp.Identity:010023": "Невозможно удалить тип статической декларации.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Максимально допустимое количество членов организационного подразделения для пользователя", "ThisUserIsNotActiveMessage": "Этот пользователь не активен.", "Permission:IdentityManagement": "Управление идентификацией", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/sk.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/sk.json index 5ab18796c5..d9fa8dbf61 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/sk.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/sk.json @@ -76,7 +76,9 @@ "Volo.Abp.Identity:010007": "Dvojfaktorové nastavenie nie je možné zmeniť.", "Volo.Abp.Identity:010008": "Dvojfaktorové nastavenie nie je povolené zmeniť.", "Volo.Abp.Identity:010009": "Nemôžete delegovať svoje vlastné oprávnenia.", - "Volo.Abp.Identity:010021" : "Názov '{0}' sa už používa.", + "Volo.Abp.Identity:010021": "Názov '{0}' sa už používa.", + "Volo.Abp.Identity:010022": "Nie je možné zmeniť typ statického oprávnenia.", + "Volo.Abp.Identity:010023": "Nie je možné odstrániť typ statického oprávnenia.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Maximálny povolený počet členov organizačnej jednotky pre používateľa", "ThisUserIsNotActiveMessage": "Tento používateľ nie je aktívny.", "Permission:IdentityManagement": "Správa identít", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/sl.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/sl.json index be509eccf1..b6d505c1c3 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/sl.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/sl.json @@ -77,6 +77,8 @@ "Volo.Abp.Identity:010008": "Ni dovoljeno spreminjati nastavitve dveh faktorjev.", "Volo.Abp.Identity:010009": "Ne morete delegirati svojih pravic.", "Volo.Abp.Identity:010021" : "Naziv '{0}' že obstaja.", + "Volo.Abp.Identity:010022": "Ne morete spremeniti tipa statične deklaracije.", + "Volo.Abp.Identity:010023": "Ne morete izbrisati tipa statične deklaracije.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Največje dovoljeno število članov v organizacijski enoti za uporabnika", "ThisUserIsNotActiveMessage": "Ta uporabnik ni aktiven.", "Permission:IdentityManagement": "Upravljanje identitet", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/sv.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/sv.json index e8ebd083bf..e664adbbfe 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/sv.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/sv.json @@ -77,6 +77,8 @@ "Volo.Abp.Identity:010008": "Det är inte tillåtet att ändra inställningen för två faktorer.", "Volo.Abp.Identity:010009": "Du kan inte delegera dig själv.", "Volo.Abp.Identity:010021": "Namn finns: '{0}'.", + "Volo.Abp.Identity:010022": "Kan inte ändra statiskt område.", + "Volo.Abp.Identity:010023": "Kan inte ta bort statiskt område.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Högsta tillåtna antal medlemskap i organisationsenheter för en användare", "ThisUserIsNotActiveMessage": "Den här användaren är inte aktiv.", "Permission:IdentityManagement": "Identitetshantering", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/tr.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/tr.json index 813f62fabe..72b232de4e 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/tr.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/tr.json @@ -76,7 +76,9 @@ "Volo.Abp.Identity:010007": "İki faktörlü ayarınızı değiştiremezsiniz.", "Volo.Abp.Identity:010008": "İki faktörlü ayarın değiştirilmesine izin verilmez.", "Volo.Abp.Identity:010009": "Kendinizi yetkilendiremezsiniz.", - "Volo.Abp.Identity:010021" : "{0} isminde bir birim zaten var.", + "Volo.Abp.Identity:010021": "{0} isminde bir birim zaten var.", + "Volo.Abp.Identity:010022": "Bir statik izin tipi değiştirilemez.", + "Volo.Abp.Identity:010023": "Bir statik izin tipi silinemez.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Bir kullanıcı için izin verilen en fazla organizasyon birimi sayısı", "ThisUserIsNotActiveMessage": "Bu kullanıcı aktif değil.", "Permission:IdentityManagement": "Kimlik yönetimi", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/vi.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/vi.json index 231b00db46..39f9940090 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/vi.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/vi.json @@ -77,6 +77,8 @@ "Volo.Abp.Identity:010008": "Không được phép thay đổi cài đặt hai yếu tố.", "Volo.Abp.Identity:010009": "Bạn không thể ủy quyền cho chính mình.", "Volo.Abp.Identity:010021": "Tên '{0}' đã tồn tại.", + "Volo.Abp.Identity:010022": "Không thể thay đổi kiểu của phát biểu tĩnh.", + "Volo.Abp.Identity:010023": "Không thể xóa phát biểu tĩnh.", "Identity.OrganizationUnit.MaxUserMembershipCount": "Số lượng thành viên đơn vị tổ chức tối đa được phép cho một người dùng", "ThisUserIsNotActiveMessage": "Người dùng này không hoạt động.", "Permission:IdentityManagement": "Quản lý danh tính", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hans.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hans.json index 4ae5130994..cfbe6bd279 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hans.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hans.json @@ -77,6 +77,8 @@ "Volo.Abp.Identity:010008": "不允许修改双因素身份验证设置。", "Volo.Abp.Identity:010009": "你不能委托给自己。", "Volo.Abp.Identity:010021": "名称:'{0}' 已存在", + "Volo.Abp.Identity:010022": "不能更改静态声明的类型。", + "Volo.Abp.Identity:010023": "不能删除静态声明的类型。", "Identity.OrganizationUnit.MaxUserMembershipCount": "组织单位最大允许的成员资格计数", "ThisUserIsNotActiveMessage": "该用户不可用。", "Permission:IdentityManagement": "身份标识管理", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hant.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hant.json index 0666df264d..b3899de248 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hant.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hant.json @@ -76,7 +76,9 @@ "Volo.Abp.Identity:010007": "你不能修改你的雙因素身份驗證設置", "Volo.Abp.Identity:010008": "不允許修改雙因素身份驗證設置.", "Volo.Abp.Identity:010009": "你不能委派給自己", - "Volo.Abp.Identity:010021" : "名稱 '{0}' 已存在.", + "Volo.Abp.Identity:010021": "名稱 '{0}' 已存在.", + "Volo.Abp.Identity:010022": "無法更改靜態宣告的類型.", + "Volo.Abp.Identity:010023": "無法刪除靜態宣告的類型.", "Identity.OrganizationUnit.MaxUserMembershipCount": "允許一個使用者至多可隸屬在幾個組織單位", "ThisUserIsNotActiveMessage": "該用戶不可用.", "Permission:IdentityManagement": "身份識別管理", diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityClaimTypeManager.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityClaimTypeManager.cs index bc8ab16d9f..f821f81d35 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityClaimTypeManager.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityClaimTypeManager.cs @@ -35,12 +35,12 @@ public class IdentityClaimTypeManager : DomainService { if (await IdentityClaimTypeRepository.AnyAsync(claimType.Name, claimType.Id)) { - throw new AbpException($"Name Exist: {claimType.Name}"); + throw new BusinessException(IdentityErrorCodes.ClaimNameExist).WithData("0", claimType.Name); } if (claimType.IsStatic) { - throw new AbpException($"Can not update a static ClaimType."); + throw new BusinessException(IdentityErrorCodes.CanNotUpdateStaticClaimType); } return await IdentityClaimTypeRepository.UpdateAsync(claimType); @@ -51,7 +51,7 @@ public class IdentityClaimTypeManager : DomainService var claimType = await IdentityClaimTypeRepository.GetAsync(id); if (claimType.IsStatic) { - throw new AbpException($"Can not delete a static ClaimType."); + throw new BusinessException(IdentityErrorCodes.CanNotDeleteStaticClaimType); } //Remove claim of this type from all users and roles From 750574ad99db6e62ffa1fc1eeac4d4e71a2e76e0 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Wed, 19 Mar 2025 21:20:27 +0800 Subject: [PATCH 5/8] Update IdentityClaimTypeManager_Tests.cs --- .../Volo/Abp/Identity/IdentityClaimTypeManager_Tests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/IdentityClaimTypeManager_Tests.cs b/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/IdentityClaimTypeManager_Tests.cs index 9078040910..04f4cc6eaa 100644 --- a/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/IdentityClaimTypeManager_Tests.cs +++ b/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/IdentityClaimTypeManager_Tests.cs @@ -53,7 +53,7 @@ public class IdentityClaimTypeManager_Tests : AbpIdentityDomainTestBase [Fact] public async Task Update_Name_Exist_Should_Exception() { - await Assert.ThrowsAnyAsync(async () => await _claimTypeManager.UpdateAsync( + await Assert.ThrowsAnyAsync(async () => await _claimTypeManager.UpdateAsync( new IdentityClaimType( Guid.NewGuid(), "Age"))); } @@ -65,6 +65,6 @@ public class IdentityClaimTypeManager_Tests : AbpIdentityDomainTestBase var phoneClaim = new IdentityClaimType(Guid.NewGuid(), "Phone", true, true); await _identityClaimTypeRepository.InsertAsync(phoneClaim); - await Assert.ThrowsAnyAsync(async () => await _claimTypeManager.UpdateAsync(phoneClaim)); + await Assert.ThrowsAnyAsync(async () => await _claimTypeManager.UpdateAsync(phoneClaim)); } } From 4dc17253103f7f2d8ae71825722b0f8bac7661ab Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Thu, 20 Mar 2025 01:03:36 +0300 Subject: [PATCH 6/8] Add Video Link to Community Article --- .../2025-03-18-Using-Vue-Components/post.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/en/Community-Articles/2025-03-18-Using-Vue-Components/post.md b/docs/en/Community-Articles/2025-03-18-Using-Vue-Components/post.md index ad5d19e22d..bc0b390b03 100644 --- a/docs/en/Community-Articles/2025-03-18-Using-Vue-Components/post.md +++ b/docs/en/Community-Articles/2025-03-18-Using-Vue-Components/post.md @@ -4,6 +4,10 @@ In modern web development, integrating dynamic front-end frameworks with server- This article won't use any SPA approach. The goal of this article is to use Razor Pages with simple Vue components to eliminate jQuery while developing MVC application. +> **🎉 Also video version is available!** +> +> [Watch on YouTube Now!](https://youtu.be/sZ8iSMovHZs?si=GynuJjsLEI1p2g6w) + ## Creating the Solution Let's create a simple TODO list application to demonstrate how to use Vue components in Razor Pages. I'll build a really simple backend without a connection to a database for demonstration purposes. We will focus on the frontend part. @@ -71,13 +75,13 @@ Let's create a simple Vue component to display the TODO list. ```html
- +
``` - Navigate to the `Index.cshtml.js` file and add the following code: ```js -Vue.component('todo-component', { +Vue.component('message-component', { template: '
Hello, {{ message }}
', props: ['message'] }); From 3cef2c479980ae92bef9513ce01e95b8b3d14488 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Thu, 20 Mar 2025 14:13:36 +0800 Subject: [PATCH 7/8] Redirect to login URL instead of logout URL in WebAssemblyRedirectToLogin component --- .../Themes/Basic/WebAssemblyRedirectToLogin.razor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/WebAssemblyRedirectToLogin.razor b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/WebAssemblyRedirectToLogin.razor index 97e0eb2995..f4f3e152ce 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/WebAssemblyRedirectToLogin.razor +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/WebAssemblyRedirectToLogin.razor @@ -15,7 +15,7 @@ { if (AbpAspNetCoreComponentsWebOptions.Value.IsBlazorWebApp) { - Navigation.NavigateTo(AuthenticationOptions.Value.LogoutUrl, forceLoad: true); + Navigation.NavigateTo(AuthenticationOptions.Value.LoginUrl, forceLoad: true); } else { From ba4a4fadd846498166b19439ab982109486a479d Mon Sep 17 00:00:00 2001 From: Mansur Besleney Date: Thu, 20 Mar 2025 13:17:40 +0300 Subject: [PATCH 8/8] Update en.json --- .../AbpIoLocalization/Community/Localization/Resources/en.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json index 78231bb1af..f1dcba47a8 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json @@ -264,6 +264,7 @@ "EditProfile": "Edit Profile", "ConfirmEmailForPost": "To be able to post, you need to confirm your email. Go to account.abp.io/Account/Manage and verify your email in the Personal Info tab.", "DailyPostCreateLimitation": "You have reached the daily post creation limit. You can create a new post in {0}.", - "YourAccountDisabled": "Your user account is disabled!" + "YourAccountDisabled": "Your user account is disabled!", + "PostCreationFailed": "An error occurred while creating the post. Please try again later." } }