Browse Source

Merge branch 'dev' into event-publish-on-project-creation

pull/13078/head
Yunus Emre Kalkan 4 years ago
parent
commit
e7ef3b52fd
  1. 1
      abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json
  2. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliPaths.cs
  3. 8
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs
  4. 8
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs
  5. 70
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs
  6. 57
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/LIbs/InstallLibsService.cs
  7. 623
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs
  8. 4
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/TemplateCodeDeleteStep.cs
  9. 7
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Theme.cs
  10. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Files/FileEntryExtensions.cs
  11. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs
  12. 1
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppNoLayersTemplateBase.cs
  13. 60
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs
  14. 22
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmGlobalPackagesChecker.cs
  15. 61
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ThemePackageAdder.cs
  16. 69
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/NpmHelper.cs
  17. 6
      framework/src/Volo.Abp.Cli/Volo/Abp/Cli/Program.cs
  18. 19
      framework/src/Volo.Abp.Core/System/Collections/Generic/AbpDictionaryExtensions.cs
  19. 2
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/appsettings.json
  20. 8
      modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/ContentConsts.cs
  21. 10
      modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/ContentFragment.cs
  22. 18
      modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/CmsKitContentWidgetOptions.cs
  23. 120
      modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentParser.cs
  24. 11
      modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentWidgetConfig.cs
  25. 4
      modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Blogs/BlogPostConsts.cs
  26. 4
      modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/BlogPostPublicDto.cs
  27. 4
      modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/PageDto.cs
  28. 14
      modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Blogs/BlogPostPublicAppService.cs
  29. 9
      modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs
  30. 6
      modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/PublicApplicationAutoMapperProfile.cs
  31. 63
      modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/cms-kit-generate-proxy.json
  32. 17
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/Default.cshtml
  33. 54
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/DefaultPageViewComponent.cs
  34. 7
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Tags/TagViewComponent.cs
  35. 115
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml
  36. 8
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml.cs
  37. 41
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml
  38. 8
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml.cs
  39. 14
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/PageViewModel.cs
  40. 138
      modules/cms-kit/test/Volo.CmsKit.Application.Tests/Contents/ContentParser_Test.cs
  41. 13
      modules/cms-kit/test/Volo.CmsKit.Domain.Tests/Pages/PageManager_Test.cs
  42. 4
      modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitTestData.cs
  43. 13
      modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20220623064459_Initial.Designer.cs
  44. 2
      modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20220623064459_Initial.cs
  45. 11
      modules/openiddict/app/OpenIddict.Demo.Server/Migrations/ServerDbContextModelSnapshot.cs
  46. 19
      modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/LogoutController.cs
  47. 22
      modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Views/Logout/Logout.cshtml
  48. 6
      modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/el.json
  49. 4
      modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/en.json
  50. 6
      modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/pt-BR.json
  51. 4
      modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/tr.json
  52. 4
      modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/zh-Hans.json
  53. 4
      modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/zh-Hant.json
  54. 1
      templates/app-nolayers/angular/angular.json
  55. 3
      templates/app-nolayers/angular/package.json
  56. 6
      templates/app-nolayers/angular/src/app/app.module.ts
  57. 1
      templates/app-nolayers/angular/src/app/home/home-routing.module.ts
  58. 6
      templates/app-nolayers/angular/src/styles.scss
  59. 10
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/MyCompanyName.MyProjectName.Blazor.Server.Mongo.csproj
  60. 16
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/MyProjectNameModule.cs
  61. 9
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Pages/_Host.cshtml
  62. 4
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/package.json
  63. 10
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj
  64. 18
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameModule.cs
  65. 9
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Pages/_Host.cshtml
  66. 4
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/package.json
  67. 2
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/MyCompanyName.MyProjectName.Host.Mongo.csproj
  68. 8
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/MyProjectNameModule.cs
  69. 2
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/package.json
  70. 2
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/MyCompanyName.MyProjectName.Host.csproj
  71. 8
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/MyProjectNameModule.cs
  72. 2
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/package.json
  73. 8
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/MyCompanyName.MyProjectName.Mvc.Mongo.csproj
  74. 10
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/MyProjectNameModule.cs
  75. 2
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/package.json
  76. 8
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/MyCompanyName.MyProjectName.Mvc.csproj
  77. 8
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/MyProjectNameModule.cs
  78. 2
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/package.json
  79. 1
      templates/app/angular/angular.json
  80. 3
      templates/app/angular/package.json
  81. 6
      templates/app/angular/src/app/app.module.ts
  82. 1
      templates/app/angular/src/app/home/home-routing.module.ts
  83. 6
      templates/app/angular/src/styles.scss
  84. 5
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyCompanyName.MyProjectName.AuthServer.csproj
  85. 9
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs
  86. 135
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/Pages/Index.cshtml
  87. 28
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/Pages/Index.cshtml.cs
  88. 2
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/package.json
  89. 7
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyCompanyName.MyProjectName.Blazor.Server.Tiered.csproj
  90. 47
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyProjectNameBlazorModule.cs
  91. 9
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/_Host.cshtml
  92. 4
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/package.json
  93. 7
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj
  94. 17
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameBlazorModule.cs
  95. 11
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/_Host.cshtml
  96. 4
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/package.json
  97. 5
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj
  98. 7
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs
  99. 12530
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/global.css
  100. 28
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/global.js

1
abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json

@ -400,6 +400,7 @@
"UserDeveloperDescription": "The 'Developers' can write code in the ABP Commercial projects, download the ABP sample projects, and ask questions on the support website. On the other hand, the 'Developers' cannot manage this organization.",
"RemoveCurrentUserFromOrganizationWarningMessage": "You are removing yourself from your own organization. You will no longer be able to manage this organization, do you confirm?",
"RenewExistingOrganizationOrCreateNewOneMessage": "You can renew the license of your organization(s) by clicking the below \"Extend Now\" button(s) and thus you can extend the license expiration date by 1 year. If you continue to checkout, you will have a new organization. Do you want to continue with a new organization?",
"PurchaseTrialOrganizationOrCreateNewOneMessage": "You have a trial license. To purchase your trial license click Purchase Now button. If you continue to checkout, you will have a new organization. Do you want to continue with a new organization?",
"ExtendNow": "Extend Now",
"CreateNewOrganization": "Create a new organization",
"RenewLicenseEarly": "If I renew my license early, will I get the full year?",

2
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliPaths.cs

@ -13,5 +13,5 @@ public static class CliPaths
public static string Build => Path.Combine(AbpRootPath, "build");
public static string Lic => Path.Combine(Path.GetTempPath(), Encoding.ASCII.GetString(new byte[] { 65, 98, 112, 76, 105, 99, 101, 110, 115, 101, 46, 98, 105, 110 }));
private static readonly string AbpRootPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".abp");
public static readonly string AbpRootPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".abp");
}

8
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs

@ -49,10 +49,10 @@ public class CliService : ITransientDependency
var commandLineArgs = CommandLineArgumentParser.Parse(args);
#if !DEBUG
if (!commandLineArgs.Options.ContainsKey("skip-cli-version-check"))
{
await CheckCliVersionAsync();
}
if (!commandLineArgs.Options.ContainsKey("skip-cli-version-check"))
{
await CheckCliVersionAsync();
}
#endif
try
{

8
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs

@ -34,9 +34,10 @@ public class NewCommand : ProjectCreationCommandBase, IConsoleCommand, ITransien
ICmdHelper cmdHelper,
IInstallLibsService installLibsService,
AngularPwaSupportAdder angularPwaSupportAdder,
InitialMigrationCreator ınitialMigrationCreator,
InitialMigrationCreator initialMigrationCreator,
ThemePackageAdder themePackageAdder,
ILocalEventBus eventBus)
: base(connectionStringProvider, solutionPackageVersionFinder, cmdHelper, installLibsService, angularPwaSupportAdder, ınitialMigrationCreator, eventBus)
: base(connectionStringProvider, solutionPackageVersionFinder, cmdHelper, installLibsService, angularPwaSupportAdder, initialMigrationCreator, themePackageAdder, eventBus)
{
TemplateProjectBuilder = templateProjectBuilder;
TemplateInfoProvider = templateInfoProvider;
@ -81,6 +82,7 @@ public class NewCommand : ProjectCreationCommandBase, IConsoleCommand, ITransien
Logger.LogInformation($"'{projectName}' has been successfully created to '{projectArgs.OutputFolder}'");
ConfigureNpmPackagesForTheme(projectArgs);
await RunGraphBuildForMicroserviceServiceTemplate(projectArgs);
await CreateInitialMigrationsAsync(projectArgs);
await RunInstallLibsForWebTemplateAsync(projectArgs);
@ -111,6 +113,7 @@ public class NewCommand : ProjectCreationCommandBase, IConsoleCommand, ITransien
sb.AppendLine("-csf|--create-solution-folder (default: true)");
sb.AppendLine("-cs|--connection-string <connection-string> (your database connection string)");
sb.AppendLine("--dbms <database-management-system> (your database management system)");
sb.AppendLine("--theme <theme-name> (if supported by the template. default: leptonx-lite)");
sb.AppendLine("--tiered (if supported by the template)");
sb.AppendLine("--no-ui (if supported by the template)");
sb.AppendLine("--no-random-port (Use template's default ports)");
@ -134,6 +137,7 @@ public class NewCommand : ProjectCreationCommandBase, IConsoleCommand, ITransien
sb.AppendLine(" abp new Acme.BookStore -csf false");
sb.AppendLine(" abp new Acme.BookStore --local-framework-ref --abp-path \"D:\\github\\abp\"");
sb.AppendLine(" abp new Acme.BookStore --dbms mysql");
sb.AppendLine(" abp new Acme.BookStore --theme basic");
sb.AppendLine(" abp new Acme.BookStore --connection-string \"Server=myServerName\\myInstanceName;Database=myDatabase;User Id=myUsername;Password=myPassword\"");
sb.AppendLine("");
sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI");

70
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs

@ -6,6 +6,7 @@ using ICSharpCode.SharpZipLib.Core;
using ICSharpCode.SharpZipLib.Zip;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using NuGet.Versioning;
using NUglify.Helpers;
using Volo.Abp.Cli.ProjectModification;
using Volo.Abp.Cli.Args;
@ -33,6 +34,8 @@ public abstract class ProjectCreationCommandBase
public ILocalEventBus EventBus { get; }
public ILogger<NewCommand> Logger { get; set; }
public ThemePackageAdder ThemePackageAdder { get; }
public ProjectCreationCommandBase(
ConnectionStringProvider connectionStringProvider,
SolutionPackageVersionFinder solutionPackageVersionFinder,
@ -40,7 +43,8 @@ public abstract class ProjectCreationCommandBase
IInstallLibsService installLibsService,
AngularPwaSupportAdder angularPwaSupportAdder,
InitialMigrationCreator initialMigrationCreator,
ILocalEventBus eventBus)
ThemePackageAdder themePackageAdder,
ILocalEventBus eventBus)
{
ConnectionStringProvider = connectionStringProvider;
SolutionPackageVersionFinder = solutionPackageVersionFinder;
@ -49,6 +53,7 @@ public abstract class ProjectCreationCommandBase
AngularPwaSupportAdder = angularPwaSupportAdder;
InitialMigrationCreator = initialMigrationCreator;
EventBus = eventBus;
ThemePackageAdder = themePackageAdder;
Logger = NullLogger<NewCommand>.Instance;
}
@ -98,6 +103,12 @@ public abstract class ProjectCreationCommandBase
Logger.LogInformation("UI Framework: " + uiFramework);
}
var theme = uiFramework == UiFramework.None ? (Theme?)null : GetTheme(commandLineArgs);
if (theme.HasValue)
{
Logger.LogInformation("Theme: " + theme);
}
var publicWebSite = uiFramework != UiFramework.None && commandLineArgs.Options.ContainsKey(Options.PublicWebSite.Long);
if (publicWebSite)
{
@ -139,7 +150,6 @@ public abstract class ProjectCreationCommandBase
if (MicroserviceServiceTemplateBase.IsMicroserviceServiceTemplate(template))
{
var slnFile = Directory.GetFiles(outputFolderRoot, "*.sln").FirstOrDefault();
if (slnFile == null)
{
throw new CliUsageException("This command should be run inside a folder that contains a microservice solution!");
@ -189,7 +199,8 @@ public abstract class ProjectCreationCommandBase
templateSource,
commandLineArgs.Options,
connectionString,
pwa
pwa,
theme
);
}
@ -483,6 +494,54 @@ public abstract class ProjectCreationCommandBase
}
}
protected virtual Theme GetTheme(CommandLineArgs commandLineArgs)
{
var optionValue = commandLineArgs.Options.GetOrNull(Options.Theme.Long);
switch (optionValue)
{
case null:
case "leptonx-lite":
return Theme.LeptonXLite;
case "basic":
return Theme.Basic;
default:
throw new CliUsageException("The option you provided for Theme is invalid!");
}
}
protected void ConfigureNpmPackagesForTheme(ProjectBuildArgs projectArgs)
{
if (!projectArgs.Theme.HasValue)
{
return;
}
switch (projectArgs.Theme)
{
case Theme.Basic:
ConfigureNpmPackagesForBasicTheme(projectArgs);
break;
}
}
private void ConfigureNpmPackagesForBasicTheme(ProjectBuildArgs projectArgs)
{
if (projectArgs.UiFramework is not UiFramework.None or UiFramework.Angular)
{
ThemePackageAdder.AddNpmPackage(projectArgs.OutputFolder, "@abp/aspnetcore.mvc.ui.theme.basic", projectArgs.Version);
}
if (projectArgs.UiFramework is UiFramework.BlazorServer)
{
ThemePackageAdder.AddNpmPackage(projectArgs.OutputFolder, "@abp/aspnetcore.components.server.basictheme", projectArgs.Version);
}
if (projectArgs.UiFramework is UiFramework.Angular)
{
ThemePackageAdder.AddAngularPackage(projectArgs.OutputFolder, "@abp/ng.theme.basic", projectArgs.Version);
}
}
public static class Options
{
public static class Template
@ -574,5 +633,10 @@ public abstract class ProjectCreationCommandBase
{
public const string Short = "pwa";
}
public static class Theme
{
public const string Long = "theme";
}
}
}

57
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/LIbs/InstallLibsService.cs

