Browse Source

Merge branch 'dev' into async-uow-transaction

pull/6809/head
Halil İbrahim Kalkan 6 years ago
parent
commit
95965980e7
  1. 2
      .github/workflows/auto-pr.yml
  2. 2
      common.props
  3. 8
      docs/en/CLI.md
  4. 3
      docs/en/Community-Articles/2020-04-19-Customize-the-SignIn-Manager/POST.md
  5. 10
      docs/en/UI/AspNetCore/Branding.md
  6. 2
      docs/en/UI/Blazor/Theming.md
  7. 3
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js
  8. 88
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs
  9. 1
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/SourceCodeDownloadService.cs
  10. 13
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/DatabaseManagementSystem.cs
  11. 97
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/DatabaseManagementSystemChangeStep.cs
  12. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/TemplateProjectBuildPipelineBuilder.cs
  13. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs
  14. 46
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/EfCoreMigrationRecreater.cs
  15. 5
      modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/de-DE.json
  16. 5
      modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json
  17. 5
      modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/es.json
  18. 5
      modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/sl.json
  19. 5
      modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/tr.json
  20. 5
      modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json
  21. 5
      modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hant.json
  22. 5
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Menus/MyProjectNameMenuContributor.cs
  23. 3
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/appsettings.json

2
.github/workflows/auto-pr.yml

@ -17,7 +17,7 @@ jobs:
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
branch: auto-rel-merge-pr-${{github.run_number}}
branch: auto-merge/rel-4-2/${{github.run_number}}
title: Merge branch dev with rel-4.2
body: This PR generated automatically to merge dev with rel-4.2. Please review the changed files before merging to prevent any errors that may occur.
reviewers: ${{github.actor}}

2
common.props

@ -21,4 +21,4 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
</Project>

8
docs/en/CLI.md

@ -106,6 +106,12 @@ abp new Acme.BookStore
* `--template-source` or `-ts`: Specifies a custom template source to use to build the project. Local and network sources can be used(Like `D:\local-template` or `https://.../my-template-file.zip`).
* `--create-solution-folder` or `-csf`: Specifies if the project will be in a new folder in the output folder or directly the output folder.
* `--connection-string` or `-cs`: Overwrites the default connection strings in all `appsettings.json` files. The default connection string is `Server=localhost;Database=MyProjectName;Trusted_Connection=True;MultipleActiveResultSets=true` for EF Core and it is configured to use the SQL Server. If you want to use the EF Core, but need to change the DBMS, you can change it as [described here](Entity-Framework-Core-Other-DBMS.md) (after creating the solution).
* `--database-management-system` or `-dbms`: Sets the database management system. Default is **SQL Server**. `--connection-string` parameter should be set along with this parameter if you want to set any DBMS other than **SQL Server**. Supported DBMS's:
* `SqlServer`
* `MySQL`
* `SQLite`
* `Oracle-Devart`
* `PostgreSQL`
* `--local-framework-ref --abp-path`: Uses local projects references to the ABP framework instead of using the NuGet packages. This can be useful if you download the ABP Framework source code and have a local reference to the framework from your application.
* `--no-random-port`: Uses template's default ports.
@ -419,4 +425,4 @@ abp bundle [options]
* ```--working-directory``` or ```-wd```: Specifies the working directory. This option is useful when executing directory doesn't contain a Blazor project file.
* ```--force``` or ```-f```: Forces to build project before generating references.
`bundle` command reads the `appsettings.json` file inside the Blazor project for bundling options. For more details about managing style and script references in Blazor apps, see [Managing Global Scripts & Styles](UI/Blazor/Global-Scripts-Styles.md)
`bundle` command reads the `appsettings.json` file inside the Blazor project for bundling options. For more details about managing style and script references in Blazor apps, see [Managing Global Scripts & Styles](UI/Blazor/Global-Scripts-Styles.md)

3
docs/en/Community-Articles/2020-04-19-Customize-the-SignIn-Manager/POST.md

