diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/zh-Hans.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/zh-Hans.json
index 924306634e..0d67d9cca5 100644
--- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/zh-Hans.json
+++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/zh-Hans.json
@@ -565,7 +565,7 @@
"PrePayment_IyzicoRedirectionInfo": "您将被重定向到 Iyzico 支付网关以安全地完成您的购买。",
"PrePayment_IyzicoAcceptVisaAndMasterCard": "Iyzico 接受 Visa 和 MasterCard。",
"Purchase": "购买",
- "AcceptTermsAndConditions": "我已阅读、理解并接受隐私政策, 条款和条件和 EULA。",
+ "AcceptTermsAndConditions": "我已阅读、理解并接受隐私政策, 条款和条件和 EULA。",
"AcceptTermsAndConditionsWarningMessage": "请接受隐私政策和条款和条件",
"SelectGatewayToContinue": "请选择一个网关以继续!",
"GatewaySelection_SelectGateway": "选择支付网关",
diff --git a/docs/en/UI/Angular/Config-State-Service.md b/docs/en/UI/Angular/Config-State-Service.md
index 11415eb771..c457184fc2 100644
--- a/docs/en/UI/Angular/Config-State-Service.md
+++ b/docs/en/UI/Angular/Config-State-Service.md
@@ -120,7 +120,7 @@ Please refer to `ApplicationConfigurationDto` type for all the properties you ca
You can get the application configuration response and set the `ConfigStateService` state value as shown below:
```js
-import {ApplicationConfigurationService, ConfigStateService} from '@abp/ng.core';
+import {AbpApplicationConfigurationService, ConfigStateService} from '@abp/ng.core';
constructor(private abpApplicationConfigurationService: AbpApplicationConfigurationService, private config: ConfigStateService) {
this.abpApplicationConfigurationService.get().subscribe(config => {
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs
index 1d95297a88..7c21b9fe09 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs
@@ -1,6 +1,5 @@
-using System.Threading.Tasks;
+using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
-using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus;
using Volo.Abp.Modularity;
using Volo.Abp.Threading;
@@ -20,6 +19,6 @@ public class AbpAspNetCoreMvcClientModule : AbpModule
public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context)
{
- await context.ServiceProvider.GetRequiredService().ServiceProvider.GetRequiredService().InitializeAsync();
+ await context.ServiceProvider.GetRequiredService().InitializeAsync();
}
}
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs
index a30b16ee41..fa0cc26d11 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs
@@ -103,18 +103,6 @@ public abstract class ProjectCreationCommandBase
Logger.LogInformation("UI Framework: " + uiFramework);
}
- var theme = uiFramework == UiFramework.None ? (Theme?)null : GetThemeByTemplateOrNull(commandLineArgs, template);
- if (theme.HasValue)
- {
- Logger.LogInformation("Theme: " + theme);
- }
-
- var themeStyle = theme.HasValue ? GetThemeStyleOrNull(commandLineArgs, theme.Value) : (ThemeStyle?)null;
- if(themeStyle.HasValue)
- {
- Logger.LogInformation("Theme Style: " + themeStyle);
- }
-
var publicWebSite = uiFramework != UiFramework.None && commandLineArgs.Options.ContainsKey(Options.PublicWebSite.Long);
if (publicWebSite)
{
@@ -210,6 +198,9 @@ public abstract class ProjectCreationCommandBase
}
commandLineArgs.Options.Add(CliConsts.Command, commandLineArgs.Command);
+
+ var theme = uiFramework == UiFramework.None ? (Theme?)null : GetThemeByTemplateOrNull(commandLineArgs, template);
+ var themeStyle = theme.HasValue ? GetThemeStyleOrNull(commandLineArgs, theme.Value) : (ThemeStyle?)null;
return new ProjectBuildArgs(
solutionName,
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs
index dcf8496e66..916f861460 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs
@@ -141,6 +141,13 @@ public class ChangeThemeStep : ProjectBuildPipelineStep
"AbpAspNetCoreComponentsWebAssemblyLeptonThemeModule"
);
+ ChangeNamespace(
+ context,
+ "/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs",
+ "Volo.Abp.AspNetCore.Components.WebAssembly.LeptonXTheme",
+ "Volo.Abp.AspNetCore.Components.WebAssembly.LeptonTheme"
+ );
+
#endregion
#region MyCompanyName.MyProjectName.Blazor.Server && MyCompanyName.MyProjectName.Blazor.Server.Tiered
@@ -210,7 +217,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep
}
AddProjectReference(file, $@"..\..\..\..\lepton-theme\src\Volo.Abp.LeptonTheme.Management.{projectName}\Volo.Abp.LeptonTheme.Management.{projectName}.csproj");
- AddModuleDependency(moduleFile, $"LeptonThemeManagement{ConvertProjectNameToModuleName($"{projectName}")}Module");
+ AddModuleDependency(moduleFile, projectName, $"LeptonThemeManagement{ConvertProjectNameToModuleName($"{projectName}")}Module");
}
}
@@ -325,21 +332,22 @@ public class ChangeThemeStep : ProjectBuildPipelineStep
AddProjectReference(projectFile, reference);
- AddModuleDependency(moduleFile, $"LeptonThemeManagement{ConvertProjectNameToModuleName(projectInfo.Key)}Module",
+ AddModuleDependency(moduleFile, projectInfo.Key, $"LeptonThemeManagement{ConvertProjectNameToModuleName(projectInfo.Key)}Module",
underManagementFolder: projectInfo.Key != "HttpApi");
}
- private void AddModuleDependency(FileEntry moduleFile, string dependency, bool underManagementFolder = true)
+ private void AddModuleDependency(FileEntry moduleFile, string projectName, string dependency, bool underManagementFolder = true)
{
- var lines = moduleFile.GetLines();
+ var projectNames = new[] { "Blazor", "Blazor.Server", "Blazor.WebAssembly" };
+ var lines = moduleFile.GetLines();
for (var i = 0; i < lines.Length; i++)
{
if (lines[i].Contains("namespace MyCompanyName.MyProjectName"))
{
- lines[i - 1] = lines[i - 1] + "using Volo.Abp.LeptonTheme" + (underManagementFolder ? ".Management" : "").EnsureEndsWith(';') + Environment.NewLine;
+ lines[i - 1] = lines[i - 1] + ("using Volo.Abp.LeptonTheme" + (underManagementFolder ? ".Management." : ".") + (projectNames.Any(p => p == projectName) ? projectName : "")).TrimEnd('.').EnsureEndsWith(';') + Environment.NewLine;
}
-
+
if (lines[i].Contains("public class MyProjectName") && lines[i-1].Contains(")]"))
{
lines[i - 2] = lines[i - 2] + "," + Environment.NewLine + $"\ttypeof({dependency})";
@@ -584,9 +592,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep
.Replace(".csproj", "Module")
.Replace(".", "");
- fileName = ConvertProjectNameToModuleName(fileName);
-
- return context.Files.FirstOrDefault(f => f.Name.Contains(splittedProjectFileName.Last() + "/" + fileName));
+ return context.Files.FirstOrDefault(f => f.Name.Contains(splittedProjectFileName.Last() + "/" + fileName) && f.Name.EndsWith("Module.cs"));
}
private static string ConvertProjectNameToModuleName(string moduleName)
@@ -796,6 +802,12 @@ public class ChangeThemeStep : ProjectBuildPipelineStep
"BlazorLeptonXThemeBundles.Scripts.Global",
"BlazorLeptonThemeBundles.Scripts.Global"
);
+
+ RemoveLinesByStatement(
+ context,
+ $"/MyCompanyName.MyProjectName.{projectName}/MyProjectNameBlazorModule.cs",
+ "Volo.Abp.LeptonX.Shared;"
+ );
}
}
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateProjectBuilder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateProjectBuilder.cs
index 126e9bdbf9..33c2237773 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateProjectBuilder.cs
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateProjectBuilder.cs
@@ -71,6 +71,8 @@ public class TemplateProjectBuilder : IProjectBuilder, ITransientDependency
args.ExtraProperties.ContainsKey(NewCommand.Options.Preview.Long)
);
+ ConfigureThemeOptions(args, templateFile.Version);
+
DeveloperApiKeyResult apiKeyResult = null;
#if DEBUG
@@ -207,4 +209,37 @@ public class TemplateProjectBuilder : IProjectBuilder, ITransientDependency
return TemplateInfoProvider.Get(args.TemplateName);
}
}
+
+ private bool IsThemeOptionEnabled(ProjectBuildArgs args, string templateVersion)
+ {
+ var version = string.IsNullOrWhiteSpace(args.Version)
+ ? templateVersion
+ : args.Version;
+
+ if (!SemanticVersion.TryParse(version, out var semanticVersion))
+ {
+ return false;
+ }
+
+ return semanticVersion >= SemanticVersion.Parse("6.0.0-rc.1");
+ }
+
+ private void ConfigureThemeOptions(ProjectBuildArgs args, string templateVersion)
+ {
+ if (!IsThemeOptionEnabled(args, templateVersion))
+ {
+ args.Theme = null;
+ args.ThemeStyle = null;
+ }
+
+ if (args.Theme.HasValue)
+ {
+ Logger.LogInformation("Theme: " + args.Theme);
+ }
+
+ if(args.ThemeStyle.HasValue)
+ {
+ Logger.LogInformation("Theme Style: " + args.ThemeStyle);
+ }
+ }
}
diff --git a/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToEnumConverter.cs b/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToEnumConverter.cs
index c4720c92db..6b7f32807e 100644
--- a/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToEnumConverter.cs
+++ b/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToEnumConverter.cs
@@ -1,5 +1,4 @@
using System;
-using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
@@ -48,4 +47,14 @@ public class AbpStringToEnumConverter : JsonConverter
JsonSerializer.Serialize(writer, value, _writeJsonSerializerOptions);
}
+
+ public override T ReadAsPropertyName(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ return (T)Enum.Parse(typeToConvert, reader.GetString());
+ }
+
+ public override void WriteAsPropertyName(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
+ {
+ writer.WritePropertyName(Enum.GetName(typeof(T), value));
+ }
}
diff --git a/framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/AbpStringToEnum_Tests.cs b/framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/AbpStringToEnum_Tests.cs
index d3bba36534..8336b4ce7d 100644
--- a/framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/AbpStringToEnum_Tests.cs
+++ b/framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/AbpStringToEnum_Tests.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using System.Text.Json;
using Shouldly;
using Volo.Abp.Json.SystemTextJson.JsonConverters;
@@ -26,6 +27,16 @@ namespace Volo.Abp.Json
testClass = JsonSerializer.Deserialize("{\"Day\": 1}", options);
testClass.ShouldNotBeNull();
testClass.Day.ShouldBe(DayOfWeek.Monday);
+
+ var dictionary = JsonSerializer.Deserialize>("{\"Monday\":\"Mo\"}", options);
+ dictionary.ShouldNotBeNull();
+ dictionary.Keys.ShouldContain(DayOfWeek.Monday);
+ dictionary.Values.ShouldContain("Mo");
+
+ dictionary = JsonSerializer.Deserialize>("{\"1\":\"Mo\"}", options);
+ dictionary.ShouldNotBeNull();
+ dictionary.Keys.ShouldContain(DayOfWeek.Monday);
+ dictionary.Values.ShouldContain("Mo");
}
[Fact]
@@ -45,6 +56,13 @@ namespace Volo.Abp.Json
});
testClassJson.ShouldBe("{\"Day\":1}");
+
+ testClassJson = JsonSerializer.Serialize(new Dictionary
+ {
+ {DayOfWeek.Monday, "Mo"}
+ }, options);
+
+ testClassJson.ShouldBe("{\"Monday\":\"Mo\"}");
}
class TestClass
diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Index.cshtml b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Index.cshtml
index a3a99969ff..958621ea9c 100644
--- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Index.cshtml
+++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Index.cshtml
@@ -37,7 +37,7 @@