@ -25,18 +25,17 @@ public class InstallLibsService : IInstallLibsService, ITransientDependency
Path.Combine("obj", "debug")
};
public ICmdHelper CmdHelper { get; }
public NpmHelper NpmHelper { get; }
public const string LibsDirectory = "./wwwroot/libs";
public ILogger<InstallLibsService> Logger { get; set; }
private readonly IJsonSerializer _jsonSerializer;
public InstallLibsService(IJsonSerializer jsonSerializer, ICmdHelper cmdHelper)
public InstallLibsService(IJsonSerializer jsonSerializer, NpmHelper npmHelper)
{
CmdHelper = cmdHelper;
NpmHelper = npmHelper;
_jsonSerializer = jsonSerializer;
Logger = NullLogger<InstallLibsService>.Instance;
}
public async Task InstallLibsAsync(string directory)
@ -48,13 +47,13 @@ public class InstallLibsService : IInstallLibsService, ITransientDependency
return;
}
if (!IsNpmInstalled())
if (!NpmHelper.IsNpmInstalled())
{
Logger.LogWarning("NPM is not installed, visit https://nodejs.org/en/download/ and install NPM");
return;
}
if (!IsYarnAvailable())
if (!NpmHelper.IsYarnAvailable())
{
Logger.LogWarning("YARN is not installed, which may cause package inconsistency, please use YARN instead of NPM. visit https://classic.yarnpkg.com/lang/en/docs/install/ and install YARN");
}
@ -72,26 +71,33 @@ public class InstallLibsService : IInstallLibsService, ITransientDependency
// angular
if (projectPath.EndsWith("angular.json"))
{
if (IsYarnAvailable())
if (NpmHelper.IsYarnAvailable())
{
RunYarn(projectDirectory);
NpmHelper.RunYarn(projectDirectory);
}
else
{
RunNpmInstall(projectDirectory);
NpmHelper.RunNpmInstall(projectDirectory);
}
}
// MVC or BLAZOR SERVER
if (projectPath.EndsWith(".csproj"))
{
if (IsYarnAvailable())
var packageJsonFilePath = Path.Combine(Path.GetDirectoryName(projectPath), "package.json");
if (!File.Exists(packageJsonFilePath))
{
continue;
}
if (NpmHelper.IsYarnAvailable())
{
RunYarn(projectDirectory);
NpmHelper.RunYarn(projectDirectory);
}
else
{
RunNpmInstall(projectDirectory);
NpmHelper.RunNpmInstall(projectDirectory);
}
await CleanAndCopyResources(projectDirectory);
@ -243,31 +249,4 @@ public class InstallLibsService : IInstallLibsService, ITransientDependency
return pattern;
}
private void RunNpmInstall(string directory)
{
Logger.LogInformation($"Running npm install on {directory}");
CmdHelper.RunCmd($"npm install", directory);
}
private void RunYarn(string directory)
{
Logger.LogInformation($"Running Yarn on {directory}");
CmdHelper.RunCmd($"yarn", directory);
}
private bool IsNpmInstalled()
{
var output = CmdHelper.RunCmdAndGetOutput("npm -v").Trim();
return SemanticVersion.TryParse(output, out _);
}
private bool IsYarnAvailable()
{
var output = CmdHelper.RunCmdAndGetOutput("yarn -v").Trim();
if (!SemanticVersion.TryParse(output, out var version)){
return false;
}
return version > SemanticVersion.Parse("1.20.0");
}
}

623
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs

@ -0,0 +1,623 @@
using System.Collections.Generic;
using System.Linq;
namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps;
public class ChangeThemeStep : ProjectBuildPipelineStep
{
public override void Execute(ProjectBuildContext context)
{
if (!context.BuildArgs.Theme.HasValue)
{
return;
}
switch (context.BuildArgs.Theme)
{
case Theme.Basic:
ChangeToBasicTheme(context);
break;
}
}
protected void ChangeToBasicTheme(ProjectBuildContext context)
{
#region MyCompanyName.MyProjectName.Web
ReplacePackageReferenceWithProjectReference(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite",
@"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic",
"AbpAspNetCoreMvcUiLeptonXLiteThemeModule",
"AbpAspNetCoreMvcUiBasicThemeModule"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling",
"LeptonXLiteThemeBundles.Styles.Global",
"BasicThemeBundles.Styles.Global"
);
#endregion
#region MyCompanyName.MyProjectName.HttpApi.Host
ReplacePackageReferenceWithProjectReference(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite",
@"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic",
"AbpAspNetCoreMvcUiLeptonXLiteThemeModule",
"AbpAspNetCoreMvcUiBasicThemeModule"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling",
"LeptonXLiteThemeBundles.Styles.Global",
"BasicThemeBundles.Styles.Global"
);
#endregion
#region MyCompanyName.MyProjectName.Blazor
ReplacePackageReferenceWithProjectReference(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj",
"Volo.Abp.AspNetCore.Components.WebAssembly.LeptonXLiteTheme",
@"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme\Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.csproj"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs",
"Volo.Abp.AspNetCore.Components.WebAssembly.LeptonXLiteTheme",
"Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme",
"AbpAspNetCoreComponentsWebAssemblyLeptonXLiteThemeModule",
"AbpAspNetCoreComponentsWebAssemblyBasicThemeModule"
);
ChangeNamespace(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs",
"Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite",
"Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic"
);
#endregion
#region MyCompanyName.MyProjectName.Blazor.Server
ReplacePackageReferenceWithProjectReference(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj",
"Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme",
@"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj"
);
ReplacePackageReferenceWithProjectReference(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite",
@"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Components.Server.BasicTheme\Volo.Abp.AspNetCore.Components.Server.BasicTheme.csproj"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs",
"Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme",
"Volo.Abp.AspNetCore.Components.Server.BasicTheme",
"AbpAspNetCoreComponentsServerLeptonXLiteThemeModule",
"AbpAspNetCoreComponentsServerBasicThemeModule"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic",
"AbpAspNetCoreMvcUiLeptonXLiteThemeModule",
"AbpAspNetCoreMvcUiBasicThemeModule"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs",
"Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling",
"Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling",
"LeptonXLiteThemeBundles.Styles.Global",
"BasicThemeBundles.Styles.Global"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling",
"BlazorLeptonXLiteThemeBundles.Styles.Global",
"BlazorBasicThemeBundles.Styles.Global"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/_Host.cshtml",
"Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite",
"Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic",
"BlazorLeptonXLiteThemeBundles.Styles.Global",
"BlazorBasicThemeBundles.Styles.Global"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/_Host.cshtml",
"Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling",
"Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling",
"BlazorLeptonXLiteThemeBundles.Scripts.Global",
"BlazorBasicThemeBundles.Scripts.Global"
);
#endregion
#region MyCompanyName.MyProjectName.Blazor.Server.Tiered
ReplacePackageReferenceWithProjectReference(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyCompanyName.MyProjectName.Blazor.Server.Tiered.csproj",
"Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme",
@"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj"
);
ReplacePackageReferenceWithProjectReference(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyCompanyName.MyProjectName.Blazor.Server.Tiered.csproj",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite",
@"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Components.Server.BasicTheme\Volo.Abp.AspNetCore.Components.Server.BasicTheme.csproj"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyProjectNameBlazorModule.cs",
"Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme",
"Volo.Abp.AspNetCore.Components.Server.BasicTheme",
"AbpAspNetCoreComponentsServerLeptonXLiteThemeModule",
"AbpAspNetCoreComponentsServerBasicThemeModule"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyProjectNameBlazorModule.cs",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic",
"AbpAspNetCoreMvcUiLeptonXLiteThemeModule",
"AbpAspNetCoreMvcUiBasicThemeModule"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyProjectNameBlazorModule.cs",
"Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling",
"Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling",
"LeptonXLiteThemeBundles.Styles.Global",
"BasicThemeBundles.Styles.Global"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyProjectNameBlazorModule.cs",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling",
"BlazorLeptonXLiteThemeBundles.Styles.Global",
"BlazorBasicThemeBundles.Styles.Global"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/_Host.cshtml",
"Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite",
"Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic",
"BlazorLeptonXLiteThemeBundles.Styles.Global",
"BlazorBasicThemeBundles.Styles.Global"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/_Host.cshtml",
"Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling",
"Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling",
"BlazorLeptonXLiteThemeBundles.Scripts.Global",
"BlazorBasicThemeBundles.Scripts.Global"
);
#endregion
#region MyCompanyName.MyProjectName.AuthServer
ReplacePackageReferenceWithProjectReference(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyCompanyName.MyProjectName.AuthServer.csproj",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite",
@"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic",
"AbpAspNetCoreMvcUiLeptonXLiteThemeModule",
"AbpAspNetCoreMvcUiBasicThemeModule"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling",
"LeptonXLiteThemeBundles.Styles.Global",
"BasicThemeBundles.Styles.Global"
);
#endregion
#region MyCompanyName.MyProjectName.Web.Mvc
ReplacePackageReferenceWithProjectReference(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Web.Mvc/MyCompanyName.MyProjectName.Web.Mvc.csproj",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite",
@"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Web.Mvc/MyProjectNameWebModule.cs",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic",
"AbpAspNetCoreMvcUiLeptonXLiteThemeModule",
"AbpAspNetCoreMvcUiBasicThemeModule"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Web.Mvc/MyProjectNameWebModule.cs",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling",
"LeptonXLiteThemeBundles.Styles.Global",
"BasicThemeBundles.Styles.Global"
);
#endregion
#region MyCompanyName.MyProjectName.Web.Mvc.Mongo
ReplacePackageReferenceWithProjectReference(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Web.Mvc.Mongo/MyCompanyName.MyProjectName.Web.Mvc.Mongo.csproj",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite",
@"..\..\..\..\..\modules\basic-theme\\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Web.Mvc.Mongo/MyProjectNameWebModule.cs",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic",
"AbpAspNetCoreMvcUiLeptonXLiteThemeModule",
"AbpAspNetCoreMvcUiBasicThemeModule"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Web.Mvc.Mongo/MyProjectNameWebModule.cs",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling",
"LeptonXLiteThemeBundles.Styles.Global",
"BasicThemeBundles.Styles.Global"
);
#endregion
#region MyCompanyName.MyProjectName.Blazor.Server - (app-nolayers)
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameModule.cs",
"Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme",
"Volo.Abp.AspNetCore.Components.Server.BasicTheme",
"AbpAspNetCoreComponentsServerLeptonXLiteThemeModule",
"AbpAspNetCoreComponentsServerBasicThemeModule"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameModule.cs",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic",
"AbpAspNetCoreMvcUiLeptonXLiteThemeModule",
"AbpAspNetCoreMvcUiBasicThemeModule"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameModule.cs",
"Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling",
"Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling",
"LeptonXLiteThemeBundles.Styles.Global",
"BasicThemeBundles.Styles.Global"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameModule.cs",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling",
"BlazorLeptonXLiteThemeBundles.Styles.Global",
"BlazorBasicThemeBundles.Styles.Global"
);
#endregion
#region MyCompanyName.MyProjectName.Blazor.Server.Mongo
ReplacePackageReferenceWithProjectReference(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Mongo/MyCompanyName.MyProjectName.Blazor.Server.Mongo.csproj",
"Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme",
@"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj"
);
ReplacePackageReferenceWithProjectReference(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Mongo/MyCompanyName.MyProjectName.Blazor.Server.Mongo.csproj",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite",
@"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Components.Server.BasicTheme\Volo.Abp.AspNetCore.Components.Server.BasicTheme.csproj"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Mongo/MyProjectNameModule.cs",
"Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme",
"Volo.Abp.AspNetCore.Components.Server.BasicTheme",
"AbpAspNetCoreComponentsServerLeptonXLiteThemeModule",
"AbpAspNetCoreComponentsServerBasicThemeModule"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Mongo/MyProjectNameModule.cs",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic",
"AbpAspNetCoreMvcUiLeptonXLiteThemeModule",
"AbpAspNetCoreMvcUiBasicThemeModule"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Mongo/MyProjectNameModule.cs",
"Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling",
"Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling",
"LeptonXLiteThemeBundles.Styles.Global",
"BasicThemeBundles.Styles.Global"
);
ChangeNamespaceAndKeyword(
context,
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Mongo/MyProjectNameModule.cs",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling",
"Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling",
"BlazorLeptonXLiteThemeBundles.Styles.Global",
"BlazorBasicThemeBundles.Styles.Global"
);
#endregion
#region Angular
ReplaceImportPackage(
context,
"/angular/src/app/app.module.ts",
"@abp/ng.theme.lepton-x",
"@abp/ng.theme.basic"
);
RemoveLinesByStatement(
context,
"/angular/src/app/app.module.ts",
"SideMenuLayoutModule"
);
ReplaceMethodNames(
context,
"/angular/src/app/app.module.ts",
"ThemeLeptonXModule",
"ThemeBasicModule"
);
#endregion
}
protected void ReplacePackageReferenceWithProjectReference(
ProjectBuildContext context,
string targetProjectFilePath,
string packageReference,
string projectReference)
{
var file = context.FindFile(targetProjectFilePath);
if (file == null)
{
return;
}
file.NormalizeLineEndings();
var lines = file.GetLines();
var lineIndex = lines.FindIndex(line => line.Contains("PackageReference") && line.Contains(packageReference));
if (lineIndex == -1)
{
return;
}
lines[lineIndex] = lines[lineIndex].Replace(lines[lineIndex], $"\t<ProjectReference Include=\"{projectReference}\" />");
file.SetLines(lines);
}
protected void ChangeNamespaceAndKeyword(
ProjectBuildContext context,
string targetModuleFilePath,
string oldNamespace,
string newNamespace,
string oldKeyword,
string newKeyword)
{
var file = context.FindFile(targetModuleFilePath);
if (file == null)
{
return;
}
file.NormalizeLineEndings();
var lines = file.GetLines();
for (var i = 0; i < lines.Length; i++)
{
if (lines[i].Contains($"using {oldNamespace}"))
{
lines[i] = $"using {newNamespace};";
}
else if (lines[i].Contains(oldKeyword))
{
lines[i] = lines[i].Replace(oldKeyword, newKeyword);
}
}
file.SetLines(lines);
}
protected void ChangeNamespace(
ProjectBuildContext context,
string targetModuleFilePath,
string oldNamespace,
string newNamespace)
{
var file = context.FindFile(targetModuleFilePath);
if (file == null)
{
return;
}
file.NormalizeLineEndings();
var lines = file.GetLines();
for (var i = 0; i < lines.Length; i++)
{
if (lines[i].Contains($"using {oldNamespace};"))
{
lines[i] = $"using {newNamespace};";
}
}
file.SetLines(lines);
}
protected void ReplaceImportPackage(
ProjectBuildContext context,
string filePath,
string oldImportPackage,
string newImportPackage)
{
var file = context.FindFile(filePath);
if (file == null)
{
return;
}
file.NormalizeLineEndings();
var lines = file.GetLines();
var lineIndex = lines.FindIndex(line => line.Contains($"from '{oldImportPackage}'"));
if (lineIndex == -1)
{
return;
}
lines[lineIndex] = lines[lineIndex].Replace(oldImportPackage, newImportPackage);
file.SetLines(lines);
}
protected void RemoveLinesByStatement(
ProjectBuildContext context,
string filePath,
string statement)
{
var file = context.FindFile(filePath);
if (file == null)
{
return;
}
file.NormalizeLineEndings();
var lines = file.GetLines();
for (var i = 0; i < lines.Length; i++)
{
if (lines[i].Contains(statement))
{
lines[i] = null;
}
}
file.SetLines(lines.Where(x => x != null));
}
protected void ReplaceMethodNames(
ProjectBuildContext context,
string filePath,
string oldMethodName,
string newMethodName)
{
var file = context.FindFile(filePath);
if (file == null)
{
return;
}
file.NormalizeLineEndings();
var lines = file.GetLines();
for (var i = 0; i < lines.Length; i++)
{
if (lines[i].Contains(oldMethodName))
{
lines[i] = lines[i].Replace(oldMethodName, newMethodName);
}
}
file.SetLines(lines);
}
}