@ -71,7 +71,8 @@ public async override Task<Microsoft.AspNetCore.Identity.ExternalLoginInfo> GetE
?? provider;
return new Microsoft.AspNetCore.Identity.ExternalLoginInfo(auth.Principal, provider, providerKey, providerDisplayName)
{
AuthenticationTokens = auth.Properties.GetTokens()
AuthenticationTokens = auth.Properties.GetTokens(),
AuthenticationProperties = auth.Properties
};
}
````

10
docs/en/UI/AspNetCore/Branding.md

@ -20,13 +20,15 @@ namespace MyProject.Web
public class MyProjectBrandingProvider : DefaultBrandingProvider
{
public override string AppName => "Book Store";
public override string LogoUrl => "logo.png";
}
}
````
The result will be like shown below:
![branding-appname](../../images/branding-appname.png)
![bookstore-added-logo](../../images/bookstore-added-logo.png)
`IBrandingProvider` has the following properties:
@ -38,8 +40,4 @@ The result will be like shown below:
## Overriding the Branding Area
The [Basic Theme](Basic-Theme.md) doesn't implement the logos. However, you can see the [UI Customization Guide](Customization-User-Interface.md) to learn how you can replace the branding area with a custom view component.
An example screenshot with an image is used in the branding area:
![bookstore-added-logo](../../images/bookstore-added-logo.png)
You can see the [UI Customization Guide](Customization-User-Interface.md) to learn how you can replace the branding area with a custom view component.

2
docs/en/UI/Blazor/Theming.md