4
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/TemplateCodeDeleteStep.cs

@ -15,7 +15,9 @@ public class TemplateCodeDeleteStep : ProjectBuildPipelineStep
file.Name.EndsWith(".gitignore") ||
file.Name.EndsWith(".yml") ||
file.Name.EndsWith(".ps1") ||
file.Name.EndsWith(".html"))
file.Name.EndsWith(".html") ||
file.Name.EndsWith(".ts") ||
file.Name.EndsWith(".scss"))
{
file.RemoveTemplateCode(context.Symbols);
file.RemoveTemplateCodeMarkers();

7
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Theme.cs

@ -0,0 +1,7 @@
namespace Volo.Abp.Cli.ProjectBuilding.Building;
public enum Theme
{
LeptonXLite = 0,
Basic = 1
}

2
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Files/FileEntryExtensions.cs

@ -120,7 +120,7 @@ public static class FileEntryExtensions
}
}
if (lines[i+1].Contains("<TEMPLATE-REMOVE"))
if ((i + 1 < lines.Length) && (lines[i + 1].Contains("<TEMPLATE-REMOVE")))
{
continue;
}

6
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs

@ -42,6 +42,8 @@ public class ProjectBuildArgs
public bool Pwa { get; set; }
public Theme? Theme { get; set; }
[NotNull]
public Dictionary<string, string> ExtraProperties { get; set; }
@ -60,7 +62,8 @@ public class ProjectBuildArgs
[CanBeNull] string templateSource = null,
Dictionary<string, string> extraProperties = null,
[CanBeNull] string connectionString = null,
bool pwa = false)
bool pwa = false,
Theme? theme = null)
{
SolutionName = Check.NotNull(solutionName, nameof(solutionName));
TemplateName = templateName;
@ -77,5 +80,6 @@ public class ProjectBuildArgs
ExtraProperties = extraProperties ?? new Dictionary<string, string>();
ConnectionString = connectionString;
Pwa = pwa;
Theme = theme;
}
}

1
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppNoLayersTemplateBase.cs

@ -87,6 +87,7 @@ public abstract class AppNoLayersTemplateBase : AppTemplateBase
UpdateNuGetConfig(context, steps);
ChangeConnectionString(context, steps);
ConfigureDockerFiles(context, steps);
ConfigureTheme(context, steps);
if (context.BuildArgs.UiFramework != UiFramework.Angular)
{

60
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs

@ -33,6 +33,7 @@ public abstract class AppTemplateBase : TemplateInfo
RemoveMigrations(context, steps);
ConfigureTieredArchitecture(context, steps);
ConfigurePublicWebSite(context, steps);
ConfigureTheme(context, steps);
RemoveUnnecessaryPorts(context, steps);
RandomizeSslPorts(context, steps);
RandomizeStringEncryption(context, steps);
@ -176,6 +177,65 @@ public abstract class AppTemplateBase : TemplateInfo
}
}
protected void ConfigureTheme(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{
if (!context.BuildArgs.Theme.HasValue)
{
return;
}
if (context.BuildArgs.Theme != Theme.LeptonXLite)
{
steps.Add(new ChangeThemeStep());
RemoveLeptonXThemePackagesFromPackageJsonFiles(steps);
}
}
private void RemoveLeptonXThemePackagesFromPackageJsonFiles(List<ProjectBuildPipelineStep> steps)
{
var packageJsonFilePaths = new List<string>()
{
"/aspnet-core/src/MyCompanyName.MyProjectName.Web/package.json",
"/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/package.json",
"/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/package.json",
"/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/package.json",
"/aspnet-core/MyCompanyName.MyProjectName.Mvc/package.json",
"/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/package.json",
"/aspnet-core/MyCompanyName.MyProjectName.Host/package.json",
"/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/package.json",
};
var blazorServerPackageJsonFilePaths = new List<string>()
{
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/package.json",
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/package.json",
"/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/package.json",
"/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/package.json"
};
var angularPackageJsonFilePaths = new List<string>()
{
"/angular/package.json"
};
foreach (var packageJsonFilePath in packageJsonFilePaths)
{
steps.Add(new RemoveDependencyFromPackageJsonFileStep(packageJsonFilePath, "@abp/aspnetcore.mvc.ui.theme.leptonxlite"));
}
foreach (var blazorServerPackageJsonFilePath in blazorServerPackageJsonFilePaths)
{
steps.Add(new RemoveDependencyFromPackageJsonFileStep(blazorServerPackageJsonFilePath, "@abp/aspnetcore.mvc.ui.theme.leptonxlite"));
steps.Add(new RemoveDependencyFromPackageJsonFileStep(blazorServerPackageJsonFilePath, "@abp/aspnetcore.components.server.leptonxlitetheme"));
}
foreach (var angularPackageJsonFilePath in angularPackageJsonFilePaths)
{
steps.Add(new RemoveDependencyFromPackageJsonFileStep(angularPackageJsonFilePath, "@abp/ng.theme.lepton-x"));
steps.Add(new RemoveDependencyFromPackageJsonFileStep(angularPackageJsonFilePath, "bootstrap-icons"));
}
}
protected void ConfigurePublicWebSite(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{
if (!context.BuildArgs.PublicWebSite)

22
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmGlobalPackagesChecker.cs

@ -7,34 +7,22 @@ namespace Volo.Abp.Cli.ProjectModification;
public class NpmGlobalPackagesChecker : ITransientDependency
{
public ICmdHelper CmdHelper { get; }
public NpmHelper NpmHelper { get; }
public ILogger<NpmGlobalPackagesChecker> Logger { get; set; }
public NpmGlobalPackagesChecker(ICmdHelper cmdHelper)
public NpmGlobalPackagesChecker(NpmHelper npmHelper)
{
CmdHelper = cmdHelper;
NpmHelper = npmHelper;
Logger = NullLogger<NpmGlobalPackagesChecker>.Instance;
}
public void Check()
{
var installedNpmPackages = GetInstalledNpmPackages();
var installedNpmPackages = NpmHelper.GetInstalledNpmPackages();
if (!installedNpmPackages.Contains(" yarn@"))
{
InstallYarn();
NpmHelper.InstallYarn();
}
}
protected virtual string GetInstalledNpmPackages()
{
Logger.LogInformation("Checking installed npm global packages...");
return CmdHelper.RunCmdAndGetOutput("npm list -g --depth 0 --silent", out int exitCode);
}
protected virtual void InstallYarn()
{
Logger.LogInformation("Installing yarn...");
CmdHelper.RunCmd("npm install yarn -g");
}
}

61
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ThemePackageAdder.cs

@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using NuGet.Versioning;
using Volo.Abp.Cli.Utils;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.Cli.ProjectModification;
public class ThemePackageAdder : ITransientDependency
{
protected NpmHelper NpmHelper { get; }
protected PackageJsonFileFinder PackageJsonFileFinder { get; }
public ThemePackageAdder(NpmHelper npmHelper, PackageJsonFileFinder packageJsonFileFinder)
{
NpmHelper = npmHelper;
PackageJsonFileFinder = packageJsonFileFinder;
}
public void AddNpmPackage(string rootDirectory, string package, string version)
{
var packageJsonFilePaths = PackageJsonFileFinder.Find(rootDirectory)
.Where(x => !File.Exists(x.RemovePostFix("package.json") + "angular.json"))
.ToList();
AddPackage(packageJsonFilePaths, package, version);
}
public void AddAngularPackage(string rootDirectory, string package, string version)
{
var angularPackageJsonFilePaths = PackageJsonFileFinder.Find(rootDirectory)
.Where(x => File.Exists(x.RemovePostFix("package.json") + "angular.json"))
.ToList();
AddPackage(angularPackageJsonFilePaths, package, version);
}
private void AddPackage(List<string> packageJsonFilePaths, string package, string version)
{
if (!packageJsonFilePaths.Any() || string.IsNullOrWhiteSpace(package))
{
return;
}
var yarnAvailable = NpmHelper.IsYarnAvailable();
foreach (var packageJsonFilePath in packageJsonFilePaths)
{
var directory = Path.GetDirectoryName(packageJsonFilePath).EnsureEndsWith(Path.DirectorySeparatorChar);
if (yarnAvailable)
{
NpmHelper.YarnAddPackage(package, version, directory);
}
else
{
NpmHelper.NpmInstallPackage(package, version, directory);
}
}
}
}

69
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/NpmHelper.cs

@ -0,0 +1,69 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using NuGet.Versioning;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.Cli.Utils;
public class NpmHelper : ITransientDependency
{
protected ICmdHelper CmdHelper { get; }
public ILogger<NpmHelper> Logger { get; set; }
public NpmHelper(ICmdHelper cmdHelper)
{
CmdHelper = cmdHelper;
Logger = NullLogger<NpmHelper>.Instance;
}
public bool IsNpmInstalled()
{
var output = CmdHelper.RunCmdAndGetOutput("npm -v").Trim();
return SemanticVersion.TryParse(output, out _);
}
public bool IsYarnAvailable()
{
var output = CmdHelper.RunCmdAndGetOutput("yarn -v").Trim();
if (!SemanticVersion.TryParse(output, out var version)){
return false;
}
return version > SemanticVersion.Parse("1.20.0");
}
public void RunNpmInstall(string directory)
{
Logger.LogInformation($"Running npm install on {directory}");
CmdHelper.RunCmd($"npm install", directory);
}
public void RunYarn(string directory)
{
Logger.LogInformation($"Running Yarn on {directory}");
CmdHelper.RunCmd($"yarn", directory);
}
public void NpmInstallPackage(string package, string version, string directory)
{
var packageVersion = !string.IsNullOrWhiteSpace(version) ? $"@{version}" : string.Empty;
CmdHelper.RunCmd("npm install " + package + packageVersion, workingDirectory: directory);
}
public void YarnAddPackage(string package, string version, string directory)
{
var packageVersion = !string.IsNullOrWhiteSpace(version) ? $"@{version}" : string.Empty;
CmdHelper.RunCmd("yarn add " + package + packageVersion, workingDirectory: directory);
}
public string GetInstalledNpmPackages()
{
Logger.LogInformation("Checking installed npm global packages...");
return CmdHelper.RunCmdAndGetOutput("npm list -g --depth 0 --silent", out int exitCode);
}
public void InstallYarn()
{
Logger.LogInformation("Installing yarn...");
CmdHelper.RunCmd("npm install yarn -g");
}
}

6
framework/src/Volo.Abp.Cli/Volo/Abp/Cli/Program.cs

@ -20,11 +20,11 @@ public class Program
.MinimumLevel.Override("System.Net.Http.HttpClient", LogEventLevel.Warning)
.MinimumLevel.Override("Volo.Abp.IdentityModel", LogEventLevel.Information)
#if DEBUG
.MinimumLevel.Override("Volo.Abp.Cli", LogEventLevel.Debug)
.MinimumLevel.Override("Volo.Abp.Cli", LogEventLevel.Debug)
#else
.MinimumLevel.Override("Volo.Abp.Cli", LogEventLevel.Information)
.MinimumLevel.Override("Volo.Abp.Cli", LogEventLevel.Information)
#endif
.Enrich.FromLogContext()
.Enrich.FromLogContext()
.WriteTo.File(Path.Combine(CliPaths.Log, "abp-cli-logs.txt"))
.WriteTo.Console()
.CreateLogger();

19
framework/src/Volo.Abp.Core/System/Collections/Generic/AbpDictionaryExtensions.cs

@ -1,4 +1,5 @@
using System.Collections.Concurrent;
using System.Dynamic;
namespace System.Collections.Generic;
@ -128,4 +129,22 @@ public static class AbpDictionaryExtensions
{
return dictionary.GetOrAdd(key, k => factory());
}
/// <summary>
/// Converts a <string,object> dictionary to dynamic object so added and removed at run
/// </summary>
/// <param name="dictionary">The collection object</param>
/// <returns>If value is correct, return ExpandoObject that represents an object</returns>
public static dynamic ConvertToDynamicObject(this Dictionary<string, object> dictionary)
{
var expandoObject = new ExpandoObject();
var expendObjectCollection = (ICollection<KeyValuePair<string, object>>)expandoObject;
foreach (var keyValuePair in dictionary)
{
expendObjectCollection.Add(keyValuePair);
}
return expandoObject;
}
}

2
modules/cms-kit/host/Volo.CmsKit.Web.Unified/appsettings.json

@ -1,5 +1,5 @@
{
"ConnectionStrings": {
"Default": "Server=(localdb)\\.\\MSSQLLocalDB;Database=CmsKit_Unified;Trusted_Connection=True"
"Default": "Server=(localdb)\\MSSQLLocalDB;Database=CmsKit_Unified;Trusted_Connection=True"
}
}

8
modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/ContentConsts.cs

@ -0,0 +1,8 @@
namespace Volo.CmsKit.Contents;
public static class ContentConsts
{
public static string Delimeter { get; set; } = "----";
public static string Widget { get; set; } = "Widget";
public static string Markdown { get; set; } = "Markdown";
public static string Content { get; set; } = "Content";
}

10
modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/ContentFragment.cs

@ -0,0 +1,10 @@
using System;
using Volo.Abp.ObjectExtending;
namespace Volo.CmsKit.Contents;
[Serializable]
public class ContentFragment : ExtensibleObject
{
public string Type { get; set; }
}

18
modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/CmsKitContentWidgetOptions.cs

@ -0,0 +1,18 @@
using System.Collections.Generic;
namespace Volo.CmsKit.Contents;
public class CmsKitContentWidgetOptions
{
public Dictionary<string, ContentWidgetConfig> WidgetConfigs { get; }
public CmsKitContentWidgetOptions()
{
WidgetConfigs = new();
}
public void AddWidget(string widgetName, string widgetKey)
{
WidgetConfigs.Add(widgetName, new ContentWidgetConfig(widgetKey));
}
}

120
modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentParser.cs

@ -0,0 +1,120 @@
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using static Volo.CmsKit.Contents.ContentConsts;
namespace Volo.CmsKit.Contents;
public class ContentParser : ITransientDependency
{
private readonly CmsKitContentWidgetOptions _options;
public ContentParser(IOptions<CmsKitContentWidgetOptions> options)
{
_options = options.Value;
}
public Task<List<ContentFragment>> ParseAsync(string content)
{
if (!_options.WidgetConfigs.Any())
{
return Task.FromResult(new List<ContentFragment>
{
new ContentFragment { Type = Markdown }.SetProperty(Content, content),
});
}
var parsedList = new List<string>();
ParseContent(content, parsedList);
var contentFragments = new List<ContentFragment>();
FillContentFragment(content, parsedList, contentFragments);
return Task.FromResult(contentFragments);
}
private void ParseContent(string content, List<string> parsedList)
{
var replacedText = Regex.Replace(content, @"\[.*?\]", Delimeter);
if (!replacedText.Contains(Delimeter))
{
parsedList.Add(replacedText);
}
while (replacedText.Contains(Delimeter))
{
//For parsing delimeter
var index = replacedText.IndexOf(Delimeter);
if (index != 0)
{
parsedList.Add(replacedText.Substring(0, index));
replacedText = replacedText.Substring(index, replacedText.Length - index);
index = 0;
}
parsedList.Add(replacedText.Substring(index, Delimeter.Length));
replacedText = replacedText.Substring(Delimeter.Length, replacedText.Length - Delimeter.Length);
//for parsing the other side
index = replacedText.IndexOf(Delimeter);
if (index != -1)
{
parsedList.Add(replacedText.Substring(0, index));
replacedText = replacedText.Substring(index, replacedText.Length - index);
}
else if (replacedText.Length > 0)
{
parsedList.Add(replacedText);
}
}
}
private void FillContentFragment(string content, List<string> parsedList, List<ContentFragment> contentFragments)
{
content = Regex.Replace(content, @"=\s*""", @"=""");
content = Regex.Replace(content, @"""\s*=", @"""=");
var widgets = Regex.Matches(content, @"(?<=\[Widget)(.*?)(?=\])").Cast<Match>().Select(p => p.Value).ToList();
for (int i = 0, k = 0; i < parsedList.Count; i++)
{
if (parsedList[i] == Delimeter)
{
if (widgets.Count > k)
{
var preparedContent = string.Join("", widgets[k]);
var keys = Regex.Matches(preparedContent, @"(?<=\s)(.*?)(?==\s*"")").Cast<Match>()
.Select(p => p.Value).Where(p => p != string.Empty).ToList();
var values = Regex.Matches(preparedContent, @"(?<=\s*[a-zA-Z]*=\s*"")(.*?)(?="")").Cast<Match>()
.Select(p => p.Value).ToList();
var widgetTypeIndex = keys.IndexOf("Type");
if (widgetTypeIndex != -1)
{
var widgetType = values[widgetTypeIndex];
var name = _options.WidgetConfigs.Where(p => p.Key == widgetType).Select(p => p.Value.Name).FirstOrDefault();
if (name is not null && widgets.Count > k)
{
values[0] = name;
var contentFragment = new ContentFragment() { Type = Widget };
contentFragments.Add(contentFragment);
for (int kv = 0; kv < values.Count; kv++)
{
contentFragments.FindLast(p => p == contentFragment)
.SetProperty(keys[kv], values[kv]);
}
}
}
}
k++;
}
else
{
contentFragments.Add(new ContentFragment() { Type = Markdown }
.SetProperty(Content, parsedList[i]));
}
}
}
}

11
modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentWidgetConfig.cs

@ -0,0 +1,11 @@
namespace Volo.CmsKit.Contents;
public class ContentWidgetConfig
{
public string Name { get; }
public ContentWidgetConfig(string widgetName)
{
Name = widgetName;
}
}

4
modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Blogs/BlogPostConsts.cs

@ -1,6 +1,4 @@
using Volo.CmsKit.GlobalFeatures;
namespace Volo.CmsKit.Blogs;
namespace Volo.CmsKit.Blogs;
public static class BlogPostConsts
{

4
modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/BlogPostPublicDto.cs

@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Application.Dtos;
using Volo.CmsKit.Contents;
using Volo.CmsKit.Users;
namespace Volo.CmsKit.Public.Blogs;
@ -15,6 +17,8 @@ public class BlogPostPublicDto : AuditedEntityDto<Guid>
public string ShortDescription { get; set; }
public List<ContentFragment> ContentFragments { get; set; }
public string Content { get; set; }
public Guid? CoverImageMediaId { get; set; }

4
modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/PageDto.cs

@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Application.Dtos;
using Volo.CmsKit.Contents;
namespace Volo.CmsKit.Public.Pages;
@ -11,6 +13,8 @@ public class PageDto : EntityDto<Guid>
public string Slug { get; set; }
public string Content { get; set; }
public List<ContentFragment> ContentFragments { get; set; }
public string Script { get; set; }

14
modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Blogs/BlogPostPublicAppService.cs

@ -5,6 +5,7 @@ using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.GlobalFeatures;
using Volo.CmsKit.Blogs;
using Volo.CmsKit.Contents;
using Volo.CmsKit.GlobalFeatures;
using Volo.CmsKit.Users;
@ -16,22 +17,29 @@ public class BlogPostPublicAppService : CmsKitPublicAppServiceBase, IBlogPostPub
protected IBlogRepository BlogRepository { get; }
protected IBlogPostRepository BlogPostRepository { get; }
protected ContentParser ContentParser { get; }
public BlogPostPublicAppService(
IBlogRepository blogRepository,
IBlogPostRepository blogPostRepository)
IBlogPostRepository blogPostRepository,
ContentParser contentParser)
{
BlogRepository = blogRepository;
BlogPostRepository = blogPostRepository;
ContentParser = contentParser;
}
public virtual async Task<BlogPostPublicDto> GetAsync([NotNull] string blogSlug, [NotNull] string blogPostSlug)
public virtual async Task<BlogPostPublicDto> GetAsync(
[NotNull] string blogSlug, [NotNull] string blogPostSlug)
{
var blog = await BlogRepository.GetBySlugAsync(blogSlug);
var blogPost = await BlogPostRepository.GetBySlugAsync(blog.Id, blogPostSlug);
return ObjectMapper.Map<BlogPost, BlogPostPublicDto>(blogPost);
var blogPostDto = ObjectMapper.Map<BlogPost, BlogPostPublicDto>(blogPost);
blogPostDto.ContentFragments = await ContentParser.ParseAsync(blogPost.Content);
return blogPostDto;
}
public virtual async Task<PagedResultDto<BlogPostPublicDto>> GetListAsync([NotNull] string blogSlug, BlogPostGetListInput input)

9
modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs

@ -1,5 +1,6 @@
using System.Threading.Tasks;
using Volo.Abp.GlobalFeatures;
using Volo.CmsKit.Contents;
using Volo.CmsKit.GlobalFeatures;
using Volo.CmsKit.Pages;
@ -9,10 +10,12 @@ namespace Volo.CmsKit.Public.Pages;
public class PagePublicAppService : CmsKitPublicAppServiceBase, IPagePublicAppService
{
protected IPageRepository PageRepository { get; }
protected ContentParser ContentParser { get; }
public PagePublicAppService(IPageRepository pageRepository)
public PagePublicAppService(IPageRepository pageRepository, ContentParser contentParser)
{
PageRepository = pageRepository;
ContentParser = contentParser;
}
public virtual async Task<PageDto> FindBySlugAsync(string slug)
@ -24,6 +27,8 @@ public class PagePublicAppService : CmsKitPublicAppServiceBase, IPagePublicAppSe
return null;
}
return ObjectMapper.Map<Page, PageDto>(page);
var pageDto = ObjectMapper.Map<Page, PageDto>(page);
pageDto.ContentFragments = await ContentParser.ParseAsync(page.Content);
return pageDto;
}
}

6
modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/PublicApplicationAutoMapperProfile.cs

@ -30,9 +30,11 @@ public class PublicApplicationAutoMapperProfile : Profile
CreateMap<Rating, RatingDto>();
CreateMap<Page, PageDto>();
CreateMap<Page, PageDto>()
.Ignore(x => x.ContentFragments);
CreateMap<BlogPost, BlogPostPublicDto>(MemberList.None);
CreateMap<BlogPost, BlogPostPublicDto>()
.Ignore(x => x.ContentFragments);
CreateMap<MenuItem, MenuItemDto>();

63
modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/cms-kit-generate-proxy.json

@ -505,6 +505,57 @@
}
}
},
"Volo.CmsKit.Public.Polls.PollViewComponentController": {
"controllerName": "PollViewComponent",
"controllerGroupName": "PollViewComponent",
"isRemoteService": true,
"apiVersion": null,
"type": "Volo.CmsKit.Public.Polls.PollViewComponentController",
"interfaces": [
{
"type": "Volo.CmsKit.Public.Polls.IPollViewComponentAppService"
}
],
"actions": {
"ParseAsyncByContent": {
"uniqueName": "ParseAsyncByContent",
"name": "ParseAsync",
"httpMethod": "GET",
"url": "api/cms-kit-public/polls/{content}",
"supportedVersions": [],
"parametersOnMethod": [
{
"name": "content",
"typeAsString": "System.String, System.Private.CoreLib",
"type": "System.String",
"typeSimple": "string",
"isOptional": false,
"defaultValue": null
}
],
"parameters": [
{
"nameOnMethod": "content",
"name": "content",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isOptional": false,
"defaultValue": null,
"constraintTypes": [],
"bindingSourceId": "Path",
"descriptorName": ""
}
],
"returnValue": {
"type": "System.Collections.Generic.List<Volo.CmsKit.Polls.ContentFragment>",
"typeSimple": "[Volo.CmsKit.Polls.ContentFragment]"
},
"allowAnonymous": null,
"implementFrom": "Volo.CmsKit.Public.Polls.IPollViewComponentAppService"
}
}
},
"Volo.CmsKit.Public.Pages.PagesPublicController": {
"controllerName": "PagesPublic",
"controllerGroupName": "PagesPublic",
@ -989,6 +1040,18 @@
"bindingSourceId": "ModelBinding",
"descriptorName": "input"
},
{
"nameOnMethod": "input",
"name": "TagId",
"jsonName": null,
"type": "System.Guid?",
"typeSimple": "string?",
"isOptional": false,
"defaultValue": null,
"constraintTypes": null,
"bindingSourceId": "ModelBinding",
"descriptorName": "input"
},
{
"nameOnMethod": "input",
"name": "Sorting",

17
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/Default.cshtml

@ -1,17 +0,0 @@
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@using Volo.CmsKit.Public.Web.Renderers
@using Volo.Abp.AspNetCore.Mvc.UI.Packages.HighlightJs
@inject IMarkdownToHtmlRenderer MarkdownRenderer
@model Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Pages.PageViewModel
<abp-card>
<abp-card-body>
@if (!Model.Content.IsNullOrEmpty())
{
@Html.Raw(await MarkdownRenderer.RenderAsync(Model.Content))
}
</abp-card-body>
</abp-card>

54
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/DefaultPageViewComponent.cs

@ -1,54 +0,0 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
using Volo.CmsKit.Public.Pages;
using Volo.CmsKit.Public.Web.Renderers;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.HighlightJs;
using Volo.Abp.AspNetCore.Mvc.UI.Widgets;
namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Pages;
[Widget(
StyleTypes = new[]
{
typeof(HighlightJsStyleContributor)
},
ScriptTypes = new[]
{
typeof(HighlightJsScriptContributor)
},
ScriptFiles = new[]
{
"/Pages/Public/CmsKit/highlightOnLoad.js"
})]
public class DefaultPageViewComponent : AbpViewComponent
{
protected IPagePublicAppService PagePublicAppService { get; }
public DefaultPageViewComponent(IPagePublicAppService pagePublicAppService)
{
PagePublicAppService = pagePublicAppService;
}
public virtual async Task<IViewComponentResult> InvokeAsync(Guid pageId, string title, string content)
{
var model = new PageViewModel
{
Id = pageId,
Title = title,
Content = content
};
return View("~/Pages/CmsKit/Shared/Components/Pages/Default.cshtml", model);
}
}
public class PageViewModel
{
public Guid Id { get; set; }
public string Title { get; set; }
public string Content { get; set; }
}

7
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Tags/TagViewComponent.cs

@ -1,9 +1,6 @@
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.Widgets;
using Volo.CmsKit.Tags;

115
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml

@ -1,5 +1,7 @@
@page
@using Volo.Abp.Data
@using Volo.CmsKit.Public.Blogs
@using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Blogs.BlogPostComment
@using Volo.CmsKit.Public.Web.Pages
@using Volo.Abp.GlobalFeatures
@ -9,6 +11,7 @@
@using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Tags
@using Volo.CmsKit.Public.Web.Renderers
@using Volo.Abp.AspNetCore.Mvc.UI.Packages.HighlightJs
@using Volo.CmsKit.Contents
@inherits CmsKitPublicPageBase
@ -23,71 +26,77 @@
}
@section styles{
@if (isScrollIndexEnabled)
{
<abp-abp-style-bundle>
<abp-style src="/Pages/Public/CmsKit/Blogs/bootstrap-toc.css"/>
</abp-abp-style-bundle>
}
@if (isScrollIndexEnabled)
{
<abp-abp-style-bundle>
<abp-style src="/Pages/Public/CmsKit/Blogs/bootstrap-toc.css" />
</abp-abp-style-bundle>
}
<abp-abp-style-bundle>
<abp-style src="/Pages/Public/CmsKit/Blogs/blogPost.css"/>
<abp-style type="typeof(HighlightJsStyleContributor)"/>
<abp-style src="/Pages/Public/CmsKit/Blogs/blogPost.css" />
<abp-style type="typeof(HighlightJsStyleContributor)" />
</abp-abp-style-bundle>
}
@section scripts{
@section scripts{
@if (isScrollIndexEnabled)
{
<abp-script-bundle>
<abp-style src="/Pages/Public/CmsKit/Blogs/bootstrap-toc.js"/>
<abp-script src="/Pages/Public/CmsKit/Blogs/blogpost-scroll-index.js"/>
<abp-style src="/Pages/Public/CmsKit/Blogs/bootstrap-toc.js" />
<abp-script src="/Pages/Public/CmsKit/Blogs/blogpost-scroll-index.js" />
</abp-script-bundle>
}
<abp-script-bundle>
<abp-script type="typeof(HighlightJsScriptContributor)"/>
<abp-script src="/Pages/Public/CmsKit/highlightOnLoad.js"/>
<abp-script type="typeof(HighlightJsScriptContributor)" />
<abp-script src="/Pages/Public/CmsKit/highlightOnLoad.js" />
</abp-script-bundle>
}
<div class="row">
<div @Html.Raw(isScrollIndexEnabled ? "class=\"col-md-10 col-sm-12\"" : "class=\"col-md-12\"")>
<abp-card class="mb-4">
<img src="/api/cms-kit/media/@Model.BlogPost.CoverImageMediaId" class="card-img-top" onerror="this.src='@dummyImageSource'"/>
<abp-card-body>
<abp-row>
<div class="col-lg-8 col-md-10 mx-auto pb-4">
<h1 class="mt-lg-4 mt-md-3">@Model.BlogPost.Title</h1>
<p class="mb-lg-5 mb-md-3">
<a href="/blogs/@Model.BlogSlug?authorId=@Model.BlogPost.Author.Id">
<span class="font-weight-bold">@@@Model.BlogPost.Author?.UserName</span>
</a>
<small style="opacity:.65;">@Model.BlogPost.CreationTime</small>
</p>
@if (!Model.BlogPost.Content.IsNullOrEmpty())
{
@Html.Raw(await MarkdownRenderer.RenderAsync(Model.BlogPost.Content))
}
<p class="mb-3">
@if (Model.BlogPost.LastModificationTime != null)
<div class="row">
<div @Html.Raw(isScrollIndexEnabled ? "class=\"col-md-10 col-sm-12\"" : "class=\"col-md-12\"")>
<abp-card class="mb-4">
<img src="/api/cms-kit/media/@Model.BlogPost.CoverImageMediaId" class="card-img-top" onerror="this.src='@dummyImageSource'" />
<abp-card-body>
<abp-row>
<div class="col-lg-8 col-md-10 mx-auto pb-4">
<h1 class="mt-lg-4 mt-md-3">@Model.BlogPost.Title</h1>
<p class="mb-lg-5 mb-md-3">
<a href="/blogs/@Model.BlogSlug?authorId=@Model.BlogPost.Author.Id">
<span class="font-weight-bold">@@@Model.BlogPost.Author?.UserName</span>
</a>
<small style="opacity:.65;">@Model.BlogPost.CreationTime</small>
</p>
@foreach (var contentFragment in Model.BlogPost.ContentFragments)
{
<small style="opacity:.65;">@L["LastModification"].Value : @Model.BlogPost.LastModificationTime</small>
if (contentFragment.Type == ContentConsts.Markdown)
{
@Html.Raw(await MarkdownRenderer.RenderAsync(contentFragment.GetProperty<string>("Content")))
}
else if (contentFragment.Type == ContentConsts.Widget)
{
@await Component.InvokeAsync(contentFragment.GetProperty<string>("Type"), contentFragment.ExtraProperties.ConvertToDynamicObject())
}
}
</p>
<hr/>
<p class="mb-3">
@if (Model.BlogPost.LastModificationTime != null)
{
<small style="opacity:.65;">@L["LastModification"].Value : @Model.BlogPost.LastModificationTime</small>
}
</p>
<hr />
@if (GlobalFeatureManager.Instance.IsEnabled<TagsFeature>())
{
if (Model.TagsFeature?.IsEnabled == true)
@if (GlobalFeatureManager.Instance.IsEnabled<TagsFeature>())
{
@await Component.InvokeAsync(typeof(TagViewComponent), new
if (Model.TagsFeature?.IsEnabled == true)
{
entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType,
entityId = Model.BlogPost.Id.ToString(),
urlFormat = $"/blogs/{Model.BlogSlug}?tagId={{TagId}}"
})
@await Component.InvokeAsync(typeof(TagViewComponent), new
{
entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType,
entityId = Model.BlogPost.Id.ToString(),
urlFormat = $"/blogs/{Model.BlogSlug}?tagId={{TagId}}"
})
}
}
</div>
@ -100,10 +109,10 @@
if (Model.ReactionsFeature?.IsEnabled == true)
{
@await Component.InvokeAsync(typeof(ReactionSelectionViewComponent), new
{
entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType,
entityId = Model.BlogPost.Id.ToString()
})
{
entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType,
entityId = Model.BlogPost.Id.ToString()
})
}
}
</abp-column>
@ -113,10 +122,10 @@
if (Model.RatingsFeature?.IsEnabled == true)
{
@await Component.InvokeAsync(typeof(RatingViewComponent), new
{
entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType,
entityId = Model.BlogPost.Id.ToString()
})
{
entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType,
entityId = Model.BlogPost.Id.ToString()
})
}
}
</abp-column>