@ -63,7 +63,7 @@ A theme is simply a Razor Class Library.
### The Easy Way
The easiest way to create a new theme is to copy the [Basic Theme Source Code](https://github.com/abpframework/abp/tree/dev/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme) and customize it. Once you get a copy of the theme in your solution, remove the `Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic` NuGet package and reference to the local project.
The easiest way to create a new theme is to copy the [Basic Theme Source Code](https://github.com/abpframework/abp/tree/dev/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme) and customize it. Once you get a copy of the theme in your solution, remove the `Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme` NuGet package and reference to the local project.
### Global Styles / Scripts

3
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js

@ -55,7 +55,8 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f
function _createContainer() {
_removeContainer();
_$modalContainer = $('<div id="' + _modalId + 'Container' + '"></div>').appendTo('body');
_$modalContainer = $('<div id="' + _modalId + 'Container' + '"></div>');
$('body').prepend(_$modalContainer);
return _$modalContainer;
}

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

@ -1,6 +1,7 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.Json;
@ -16,6 +17,7 @@ using Volo.Abp.Cli.ProjectBuilding;
using Volo.Abp.Cli.ProjectBuilding.Building;
using Volo.Abp.Cli.ProjectBuilding.Templates.App;
using Volo.Abp.Cli.ProjectBuilding.Templates.Console;
using Volo.Abp.Cli.ProjectModification;
using Volo.Abp.Cli.Utils;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Threading;
@ -24,14 +26,17 @@ namespace Volo.Abp.Cli.Commands
{
public class NewCommand : IConsoleCommand, ITransientDependency
{
private readonly EfCoreMigrationRecreater _efCoreMigrationRecreater;
public ILogger<NewCommand> Logger { get; set; }
protected TemplateProjectBuilder TemplateProjectBuilder { get; }
public ITemplateInfoProvider TemplateInfoProvider { get; }
public NewCommand(TemplateProjectBuilder templateProjectBuilder
, ITemplateInfoProvider templateInfoProvider)
, ITemplateInfoProvider templateInfoProvider,
EfCoreMigrationRecreater efCoreMigrationRecreater)
{
_efCoreMigrationRecreater = efCoreMigrationRecreater;
TemplateProjectBuilder = templateProjectBuilder;
TemplateInfoProvider = templateInfoProvider;
@ -84,18 +89,31 @@ namespace Volo.Abp.Cli.Commands
Logger.LogInformation("Database provider: " + databaseProvider);
}
var uiFramework = GetUiFramework(commandLineArgs);
if (uiFramework != UiFramework.NotSpecified)
{
Logger.LogInformation("UI Framework: " + uiFramework);
}
var connectionString = GetConnectionString(commandLineArgs);
if (connectionString != null)
{
Logger.LogInformation("Connection string: " + connectionString);
}
var databaseManagementSystem = GetDatabaseManagementSystem(commandLineArgs);
if (databaseManagementSystem != DatabaseManagementSystem.NotSpecified)
{
Logger.LogInformation("DBMS: " + databaseManagementSystem);
}
if (databaseManagementSystem != DatabaseManagementSystem.NotSpecified
&& databaseManagementSystem != DatabaseManagementSystem.SQLServer
&& connectionString == null)
{
throw new CliUsageException($"Connection string must be set if a Database Management System other than SQLServer is set. Use \"--{Options.ConnectionString.Long}\" parameter to set connection string");
}
var uiFramework = GetUiFramework(commandLineArgs);
if (uiFramework != UiFramework.NotSpecified)
{
Logger.LogInformation("UI Framework: " + uiFramework);
}
var mobileApp = GetMobilePreference(commandLineArgs);
if (mobileApp != MobileApp.None)
{
@ -147,6 +165,7 @@ namespace Volo.Abp.Cli.Commands
template,
version,
databaseProvider,
databaseManagementSystem,
uiFramework,
mobileApp,
gitHubAbpLocalRepositoryPath,
@ -196,6 +215,8 @@ namespace Volo.Abp.Cli.Commands
}
}
ReCreateMigrationsIfNeeded(databaseProvider, databaseManagementSystem, outputFolder);
Logger.LogInformation($"'{projectName}' has been successfully created to '{outputFolder}'");
if (AppTemplateBase.IsAppTemplate(template ?? (await TemplateInfoProvider.GetDefaultAsync()).Name))
@ -205,6 +226,23 @@ namespace Volo.Abp.Cli.Commands
}
}
private void ReCreateMigrationsIfNeeded(DatabaseProvider databaseProvider, DatabaseManagementSystem databaseManagementSystem, string outputFolder)
{
if (databaseManagementSystem == DatabaseManagementSystem.NotSpecified || databaseManagementSystem == DatabaseManagementSystem.SQLServer)
{
return;
}
if (databaseProvider != DatabaseProvider.NotSpecified && databaseProvider != DatabaseProvider.EntityFrameworkCore)
{
return;
}
Logger.LogInformation($"Re-creating migrations... ({databaseManagementSystem})");
_efCoreMigrationRecreater.Recreate(outputFolder);
}
private void OpenThanksPage(UiFramework uiFramework, DatabaseProvider databaseProvider, bool tiered, bool commercial)
{
uiFramework = uiFramework == UiFramework.NotSpecified || uiFramework == UiFramework.None ? UiFramework.Mvc : uiFramework;
@ -267,6 +305,7 @@ namespace Volo.Abp.Cli.Commands
sb.AppendLine("-ts|--template-source <template-source> (your local or network abp template source)");
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. Requires --connection-string to be set)");
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)");
@ -289,6 +328,7 @@ namespace Volo.Abp.Cli.Commands
sb.AppendLine(" abp new Acme.BookStore -ts \"D:\\localTemplate\\abp\"");
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 --connection-string \"Server=myServerName\\myInstanceName;Database=myDatabase;User Id=myUsername;Password=myPassword\"");
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");
@ -315,6 +355,34 @@ namespace Volo.Abp.Cli.Commands
}
}
protected virtual DatabaseManagementSystem GetDatabaseManagementSystem(CommandLineArgs commandLineArgs)
{
var optionValue = commandLineArgs.Options.GetOrNull(Options.DatabaseManagementSystem.Short, Options.DatabaseManagementSystem.Long);
if (optionValue == null)
{
return DatabaseManagementSystem.NotSpecified;
}
switch (optionValue.ToLowerInvariant())
{
case "sqlserver":
return DatabaseManagementSystem.SQLServer;
case "mysql":
return DatabaseManagementSystem.MySQL;
case "postgresql":
return DatabaseManagementSystem.PostgreSQL;
case "oracle-devart":
return DatabaseManagementSystem.OracleDevart;
case "sqlite":
return DatabaseManagementSystem.SQLite;
case "oracle": // Currently disabled. See https://github.com/abpframework/abp/issues/6513
// return DatabaseManagementSystem.Oracle;
default:
return DatabaseManagementSystem.NotSpecified;
}
}
protected virtual UiFramework GetUiFramework(CommandLineArgs commandLineArgs)
{
var optionValue = commandLineArgs.Options.GetOrNull(Options.UiFramework.Short, Options.UiFramework.Long);
@ -362,6 +430,12 @@ namespace Volo.Abp.Cli.Commands
public const string Long = "database-provider";
}
public static class DatabaseManagementSystem
{
public const string Short = "dbms";
public const string Long = "database-management-system";
}
public static class OutputFolder
{
public const string Short = "o";

1
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/SourceCodeDownloadService.cs

@ -37,6 +37,7 @@ namespace Volo.Abp.Cli.Commands.Services
moduleName,
version,
DatabaseProvider.NotSpecified,
DatabaseManagementSystem.NotSpecified,
UiFramework.NotSpecified,
null,
gitHubAbpLocalRepositoryPath,

13
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/DatabaseManagementSystem.cs

@ -0,0 +1,13 @@
namespace Volo.Abp.Cli.ProjectBuilding.Building
{
public enum DatabaseManagementSystem
{
NotSpecified,
SQLServer,
MySQL,
PostgreSQL,
Oracle,
OracleDevart,
SQLite
}
}

97
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/DatabaseManagementSystemChangeStep.cs

@ -0,0 +1,97 @@
using System;
using System.Linq;
using Volo.Abp.Cli.ProjectBuilding.Files;
namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps
{
public class DatabaseManagementSystemChangeStep : ProjectBuildPipelineStep
{
public override void Execute(ProjectBuildContext context)
{
switch (context.BuildArgs.DatabaseManagementSystem)
{
case DatabaseManagementSystem.MySQL:
ChangeEntityFrameworkCoreDependency(context,"Volo.Abp.EntityFrameworkCore.MySQL",
"Volo.Abp.EntityFrameworkCore.MySQL",
"AbpEntityFrameworkCoreMySQLModule");
AddMySqlServerVersion(context);
ChangeUseSqlServer(context,"UseMySQL", "UseMySql");
break;
case DatabaseManagementSystem.PostgreSQL:
ChangeEntityFrameworkCoreDependency(context,"Volo.Abp.EntityFrameworkCore.PostgreSql",
"Volo.Abp.EntityFrameworkCore.PostgreSql",
"AbpEntityFrameworkCorePostgreSqlModule");
ChangeUseSqlServer(context,"UseNpgsql");
break;
case DatabaseManagementSystem.Oracle:
ChangeEntityFrameworkCoreDependency(context,"Volo.Abp.EntityFrameworkCore.Oracle",
"Volo.Abp.EntityFrameworkCore.Oracle",
"AbpEntityFrameworkCoreOracleModule");
ChangeUseSqlServer(context,"UseOracle");
break;
case DatabaseManagementSystem.OracleDevart:
ChangeEntityFrameworkCoreDependency(context,"Volo.Abp.EntityFrameworkCore.Oracle.Devart",
"Volo.Abp.EntityFrameworkCore.Oracle.Devart",
"AbpEntityFrameworkCoreOracleDevartModule");
AdjustOracleDbContextOptionsBuilder(context);
ChangeUseSqlServer(context,"UseOracle");
break;
case DatabaseManagementSystem.SQLite:
ChangeEntityFrameworkCoreDependency(context,"Volo.Abp.EntityFrameworkCore.Sqlite",
"Volo.Abp.EntityFrameworkCore.Sqlite",
"AbpEntityFrameworkCoreSqliteModule");
ChangeUseSqlServer(context,"UseSqlite");
break;
default:
return;
}
}
private void AdjustOracleDbContextOptionsBuilder(ProjectBuildContext context)
{
var dbContextFactoryFile = context.Files.First(f => f.Name.EndsWith("MigrationsDbContextFactory.cs", StringComparison.OrdinalIgnoreCase));
dbContextFactoryFile.ReplaceText("new DbContextOptionsBuilder",
$"(DbContextOptionsBuilder<{context.BuildArgs.SolutionName.ProjectName}MigrationsDbContext>) new DbContextOptionsBuilder");
}
private void AddMySqlServerVersion(ProjectBuildContext context)
{
var dbContextFactoryFile = context.Files.First(f => f.Name.EndsWith("MigrationsDbContextFactory.cs", StringComparison.OrdinalIgnoreCase));
dbContextFactoryFile.ReplaceText("configuration.GetConnectionString(\"Default\")",
"configuration.GetConnectionString(\"Default\"), MySqlServerVersion.LatestSupportedServerVersion");
}
private void ChangeEntityFrameworkCoreDependency(ProjectBuildContext context, string newPackageName, string newModuleNamespace, string newModuleClass)
{
var efCoreProjectFile = context.Files.First(f => f.Name.EndsWith("EntityFrameworkCore.csproj", StringComparison.OrdinalIgnoreCase));
efCoreProjectFile.ReplaceText("Volo.Abp.EntityFrameworkCore.SqlServer", newPackageName);
var efCoreModuleClass = context.Files.First(f => f.Name.EndsWith("EntityFrameworkCoreModule.cs", StringComparison.OrdinalIgnoreCase));
efCoreModuleClass.ReplaceText("Volo.Abp.EntityFrameworkCore.SqlServer", newModuleNamespace);
efCoreModuleClass.ReplaceText("AbpEntityFrameworkCoreSqlServerModule", newModuleClass);
}
private void ChangeUseSqlServer(ProjectBuildContext context, string newUseMethodForEfModule, string newUseMethodForDbContext = null)
{
if (newUseMethodForDbContext == null)
{
newUseMethodForDbContext = newUseMethodForEfModule;
}
var oldUseMethod = "UseSqlServer";
var efCoreModuleClass = context.Files.First(f => f.Name.EndsWith("EntityFrameworkCoreModule.cs", StringComparison.OrdinalIgnoreCase));
efCoreModuleClass.ReplaceText(oldUseMethod, newUseMethodForEfModule);
var dbContextFactoryFile = context.Files.First(f => f.Name.EndsWith("MigrationsDbContextFactory.cs", StringComparison.OrdinalIgnoreCase));
dbContextFactoryFile.ReplaceText(oldUseMethod, newUseMethodForDbContext);
}
}
}

6
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/TemplateProjectBuildPipelineBuilder.cs

@ -25,6 +25,12 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building
pipeline.Steps.Add(new LicenseCodeReplaceStep());
}
if (context.Template.Name == AppTemplate.TemplateName ||
context.Template.Name == AppProTemplate.TemplateName)
{
pipeline.Steps.Add(new DatabaseManagementSystemChangeStep());
}
if ((context.BuildArgs.UiFramework == UiFramework.Mvc || context.BuildArgs.UiFramework == UiFramework.Blazor)
&& context.BuildArgs.MobileApp == MobileApp.None)
{

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

@ -17,6 +17,8 @@ namespace Volo.Abp.Cli.ProjectBuilding
public DatabaseProvider DatabaseProvider { get; set; }
public DatabaseManagementSystem DatabaseManagementSystem { get; set; }
public UiFramework UiFramework { get; set; }
public MobileApp? MobileApp { get; set; }
@ -41,6 +43,7 @@ namespace Volo.Abp.Cli.ProjectBuilding
[CanBeNull] string templateName = null,
[CanBeNull] string version = null,
DatabaseProvider databaseProvider = DatabaseProvider.NotSpecified,
DatabaseManagementSystem databaseManagementSystem = DatabaseManagementSystem.NotSpecified,
UiFramework uiFramework = UiFramework.NotSpecified,
MobileApp? mobileApp = null,
[CanBeNull] string abpGitHubLocalRepositoryPath = null,
@ -53,6 +56,7 @@ namespace Volo.Abp.Cli.ProjectBuilding
TemplateName = templateName;
Version = version;
DatabaseProvider = databaseProvider;
DatabaseManagementSystem = databaseManagementSystem;
UiFramework = uiFramework;
MobileApp = mobileApp;
AbpGitHubLocalRepositoryPath = abpGitHubLocalRepositoryPath;
@ -62,4 +66,4 @@ namespace Volo.Abp.Cli.ProjectBuilding
ConnectionString = connectionString;
}
}
}
}

46
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/EfCoreMigrationRecreater.cs

@ -0,0 +1,46 @@
using System;
using System.IO;
using System.Linq;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.Cli.Utils;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.Cli.ProjectModification
{
public class EfCoreMigrationRecreater : ITransientDependency
{
public ILogger<EfCoreMigrationRecreater> Logger { get; set; }
public EfCoreMigrationRecreater()
{
Logger = NullLogger<EfCoreMigrationRecreater>.Instance;
}
public void Recreate(string solutionFolder)
{
if (Directory.Exists(Path.Combine(solutionFolder, "aspnet-core")))
{
solutionFolder = Path.Combine(solutionFolder, "aspnet-core");
}
var srcFolder = Path.Combine(solutionFolder, "src");
try
{
var migrationsFolder = Directory.GetDirectories(srcFolder).First(d => d.EndsWith(".EntityFrameworkCore.DbMigrations"));
Directory.Delete(Path.Combine(migrationsFolder, "Migrations"), true);
var migratorFolder = Directory.GetDirectories(srcFolder).First(d => d.EndsWith(".DbMigrator"));
var migratorProjectFile = Directory.GetFiles(migratorFolder).First(d => d.EndsWith(".DbMigrator.csproj"));
var addMigrationCommand = $"dotnet ef migrations add Initial --startup-project {migratorProjectFile}";
CmdHelper.RunCmd($"cd {migrationsFolder} && {addMigrationCommand}");
}
catch (Exception e)
{
Logger.LogWarning("Re-creating migrations process failed.");
throw e;
}
}
}
}