8
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml.cs

@ -1,11 +1,5 @@
using Markdig;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.GlobalFeatures;
using Volo.CmsKit.Blogs;
using Volo.CmsKit.GlobalFeatures;

41
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml

@ -1,31 +1,46 @@
@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.CmsKit.Localization
@using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Pages
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@using Volo.CmsKit.Contents
@using System.Dynamic
@using Volo.CmsKit.Public.Web.Renderers
@using Volo.Abp.Data
@using Volo.Abp.AspNetCore.Mvc.UI.Packages.HighlightJs;
@using Volo.Abp.AspNetCore.Mvc.UI.Widgets;
@inject IMarkdownToHtmlRenderer MarkdownRenderer
@model Volo.CmsKit.Public.Web.Pages.Public.CmsKit.Pages.IndexModel
@inject IHtmlLocalizer<CmsKitResource> L
@section styles{
<abp-style src="/Pages/Public/CmsKit/Pages/index.css" />
<style>
@Html.Raw(Model.Page.Style)
@Html.Raw(Model.PageDto.Style)
</style>
}
@section scripts{
<script>
@Html.Raw(Model.Page.Script)
@Html.Raw(Model.PageDto.Script)
</script>
}
@await Component.InvokeAsync(typeof(DefaultPageViewComponent),
new
{
pageId = Model.Page.Id,
title = Model.Page.Title,
content = Model.Page.Content
})
<abp-card>
<abp-card-body>
@foreach (ContentFragment contentFragment in Model.PageDto.ContentFragments)
{
if (contentFragment.Type == ContentConsts.Markdown)
{
@Html.Raw(await MarkdownRenderer.RenderAsync(contentFragment.GetProperty<string>("Content")))
}
else if (contentFragment.Type == ContentConsts.Widget)
{
@await Component.InvokeAsync(contentFragment.GetProperty<string>("Type"), contentFragment.ExtraProperties.ConvertToDynamicObject())
}
}
</abp-card-body>
</abp-card>

8
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml.cs

@ -12,18 +12,18 @@ public class IndexModel : CommonPageModel
protected IPagePublicAppService PagePublicAppService { get; }
public PageDto Page;
public PageDto PageDto{ get; private set; }
public IndexModel(IPagePublicAppService pagePublicAppService)
public IndexModel(IPagePublicAppService pagePublicAppService)
{
PagePublicAppService = pagePublicAppService;
}
public async Task<IActionResult> OnGetAsync()
{
Page = await PagePublicAppService.FindBySlugAsync(Slug);
PageDto = await PagePublicAppService.FindBySlugAsync(Slug);
if (Page == null)
if (PageDto == null)
{
return NotFound();
}

14
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/PageViewModel.cs

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using Volo.CmsKit.Contents;
namespace Volo.CmsKit.Public.Web.Pages.Public.CmsKit.Pages;
public class PageViewModel
{
public Guid Id { get; set; }
public string Title { get; set; }
public List<ContentFragment> ContentFragments { get; set; }
}

138
modules/cms-kit/test/Volo.CmsKit.Application.Tests/Contents/ContentParser_Test.cs

@ -0,0 +1,138 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
using Shouldly;
using Xunit;
namespace Volo.CmsKit.Contents;
public class ContentParser_Test : CmsKitDomainTestBase
{
private readonly CmsKitTestData testData;
private readonly IOptions<CmsKitContentWidgetOptions> _options;
private ContentParser contentParser;
public ContentParser_Test()
{
testData = GetRequiredService<CmsKitTestData>();
_options = GetRequiredService<IOptions<CmsKitContentWidgetOptions>>();
}
[Fact]
public async Task ParseAsync_ShouldWorkWithDifferentWidgetTypes()
{
_options.Value.AddWidget(testData.PollName, testData.WidgetName);
_options.Value.AddWidget("ImageGallery", "ImageGallery");
contentParser = new ContentParser(_options);
var content = @"**ABP Framework** is completely open source and developed in a community-driven manner.
[Widget Type=""Poll"" Code=""poll-name""]
Thanks _for_ *your * feedback.
[Widget GalleryName=""Xyz"" Type=""ImageGallery"" Source=""GoogleDrive""]";
var widgets = await contentParser.ParseAsync(content);
widgets.ShouldNotBeNull();
widgets.Count.ShouldBe(4);
widgets[1].ExtraProperties.Count.ShouldBe(2);
widgets[3].ExtraProperties.Count.ShouldBe(3);
}
[Fact]
public async Task ParseAsync_ShouldWorkWithoutConfigOptions()
{
var content = @"**ABP Framework** is completely open source and developed in a community-driven manner.
[Widget Type= ""Poll"" Code =""poll-name""]
Thanks _for_ *your * feedback.";
contentParser = new ContentParser(_options);
var widgets = await contentParser.ParseAsync(content);
widgets.ShouldNotBeNull();
widgets.Count.ShouldBe(1);//Ignored Widget
}
[Fact]
public async Task ParseAsync_ShouldWorkWithWrongConfigOptions()
{
_options.Value.AddWidget(testData.WidgetName, testData.PollName);
contentParser = new ContentParser(_options);
var content = @"**ABP Framework** is completely open source and developed in a community-driven manner.
[Widget Type= ""Poll"" Code =""poll-name""]
Thanks _for_ *your * feedback.";
var widgets = await contentParser.ParseAsync(content);
widgets.ShouldNotBeNull();
widgets.Count.ShouldBe(2);
}
[Fact]
public async Task ParseAsync_ShouldWorkWithWrongWidgetType()
{
_options.Value.AddWidget(testData.PollName, testData.WidgetName);
contentParser = new ContentParser(_options);
var content = @"**ABP Framework** is completely open source and developed in a community-driven manner.
[Widget Wrong Type= ""Poll"" Code =""poll-name""]
Thanks _for_ *your * feedback.";
var widgets = await contentParser.ParseAsync(content);
widgets.ShouldNotBeNull();
widgets.Count.ShouldBe(2);
}
[Fact]
public async Task ParseAsync_ShouldWorkWithWrongPollName()
{
_options.Value.AddWidget(testData.PollName, testData.WidgetName);
contentParser = new ContentParser(_options);
var content = @"**ABP Framework** is completely open source and developed in a community-driven manner.
[Widget Type= ""Poll"" PollWrongName =""poll-name""]
Thanks _for_ *your * feedback.";
var widgets = await contentParser.ParseAsync(content);
widgets.ShouldNotBeNull();
widgets.Count.ShouldBe(3);
}
[Theory]
[MemberData(nameof(ExampleData))]
public async Task ParseAsync_ShouldWorkProperlyWithCorrectInputs(string content, int expectedLine)
{
_options.Value.AddWidget(testData.PollName, testData.WidgetName);
contentParser = new ContentParser(_options);
var widgets = await contentParser.ParseAsync(content);
widgets.ShouldNotBeNull();
widgets.Count.ShouldBe(expectedLine);
}
public static IEnumerable<object[]> ExampleData =>
new List<object[]>
{
new object[] { @"**ABP Framework** is completely open source and developed in a community-driven manner.
[Widget Type=""Poll"" Code=""poll-name""]
Thanks _for_ *your * feedback.", 3},
new object[] { @"**ABP Framework** is completely open source and developed in a community-driven manner.
[Widget Type=""Poll"" Code=""poll-name""]
Thanks _for_ *your * feedback.
[Widget Type=""Poll"" Code=""poll-name1""]", 4 },
new object[] { @"**ABP Framework** is completely open source and developed in a community-driven manner.
Thanks _for_ *your * feedback.
[Widget Type=""Poll"" Code=""poll-name""]", 2 },
new object[] { @"[Widget Type=""Poll"" Code=""poll-name""] gg [Widget Type=""Poll"" Code=""poll-name1""]**ABP Framework** is completely open source and developed in a community-driven manner.
Thanks _for_ *your * feedback.
Thanks _for_ *your * feedback.", 4},
new object[] { @"Thanks _for_ *your * feedback.
Thanks _for_ *your * feedback.", 1}
};
}

13
modules/cms-kit/test/Volo.CmsKit.Domain.Tests/Pages/PageManager_Test.cs

@ -1,9 +1,6 @@
using Shouldly;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading.Tasks;
using Shouldly;
using Xunit;
namespace Volo.CmsKit.Pages;
@ -20,6 +17,7 @@ public class PageManager_Test : CmsKitDomainTestBase
pageRepository = GetRequiredService<IPageRepository>();
}
[Fact]
public async Task CreateAsync_ShouldWorkProperly_WithNonExistingSlug()
{
var title = "My awesome page";
@ -34,6 +32,7 @@ public class PageManager_Test : CmsKitDomainTestBase
page.Content.ShouldBe(content);
}
[Fact]
public async Task CreateAsync_ShouldThrowException_WithExistingSlug()
{
var title = "My awesome page";
@ -46,6 +45,7 @@ public class PageManager_Test : CmsKitDomainTestBase
exception.ShouldNotBeNull();
}
[Fact]
public async Task SetSlugAsync_ShouldWorkProperly_WithNonExistingSlug()
{
var newSlug = "freshly-generated-new-slug";
@ -56,6 +56,7 @@ public class PageManager_Test : CmsKitDomainTestBase
page.Slug.ShouldBe(newSlug);
}
[Fact]
public async Task SetSlugAsync_ShouldThrowException_WithExistingSlug()
{
var newSlug = testData.Page_2_Slug;

4
modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitTestData.cs

@ -127,4 +127,8 @@ public class CmsKitTestData : ISingletonDependency
public string MenuItem_3_Name { get; } = "Products";
public string MenuItem_3_Url { get; } = "/products";
public string PollName { get; } = "Poll";
public string WidgetName { get; } = "CmsPollByCode";
}

13
modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20220425082215_Initial.Designer.cs → modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20220623064459_Initial.Designer.cs

@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace OpenIddict.Demo.Server.Migrations
{
[DbContext(typeof(ServerDbContext))]
[Migration("20220425082215_Initial")]
[Migration("20220623064459_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -21,7 +21,7 @@ namespace OpenIddict.Demo.Server.Migrations
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
.HasAnnotation("ProductVersion", "6.0.0")
.HasAnnotation("ProductVersion", "6.0.5")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
@ -336,7 +336,8 @@ namespace OpenIddict.Demo.Server.Migrations
.HasColumnName("ExtraProperties");
b.Property<bool>("IsActive")
.HasColumnType("bit");
.HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
@ -682,6 +683,9 @@ namespace OpenIddict.Demo.Server.Migrations
b.Property<string>("ClientSecret")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClientUri")
.HasColumnType("nvarchar(max)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
@ -732,6 +736,9 @@ namespace OpenIddict.Demo.Server.Migrations
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("LogoUri")
.HasColumnType("nvarchar(max)");
b.Property<string>("Permissions")
.HasColumnType("nvarchar(max)");

2
modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20220425082215_Initial.cs → modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20220623064459_Initial.cs

@ -237,6 +237,8 @@ namespace OpenIddict.Demo.Server.Migrations
RedirectUris = table.Column<string>(type: "nvarchar(max)", nullable: true),
Requirements = table.Column<string>(type: "nvarchar(max)", nullable: true),
Type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ClientUri = table.Column<string>(type: "nvarchar(max)", nullable: true),
LogoUri = table.Column<string>(type: "nvarchar(max)", nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),

11
modules/openiddict/app/OpenIddict.Demo.Server/Migrations/ServerDbContextModelSnapshot.cs

@ -19,7 +19,7 @@ namespace OpenIddict.Demo.Server.Migrations
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
.HasAnnotation("ProductVersion", "6.0.0")
.HasAnnotation("ProductVersion", "6.0.5")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
@ -334,7 +334,8 @@ namespace OpenIddict.Demo.Server.Migrations
.HasColumnName("ExtraProperties");
b.Property<bool>("IsActive")
.HasColumnType("bit");
.HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
@ -680,6 +681,9 @@ namespace OpenIddict.Demo.Server.Migrations
b.Property<string>("ClientSecret")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClientUri")
.HasColumnType("nvarchar(max)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
@ -730,6 +734,9 @@ namespace OpenIddict.Demo.Server.Migrations
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("LogoUri")
.HasColumnType("nvarchar(max)");
b.Property<string>("Permissions")
.HasColumnType("nvarchar(max)");

19
modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/LogoutController.cs

@ -10,21 +10,12 @@ namespace Volo.Abp.OpenIddict.Controllers;
public class LogoutController : AbpOpenIdDictControllerBase
{
[HttpGet]
public virtual Task<IActionResult> GetAsync()
public virtual async Task<IActionResult> GetAsync()
{
return Task.FromResult<IActionResult>(View("Logout"));
}
[HttpPost]
public virtual async Task<IActionResult> PostAsync()
{
if (await HasFormValueAsync("accept"))
{
// Ask ASP.NET Core Identity to delete the local and external cookies created
// when the user agent is redirected from the external identity provider
// after a successful authentication flow (e.g Google or Facebook).
await SignInManager.SignOutAsync();
}
// Ask ASP.NET Core Identity to delete the local and external cookies created
// when the user agent is redirected from the external identity provider
// after a successful authentication flow (e.g Google or Facebook).
await SignInManager.SignOutAsync();
// Returning a SignOutResult will ask OpenIddict to redirect the user agent
// to the post_logout_redirect_uri specified by the client application or to

22
modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Views/Logout/Logout.cshtml

@ -1,22 +0,0 @@
@using Microsoft.Extensions.Primitives
@using Volo.Abp.OpenIddict.Localization
@using Microsoft.AspNetCore.Mvc.Localization
@model AuthorizeViewModel
@inject IHtmlLocalizer<AbpOpenIddictResource> L
<div class="jumbotron">
<h1>@L["LogOut"]</h1>
<p class="lead text-left">@L["AreYouSureYouWantToSignOut"]</p>
<form method="post" action="~/connect/logout">
@Html.AntiForgeryToken()
@* Flow the request parameters so they can be received by the LogoutPost action: *@
@foreach (var parameter in Context.Request.HasFormContentType ? (IEnumerable<KeyValuePair<string, StringValues>>) Context.Request.Form : Context.Request.Query)
{
<input type="hidden" name="@parameter.Key" value="@parameter.Value"/>
}
<input class="btn btn-primary" name="accept" type="submit" value="@L["Accept"]"/>
<input class="btn btn-danger ms-1" name="deny" type="submit" value="@L["Deny"]"/>
</form>
</div>

6
modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/el.json

@ -10,8 +10,6 @@
"DoYouWantToGrantAccessToYourData": "Θέλετε να παραχωρήσετε στον χρήστη {0} πρόσβαση στα δεδομένα σας;",
"ScopesRequested": "Ζητούνται πεδία εφαρμογής",
"Accept": "Αποδοχή",
"Deny": "Άρνηση",
"LogOut": "Αποσύνδεση",
"AreYouSureYouWantToSignOut": "Είστε βέβαιοι ότι θέλετε να αποσυνδεθείτε;"
"Deny": "Άρνηση"
}
}
}

4
modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/en.json

@ -10,8 +10,6 @@
"DoYouWantToGrantAccessToYourData": "Do you want to grant {0} access to your data?",
"ScopesRequested": "Scopes requested",
"Accept": "Accept",
"Deny": "Deny",
"LogOut": "Log out",
"AreYouSureYouWantToSignOut": "Are you sure you want to sign out?"
"Deny": "Deny"
}
}

6
modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/pt-BR.json

@ -10,8 +10,6 @@
"DoYouWantToGrantAccessToYourData": "Deseja permitir {0} acesse seus dados?",
"ScopesRequested": "Escopo solicitado",
"Accept": "Aceitar",
"Deny": "Negar",
"LogOut": "Sair",
"AreYouSureYouWantToSignOut": "Tem certeza que deseja sair?"
"Deny": "Negar"
}
}
}

4
modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/tr.json

@ -10,8 +10,6 @@
"DoYouWantToGrantAccessToYourData": "Do you want to grant {0} access to your data?",
"ScopesRequested": "İstenen kapsamlar",
"Accept": "Kabul etmek",
"Deny": "Reddetmek",
"LogOut": "Çıkış Yap",
"AreYouSureYouWantToSignOut": "Çıkış yapmak istediğinden emin misin?"
"Deny": "Reddetmek"
}
}

4
modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/zh-Hans.json

@ -10,8 +10,6 @@
"DoYouWantToGrantAccessToYourData": "是否要授予 {0} 访问你的数据的权限?",
"ScopesRequested": "要求的Scope",
"Accept": "同意",
"Deny": "拒绝",
"LogOut": "注销",
"AreYouSureYouWantToSignOut": "你确定要退出吗?"
"Deny": "拒绝"
}
}