5
modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/de-DE.json

@ -57,6 +57,9 @@
"ProfileTab:Password": "Passwort ändern",
"ProfileTab:PersonalInfo": "Persönliche Informationen",
"ReturnToApplication": "Zur Anwendung zurückkehren",
"Volo.Account:InvalidEmailAddress": "Die angegebene E-Mail-Adresse kann nicht gefunden werden: {0}"
"Volo.Account:InvalidEmailAddress": "Die angegebene E-Mail-Adresse kann nicht gefunden werden: {0}",
"PasswordReset": "Passwort zurücksetzen",
"PasswordResetInfoInEmail": "Wir haben eine Anfrage zur Wiederherstellung des Kontos erhalten! Wenn Sie diese Anforderung initiiert haben, klicken Sie auf den folgenden Link, um Ihr Passwort zurückzusetzen.",
"ResetMyPassword": "Mein Passwort zurücksetzen"
}
}

5
modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json

@ -57,6 +57,9 @@
"ProfileTab:Password": "Change password",
"ProfileTab:PersonalInfo": "Personal info",
"ReturnToApplication": "Return to application",
"Volo.Account:InvalidEmailAddress": "Can not find the given email address: {0}"
"Volo.Account:InvalidEmailAddress": "Can not find the given email address: {0}",
"PasswordReset": "Password reset",
"PasswordResetInfoInEmail": "We received an account recovery request! If you initiated this request, click the following link to reset your password.",
"ResetMyPassword": "Reset my password"
}
}

5
modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/es.json

@ -57,6 +57,9 @@
"ProfileTab:Password": "Cambiar contraseña",
"ProfileTab:PersonalInfo": "Información personal",
"ReturnToApplication": "Volver a la aplicación",
"Volo.Account:InvalidEmailAddress": "No se puede encontrar la dirección de e-mail solicitada: {0}"
"Volo.Account:InvalidEmailAddress": "No se puede encontrar la dirección de e-mail solicitada: {0}",
"PasswordReset": "Restablecer contraseña",
"PasswordResetInfoInEmail": "Recibimos una solicitud de recuperación de cuenta. Si inició esta solicitud, haga clic en el siguiente enlace para restablecer su contraseña.",
"ResetMyPassword": "Restablecer mi contraseña"
}
}

5
modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/sl.json

@ -49,6 +49,9 @@
"ResetPassword_Information": "Prosimo vnesite vaše novo geslo.",
"YourPasswordIsSuccessfullyReset": "Vaše geslo je uspešno ponastavljeno.",
"BackToLogin": "Nazaj na prijavo",
"Volo.Account:InvalidEmailAddress": "Navedenega e-poštnega naslova ni mogoče najti: {0}"
"Volo.Account:InvalidEmailAddress": "Navedenega e-poštnega naslova ni mogoče najti: {0}",
"PasswordReset": "Ponastavitev gesla",
"PasswordResetInfoInEmail": "Prejeta je bila zahteva za obnovitev računa! V kolikor ste vi sprožili zahtevo, kliknite na sledečo povezavo, da ponastavite geslo.",
"ResetMyPassword": "Ponastavi geslo"
}
}