4
modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/zh-Hant.json

@ -11,8 +11,6 @@
"DoYouWantToGrantAccessToYourData": "是否要授予 {0} 訪問你的數據的權限?",
"ScopesRequested": "要求的Scope",
"Accept": "接受",
"Deny": "拒絕",
"LogOut": "註銷",
"AreYouSureYouWantToSignOut": "你確定要退出嗎?"
"Deny": "拒絕"
}
}

1
templates/app-nolayers/angular/angular.json

@ -65,6 +65,7 @@
"inject": true,
"bundleName": "bootstrap-ltr.min"
},
"node_modules/bootstrap-icons/font/bootstrap-icons.css",
"src/styles.scss"
],
"scripts": []

3
templates/app-nolayers/angular/package.json

@ -18,8 +18,8 @@
"@abp/ng.identity": "~5.3.0",
"@abp/ng.setting-management": "~5.3.0",
"@abp/ng.tenant-management": "~5.3.0",
"@abp/ng.theme.basic": "~5.3.0",
"@abp/ng.theme.shared": "~5.3.0",
"@abp/ng.theme.lepton-x": "~1.0.0-beta.2",
"@angular/animations": "~13.1.1",
"@angular/common": "~13.1.1",
"@angular/compiler": "~13.1.1",
@ -31,6 +31,7 @@
"@angular/router": "~13.1.1",
"rxjs": "~6.6.0",
"tslib": "^2.1.0",
"bootstrap-icons": "~1.8.3",
"zone.js": "~0.11.4"
},
"devDependencies": {

6
templates/app-nolayers/angular/src/app/app.module.ts

@ -4,7 +4,8 @@ import { registerLocale } from '@abp/ng.core/locale';
import { IdentityConfigModule } from '@abp/ng.identity/config';
import { SettingManagementConfigModule } from '@abp/ng.setting-management/config';
import { TenantManagementConfigModule } from '@abp/ng.tenant-management/config';
import { ThemeBasicModule } from '@abp/ng.theme.basic';
import { ThemeLeptonXModule } from '@abp/ng.theme.lepton-x';
import { SideMenuLayoutModule } from '@abp/ng.theme.lepton-x/layouts';
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
@ -28,7 +29,8 @@ import { APP_ROUTE_PROVIDER } from './route.provider';
IdentityConfigModule.forRoot(),
TenantManagementConfigModule.forRoot(),
SettingManagementConfigModule.forRoot(),
ThemeBasicModule.forRoot(),
ThemeLeptonXModule.forRoot(),
SideMenuLayoutModule.forRoot(),
],
declarations: [AppComponent],
providers: [APP_ROUTE_PROVIDER],

1
templates/app-nolayers/angular/src/app/home/home-routing.module.ts

@ -1,7 +1,6 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home.component';
import { ApplicationLayoutComponent } from '@abp/ng.theme.basic';
const routes: Routes = [{ path: '', component: HomeComponent }];

6
templates/app-nolayers/angular/src/styles.scss

@ -24,3 +24,9 @@
transform: translate(-50%, -50%);
}
}
:root {
--lpx-logo: url('/assets/images/logo.png');
--lpx-logo-icon: url('/assets/images/logo-icon.png');
--lpx-brand: #edae53;
}

10
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/MyCompanyName.MyProjectName.Blazor.Server.Mongo.csproj

@ -12,6 +12,11 @@
<PackageReference Include="Serilog.AspNetCore" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="1.0.0-beta.2" />
<PackageReference Include="Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme" Version="1.0.0-beta.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc\Volo.Abp.AspNetCore.Mvc.csproj" />
@ -68,11 +73,6 @@
<ProjectReference Include="..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.MongoDB\Volo.Abp.AuditLogging.MongoDB.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<ProjectReference Include="..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Components.Server.BasicTheme\Volo.Abp.AspNetCore.Components.Server.BasicTheme.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="6.0.5" />
</ItemGroup>

16
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/MyProjectNameModule.cs

@ -8,14 +8,14 @@ using MyCompanyName.MyProjectName.Menus;
using Volo.Abp;
using Volo.Abp.Account;
using Volo.Abp.Account.Web;
using Volo.Abp.AspNetCore.Components.Server.BasicTheme;
using Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite;
using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme;
using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling;
using Volo.Abp.AspNetCore.Components.Web.Theming.Routing;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.AuditLogging.MongoDB;
using Volo.Abp.Autofac;
@ -59,8 +59,8 @@ namespace MyCompanyName.MyProjectName;
typeof(AbpAutoMapperModule),
typeof(AbpSwashbuckleModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAspNetCoreComponentsServerBasicThemeModule),
typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule),
typeof(AbpAspNetCoreComponentsServerLeptonXLiteThemeModule),
// Account module packages
typeof(AbpAccountApplicationModule),
@ -166,7 +166,7 @@ public class MyProjectNameModule : AbpModule
{
// MVC UI
options.StyleBundles.Configure(
BasicThemeBundles.Styles.Global,
LeptonXLiteThemeBundles.Styles.Global,
bundle =>
{
bundle.AddFiles("/global-styles.css");
@ -175,7 +175,7 @@ public class MyProjectNameModule : AbpModule
//BLAZOR UI
options.StyleBundles.Configure(
BlazorBasicThemeBundles.Styles.Global,
BlazorLeptonXLiteThemeBundles.Styles.Global,
bundle =>
{
bundle.AddFiles("/blazor-global-styles.css");

9
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Pages/_Host.cshtml

@ -1,8 +1,8 @@
@page "/"
@namespace MyCompanyName.MyProjectName.Blazor.Server.Pages
@using System.Globalization
@using Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling
@using Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic
@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite
@using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling
@using Volo.Abp.Localization
@{
Layout = null;
@ -17,9 +17,10 @@
<title>MyCompanyName.MyProjectName.Blazor.Server</title>
<base href="~/" />
<abp-style-bundle name="@BlazorBasicThemeBundles.Styles.Global" />
<abp-style-bundle name="@BlazorLeptonXLiteThemeBundles.Styles.Global"/>
</head>
<body class="abp-application-layout bg-light @rtl">
<component type="typeof(App)" render-mode="Server" />
<div id="blazor-error-ui">
@ -33,6 +34,6 @@
<a class="dismiss">🗙</a>
</div>
<abp-script-bundle name="@BlazorBasicThemeBundles.Scripts.Global" />
<abp-script-bundle name="@BlazorLeptonXLiteThemeBundles.Scripts.Global" />
</body>
</html>

4
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/package.json

@ -3,7 +3,7 @@
"name": "my-app",
"private": true,
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0",
"@abp/aspnetcore.components.server.basictheme": "^5.3.0"
"@abp/aspnetcore.mvc.ui.theme.leptonxlite": "^1.0.0",
"@abp/aspnetcore.components.server.leptonxlitetheme": "^1.0.0"
}
}

10
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj

@ -12,6 +12,11 @@
<PackageReference Include="Serilog.AspNetCore" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="1.0.0-beta.2" />
<PackageReference Include="Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme" Version="1.0.0-beta.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc\Volo.Abp.AspNetCore.Mvc.csproj" />
@ -69,11 +74,6 @@
<ProjectReference Include="..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<ProjectReference Include="..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Components.Server.BasicTheme\Volo.Abp.AspNetCore.Components.Server.BasicTheme.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="6.0.5" />
</ItemGroup>

18
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameModule.cs

@ -8,14 +8,14 @@ using MyCompanyName.MyProjectName.Menus;
using Volo.Abp;
using Volo.Abp.Account;
using Volo.Abp.Account.Web;
using Volo.Abp.AspNetCore.Components.Server.BasicTheme;
using Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite;
using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme;
using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling;
using Volo.Abp.AspNetCore.Components.Web.Theming.Routing;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.Autofac;
@ -60,9 +60,9 @@ namespace MyCompanyName.MyProjectName;
typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(AbpSwashbuckleModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAspNetCoreComponentsServerBasicThemeModule),
typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule),
typeof(AbpAspNetCoreComponentsServerLeptonXLiteThemeModule),
// Account module packages
typeof(AbpAccountApplicationModule),
typeof(AbpAccountHttpApiModule),
@ -167,7 +167,7 @@ public class MyProjectNameModule : AbpModule
{
// MVC UI
options.StyleBundles.Configure(
BasicThemeBundles.Styles.Global,
LeptonXLiteThemeBundles.Styles.Global,
bundle =>
{
bundle.AddFiles("/global-styles.css");
@ -176,7 +176,7 @@ public class MyProjectNameModule : AbpModule
//BLAZOR UI
options.StyleBundles.Configure(
BlazorBasicThemeBundles.Styles.Global,
BlazorLeptonXLiteThemeBundles.Styles.Global,
bundle =>
{
bundle.AddFiles("/blazor-global-styles.css");

9
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Pages/_Host.cshtml

@ -1,8 +1,8 @@
@page "/"
@namespace MyCompanyName.MyProjectName.Blazor.Server.Pages
@using System.Globalization
@using Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling
@using Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic
@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite
@using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling
@using Volo.Abp.Localization
@{
Layout = null;
@ -17,9 +17,10 @@
<title>MyCompanyName.MyProjectName.Blazor.Server</title>
<base href="~/" />
<abp-style-bundle name="@BlazorBasicThemeBundles.Styles.Global" />
<abp-style-bundle name="@BlazorLeptonXLiteThemeBundles.Styles.Global"/>
</head>
<body class="abp-application-layout bg-light @rtl">
<component type="typeof(App)" render-mode="Server" />
<div id="blazor-error-ui">
@ -33,6 +34,6 @@
<a class="dismiss">🗙</a>
</div>
<abp-script-bundle name="@BlazorBasicThemeBundles.Scripts.Global" />
<abp-script-bundle name="@BlazorLeptonXLiteThemeBundles.Scripts.Global" />
</body>
</html>

4
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/package.json

@ -3,7 +3,7 @@
"name": "my-app",
"private": true,
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0",
"@abp/aspnetcore.components.server.basictheme": "^5.3.0"
"@abp/aspnetcore.mvc.ui.theme.leptonxlite": "^1.0.0",
"@abp/aspnetcore.components.server.leptonxlitetheme": "^1.0.0"
}
}

2
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/MyCompanyName.MyProjectName.Host.Mongo.csproj

@ -64,7 +64,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="1.0.0-beta.2" />
</ItemGroup>
<ItemGroup>

8
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/MyProjectNameModule.cs

@ -11,8 +11,8 @@ using Volo.Abp.AspNetCore.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.AuditLogging.MongoDB;
@ -51,7 +51,7 @@ namespace MyCompanyName.MyProjectName;
typeof(AbpAspNetCoreMultiTenancyModule),
typeof(AbpAutofacModule),
typeof(AbpAutoMapperModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule),
typeof(AbpSwashbuckleModule),
typeof(AbpAspNetCoreSerilogModule),
@ -144,7 +144,7 @@ public class MyProjectNameModule : AbpModule
Configure<AbpBundlingOptions>(options =>
{
options.StyleBundles.Configure(
BasicThemeBundles.Styles.Global,
LeptonXLiteThemeBundles.Styles.Global,
bundle => { bundle.AddFiles("/global-styles.css"); }
);
});

2
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/package.json

@ -3,6 +3,6 @@
"name": "my-app",
"private": true,
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0"
"@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~1.0.0"
}
}

2
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/MyCompanyName.MyProjectName.Host.csproj

@ -65,7 +65,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="1.0.0-beta.2" />
</ItemGroup>
<ItemGroup>

8
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/MyProjectNameModule.cs

@ -11,8 +11,8 @@ using Volo.Abp.AspNetCore.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
@ -53,7 +53,7 @@ namespace MyCompanyName.MyProjectName;
typeof(AbpAutofacModule),
typeof(AbpAutoMapperModule),
typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule),
typeof(AbpSwashbuckleModule),
typeof(AbpAspNetCoreSerilogModule),
@ -146,7 +146,7 @@ public class MyProjectNameModule : AbpModule
Configure<AbpBundlingOptions>(options =>
{
options.StyleBundles.Configure(
BasicThemeBundles.Styles.Global,
LeptonXLiteThemeBundles.Styles.Global,
bundle => { bundle.AddFiles("/global-styles.css"); }
);
});

2
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/package.json

@ -3,6 +3,6 @@
"name": "my-app",
"private": true,
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0"
"@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~1.0.0"
}
}

8
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/MyCompanyName.MyProjectName.Mvc.Mongo.csproj

@ -10,6 +10,10 @@
<PackageReference Include="Serilog.AspNetCore" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="1.0.0-beta.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc\Volo.Abp.AspNetCore.Mvc.csproj" />
@ -66,10 +70,6 @@
<ProjectReference Include="..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.MongoDB\Volo.Abp.AuditLogging.MongoDB.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="6.0.5" />
</ItemGroup>

10
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/MyProjectNameModule.cs

@ -9,8 +9,8 @@ using Volo.Abp.Account.Web;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.AuditLogging.MongoDB;
@ -55,8 +55,8 @@ namespace MyCompanyName.MyProjectName;
typeof(AbpAutoMapperModule),
typeof(AbpSwashbuckleModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule),
// Account module packages
typeof(AbpAccountApplicationModule),
typeof(AbpAccountHttpApiModule),
@ -165,7 +165,7 @@ public class MyProjectNameModule : AbpModule
Configure<AbpBundlingOptions>(options =>
{
options.StyleBundles.Configure(
BasicThemeBundles.Styles.Global,
LeptonXLiteThemeBundles.Styles.Global,
bundle =>
{
bundle.AddFiles("/global-styles.css");

2
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/package.json

@ -3,6 +3,6 @@
"name": "my-app",
"private": true,
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "~5.3.0"
"@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~1.0.0"
}
}

8
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/MyCompanyName.MyProjectName.Mvc.csproj

@ -10,6 +10,10 @@
<PackageReference Include="Serilog.AspNetCore" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="1.0.0-beta.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc\Volo.Abp.AspNetCore.Mvc.csproj" />
@ -67,10 +71,6 @@
<ProjectReference Include="..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="6.0.5" />
</ItemGroup>

8
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/MyProjectNameModule.cs

@ -9,8 +9,8 @@ using Volo.Abp.Account.Web;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
@ -56,7 +56,7 @@ namespace MyCompanyName.MyProjectName;
typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(AbpSwashbuckleModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule),
// Account module packages
typeof(AbpAccountApplicationModule),
@ -167,7 +167,7 @@ public class MyProjectNameModule : AbpModule
Configure<AbpBundlingOptions>(options =>
{
options.StyleBundles.Configure(
BasicThemeBundles.Styles.Global,
LeptonXLiteThemeBundles.Styles.Global,
bundle =>
{
bundle.AddFiles("/global-styles.css");

2
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/package.json

@ -3,6 +3,6 @@
"name": "my-app",
"private": true,
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "~5.3.0"
"@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~1.0.0"
}
}

1
templates/app/angular/angular.json

@ -65,6 +65,7 @@
"inject": true,
"bundleName": "bootstrap-ltr.min"
},
"node_modules/bootstrap-icons/font/bootstrap-icons.css",
"src/styles.scss"
],
"scripts": []

3
templates/app/angular/package.json

@ -18,8 +18,8 @@
"@abp/ng.identity": "~5.3.0",
"@abp/ng.setting-management": "~5.3.0",
"@abp/ng.tenant-management": "~5.3.0",
"@abp/ng.theme.basic": "~5.3.0",
"@abp/ng.theme.shared": "~5.3.0",
"@abp/ng.theme.lepton-x": "~1.0.0-beta.2",
"@angular/animations": "~13.3.3",
"@angular/common": "~13.3.3",
"@angular/compiler": "~13.3.3",
@ -31,6 +31,7 @@
"@angular/router": "~13.3.3",
"rxjs": "~6.6.0",
"tslib": "^2.1.0",
"bootstrap-icons": "~1.8.3",
"zone.js": "~0.11.4"
},
"devDependencies": {

6
templates/app/angular/src/app/app.module.ts

@ -4,7 +4,8 @@ import { registerLocale } from '@abp/ng.core/locale';
import { IdentityConfigModule } from '@abp/ng.identity/config';
import { SettingManagementConfigModule } from '@abp/ng.setting-management/config';
import { TenantManagementConfigModule } from '@abp/ng.tenant-management/config';
import { ThemeBasicModule } from '@abp/ng.theme.basic';
import { ThemeLeptonXModule } from '@abp/ng.theme.lepton-x';
import { SideMenuLayoutModule } from '@abp/ng.theme.lepton-x/layouts';
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
@ -28,7 +29,8 @@ import { APP_ROUTE_PROVIDER } from './route.provider';
IdentityConfigModule.forRoot(),
TenantManagementConfigModule.forRoot(),
SettingManagementConfigModule.forRoot(),
ThemeBasicModule.forRoot(),
ThemeLeptonXModule.forRoot(),
SideMenuLayoutModule.forRoot(),
],
declarations: [AppComponent],
providers: [APP_ROUTE_PROVIDER],

1
templates/app/angular/src/app/home/home-routing.module.ts

@ -1,7 +1,6 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home.component';
import { ApplicationLayoutComponent } from '@abp/ng.theme.basic';
const routes: Routes = [{ path: '', component: HomeComponent }];

6
templates/app/angular/src/styles.scss

@ -24,3 +24,9 @@
transform: translate(-50%, -50%);
}
}
:root {
--lpx-logo: url('/assets/images/logo.png');
--lpx-logo-icon: url('/assets/images/logo-icon.png');
--lpx-brand: #edae53;
}

5
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyCompanyName.MyProjectName.AuthServer.csproj

@ -35,11 +35,14 @@
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="6.0.5" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="1.0.0-beta.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Caching.StackExchangeRedis\Volo.Abp.Caching.StackExchangeRedis.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Serilog\Volo.Abp.AspNetCore.Serilog.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\account\src\Volo.Abp.Account.Web.OpenIddict\Volo.Abp.Account.Web.OpenIddict.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\account\src\Volo.Abp.Account.Application\Volo.Abp.Account.Application.csproj" />

9
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs

@ -17,8 +17,8 @@ using Volo.Abp.Account.Web;
using Volo.Abp.AspNetCore.Mvc.UI;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Auditing;
@ -40,7 +40,7 @@ namespace MyCompanyName.MyProjectName;
typeof(AbpAccountWebOpenIddictModule),
typeof(AbpAccountApplicationModule),
typeof(AbpAccountHttpApiModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule),
typeof(MyProjectNameEntityFrameworkCoreModule),
typeof(AbpAspNetCoreSerilogModule)
)]
@ -97,7 +97,7 @@ public class MyProjectNameAuthServerModule : AbpModule
Configure<AbpBundlingOptions>(options =>
{
options.StyleBundles.Configure(
BasicThemeBundles.Styles.Global,
LeptonXLiteThemeBundles.Styles.Global,
bundle =>
{
bundle.AddFiles("/global-styles.css");
@ -120,7 +120,6 @@ public class MyProjectNameAuthServerModule : AbpModule
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiBootstrapModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI.Bootstrap", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiThemeSharedModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiBasicThemeModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}basic-theme{0}src{0}Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAccountWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}account{0}src{0}Volo.Abp.Account.Web", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAccountWebOpenIddictModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}account{0}src{0}Volo.Abp.Account.Web.OpenIddict", Path.DirectorySeparatorChar)));
//</TEMPLATE-REMOVE>

135
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/Pages/Index.cshtml

@ -1,34 +1,119 @@
@page
@using Microsoft.AspNetCore.Http.Extensions
@using Microsoft.AspNetCore.Mvc.Localization
@using MyCompanyName.MyProjectName.Pages
@using MyCompanyName.MyProjectName.Localization
@using Volo.Abp.Users
@using Volo.Abp.AspNetCore.Mvc.UI.Theming
@using Volo.Abp.Ui.Branding
@model IndexModel
@inject IHtmlLocalizer<MyProjectNameResource> L
@inject ICurrentUser CurrentUser
@if (CurrentUser.IsAuthenticated)
{
<div>
@inject IBrandingProvider BrandingProvider
@inject ITheme Theme
@{
Layout = Theme.GetEmptyLayout();
}
<div class="d-flex align-items-center" style="min-height: 100vh;">
<div class="container">
<abp-row>
<abp-column size-md="_3" class="text-center">
<i class="fa fa-user d-block" style="font-size: 10em; color: #12b900"></i>
<a abp-button="Primary" href="/Account/Logout">Logout</a>
</abp-column>
<abp-column size-md="_9">
<h2>@CurrentUser.UserName</h2>
<h5 class="text-muted">@CurrentUser.Email</h5>
<div>
<strong>Roles</strong>: @CurrentUser.Roles.JoinAsString(", ")
<br />
<strong>Claims</strong>: <br />
@Html.Raw(CurrentUser.GetAllClaims().Select(c => $"{c.Type}={c.Value}").JoinAsString(" <br /> "))
<div class="col mx-auto account-column">
<div class="account-brand p-4 text-center mb-1">
@if (!BrandingProvider.LogoUrl.IsNullOrEmpty())
{
<a class="navbar-brand" href="/" alt="@BrandingProvider.AppName"></a>
}
else
{
<h1>@BrandingProvider.AppName</h1>
}
</div>
</abp-column>
</abp-row>
</div>
}
<abp-card>
<abp-card-body>
<div class="container">
<abp-row>
<abp-column size="_9">
<div class="d-flex align-items-center">
<div class="me-3 p-2">
<i class="fa fa-user d-block" style="font-size: 10em; color: #12b900"></i>
</div>
<div class="p2">
@if (CurrentUser.IsAuthenticated)
{
<span class="fs-16">
@L["Welcome"] <span class="fw-7">@CurrentUser.UserName</span>
</span>
<span class="fs-14 d-block text-dark-800 opacity-75 mb-1">@CurrentUser.Email</span>
<div class="d-grid gap-2">
<a abp-button="Outline_Primary" asp-controller="Manage" asp-action="Index" asp-area="Account">@L["MyAccount"]</a>
<a abp-button="Primary" asp-controller="Logout" asp-action="Index" asp-area="Account">@L["Logout"]</a>
</div>
}
else
{
<a abp-button="Primary" asp-controller="Login" asp-action="Index" asp-area="Account">@L["Login"]</a>
}
</div>
@if (!CurrentUser.IsAuthenticated)
{
<div class="text-center">
<i class="fa fa-user d-block" style="font-size: 10em; color: #aaa"></i><br/><br />
<a abp-button="Primary" asp-page="/Account/Login">Login</a>
</div>
</abp-column>
<abp-column size="_3">
<div class="ml-auto p-2 float-end">
<abp-dropdown>
<abp-dropdown-button text="@Model.CurrentLanguage" />
<abp-dropdown-menu>
@foreach (var language in Model.Languages)
{
<abp-dropdown-item href="~/Abp/Languages/Switch?culture=@(language.CultureName)&uiCulture=@(language.UiCultureName)&returnUrl=@(System.Net.WebUtility.UrlEncode(Request.GetEncodedPathAndQuery()))">@language.DisplayName</abp-dropdown-item>
}
</abp-dropdown-menu>
</abp-dropdown>
</div>
</abp-column>
</abp-row>
<hr class="m-4" />
<abp-row>
@foreach (var application in Model.Applications)
{
<abp-column size-md="_4" class="mb-2">
<abp-card>
<abp-card-body>
@if (!application.LogoUri.IsNullOrEmpty())
{
<div class="mx-auto">
<img src="@application.LogoUri" style="height:64px" class="mb-3" />
</div>
}
<h4>@application.DisplayName</h4>
<span class="text-muted">@application.ClientUri</span>
<div class="mt-1">
<a abp-button="Outline_Secondary" href="@application.ClientUri">@L["Visit"]</a>
</div>
</abp-card-body>
</abp-card>
</abp-column>
}
</abp-row>
</div>
</abp-card-body>
</abp-card>
</div>
</abp-row>
</div>
}
</div>

28
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/Pages/Index.cshtml.cs

@ -1,10 +1,36 @@
using System.Collections.Generic;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
using Volo.Abp.Localization;
using Volo.Abp.OpenIddict.Applications;
namespace MyCompanyName.MyProjectName.Pages;
public class IndexModel : AbpPageModel
{
public void OnGet()
public List<OpenIddictApplication> Applications { get; protected set; }
public IReadOnlyList<LanguageInfo> Languages { get; protected set; }
public string CurrentLanguage { get; protected set; }
protected IOpenIddictApplicationRepository OpenIdApplicationRepository { get; }
protected ILanguageProvider LanguageProvider { get; }
public IndexModel(IOpenIddictApplicationRepository openIdApplicationmRepository, ILanguageProvider languageProvider)
{
OpenIdApplicationRepository = openIdApplicationmRepository;
LanguageProvider = languageProvider;
}
public async Task OnGetAsync()
{
Applications = await OpenIdApplicationRepository.GetListAsync();
Languages = await LanguageProvider.GetLanguagesAsync();
CurrentLanguage = CultureInfo.CurrentCulture.DisplayName;
}
}

2
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/package.json

@ -3,6 +3,6 @@
"name": "my-app-authserver",
"private": true,
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0"
"@abp/aspnetcore.mvc.ui.theme.leptonxlite": "^1.0.0"
}
}

7
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyCompanyName.MyProjectName.Blazor.Server.Tiered.csproj

@ -19,6 +19,11 @@
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="6.0.5" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme" Version="1.0.0-beta.2" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="1.0.0-beta.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MyCompanyName.MyProjectName.HttpApi.Client\MyCompanyName.MyProjectName.HttpApi.Client.csproj" />
@ -26,11 +31,9 @@
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.Client\Volo.Abp.AspNetCore.Mvc.Client.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Authentication.OpenIdConnect\Volo.Abp.AspNetCore.Authentication.OpenIdConnect.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Http.Client.IdentityModel.Web\Volo.Abp.Http.Client.IdentityModel.Web.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Swashbuckle\Volo.Abp.Swashbuckle.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Serilog\Volo.Abp.AspNetCore.Serilog.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Components.Server.BasicTheme\Volo.Abp.AspNetCore.Components.Server.BasicTheme.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Blazor.Server\Volo.Abp.Identity.Blazor.Server.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Blazor.Server\Volo.Abp.TenantManagement.Blazor.Server.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.Blazor.Server\Volo.Abp.SettingManagement.Blazor.Server.csproj" />

47
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyProjectNameBlazorModule.cs

@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Net.Http;
using Blazorise.Bootstrap5;
@ -17,8 +17,10 @@ using MyCompanyName.MyProjectName.MultiTenancy;
using StackExchange.Redis;
using Volo.Abp;
using Volo.Abp.AspNetCore.Authentication.OpenIdConnect;
using Volo.Abp.AspNetCore.Components.Server.BasicTheme;
using Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling;
using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme;
using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling;
using Volo.Abp.AspNetCore.Components.Web.Theming.Routing;
using Volo.Abp.AspNetCore.Mvc.Client;
using Volo.Abp.AspNetCore.Mvc.Localization;
@ -26,8 +28,6 @@ using Volo.Abp.AspNetCore.Mvc.UI;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Toolbars;
using Volo.Abp.AspNetCore.Serilog;
@ -56,11 +56,11 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Tiered;
typeof(AbpAspNetCoreMvcClientModule),
typeof(AbpAspNetCoreAuthenticationOpenIdConnectModule),
typeof(AbpHttpClientIdentityModelWebModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAspNetCoreComponentsServerLeptonXLiteThemeModule),
typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule),
typeof(AbpAutofacModule),
typeof(AbpSwashbuckleModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpAspNetCoreComponentsServerBasicThemeModule),
typeof(AbpIdentityBlazorServerModule),
typeof(AbpTenantManagementBlazorServerModule),
typeof(AbpSettingManagementBlazorServerModule)
@ -120,23 +120,23 @@ public class MyProjectNameBlazorModule : AbpModule
{
Configure<AbpBundlingOptions>(options =>
{
// MVC UI
options.StyleBundles.Configure(
BasicThemeBundles.Styles.Global,
// MVC UI
options.StyleBundles.Configure(
LeptonXLiteThemeBundles.Styles.Global,
bundle =>
{
bundle.AddFiles("/global-styles.css");
}
);
//BLAZOR UI
options.StyleBundles.Configure(
BlazorBasicThemeBundles.Styles.Global,
//BLAZOR UI
options.StyleBundles.Configure(
BlazorLeptonXLiteThemeBundles.Styles.Global,
bundle =>
{
bundle.AddFiles("/blazor-global-styles.css");
//You can remove the following line if you don't use Blazor CSS isolation for components
bundle.AddFiles("/MyCompanyName.MyProjectName.Blazor.Server.Tiered.styles.css");
//You can remove the following line if you don't use Blazor CSS isolation for components
bundle.AddFiles("/MyCompanyName.MyProjectName.Blazor.Server.Tiered.styles.css");
}
);
});
@ -186,19 +186,18 @@ public class MyProjectNameBlazorModule : AbpModule
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
//<TEMPLATE-REMOVE>
options.FileSets.ReplaceEmbeddedByPhysical<AbpUiModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.UI", Path.DirectorySeparatorChar)));
//<TEMPLATE-REMOVE>
options.FileSets.ReplaceEmbeddedByPhysical<AbpUiModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.UI", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiBootstrapModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI.Bootstrap", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiThemeSharedModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiBasicThemeModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}basic-theme{0}src{0}Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiMultiTenancyModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy", Path.DirectorySeparatorChar)));
//options.FileSets.ReplaceEmbeddedByPhysical<AbpPermissionManagementWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}permission-management{0}src{0}Volo.Abp.PermissionManagement.Web", Path.DirectorySeparatorChar)));
//options.FileSets.ReplaceEmbeddedByPhysical<AbpFeatureManagementWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}feature-management{0}src{0}Volo.Abp.FeatureManagement.Web", Path.DirectorySeparatorChar)));
//options.FileSets.ReplaceEmbeddedByPhysical<AbpIdentityWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}identity{0}src{0}Volo.Abp.Identity.Web", Path.DirectorySeparatorChar)));
//options.FileSets.ReplaceEmbeddedByPhysical<AbpTenantManagementWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}tenant-management{0}src{0}Volo.Abp.TenantManagement.Web", Path.DirectorySeparatorChar)));
//</TEMPLATE-REMOVE>
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameDomainSharedModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Domain.Shared"));
//options.FileSets.ReplaceEmbeddedByPhysical<AbpPermissionManagementWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}permission-management{0}src{0}Volo.Abp.PermissionManagement.Web", Path.DirectorySeparatorChar)));
//options.FileSets.ReplaceEmbeddedByPhysical<AbpFeatureManagementWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}feature-management{0}src{0}Volo.Abp.FeatureManagement.Web", Path.DirectorySeparatorChar)));
//options.FileSets.ReplaceEmbeddedByPhysical<AbpIdentityWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}identity{0}src{0}Volo.Abp.Identity.Web", Path.DirectorySeparatorChar)));
//options.FileSets.ReplaceEmbeddedByPhysical<AbpTenantManagementWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}tenant-management{0}src{0}Volo.Abp.TenantManagement.Web", Path.DirectorySeparatorChar)));
//</TEMPLATE-REMOVE>
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameDomainSharedModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Domain.Shared"));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameApplicationContractsModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Application.Contracts"));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameBlazorModule>(hostingEnvironment.ContentRootPath);
});