5
modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/tr.json

@ -57,6 +57,9 @@
"ProfileTab:Password": "Şifre değiştir",
"ProfileTab:PersonalInfo": "Kişisel bilgiler",
"ReturnToApplication": "Uygulamaya geri dön",
"Volo.Account:InvalidEmailAddress": "Email adresi bulunamadı: {0}"
"Volo.Account:InvalidEmailAddress": "Email adresi bulunamadı: {0}",
"PasswordReset": "Şifre Sıfırlama",
"PasswordResetInfoInEmail": "Şifrenizi sıfırlamanız için bir talep aldık! Eğer bu talebi siz gerçekleştirmişseniz, şifrenizi sıfırlamak için bağlantıya tıklayın.",
"ResetMyPassword": "Şifremi sıfırla"
}
}

5
modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json

@ -57,6 +57,9 @@
"ProfileTab:Password": "更改密码",
"ProfileTab:PersonalInfo": "个人信息",
"ReturnToApplication": "返回到应用程序",
"Volo.Account:InvalidEmailAddress": "找不到给定的电子邮件地址:{0}"
"Volo.Account:InvalidEmailAddress": "找不到给定的电子邮件地址:{0}",
"PasswordReset": "重设密码",
"PasswordResetInfoInEmail": "我们收到了帐户恢复请求!如果你发起了此请求,请单击以下链接以重置密码.",
"ResetMyPassword": "重置我的密码"
}
}

5
modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hant.json

@ -55,6 +55,9 @@
"BackToLogin": "返回登錄",
"ProfileTab:Password": "更改密碼",
"ProfileTab:PersonalInfo": "個人信息",
"ReturnToApplication": "返回到應用程序"
"ReturnToApplication": "返回到應用程序",
"PasswordReset": "重設密碼",
"PasswordResetInfoInEmail": "我們收到了帳戶恢復請求!如果你發起了此請求,請單擊以下鏈接以重置密碼.",
"ResetMyPassword": "重置我的密碼"
}
}

5
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Menus/MyProjectNameMenuContributor.cs

@ -59,11 +59,10 @@ namespace MyCompanyName.MyProjectName.Blazor.Menus
context.Menu.AddItem(new ApplicationMenuItem(
"Account.Manage",
accountStringLocalizer["ManageYourProfile"],
$"{identityServerUrl.EnsureEndsWith('/')}Account/Manage",
$"{identityServerUrl.EnsureEndsWith('/')}Account/Manage?returnUrl={_configuration["App:SelfUrl"]}",
icon: "fa fa-cog",
order: 1000,
null,
"_blank"));
null));
}
return Task.CompletedTask;

3
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/appsettings.json

@ -1,4 +1,7 @@
{
"App": {
"SelfUrl": "https://localhost:44307"
},
"AuthServer": {
"Authority": "https://localhost:44305",
"ClientId": "MyProjectName_Blazor",

Loading…
Cancel
Save