9
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/_Host.cshtml

@ -1,8 +1,8 @@
@page "/"
@namespace MyCompanyName.MyProjectName.Blazor.Server.Tiered.Pages
@using System.Globalization
@using Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling
@using Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic
@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite
@using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling
@using Volo.Abp.Localization
@{
Layout = null;
@ -17,9 +17,10 @@
<title>MyCompanyName.MyProjectName.Blazor.Server</title>
<base href="~/" />
<abp-style-bundle name="@BlazorBasicThemeBundles.Styles.Global" />
<abp-style-bundle name="@BlazorLeptonXLiteThemeBundles.Styles.Global"/>
</head>
<body class="abp-application-layout bg-light @rtl">
<component type="typeof(App)" render-mode="Server" />
<div id="blazor-error-ui">
@ -33,6 +34,6 @@
<a class="dismiss">🗙</a>
</div>
<abp-script-bundle name="@BlazorBasicThemeBundles.Scripts.Global" />
<abp-script-bundle name="@BlazorLeptonXLiteThemeBundles.Scripts.Global" />
</body>
</html>

4
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/package.json

@ -3,7 +3,7 @@
"name": "my-app",
"private": true,
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0",
"@abp/aspnetcore.components.server.basictheme": "^5.3.0"
"@abp/aspnetcore.mvc.ui.theme.leptonxlite": "^1.0.0",
"@abp/aspnetcore.components.server.leptonxlitetheme": "^1.0.0"
}
}

7
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj

@ -18,16 +18,19 @@
<PackageReference Include="Serilog.AspNetCore" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme" Version="1.0.0-beta.2" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="1.0.0-beta.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MyCompanyName.MyProjectName.Application\MyCompanyName.MyProjectName.Application.csproj" />
<ProjectReference Include="..\MyCompanyName.MyProjectName.HttpApi\MyCompanyName.MyProjectName.HttpApi.csproj" />
<ProjectReference Include="..\MyCompanyName.MyProjectName.EntityFrameworkCore\MyCompanyName.MyProjectName.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Swashbuckle\Volo.Abp.Swashbuckle.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Serilog\Volo.Abp.AspNetCore.Serilog.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Components.Server.BasicTheme\Volo.Abp.AspNetCore.Components.Server.BasicTheme.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\account\src\Volo.Abp.Account.Web.OpenIddict\Volo.Abp.Account.Web.OpenIddict.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Blazor.Server\Volo.Abp.Identity.Blazor.Server.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Blazor.Server\Volo.Abp.TenantManagement.Blazor.Server.csproj" />

17
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameBlazorModule.cs

@ -13,8 +13,10 @@ using MyCompanyName.MyProjectName.Localization;
using MyCompanyName.MyProjectName.MultiTenancy;
using Volo.Abp;
using Volo.Abp.Account.Web;
using Volo.Abp.AspNetCore.Components.Server.BasicTheme;
using Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling;
using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme;
using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling;
using Volo.Abp.AspNetCore.Components.Web.Theming.Routing;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.Localization;
@ -22,8 +24,6 @@ using Volo.Abp.AspNetCore.Mvc.UI;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Autofac;
@ -45,12 +45,12 @@ namespace MyCompanyName.MyProjectName.Blazor.Server;
typeof(MyProjectNameApplicationModule),
typeof(MyProjectNameEntityFrameworkCoreModule),
typeof(MyProjectNameHttpApiModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAutofacModule),
typeof(AbpSwashbuckleModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpAccountWebOpenIddictModule),
typeof(AbpAspNetCoreComponentsServerBasicThemeModule),
typeof(AbpAspNetCoreComponentsServerLeptonXLiteThemeModule),
typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule),
typeof(AbpIdentityBlazorServerModule),
typeof(AbpTenantManagementBlazorServerModule),
typeof(AbpSettingManagementBlazorServerModule)
@ -114,7 +114,7 @@ public class MyProjectNameBlazorModule : AbpModule
{
// MVC UI
options.StyleBundles.Configure(
BasicThemeBundles.Styles.Global,
LeptonXLiteThemeBundles.Styles.Global,
bundle =>
{
bundle.AddFiles("/global-styles.css");
@ -123,7 +123,7 @@ public class MyProjectNameBlazorModule : AbpModule
//BLAZOR UI
options.StyleBundles.Configure(
BlazorBasicThemeBundles.Styles.Global,
BlazorLeptonXLiteThemeBundles.Styles.Global,
bundle =>
{
bundle.AddFiles("/blazor-global-styles.css");
@ -145,7 +145,6 @@ public class MyProjectNameBlazorModule : AbpModule
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiBootstrapModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI.Bootstrap", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiThemeSharedModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiBasicThemeModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}basic-theme{0}src{0}Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiMultiTenancyModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy", Path.DirectorySeparatorChar)));
//options.FileSets.ReplaceEmbeddedByPhysical<AbpPermissionManagementWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}permission-management{0}src{0}Volo.Abp.PermissionManagement.Web", Path.DirectorySeparatorChar)));
//options.FileSets.ReplaceEmbeddedByPhysical<AbpFeatureManagementWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}feature-management{0}src{0}Volo.Abp.FeatureManagement.Web", Path.DirectorySeparatorChar)));

11
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/_Host.cshtml

@ -1,8 +1,8 @@
@page "/"
@namespace MyCompanyName.MyProjectName.Blazor.Server.Pages
@using System.Globalization
@using Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling
@using Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic
@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite
@using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling
@using Volo.Abp.Localization
@{
Layout = null;
@ -16,10 +16,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MyCompanyName.MyProjectName.Blazor.Server</title>
<base href="~/" />
<abp-style-bundle name="@BlazorBasicThemeBundles.Styles.Global" />
<abp-style-bundle name="@BlazorLeptonXLiteThemeBundles.Styles.Global" />
</head>
<body class="abp-application-layout bg-light @rtl">
<component type="typeof(App)" render-mode="Server" />
<div id="blazor-error-ui">
@ -33,6 +34,6 @@
<a class="dismiss">🗙</a>
</div>
<abp-script-bundle name="@BlazorBasicThemeBundles.Scripts.Global" />
<abp-script-bundle name="@BlazorLeptonXLiteThemeBundles.Scripts.Global" />
</body>
</html>

4
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/package.json

@ -3,7 +3,7 @@
"name": "my-app",
"private": true,
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0",
"@abp/aspnetcore.components.server.basictheme": "^5.3.0"
"@abp/aspnetcore.mvc.ui.theme.leptonxlite": "^1.0.0",
"@abp/aspnetcore.components.server.leptonxlitetheme": "^1.0.0"
}
}

5
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj

@ -16,10 +16,13 @@
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.5" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Components.WebAssembly.LeptonXLiteTheme" Version="1.0.0-beta.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac.WebAssembly\Volo.Abp.Autofac.WebAssembly.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme\Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.csproj" />
</ItemGroup>
<ItemGroup>

7
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs

@ -8,13 +8,13 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using MyCompanyName.MyProjectName.Blazor.Menus;
using OpenIddict.Abstractions;
using Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic;
using Volo.Abp.AspNetCore.Components.WebAssembly.LeptonXLiteTheme;
using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite;
using Volo.Abp.AspNetCore.Components.Web.Theming.Routing;
using Volo.Abp.Autofac.WebAssembly;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation;
using Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme;
using Volo.Abp.Identity.Blazor.WebAssembly;
using Volo.Abp.Security.Claims;
using Volo.Abp.SettingManagement.Blazor.WebAssembly;
@ -25,7 +25,7 @@ namespace MyCompanyName.MyProjectName.Blazor;
[DependsOn(
typeof(AbpAutofacWebAssemblyModule),
typeof(MyProjectNameHttpApiClientModule),
typeof(AbpAspNetCoreComponentsWebAssemblyBasicThemeModule),
typeof(AbpAspNetCoreComponentsWebAssemblyLeptonXLiteThemeModule),
typeof(AbpIdentityBlazorWebAssemblyModule),
typeof(AbpTenantManagementBlazorWebAssemblyModule),
typeof(AbpSettingManagementBlazorWebAssemblyModule)
@ -87,6 +87,7 @@ public class MyProjectNameBlazorModule : AbpModule
private static void ConfigureUI(WebAssemblyHostBuilder builder)
{
builder.RootComponents.Add<App>("#ApplicationContainer");
}
private static void ConfigureHttpClient(ServiceConfigurationContext context, IWebAssemblyHostEnvironment environment)

12530
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/global.css

File diff suppressed because one or more lines are too long

28
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/global.js

File diff suppressed because one or more lines are too long

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save