diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json index e90d5b3897..98f6ed0820 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json @@ -173,6 +173,10 @@ "BuyOrRenewLicenseToGetExtra2Months": "Buy or Renew License Now and Get 2 Extra Months! HURRY UP! ⏰ Last Day: {0}", "HurryUp": "HURRY UP!", "LastDay": "Last Day: {0}", - "BuyNewLicenseBetweenDatesToGetBenefit": "Buy a new license between {0} and {1} to get benefit for extra 2 months!" + "BuyNewLicenseBetweenDatesToGetBenefit": "Buy a new license between {0} and {1} to get benefit for extra 2 months!", + "CheckAllCommunityTalks": "Check All Community Posts", + "ReadMore": "Read More", + "Post": "Post", + "ExploreTheContentsCreatedByTheCoreABPTeamAndTheABPCommunity": "Explore the contents created by the core ABP team and the ABP community." } } diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/zh-Hans.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/zh-Hans.json index 0711a49836..4ba89108ce 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/zh-Hans.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/zh-Hans.json @@ -170,6 +170,10 @@ "BuyOrRenewLicenseToGetExtra2Months": "立即购买或续订 ABP 商业许可证(适用于所有版本)并额外获得 2 个月!", "HurryUp": "赶快下单!", "LastDay": "活动截止日期: {0}", - "BuyNewLicenseBetweenDatesToGetBenefit": "在 {0} 和 {1} 之间购买一个新的许可证以获得额外 2 个月的收益!" + "BuyNewLicenseBetweenDatesToGetBenefit": "在 {0} 和 {1} 之间购买一个新的许可证以获得额外 2 个月的收益!", + "CheckAllCommunityTalks": "检查所有社区帖子", + "ReadMore": "阅读更多", + "Post": "邮政", + "ExploreTheContentsCreatedByTheCoreABPTeamAndTheABPCommunity": "探索核心 ABP 团队和 ABP 社区创建的内容。" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json index 34853aa258..c73da26137 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json @@ -150,7 +150,6 @@ "GetStarted": "Get Started", "SourceCode": "Source Code", "LeaveComment": "Leave Comment", - "ReadMore": "Read more", "ShowMore": "Show More", "NoPublishedPostsYet": "No published posts yet.", "Name": "Name", @@ -185,7 +184,6 @@ "Layout_Title": "{0} | ABP Community", "Layout_MetaDescription": "ABP Community is an environment where people can share posts about ABP framework and follows the projects.", "Index_Page_CommunityIntroduction": "This is a hub for ABP Framework, .NET and software development. You can read the articles, watch the video tutorials, get informed about ABP’s development progress and ABP-related events, help other developers and share your expertise with the ABP community.", - "TagsInArticle": "Tags in article", - "ExploreTheContentsCreatedByTheCoreABPTeamAndTheABPCommunity": "Explore the contents created by the core ABP team and the ABP community." + "TagsInArticle": "Tags in article" } } diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/zh-Hans.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/zh-Hans.json index 3513a37dde..8196d567a1 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/zh-Hans.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/zh-Hans.json @@ -150,7 +150,6 @@ "GetStarted": "开始使用", "SourceCode": "源代码", "LeaveComment": "发表评论", - "ReadMore": "阅读更多", "ShowMore": "展示更多", "NoPublishedPostsYet": "还没有发布的帖子。", "Name": "名字", diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json index ac1619271b..0b9dfab886 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json @@ -293,7 +293,6 @@ "ExploreDocumentationAndGuides": "Explore the comprehensive documentation and guides.", "Documentations": "Documentation", "Views": "Views", - "ReadMore": "Read More", "EnterYouEmailToGetNews": "Enter your email to get the latest news about the ABP Framework", "Tiered": "Tiered", "SeparateIdentityServer": "Separate Identity Server", diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json index d787594039..7826f00ca2 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json @@ -293,7 +293,6 @@ "ExploreDocumentationAndGuides": "探索全面的文档和指南。", "Documentations": "文档", "Views": "意见", - "ReadMore": "阅读更多", "EnterYouEmailToGetNews": "输入您的电子邮件以获取有关 ABP 框架的最新消息", "Tiered": "分层", "SeparateIdentityServer": "独立的身份服务器", diff --git a/docs/en/Community-Articles/2020-10-08-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md b/docs/en/Community-Articles/2020-10-08-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md index 308358bb67..8e46bd6944 100644 --- a/docs/en/Community-Articles/2020-10-08-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md +++ b/docs/en/Community-Articles/2020-10-08-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md @@ -1,9 +1,13 @@ # How to Add Custom Properties to the User Entity +> **Note:** If your application is greater than version 4.3.3, please follow [this article](../2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md). + ## Introduction In this step-by-step article, I will explain how you can customize the user entity class, which is available in every web application you create using the ABP framework, according to your needs. When you read this article, you will learn how to override the services of built-in modules, extend the entities, extend data transfer objects and customize the user interface in the applications you develop using the ABP framework. +> **Note:** This article is not about customizing the `Login` page. If you have such a need, please follow [this article](../2020-05-09-Customize-the-Login-Page-for-MVC-Razor-Page-Applications/POST.md). + You can see the screenshots below which we will reach at the end of the article. ![custom-identity-user-list](./custom-identity-user-list.png) diff --git a/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md new file mode 100644 index 0000000000..7c119c6e66 --- /dev/null +++ b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md @@ -0,0 +1,154 @@ +# How to Add Custom Properties to the User Entity + +> **Note:** If your application is less than version 4.4.x, please follow [this article](../2020-10-08-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md). + +## Introduction + +In this step-by-step article, I will explain how you can customize the user entity class, which is available in every web application you create using the ABP framework, according to your needs. When you read this article, you will learn how to override the services of built-in modules, extend the entities, extend data transfer objects and customize the user interface in the applications you develop using the ABP framework. + +> **Note:** This article is not about customizing the `Login` page. If you have such a need, please follow [this article](../2020-05-09-Customize-the-Login-Page-for-MVC-Razor-Page-Applications/POST.md). + +You can see the screenshots below which we will reach at the end of the article. + +![custom-identity-user-list](./custom-identity-user-list.png) + +![new-user](./new-user.png) + +## Preparing the Project + +### Startup template and the initial run + +Abp Framework offers startup templates to get into the work faster. We can create a new startup template using Abp CLI: + +`abp new CustomizeUserDemo` + +> In this article, I will go through the MVC application, but it will work also in the [Angular](https://docs.abp.io/en/abp/latest/Getting-Started?UI=NG&DB=EF&Tiered=No), [Blazor Server](https://docs.abp.io/en/abp/latest/Getting-Started?UI=BlazorServer&DB=EF&Tiered=No), and [Blazor WebAssembly](https://docs.abp.io/en/abp/latest/Getting-Started?UI=Blazor&DB=EF&Tiered=No) application. + +After the download is finished, we can run **CustomizeUserDemo.DbMigrator** project to create the database migrations and seed the initial data (admin user, role, etc). Then we can run `CustomizeUserDemo.Web` to see that our application is working. + +> Default admin username is **admin** and password is **1q2w3E\*** + +![initial-project](./initial-project.png) + +In this article, we will go through a scenario together and find the solutions to our questions through this scenario. However, since the scenario is not a real-life scenario, it may be strange, please don't get too about this issue :) + +## Step-1 + +Create the Users folder in the **CustomizeUserDemo.Domain.Shared** project, create the class `UserConsts` inside the folder and update the class you created as below: + +```csharp +public static class UserConsts +{ + public const string TitlePropertyName = "Title"; + + public const string ReputationPropertyName = "Reputation"; + + public const int MaxTitleLength = 64; + + public const double MaxReputationValue = 1_000; + + public const double MinReputationValue = 1; +} +``` + +## Step-2 + +Update the `CustomizeUserDemoEfCoreEntityExtensionMappings` class in the **CustomizeUserDemo.EntityFramework** project in the EntityFrameworkCore folder as below: + +```csharp +public static class CustomizeUserDemoEfCoreEntityExtensionMappings +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + CustomizeUserDemoGlobalFeatureConfigurator.Configure(); + CustomizeUserDemoModuleExtensionConfigurator.Configure(); + + OneTimeRunner.Run(() => + { + ObjectExtensionManager.Instance + .MapEfCoreProperty( + UserConsts.TitlePropertyName, + (_, propertyBuilder) => + { + propertyBuilder.HasDefaultValue(""); + propertyBuilder.HasMaxLength(UserConsts.MaxTitleLength); + } + ).MapEfCoreProperty( + UserConsts.ReputationPropertyName, + (_, propertyBuilder) => + { + propertyBuilder.HasDefaultValue(UserConsts.MinReputationValue); + } + ); + }); + } +} +``` + +This class can be used to map these extra properties to table fields in the database. Please read [this](https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities) article to improve your understanding of what we are doing. + +So far, we have added our extra features to the `User` entity and matched these features with the `ef core`. + +Now we need to add migration to see what has changed in our database. This for, open the Package Manager Console (PMC) under the menu Tools > NuGet Package Manager. + +![nuget-package-manager](./nuget-package-manager.png) + +Select the **CustomizeUserDemo.EntityFramework** as the **default project** and execute the following command: + +```bash +Add-Migration "Updated-User-Entity" +``` + +![added-new-migration](./added-new-migration.png) + +This will create a new migration class inside the `Migrations` folder of the **CustomizeUserDemo.EntityFrameworkCore** project. + +> If you are using another IDE than the Visual Studio, you can use `dotnet-ef` tool as [documented here](https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/?tabs=dotnet-core-cli#create-a-migration). + +Finally, run the **CustomizeUserDemo.DbMigrator** project to update the database. + +When we updated the database, you can see that the `Title` and `Reputation` columns are added to the `Users` table. + +![user-table](./user-table.png) + +## Step-3 +Open the `CustomizeUserDemoModuleExtensionConfigurator` in the **CustomizeUserDemo.Domain.Shared** project, and change the contents of the `ConfigureExtraProperties` method as shown below: +```csharp +private static void ConfigureExtraProperties() +{ + ObjectExtensionManager.Instance.Modules().ConfigureIdentity(identity => + { + identity.ConfigureUser(user => + { + user.AddOrUpdateProperty( + UserConsts.TitlePropertyName, + options => + { + options.Attributes.Add(new RequiredAttribute()); + options.Attributes.Add( + new StringLengthAttribute(UserConsts.MaxTitleLength) + ); + } + ); + user.AddOrUpdateProperty( + UserConsts.ReputationPropertyName, + options => + { + options.DefaultValue = UserConsts.MinReputationValue; + options.Attributes.Add( + new RangeAttribute(UserConsts.MinReputationValue, UserConsts.MaxReputationValue) + ); + } + ); + }); + }); +} +``` + +That's it. Now let's run the application and look at the Identity user page. You can also try to edit and recreate a record if you want, it will work even though we haven't done anything extra. Here is the magic code behind ABP framework. + +If there is a situation you want to add, you can click the contribute button or make a comment. Also, if you like the article, don't forget to share it :) + +Happy coding :) diff --git a/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/added-new-migration.png b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/added-new-migration.png new file mode 100755 index 0000000000..d459fdeed2 Binary files /dev/null and b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/added-new-migration.png differ diff --git a/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/custom-identity-user-list.png b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/custom-identity-user-list.png new file mode 100644 index 0000000000..896ed947aa Binary files /dev/null and b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/custom-identity-user-list.png differ diff --git a/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/initial-project.png b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/initial-project.png new file mode 100755 index 0000000000..b64e93a99f Binary files /dev/null and b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/initial-project.png differ diff --git a/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/new-user.png b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/new-user.png new file mode 100644 index 0000000000..d3a5c66198 Binary files /dev/null and b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/new-user.png differ diff --git a/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/nuget-package-manager.png b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/nuget-package-manager.png new file mode 100755 index 0000000000..680bc9d2e7 Binary files /dev/null and b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/nuget-package-manager.png differ diff --git a/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/user-table.png b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/user-table.png new file mode 100755 index 0000000000..5bb71b8325 Binary files /dev/null and b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/user-table.png differ diff --git a/docs/en/Deploy-azure-app-service.md b/docs/en/Deploy-azure-app-service.md new file mode 100644 index 0000000000..9e0309f3b9 --- /dev/null +++ b/docs/en/Deploy-azure-app-service.md @@ -0,0 +1,452 @@ +# Deploying ABP Project to Azure App Service + +In this document, you will learn how to create and deploy your first ABP web app to [Azure App Service](https://docs.microsoft.com/en-us/azure/app-service/overview). The App Service supports various versions of .NET apps, and provides a highly scalable, self-patching web hosting service. ABP web apps are cross-platform and can be hosted on Linux, Windows or MacOS. + +****Prerequisites**** + +- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/dotnet). +- A GitHub account [Create an account for free](http://github.com/). + + + +## Creating a new ABP application + +Create a repository on [GitHub.com](https://github.com/) (keep all settings as default). + +Open the command prompt and clone the repository into a folder on your computer + +```bash +git clone https://github.com/your-username/your-repository-name.git +``` + +Check your dotnet version. It should be at least 3.1.x + +```bash +dotnet --version +``` + +Install or update the [ABP CLI](https://docs.abp.io/en/abp/latest/cli) with the following command: + +```bash +dotnet tool install -g Volo.Abp.Cli || dotnet tool update -g Volo.Abp.Cli +``` + +Open the command prompt in the *GitHub repository folder* and create a new ABP Blazor solution with the command below: + +```bash +abp new YourAppName -u blazor +``` + + + +## Running the application + +Open the command prompt in the *[YourAppName].DbMigrator* project and enter the command below to apply the database migrations: + +```bash +dotnet run +``` + +Open the command prompt in the *[YourAppName].HttpApi.Host* project to run the API project: + +```bash +dotnet run +``` + +Navigate to the *applicationUrl* specified in *the launchSettings.json* file of the *[YourAppName].HttpApi.Host project*. You should get the *Swagger window* + +Open the command prompt in the *[YourAppName].Blazor* folder and enter the command below to run the Blazor project: + +```bash +dotnet run +``` + +Navigate to the *applicationUrl* specified in the *launchSettings.json* file of the *[YourAppName].Blazor* project and you should see the landing page. + +Stop both the *API* and the *Blazor* project by pressing **CTRL+C** + + + +## Committing to GitHub + +Before the GitHub commit, you have to delete the line "**/wwwroot/libs/*" at *.gitignore* file. + +![azdevops-23](images/azdevops-23.png) + +Open the command prompt in the root folder of your project and *add, commit and push* all your changes to your GitHub repository: + +```bash +git add . +git commit -m initialcommit +git push +``` + + + +## Configuring Azure database connection string + +Create a SQL database on Azure and change the connection string in all the *appsettings.json* files. + +* Login into [Azure Portal](https://portal.azure.com/) + +* Click **Create a resource** + +* Search for *SQL Database* + +* Click the **Create** button in the *SQL Database window* + +* Create a new resource group. Name it *rg[YourAppName]* + +* Enter *[YourAppName]Db* as database name + +* Create a new Server and name it *[yourappname]server* + +* Enter a serveradmin login and passwords. Click the **OK** button + +* Select your *Location* + +* Check *Allow Azure services to access server* + +* Click **Configure database**. Go to the *Basic* version and click the **Apply** button + +* Click the **Review + create** button. Click **Create** + +* Click **Go to resource** and click **SQL server** when the SQL Database is created + +* Click **Networking** under Security left side menu + +* Select **Selected networks** and click **Add your client IP$ address** at the Firewall rules + +* Select **Allow Azure and resources to access this seerver** and save + +* Go to your **SQL database**, click **Connection strings** and copy the connection string + +* Copy/paste the *appsettings.json* files of the *[YourAppName].HttpApi.Host* and the *[YourAppName].DbMigrator* project + +* Do not forget to replace {your_password} with the correct server password you entered in Azure SQL Database + + + +## Running DB Migrations + +Open the command prompt in the *[YourAppName].DbMigrator* project again and enter the command below to apply the database migrations: + +```bash +dotnet run +``` + +Open the command prompt in the *[YourAppName].HttpApi.Host* project and enter the command below to check your API is working: + +```bash +dotnet run +``` + +Stop the *[YourAppName].HttpApi.Host* by pressing CTRL+C. + + + +## Committing to GitHub + +Open the command prompt in the root folder of your project and add, commit and push all your changes to your GitHub repository + +```bash +git add . +git commit -m initialcommit +git push +``` + + + +## Setting up the Build pipeline in AzureDevops and publish the Build Artifacts + +* Sign in Azure DevOps + +* Click **New organization** and follow the steps to create a new organisation. Name it [YourAppName]org + +* Enter [YourAppName]Proj as project name in the ***Create a project to get started*** window + +* Select **Public visibility** and click the **Create project** button + +* Click the **Pipelines** button to continue + +* Click the **Create Pipeline** button + + Select GitHub in the Select your repository window + +![azdevops-1](images/azdevops-1.png) + +* Enter the Connection name. *[YourAppName]GitHubConnection* and click **Authorize using OAuth** + +* Select your **GitHub** [YourAppName]repo and click Continue + +* Search for **ASP.NET** in the ***Select a template*** window + +![azdevops-2](images/azdevops-2.png) + +* Select the ASP.NET Core template and click the **Apply** button + +* Add the below commands block as a first step in the pipeline + + ``` + - task: UseDotNet@2 + inputs: + packageType: 'sdk' + version: '6.0.106' + ``` + +![azdevops-18](images/azdevops-18.png) + +* Select **Settings** on the second task(Nugetcommand@2) in the pipeline + +* Select **Feeds in my Nuget.config** and type **Nuget.config** in the text box + +![azdevops-3](images/azdevops-3.png) + +* Add the below commands block to the end of the pipeline + + ``` + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact' + inputs: + PathtoPublish: '$(build.artifactstagingdirectory)' + ArtifactName: '$(Parameters.ArtifactName)' + condition: succeededOrFailed() + ``` + + ![azdevops-4](images/azdevops-4.png) + +``` +# ASP.NET +# Build and test ASP.NET projects. +# Add steps that publish symbols, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4 + +trigger: +- main + +pool: + vmImage: 'windows-latest' + +variables: + solution: '**/*.sln' + buildPlatform: 'Any CPU' + buildConfiguration: 'Release' + +steps: +- task: UseDotNet@2 + inputs: + packageType: 'sdk' + version: '6.0.106' + +- task: NuGetToolInstaller@1 + +- task: NuGetCommand@2 + inputs: + command: 'restore' + restoreSolution: '$(solution)' + feedsToUse: 'config' + nugetConfigPath: 'NuGet.config' + +- task: VSBuild@1 + inputs: + solution: '$(solution)' + msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"' + platform: '$(buildPlatform)' + configuration: '$(buildConfiguration)' + +- task: VSTest@2 + inputs: + platform: '$(buildPlatform)' + configuration: '$(buildConfiguration)' + +- task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact' + inputs: + PathtoPublish: '$(build.artifactstagingdirectory)' + ArtifactName: '$(Parameters.ArtifactName)' + publishLocation: 'Container' + condition: succeededOrFailed() +``` + +* Click **Save & queue** in the top menu. Click **Save & queue** again and click **Save and run** to run the Build pipeline + +* When the Build pipeline has finished. Click **1 published; 1 consumed** + + + +## Creating a Web App in the Azure Portal to deploy [YourAppName].HttpApi.Host project + +* Search for Web App in the *Search the Marketplace* field + +* Click the **Create** button in the Web App window + +* Select rg[YourAppName] in the *Resource Group* dropdown + +* Enter [YourAppName]API in the *Name input* field + +* Select code, .NET Core 3.1 (LTS) and windows as *Operating System* + +* Enter [YourAppName]API in the *Name input* field + +* Select .NET Core 3.1 (LTS) in the *Runtime stack* dropdown + +* Select Windows as *Operating System* + +* Select the same *Region* as in the SQL server you created in Part 3 + +![azdevops-5](images/azdevops-5.png) + +* Click **Create new** in the Windows Plan. Name it [YourAppName]ApiWinPlan + +* Click **Change size** in Sku and size. Go to the Dev/Test Free F1 version and click the **Apply** button + +![azdevops-6](images/azdevops-6.png) + +* Click the **Review + create** button. Click the **Create** button + +* Click **Go to resource** when the Web App has been created + + + +## Creating a release pipeline in the AzureDevops and deploy [YourAppName].HttpApi.Host project + +* Sign in into [Azure DevOps](https://azure.microsoft.com/en-us/services/devops/) + +* Click [YourAppName]Proj and click **Releases** in the *Pipelines* menu + +* Click the **New pipeline** button in the *No release pipelines found* window + +* Select *Azure App Service deployment* and click the **Apply** button + +![azdevops-7](images/azdevops-7.png) + +* Enter *[YourAppName]staging* in the *Stage name* field in the *Stage* window. And close the window + +* Click **+ Add an artifact** in the *Pipeline* tab + +* Select the **Build** icon as *Source type* in the *Add an artifact* window + +* Select Build pipeline in the *Source (build pipeline)* dropdown and click the **Add** button + +![azdevops-8](images/azdevops-8.png) + +* Click the **Continuous deployment trigger (thunderbolt icon)** + +* Set the toggle to **Enabled** in the the *Continuous deployment trigger* window + +* Click **+ Add** in *No filters added*. Select **Include** in the *Type* dropdown. Select your branch in the *Build branch* dropdown and close the window + +![azdevops-9](images/azdevops-9.png) + +* Click **the little red circle with the exclamation mark** in the *Tasks* tab menu + +* Select your subscription in the *Azure subscription* dropdown. + +![azdevops-10](images/azdevops-10.png) + +* Click **Authorize** and enter your credentials in the next screens + +* After Authorization, select the **[YourAppName]API** in the *App service name* dropdown + +* Click the **Deploy Azure App Service** task + +* Select **[YourAppName].HttpApi.Host.zip** in the *Package or folder* input field + +![azdevops-11](images/azdevops-11.png) + +* Click the **Save** icon in the top menu and click **OK** + +* Click **Create release** in the top menu. Click **Create** to create a release + +* Click the *Pipeline* tab and wait until the Deployment succeeds + +![azdevops-12](images/azdevops-12.png) + +* Open a browser and navigate to the URL of your Web App + +``` +https://[YourAppName]api.azurewebsites.net +``` + +![azdevops-13](images/azdevops-13.png) + + + +## Creating a Web App in Azure Portal to deploy [YourAppName].Blazor project + +* Login into [Azure Portal](https://portal.azure.com/) + +* Click **Create a resource** + +* Search for *Web App* in the *Search the Marketplace* field + +* Click the **Create** button in the *Web App* window + +* Select *rg[YourAppName]* in the *Resource Group* dropdown + +* Enter *[YourAppName]Blazor* in the *Name* input field + +* Select *.NET Core 3.1 (LTS)* in the *Runtime stack* dropdown + +* Select *Windows* as *Operating System* + +* Select the same region as the SQL server you created in Part 3 + +* Select the [YourAppName]ApiWinPlan in the *Windows Plan* dropdown + +![azdevops-14](images/azdevops-14.png) + +* Click the **Review + create** button. Click **Create** button + +* Click **Go to resource** when the Web App has been created + +* Copy the URL of the Blazor Web App for later use + +``` +https://[YourAppName]blazor.azurewebsites.net +``` + + +## Changing the Web App configuration for the Azure App Service + +Copy the URL of the Api Host and Blazor Web App. Change appsettings.json files in the Web App as follows images. + +![azdevops-19](images/azdevops-19.png) + +![azdevops-20](images/azdevops-20.png) + +![azdevops-21](images/azdevops-21.png) + + + +## Adding an extra Stage in the Release pipeline in the AzureDevops to deploy [YourAppName].Blazor project + +* Go to the *Release* pipeline in [Azure DevOps](https://azure.microsoft.com/en-us/services/devops/) and click **Edit** + +* Click the **+ Add** link and add a **New Stage** + +![azdevops-15](images/azdevops-15.png) + +* Select *Azure App Service deployment* and click the **Apply** button + +* Enter *BlazorDeployment* in the *Stage name* input field and close the *Stage* window + +* Click the **little red circle with the exclamation mark** in the BlazorDeployment stage + +* Select your subscription in the *Azure subscription* dropdown + +* Select your Blazor Web App in the *App service name* dropdown + +* Click the **Deploy Azure App Service task** + +* Select *[YourAppName].Blazor.zip* in the *Package or folder* input field + +![azdevops-16](images/azdevops-16.png) + +* Click **Save** in the top menu and click the **OK** button after + +* Click **Create release** in the top menu and click the **Create** button + +![azdevops-17](images/azdevops-17.png) + +![azdevops-22](images/azdevops-22.png) diff --git a/docs/en/Deployment/Deploy-Azure-App-Service.md b/docs/en/Deployment/Deploy-Azure-App-Service.md new file mode 100644 index 0000000000..e7536947bf --- /dev/null +++ b/docs/en/Deployment/Deploy-Azure-App-Service.md @@ -0,0 +1,425 @@ +# Deploy Abp Webapp to Azure App Service + +> In this document, you'll learn how to create and deploy your first abp web app to [Azure App Service](https://docs.microsoft.com/en-us/azure/app-service/overview). The App Service supports various versions of .NET apps, and provides a highly scalable, self-patching web hosting service. Abp web apps are cross-platform and can be hosted on Linux and Windows. + +****Prerequisites**** + +- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/dotnet). +- A GitHub account [Create an account for free](http://github.com/). + + +## Create a new ABP Framework application + +Create a repository on [GitHub.com](https://github.com/) (keep all the default settings) + +Open the command prompt and clone the repository into a folder on your computer + +```bash +git clone https://github.com/your-username/your-repository-name.git +``` +Check your dotnet version. It should be at least 3.1.x +```bash +dotnet --version +``` +Install or update the *ABP CLI* using a command line window + +```bash +dotnet tool install -g Volo.Abp.Cli || dotnet tool update -g Volo.Abp.Cli +``` + +Open the command prompt in the *GitHub repository folder* and create a *new abp Blazor solution* with the command below + +```bash +abp new YourAppName -u blazor +``` + +Open the command prompt in the *[YourAppName].DbMigrator* project and enter the command below to apply the database migrations + +```bash +dotnet run +``` + +Open the command prompt in the *[YourAppName].HttpApi.Host* project to run the API project + +```bash +dotnet run +``` + +Navigate to the *applicationUrl* specified in *the launchSettings.json* file of the *[YourAppName].HttpApi.Host project*. You should get the *Swagger window* + +Open the command prompt in the *[YourAppName].Blazor* folder and enter the command below to run the Blazor project + +```bash +dotnet run +``` + +Navigate to the *applicationUrl* specified in the *launchSettings.json* file of the *[YourAppName].Blazor* project. You should get the *ABP Framework Welcome window* + +Stop both the *API* and the *Blazor* project by pressing **CTRL+C** + +Before the github commit, you have to delete "**/wwwroot/libs/*" at *.gitignore* file. + +![azdevops-23](../images/azdevops-23.png) + +Open the command prompt in the root folder of your project and *add, commit and push* all your changes to your GitHub repository + +```bash +git add . +git commit -m initialcommit +git push +``` + + +## Create a SQL Database on Azure and change the connection string in the appsettings.json files + +* Login into [Azure Portal](https://portal.azure.com/) + +* Click **Create a resource** + +* Search for *SQL Database* + +* Click the **Create** button in the *SQL Database window* + +* Create a new resource group. Name it *rg[YourAppName]* + +* Enter *[YourAppName]Db* as database name + +* Create a new Server and name it *[yourappname]server* + +* Enter a serveradmin login and passwords. Click the **OK** button + +* Select your *Location* + +* Check *Allow Azure services to access server* + +* Click **Configure database**. Go to the *Basic* version and click the **Apply** button + +* Click the **Review + create** button. Click **Create** + +* Click **Go to resource** and click **SQL server** when the SQL Database is created + +* Click **Networking** under Security left side menu + +* Select **Selected networks** and click **Add your client IP$ address** at the Firewall rules + +* Select **Allow Azure and resources to access this seerver** and save + +* Go to your **SQL database**, click **Connection strings** and copy the connection string + +* Copy/paste the appsettings.json files of the [YourAppName].HttpApi.Host and the [YourAppName].DbMigrator project + +* Do not forget to replace {your_password} with the correct server password you entered in Azure SQL Database + +Open the command prompt in the [YourAppName].DbMigrator project again and enter the command below to apply the database migrations + +```bash +dotnet run +``` +Open the command prompt in the [YourAppName].HttpApi.Host project and enter the command below to check your API is working + +```bash +dotnet run +``` + +Stop the [YourAppName].HttpApi.Host by entering CTRL+C + +Open the command prompt in the root folder of your project and add, commit and push all your changes to your GitHub repository +```bash +git add . +git commit -m initialcommit +git push +``` + + +## Set up the Build pipeline in AzureDevops and publish the Build Artifacts + +* Sign in into Azure DevOps + +* Click **New organization** and follow the steps to create a new organisation. Name it [YourAppName]org + +* Enter [YourAppName]Proj as project name in the ***Create a project to get started*** window + +* Select **Public visibility** and click the **Create project** button + +* Click the **Pipelines** button to continue + +* Click the **Create Pipeline** button + + Select GitHub in the Select your repository window + +![azdevops-1](../images/azdevops-1.png) + +* Enter the Connection name. [YourAppName]GitHubConnection and click **Authorize using OAuth** + +* Select your **GitHub** [YourAppName]repo and click Continue + +* Search for **ASP.NET** in the ***Select a template*** window + +![azdevops-2](../images/azdevops-2.png) + +* Select the ASP.NET Core template and click the **Apply** button + +* Add the below commands block as a first step in the pipeline + + ``` + - task: UseDotNet@2 + inputs: + packageType: 'sdk' + version: '6.0.106' + ``` + +![azdevops-18](../images/azdevops-18.png) + +* Select **Settings** on the second task(Nugetcommand@2) in the pipeline + +* Select **Feeds in my Nuget.config** and type **Nuget.config** in the text box + +![azdevops-3](../images/azdevops-3.png) + +* Add the below commands block to the end of the pipeline + + ``` + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact' + inputs: + PathtoPublish: '$(build.artifactstagingdirectory)' + ArtifactName: '$(Parameters.ArtifactName)' + condition: succeededOrFailed() + ``` +![azdevops-4](../images/azdevops-4.png) + +``` +# ASP.NET +# Build and test ASP.NET projects. +# Add steps that publish symbols, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4 + +trigger: +- main + +pool: + vmImage: 'windows-latest' + +variables: + solution: '**/*.sln' + buildPlatform: 'Any CPU' + buildConfiguration: 'Release' + +steps: +- task: UseDotNet@2 + inputs: + packageType: 'sdk' + version: '6.0.106' + +- task: NuGetToolInstaller@1 + +- task: NuGetCommand@2 + inputs: + command: 'restore' + restoreSolution: '$(solution)' + feedsToUse: 'config' + nugetConfigPath: 'NuGet.config' + +- task: VSBuild@1 + inputs: + solution: '$(solution)' + msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"' + platform: '$(buildPlatform)' + configuration: '$(buildConfiguration)' + +- task: VSTest@2 + inputs: + platform: '$(buildPlatform)' + configuration: '$(buildConfiguration)' + +- task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact' + inputs: + PathtoPublish: '$(build.artifactstagingdirectory)' + ArtifactName: '$(Parameters.ArtifactName)' + publishLocation: 'Container' + condition: succeededOrFailed() +``` + +* Click **Save & queue** in the top menu. Click **Save & queue** again and click **Save and run** to run the Build pipeline + +* When the Build pipeline has finished. Click **1 published; 1 consumed** + + + +## Create a Web App in the Azure Portal to deploy [YourAppName].HttpApi.Host project + +* Search for Web App in the *Search the Marketplace* field + +* Click the **Create** button in the Web App window + +* Select rg[YourAppName] in the *Resource Group* dropdown + +* Enter [YourAppName]API in the *Name input* field + +* Select code, .NET Core 3.1 (LTS) and windows as *Operating System* + +* Enter [YourAppName]API in the *Name input* field + +* Select .NET Core 3.1 (LTS) in the *Runtime stack* dropdown + +* Select Windows as *Operating System* + +* Select the same *Region* as in the SQL server you created in Part 3 + +![azdevops-5](../images/azdevops-5.png) + +* Click **Create new** in the Windows Plan. Name it [YourAppName]ApiWinPlan + +* Click **Change size** in Sku and size. Go to the Dev/Test Free F1 version and click the **Apply** button + +![azdevops-6](../images/azdevops-6.png) + +* Click the **Review + create** button. Click the **Create** button + +* Click **Go to resource** when the Web App has been created + + + +## Create a Release pipeline in the AzureDevops and deploy [YourAppName].HttpApi.Host project + +* Sign in into [Azure DevOps](https://azure.microsoft.com/en-us/services/devops/) + +* Click [YourAppName]Proj and click **Releases** in the *Pipelines* menu + +* Click the **New pipeline** button in the *No release pipelines found* window + +* Select *Azure App Service deployment* and click the **Apply** button + +![azdevops-7](../images/azdevops-7.png) + +* Enter *[YourAppName]staging* in the *Stage name* field in the *Stage* window. And close the window + +* Click **+ Add an artifact** in the *Pipeline* tab + +* Select the **Build** icon as *Source type* in the *Add an artifact* window + +* Select Build pipeline in the *Source (build pipeline)* dropdown and click the **Add** button + +![azdevops-8](../images/azdevops-8.png) + +* Click the **Continuous deployment trigger (thunderbolt icon)** + +* Set the toggle to **Enabled** in the the *Continuous deployment trigger* window + +* Click **+ Add** in *No filters added*. Select **Include** in the *Type* dropdown. Select your branch in the *Build branch* dropdown and close the window + +![azdevops-9](../images/azdevops-9.png) + +* Click **the little red circle with the exclamation mark** in the *Tasks* tab menu + +* Select your subscription in the *Azure subscription* dropdown. + +![azdevops-10](../images/azdevops-10.png) + +* Click **Authorize** and enter your credentials in the next screens + +* After Authorization, select the **[YourAppName]API** in the *App service name* dropdown + +* Click the **Deploy Azure App Service** task + +* Select **[YourAppName].HttpApi.Host.zip** in the *Package or folder* input field + +![azdevops-11](../images/azdevops-11.png) + +* Click the **Save** icon in the top menu and click **OK** + +* Click **Create release** in the top menu. Click **Create** to create a release + +* Click the *Pipeline* tab and wait until the Deployment succeeds + +![azdevops-12](../images/azdevops-12.png) + +* Open a browser and navigate to the URL of your Web App + +``` +https://[YourAppName]api.azurewebsites.net +``` + +![azdevops-13](../images/azdevops-13.png) + + + +## Create a Web App in Azure Portal to deploy [YourAppName].Blazor project + +* Login into [Azure Portal](https://portal.azure.com/) + +* Click **Create a resource** + +* Search for *Web App* in the *Search the Marketplace* field + +* Click the **Create** button in the *Web App* window + +* Select *rg[YourAppName]* in the *Resource Group* dropdown + +* Enter *[YourAppName]Blazor* in the *Name* input field + +* Select *.NET Core 3.1 (LTS)* in the *Runtime stack* dropdown + +* Select *Windows* as *Operating System* + +* Select the same region as the SQL server you created in Part 3 + +* Select the [YourAppName]ApiWinPlan in the *Windows Plan* dropdown + +![azdevops-14](../images/azdevops-14.png) + +* Click the **Review + create** button. Click **Create** button + +* Click **Go to resource** when the Web App has been created + +* Copy the URL of the Blazor Web App for later use + +``` +https://[YourAppName]blazor.azurewebsites.net +``` + + +## Change the Web App configuration for the Azure App Service + +Copy the URL of the Api Host and Blazor Web App. Change appsettings.json files in the Web App as follows images. + +![azdevops-19](../images/azdevops-19.png) + +![azdevops-20](../images/azdevops-20.png) + +![azdevops-21](../images/azdevops-21.png) + + + +## Add an extra Stage in the Release pipeline in the AzureDevops to deploy [YourAppName].Blazor project + +* Go to the *Release* pipeline in [Azure DevOps](https://azure.microsoft.com/en-us/services/devops/) and click **Edit** + +* Click the **+ Add** link and add a **New Stage** + +![azdevops-15](../images/azdevops-15.png) + +* Select *Azure App Service deployment* and click the **Apply** button + +* Enter *BlazorDeployment* in the *Stage name* input field and close the *Stage* window + +* Click the **little red circle with the exclamation mark** in the BlazorDeployment stage + +* Select your subscription in the *Azure subscription* dropdown + +* Select your Blazor Web App in the *App service name* dropdown + +* Click the **Deploy Azure App Service task** + +* Select *[YourAppName].Blazor.zip* in the *Package or folder* input field + +![azdevops-16](../images/azdevops-16.png) + +* Click **Save** in the top menu and click the **OK** button after + +* Click **Create release** in the top menu and click the **Create** button + +![azdevops-17](../images/azdevops-17.png) + +![azdevops-22](../images/azdevops-22.png) \ No newline at end of file diff --git a/docs/en/Deployment/Index.md b/docs/en/Deployment/Index.md index dc1cca300e..a1c2e2d5f8 100644 --- a/docs/en/Deployment/Index.md +++ b/docs/en/Deployment/Index.md @@ -6,4 +6,7 @@ However, there are some topics that you should care about when you are deploying ## Guides -* [Deploying to a clustered environment](Clustered-Environment.md): Explains how to configure your application when you want to run multiple instances of your application concurrently. \ No newline at end of file +* [Deploying to a clustered environment](Clustered-Environment.md): Explains how to configure your application when you want to run multiple instances of your application concurrently. + + +* [Deploy Abp Webapp to Azure App Service](Deploy-Azure-App-Service.md): Explains how to create and deploy your first abp web app to [Azure App Service](https://docs.microsoft.com/en-us/azure/app-service/overview). \ No newline at end of file diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index f764ca0bf2..4b82495a00 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -1282,6 +1282,10 @@ { "text": "Deploying to a Clustered Environment", "path": "Deployment/Clustered-Environment.md" + }, + { + "text": "Deploy Abp Webapp to Azure App Service", + "path": "Deployment/Deploy-Azure-App-Service.md" } ] }, diff --git a/docs/en/images/azdevops-1.png b/docs/en/images/azdevops-1.png new file mode 100644 index 0000000000..78181e4b7c Binary files /dev/null and b/docs/en/images/azdevops-1.png differ diff --git a/docs/en/images/azdevops-10.png b/docs/en/images/azdevops-10.png new file mode 100644 index 0000000000..75a273ba52 Binary files /dev/null and b/docs/en/images/azdevops-10.png differ diff --git a/docs/en/images/azdevops-11.png b/docs/en/images/azdevops-11.png new file mode 100644 index 0000000000..422a0ddbc0 Binary files /dev/null and b/docs/en/images/azdevops-11.png differ diff --git a/docs/en/images/azdevops-12.png b/docs/en/images/azdevops-12.png new file mode 100644 index 0000000000..e1bc1399f9 Binary files /dev/null and b/docs/en/images/azdevops-12.png differ diff --git a/docs/en/images/azdevops-13.png b/docs/en/images/azdevops-13.png new file mode 100644 index 0000000000..e83f972b20 Binary files /dev/null and b/docs/en/images/azdevops-13.png differ diff --git a/docs/en/images/azdevops-14.png b/docs/en/images/azdevops-14.png new file mode 100644 index 0000000000..a4bd3b65d0 Binary files /dev/null and b/docs/en/images/azdevops-14.png differ diff --git a/docs/en/images/azdevops-15.png b/docs/en/images/azdevops-15.png new file mode 100644 index 0000000000..ed4b9dc6a0 Binary files /dev/null and b/docs/en/images/azdevops-15.png differ diff --git a/docs/en/images/azdevops-16.png b/docs/en/images/azdevops-16.png new file mode 100644 index 0000000000..402f6b7d5e Binary files /dev/null and b/docs/en/images/azdevops-16.png differ diff --git a/docs/en/images/azdevops-17.png b/docs/en/images/azdevops-17.png new file mode 100644 index 0000000000..5441a87035 Binary files /dev/null and b/docs/en/images/azdevops-17.png differ diff --git a/docs/en/images/azdevops-18.png b/docs/en/images/azdevops-18.png new file mode 100644 index 0000000000..8e358172d5 Binary files /dev/null and b/docs/en/images/azdevops-18.png differ diff --git a/docs/en/images/azdevops-19.png b/docs/en/images/azdevops-19.png new file mode 100644 index 0000000000..ff282de4d5 Binary files /dev/null and b/docs/en/images/azdevops-19.png differ diff --git a/docs/en/images/azdevops-2.png b/docs/en/images/azdevops-2.png new file mode 100644 index 0000000000..9982431409 Binary files /dev/null and b/docs/en/images/azdevops-2.png differ diff --git a/docs/en/images/azdevops-20.png b/docs/en/images/azdevops-20.png new file mode 100644 index 0000000000..f8a00be927 Binary files /dev/null and b/docs/en/images/azdevops-20.png differ diff --git a/docs/en/images/azdevops-21.png b/docs/en/images/azdevops-21.png new file mode 100644 index 0000000000..7d55d11150 Binary files /dev/null and b/docs/en/images/azdevops-21.png differ diff --git a/docs/en/images/azdevops-22.png b/docs/en/images/azdevops-22.png new file mode 100644 index 0000000000..f103c8f56f Binary files /dev/null and b/docs/en/images/azdevops-22.png differ diff --git a/docs/en/images/azdevops-23.png b/docs/en/images/azdevops-23.png new file mode 100644 index 0000000000..7318b82d13 Binary files /dev/null and b/docs/en/images/azdevops-23.png differ diff --git a/docs/en/images/azdevops-3.png b/docs/en/images/azdevops-3.png new file mode 100644 index 0000000000..0ede96f42a Binary files /dev/null and b/docs/en/images/azdevops-3.png differ diff --git a/docs/en/images/azdevops-4.png b/docs/en/images/azdevops-4.png new file mode 100644 index 0000000000..52e025913c Binary files /dev/null and b/docs/en/images/azdevops-4.png differ diff --git a/docs/en/images/azdevops-5.png b/docs/en/images/azdevops-5.png new file mode 100644 index 0000000000..31384e5de5 Binary files /dev/null and b/docs/en/images/azdevops-5.png differ diff --git a/docs/en/images/azdevops-6.png b/docs/en/images/azdevops-6.png new file mode 100644 index 0000000000..cc493dfd43 Binary files /dev/null and b/docs/en/images/azdevops-6.png differ diff --git a/docs/en/images/azdevops-7.png b/docs/en/images/azdevops-7.png new file mode 100644 index 0000000000..e5f0cda151 Binary files /dev/null and b/docs/en/images/azdevops-7.png differ diff --git a/docs/en/images/azdevops-8.png b/docs/en/images/azdevops-8.png new file mode 100644 index 0000000000..5c2f996cf8 Binary files /dev/null and b/docs/en/images/azdevops-8.png differ diff --git a/docs/en/images/azdevops-9.png b/docs/en/images/azdevops-9.png new file mode 100644 index 0000000000..0c8a7b557e Binary files /dev/null and b/docs/en/images/azdevops-9.png differ diff --git a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AspNetCoreAuditLogContributor.cs b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AspNetCoreAuditLogContributor.cs index dd9e6cfe62..c0c56053d3 100644 --- a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AspNetCoreAuditLogContributor.cs +++ b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AspNetCoreAuditLogContributor.cs @@ -1,11 +1,14 @@ using System; +using System.Linq; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; +using Volo.Abp.AspNetCore.ExceptionHandling; using Volo.Abp.AspNetCore.WebClientInfo; using Volo.Abp.Auditing; using Volo.Abp.DependencyInjection; +using Volo.Abp.ExceptionHandling; namespace Volo.Abp.AspNetCore.Auditing; @@ -57,28 +60,46 @@ public class AspNetCoreAuditLogContributor : AuditLogContributor, ITransientDepe public override void PostContribute(AuditLogContributionContext context) { + if (context.AuditInfo.HttpStatusCode != null) + { + return; + } + var httpContext = context.ServiceProvider.GetRequiredService().HttpContext; if (httpContext == null) { return; } - if (context.AuditInfo.HttpStatusCode == null) + if (context.AuditInfo.Exceptions.Any()) { - context.AuditInfo.HttpStatusCode = httpContext.Response.StatusCode; + var httpExceptionStatusCodeFinder = context.ServiceProvider.GetRequiredService(); + foreach (var auditInfoException in context.AuditInfo.Exceptions) + { + var statusCode = httpExceptionStatusCodeFinder.GetStatusCode(httpContext, auditInfoException); + context.AuditInfo.HttpStatusCode = (int) statusCode; + } + + if (context.AuditInfo.HttpStatusCode != null) + { + return; + } } + + context.AuditInfo.HttpStatusCode = httpContext.Response.StatusCode; } protected virtual string BuildUrl(HttpContext httpContext) { //TODO: Add options to include/exclude query, schema and host - var uriBuilder = new UriBuilder(); - - uriBuilder.Scheme = httpContext.Request.Scheme; - uriBuilder.Host = httpContext.Request.Host.Host; - uriBuilder.Path = httpContext.Request.Path.ToString(); - uriBuilder.Query = httpContext.Request.QueryString.ToString(); + var uriBuilder = new UriBuilder + { + Scheme = httpContext.Request.Scheme, + Host = httpContext.Request.Host.Host, + Path = httpContext.Request.Path.ToString(), + Query = httpContext.Request.QueryString.ToString() + }; return uriBuilder.Uri.AbsolutePath; } diff --git a/framework/src/Volo.Abp.Caching.StackExchangeRedis/Volo/Abp/Caching/StackExchangeRedis/AbpRedisCache.cs b/framework/src/Volo.Abp.Caching.StackExchangeRedis/Volo/Abp/Caching/StackExchangeRedis/AbpRedisCache.cs index d52a40e5b5..68a59aab2d 100644 --- a/framework/src/Volo.Abp.Caching.StackExchangeRedis/Volo/Abp/Caching/StackExchangeRedis/AbpRedisCache.cs +++ b/framework/src/Volo.Abp.Caching.StackExchangeRedis/Volo/Abp/Caching/StackExchangeRedis/AbpRedisCache.cs @@ -15,18 +15,18 @@ namespace Volo.Abp.Caching.StackExchangeRedis; [DisableConventionalRegistration] public class AbpRedisCache : RedisCache, ICacheSupportsMultipleItems { - protected static readonly string SetScript; protected static readonly string AbsoluteExpirationKey; protected static readonly string SlidingExpirationKey; protected static readonly string DataKey; protected static readonly long NotPresent; - private static readonly FieldInfo RedisDatabaseField; - private static readonly MethodInfo ConnectMethod; - private static readonly MethodInfo ConnectAsyncMethod; - private static readonly MethodInfo MapMetadataMethod; - private static readonly MethodInfo GetAbsoluteExpirationMethod; - private static readonly MethodInfo GetExpirationInSecondsMethod; + private readonly static FieldInfo SetScriptField; + private readonly static FieldInfo RedisDatabaseField; + private readonly static MethodInfo ConnectMethod; + private readonly static MethodInfo ConnectAsyncMethod; + private readonly static MethodInfo MapMetadataMethod; + private readonly static MethodInfo GetAbsoluteExpirationMethod; + private readonly static MethodInfo GetExpirationInSecondsMethod; protected IDatabase RedisDatabase => GetRedisDatabase(); private IDatabase _redisDatabase; @@ -36,9 +36,11 @@ public class AbpRedisCache : RedisCache, ICacheSupportsMultipleItems static AbpRedisCache() { var type = typeof(RedisCache); - + RedisDatabaseField = type.GetField("_cache", BindingFlags.Instance | BindingFlags.NonPublic); + SetScriptField = type.GetField("_setScript", BindingFlags.Instance | BindingFlags.NonPublic); + ConnectMethod = type.GetMethod("Connect", BindingFlags.Instance | BindingFlags.NonPublic); ConnectAsyncMethod = type.GetMethod("ConnectAsync", BindingFlags.Instance | BindingFlags.NonPublic); @@ -51,9 +53,6 @@ public class AbpRedisCache : RedisCache, ICacheSupportsMultipleItems GetExpirationInSecondsMethod = type.GetMethod("GetExpirationInSeconds", BindingFlags.Static | BindingFlags.NonPublic); - SetScript = type.GetField("SetScript", BindingFlags.Static | BindingFlags.NonPublic)?.GetValue(null) - .ToString(); - AbsoluteExpirationKey = type.GetField("AbsoluteExpirationKey", BindingFlags.Static | BindingFlags.NonPublic) ?.GetValue(null).ToString(); @@ -83,14 +82,14 @@ public class AbpRedisCache : RedisCache, ICacheSupportsMultipleItems ConnectMethod.Invoke(this, Array.Empty()); } - protected virtual Task ConnectAsync(CancellationToken token = default) + protected virtual async Task ConnectAsync(CancellationToken token = default) { if (GetRedisDatabase() != null) { - return Task.CompletedTask; + return; } - return (Task)ConnectAsyncMethod.Invoke(this, new object[] { token }); + await (Task)ConnectAsyncMethod.Invoke(this, new object[] { token }); } public byte[][] GetMany( @@ -283,7 +282,7 @@ public class AbpRedisCache : RedisCache, ICacheSupportsMultipleItems for (var i = 0; i < itemArray.Length; i++) { - tasks[i] = RedisDatabase.ScriptEvaluateAsync(SetScript, new RedisKey[] { Instance + itemArray[i].Key }, + tasks[i] = RedisDatabase.ScriptEvaluateAsync(GetSetScript(), new RedisKey[] { Instance + itemArray[i].Key }, new RedisValue[] { absoluteExpiration?.Ticks ?? NotPresent, @@ -333,4 +332,9 @@ public class AbpRedisCache : RedisCache, ICacheSupportsMultipleItems return _redisDatabase; } + + private string GetSetScript() + { + return SetScriptField?.GetValue(this).ToString(); + } } diff --git a/framework/src/Volo.Abp.Core/Microsoft/Extensions/Configuration/AbpConfigurationBuilderOptions.cs b/framework/src/Volo.Abp.Core/Microsoft/Extensions/Configuration/AbpConfigurationBuilderOptions.cs index f922f2b7da..f9f2ca23ad 100644 --- a/framework/src/Volo.Abp.Core/Microsoft/Extensions/Configuration/AbpConfigurationBuilderOptions.cs +++ b/framework/src/Volo.Abp.Core/Microsoft/Extensions/Configuration/AbpConfigurationBuilderOptions.cs @@ -21,6 +21,16 @@ public class AbpConfigurationBuilderOptions /// public string FileName { get; set; } = "appsettings"; + /// + /// Whether the file is optional, Default value: true. + /// + public bool Optional { get; set; } = true; + + /// + /// Whether the configuration should be reloaded if the file changes, Default value: true. + /// + public bool ReloadOnChange { get; set; } = true; + /// /// Environment name. Generally used "Development", "Staging" or "Production". /// diff --git a/framework/src/Volo.Abp.Core/Microsoft/Extensions/Configuration/ConfigurationHelper.cs b/framework/src/Volo.Abp.Core/Microsoft/Extensions/Configuration/ConfigurationHelper.cs index 8a14528e03..28ea8326ac 100644 --- a/framework/src/Volo.Abp.Core/Microsoft/Extensions/Configuration/ConfigurationHelper.cs +++ b/framework/src/Volo.Abp.Core/Microsoft/Extensions/Configuration/ConfigurationHelper.cs @@ -18,11 +18,11 @@ public static class ConfigurationHelper var builder = new ConfigurationBuilder() .SetBasePath(options.BasePath) - .AddJsonFile(options.FileName + ".json", optional: true, reloadOnChange: true); + .AddJsonFile(options.FileName + ".json", optional: options.Optional, reloadOnChange: options.ReloadOnChange); if (!options.EnvironmentName.IsNullOrEmpty()) { - builder = builder.AddJsonFile($"{options.FileName}.{options.EnvironmentName}.json", optional: true, reloadOnChange: true); + builder = builder.AddJsonFile($"{options.FileName}.{options.EnvironmentName}.json", optional: options.Optional, reloadOnChange: options.ReloadOnChange); } if (options.EnvironmentName == "Development") diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/pt-BR.json b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/pt-BR.json index b1f3878b88..c0d6227e48 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/pt-BR.json +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/pt-BR.json @@ -9,7 +9,7 @@ "DisplayName:Abp.Mailing.Smtp.Password": "Senha", "DisplayName:Abp.Mailing.Smtp.Domain": "Domínio", "DisplayName:Abp.Mailing.Smtp.EnableSsl": "Habilitar SSL", - "DisplayName:Abp.Mailing.Smtp.UseDefaultCredentials": "Use credenciais padrão", + "DisplayName:Abp.Mailing.Smtp.UseDefaultCredentials": "Usar credenciais padrão", "Description:Abp.Mailing.DefaultFromAddress": "O endereço de origem padrão", "Description:Abp.Mailing.DefaultFromDisplayName": "O nome de exibição padrão", "Description:Abp.Mailing.Smtp.Host": "O nome ou endereço IP do host usado para transações SMTP.", diff --git a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/pt-BR.json b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/pt-BR.json index aa915a704f..03855ec698 100644 --- a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/pt-BR.json +++ b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/pt-BR.json @@ -1,10 +1,10 @@ { "culture": "pt-BR", "texts": { - "Languages": "línguas", + "Languages": "Idiomas", "AreYouSure": "Você tem certeza?", "Cancel": "Cancelar", - "Clear": "Claro", + "Clear": "Limpar", "Yes": "Sim", "No": "Não", "Ok": "OK", @@ -16,7 +16,7 @@ "SuccessfullyDeleted": "Excluído com sucesso", "Edit": "Editar", "Refresh": "Atualizar", - "Language": "Língua", + "Language": "Idioma", "LoadMore": "Carregar mais", "ProcessingWithThreeDot": "Processando...", "LoadingWithThreeDot": "Carregando...", diff --git a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/pt-BR.json b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/pt-BR.json index 4adbd81e80..1168a19317 100644 --- a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/pt-BR.json +++ b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/pt-BR.json @@ -24,6 +24,8 @@ "ThisFieldMustBeAStringOrArrayTypeWithAMinimumLengthOf{0}": "Este campo deve ser do tipo palavra ou matriz com comprimento mínimo de '{0}'.", "ThisFieldIsNotAValidPhoneNumber.": "Número de telefone inválido.", "ThisFieldMustBeBetween{0}And{1}": "Este campo deve estar entre {0} e {1}.", + "ThisFieldMustBeGreaterThanOrEqual{0}": "Este campo deve ser maior ou igual a {0}.", + "ThisFieldMustBeLessOrEqual{0}": "Este campo deve ser menor ou igual a {0}.", "ThisFieldMustMatchTheRegularExpression{0}": "Este campo deve ser compatível com a expressão regular: '{0}'.", "ThisFieldIsRequired.": "Campo Obrigatório.", "ThisFieldMustBeAStringWithAMaximumLengthOf{0}": "Campo com no máximo {0} caracteres.", diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/AbpAccountApplicationContractsModule.cs b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/AbpAccountApplicationContractsModule.cs index 4cfe025e1c..1400fd5f25 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/AbpAccountApplicationContractsModule.cs +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/AbpAccountApplicationContractsModule.cs @@ -3,6 +3,9 @@ using Volo.Abp.Identity; using Volo.Abp.Localization; using Volo.Abp.Localization.ExceptionHandling; using Volo.Abp.Modularity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.ObjectExtending.Modularity; +using Volo.Abp.Threading; using Volo.Abp.Validation.Localization; using Volo.Abp.VirtualFileSystem; @@ -13,6 +16,8 @@ namespace Volo.Abp.Account; )] public class AbpAccountApplicationContractsModule : AbpModule { + private readonly static OneTimeRunner OneTimeRunner = new OneTimeRunner(); + public override void ConfigureServices(ServiceConfigurationContext context) { Configure(options => @@ -33,4 +38,17 @@ public class AbpAccountApplicationContractsModule : AbpModule options.MapCodeNamespace("Volo.Account", typeof(AccountResource)); }); } + + public override void PostConfigureServices(ServiceConfigurationContext context) + { + OneTimeRunner.Run(() => + { + ModuleExtensionConfigurationHelper.ApplyEntityConfigurationToApi( + IdentityModuleExtensionConsts.ModuleName, + IdentityModuleExtensionConsts.EntityNames.User, + getApiTypes: new[] { typeof(ProfileDto) }, + updateApiTypes: new[] { typeof(UpdateProfileDto) } + ); + }); + } } diff --git a/modules/account/src/Volo.Abp.Account.Blazor/AbpAccountBlazorAutoMapperProfile.cs b/modules/account/src/Volo.Abp.Account.Blazor/AbpAccountBlazorAutoMapperProfile.cs index 8838cee634..af59d75321 100644 --- a/modules/account/src/Volo.Abp.Account.Blazor/AbpAccountBlazorAutoMapperProfile.cs +++ b/modules/account/src/Volo.Abp.Account.Blazor/AbpAccountBlazorAutoMapperProfile.cs @@ -10,10 +10,11 @@ public class AbpAccountBlazorAutoMapperProfile : Profile public AbpAccountBlazorAutoMapperProfile() { CreateMap() + .MapExtraProperties() .Ignore(x => x.PhoneNumberConfirmed) .Ignore(x => x.EmailConfirmed); CreateMap() - .Ignore(x => x.ExtraProperties); + .MapExtraProperties(); } } diff --git a/modules/account/src/Volo.Abp.Account.Blazor/AbpAccountBlazorModule.cs b/modules/account/src/Volo.Abp.Account.Blazor/AbpAccountBlazorModule.cs index c1e52e9b5f..61b42e1807 100644 --- a/modules/account/src/Volo.Abp.Account.Blazor/AbpAccountBlazorModule.cs +++ b/modules/account/src/Volo.Abp.Account.Blazor/AbpAccountBlazorModule.cs @@ -1,8 +1,12 @@ using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Account.Blazor.Pages.Account; using Volo.Abp.AspNetCore.Components.Web.Theming; using Volo.Abp.AspNetCore.Components.Web.Theming.Routing; using Volo.Abp.AutoMapper; using Volo.Abp.Modularity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.ObjectExtending.Modularity; +using Volo.Abp.Threading; using Volo.Abp.UI.Navigation; namespace Volo.Abp.Account.Blazor; @@ -14,6 +18,8 @@ namespace Volo.Abp.Account.Blazor; )] public class AbpAccountBlazorModule : AbpModule { + private readonly static OneTimeRunner OneTimeRunner = new OneTimeRunner(); + public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.AddAutoMapperObjectMapper(); @@ -33,4 +39,17 @@ public class AbpAccountBlazorModule : AbpModule options.AdditionalAssemblies.Add(typeof(AbpAccountBlazorModule).Assembly); }); } + + public override void PostConfigureServices(ServiceConfigurationContext context) + { + OneTimeRunner.Run(() => + { + ModuleExtensionConfigurationHelper + .ApplyEntityConfigurationToUi( + IdentityModuleExtensionConsts.ModuleName, + IdentityModuleExtensionConsts.EntityNames.User, + editFormTypes: new[] { typeof(PersonalInfoModel) } + ); + }); + } } diff --git a/modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/AccountManage.razor b/modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/AccountManage.razor index a3a4e76b58..2a625f3e35 100644 --- a/modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/AccountManage.razor +++ b/modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/AccountManage.razor @@ -1,5 +1,9 @@ @page "/account/manage-profile" @using Microsoft.AspNetCore.Components.Forms +@using Volo.Abp.Account.Localization +@using Volo.Abp.AspNetCore.Components.Web +@using Volo.Abp.BlazoriseUI.Components.ObjectExtending +@inject AbpBlazorMessageLocalizerHelper LH @inherits AbpAccountComponentBase @@ -58,6 +62,7 @@ @L["DisplayName:PhoneNumber"] + diff --git a/modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/AccountManage.razor.cs b/modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/AccountManage.razor.cs index 3a0aff243b..567363843b 100644 --- a/modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/AccountManage.razor.cs +++ b/modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/AccountManage.razor.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Components; using Volo.Abp.AspNetCore.Components.Messages; using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; namespace Volo.Abp.Account.Blazor.Pages.Account; @@ -58,7 +59,7 @@ public partial class AccountManage await UiMessageService.Success(L["PasswordChanged"]); } - protected async Task UpdatePersonalInfoAsync() + protected virtual async Task UpdatePersonalInfoAsync() { await ProfileAppService.UpdateAsync( ObjectMapper.Map(PersonalInfoModel) @@ -86,7 +87,7 @@ public class ChangePasswordModel } } -public class PersonalInfoModel +public class PersonalInfoModel : ExtensibleObject { public string UserName { get; set; } diff --git a/modules/account/src/Volo.Abp.Account.Web/AbpAccountWebAutomapperProfile.cs b/modules/account/src/Volo.Abp.Account.Web/AbpAccountWebAutomapperProfile.cs index 329f8f7ac1..cdc92e8b19 100644 --- a/modules/account/src/Volo.Abp.Account.Web/AbpAccountWebAutomapperProfile.cs +++ b/modules/account/src/Volo.Abp.Account.Web/AbpAccountWebAutomapperProfile.cs @@ -9,6 +9,7 @@ public class AbpAccountWebAutoMapperProfile : Profile { public AbpAccountWebAutoMapperProfile() { - CreateMap(); + CreateMap() + .MapExtraProperties(); } } diff --git a/modules/account/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs b/modules/account/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs index 0dc4f2fc48..9f670ffc82 100644 --- a/modules/account/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs +++ b/modules/account/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs @@ -2,6 +2,7 @@ using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Account.Localization; using Volo.Abp.Account.Web.Pages.Account; +using Volo.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.PersonalInfo; using Volo.Abp.Account.Web.ProfileManagement; using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.AspNetCore.Mvc.UI.Bundling; @@ -12,6 +13,9 @@ using Volo.Abp.ExceptionHandling; using Volo.Abp.Http.ProxyScripting.Generators.JQuery; using Volo.Abp.Identity.AspNetCore; using Volo.Abp.Modularity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.ObjectExtending.Modularity; +using Volo.Abp.Threading; using Volo.Abp.UI.Navigation; using Volo.Abp.VirtualFileSystem; @@ -26,6 +30,8 @@ namespace Volo.Abp.Account.Web; )] public class AbpAccountWebModule : AbpModule { + private readonly static OneTimeRunner OneTimeRunner = new OneTimeRunner(); + public override void PreConfigureServices(ServiceConfigurationContext context) { context.Services.PreConfigure(options => @@ -95,4 +101,17 @@ public class AbpAccountWebModule : AbpModule }); } + + public override void PostConfigureServices(ServiceConfigurationContext context) + { + OneTimeRunner.Run(() => + { + ModuleExtensionConfigurationHelper + .ApplyEntityConfigurationToUi( + IdentityModuleExtensionConsts.ModuleName, + IdentityModuleExtensionConsts.EntityNames.User, + editFormTypes: new[] { typeof(AccountProfilePersonalInfoManagementGroupViewComponent.PersonalInfoModel) } + ); + }); + } } diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/AccountProfilePersonalInfoManagementGroupViewComponent.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/AccountProfilePersonalInfoManagementGroupViewComponent.cs index 45705eb7f5..0dea3bc6eb 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/AccountProfilePersonalInfoManagementGroupViewComponent.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/AccountProfilePersonalInfoManagementGroupViewComponent.cs @@ -5,6 +5,7 @@ using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc.UI.Widgets; using Volo.Abp.Domain.Entities; using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; using Volo.Abp.Validation; namespace Volo.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.PersonalInfo; @@ -30,7 +31,7 @@ public class AccountProfilePersonalInfoManagementGroupViewComponent : AbpViewCom return View("~/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.cshtml", model); } - public class PersonalInfoModel : IHasConcurrencyStamp + public class PersonalInfoModel : ExtensibleObject, IHasConcurrencyStamp { [Required] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxUserNameLength))] @@ -54,7 +55,6 @@ public class AccountProfilePersonalInfoManagementGroupViewComponent : AbpViewCom [Display(Name = "DisplayName:PhoneNumber")] public string PhoneNumber { get; set; } - [HiddenInput] - public string ConcurrencyStamp { get; set; } + [HiddenInput] public string ConcurrencyStamp { get; set; } } -} +} \ No newline at end of file diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.cshtml b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.cshtml index ba695a8557..b9b0783ab9 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.cshtml +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.cshtml @@ -1,13 +1,24 @@ @using Volo.Abp.Account.Localization @using Volo.Abp.Users @using Microsoft.AspNetCore.Mvc.Localization +@using Microsoft.AspNetCore.Mvc.TagHelpers +@using Microsoft.Extensions.Localization +@using Volo.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.PersonalInfo +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Alert +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Grid @using Volo.Abp.AspNetCore.Mvc.UI.Theming +@using Volo.Abp.Data @using Volo.Abp.Identity.Settings +@using Volo.Abp.Localization +@using Volo.Abp.ObjectExtending @using Volo.Abp.Settings @inject IHtmlLocalizer L @inject ICurrentUser CurrentUser @inject ISettingProvider SettingManager @inject IThemeManager ThemeManager +@inject IStringLocalizerFactory StringLocalizerFactory @model Volo.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.PersonalInfo.AccountProfilePersonalInfoManagementGroupViewComponent.PersonalInfoModel @{ var isUserNameUpdateEnabled = string.Equals(await SettingManager.GetOrNullAsync(IdentitySettingNames.User.IsUserNameUpdateEnabled), "true", @@ -19,8 +30,8 @@

@L["PersonalSettings"]


- - + + @@ -37,5 +48,39 @@ + @foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties()) + { + if (!propertyInfo.Name.EndsWith("_Text")) + { + if (propertyInfo.Type.IsEnum || !propertyInfo.Lookup.Url.IsNullOrEmpty()) + { + if (propertyInfo.Type.IsEnum) + { + Model.ExtraProperties.ToEnum(propertyInfo.Name, propertyInfo.Type); + } + + + } + else + { + + } + } + } + - + \ No newline at end of file diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.js b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.js index 55a88e52e3..c8ff17ec67 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.js +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.js @@ -9,7 +9,7 @@ return false; } - var input = $('#PersonalSettingsForm').serializeFormToObject(); + var input = $('#PersonalSettingsForm').serializeFormToObject(false); volo.abp.account.profile.update(input).then(function (result) { abp.notify.success(l('PersonalSettingsSaved')); diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/pt-BR.json b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/pt-BR.json index f26b339d71..bb19760972 100644 --- a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/pt-BR.json +++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/pt-BR.json @@ -37,7 +37,7 @@ "Edit": "Editar", "BLOG": "BLOG", "CommentDeletionWarningMessage": "O comentário será excluído.", - "PostDeletionWarningMessage": "O post será excluído.", + "PostDeletionWarningMessage": "A postagem será excluída.", "BlogDeletionWarningMessage": "O Blog será excluído.", "AreYouSure": "Você tem certeza?", "CommentWithCount": "{0} comentários", @@ -54,8 +54,10 @@ "Blogs": "Blogs", "Tags": "Etiquetas", "ShareOn": "Compartilhar no", - "TitleLengthWarning": "Mantenha o tamanho do título abaixo de 60 caracteres para ser SEO amigável!", + "TitleLengthWarning": "Mantenha o tamanho do título abaixo de 60 caracteres para ser amigável ao SEO!", "ClearCache": "Limpar cache", - "ClearCacheConfirmationMessage": "Tem certeza de que deseja limpar o cache?" + "ClearCacheConfirmationMessage": "Tem certeza de que deseja limpar o cache?", + "MarkdownSupported": "Markdown é suportado", + "FileUploadInfo": "Arrastar, soltar, ou colar uma imagem copiada." } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Tags/EntityTagSetDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Tags/EntityTagSetDto.cs index 245526cfc2..11466463f8 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Tags/EntityTagSetDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Tags/EntityTagSetDto.cs @@ -1,15 +1,40 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.ComponentModel.DataAnnotations; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Localization; +using Volo.Abp.Validation.Localization; +using Volo.CmsKit.Localization; +using Volo.CmsKit.Tags; namespace Volo.CmsKit.Admin.Tags; [Serializable] -public class EntityTagSetDto +public class EntityTagSetDto : IValidatableObject { public string EntityId { get; set; } + public string EntityType { get; set; } + + [Required] public List Tags { get; set; } + + public IEnumerable Validate(ValidationContext validationContext) + { + var l = validationContext.GetRequiredService>(); + + foreach (var tag in Tags) + { + if (tag.Length > TagConsts.MaxNameLength) + { + yield return new ValidationResult( + l[ + "ThisFieldMustBeAStringWithAMaximumLengthOf{0}", + TagConsts.MaxNameLength + ], + new[] { nameof(Tags) } + ); + } + } + } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentParser.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentParser.cs index 9c6aafc0d0..aea5cc2a82 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentParser.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentParser.cs @@ -20,11 +20,11 @@ public class ContentParser : ITransientDependency public Task> ParseAsync(string content) { - if (!_options.WidgetConfigs.Any()) + if (!_options.WidgetConfigs.Any() || content is null) { return Task.FromResult(new List { - new ContentFragment { Type = Markdown }.SetProperty(Content, content), + new ContentFragment { Type = Markdown }.SetProperty(Content, content ?? string.Empty), }); } diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Renderers/MarkdownToHtmlRenderer.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Renderers/MarkdownToHtmlRenderer.cs index 5e0a2e89f5..83317c2111 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Renderers/MarkdownToHtmlRenderer.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Renderers/MarkdownToHtmlRenderer.cs @@ -1,11 +1,11 @@ using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; -using Markdig; using System.Threading.Tasks; using System.Web; -using Volo.Abp.DependencyInjection; using Ganss.XSS; +using Markdig; +using Volo.Abp.DependencyInjection; namespace Volo.CmsKit.Web.Renderers; @@ -20,7 +20,7 @@ public class MarkdownToHtmlRenderer : IMarkdownToHtmlRenderer, ITransientDepende _htmlSanitizer = new HtmlSanitizer(); } - public async Task RenderAsync(string rawMarkdown, bool allowHtmlTags = true, bool preventXSS = true) + public Task RenderAsync(string rawMarkdown, bool allowHtmlTags = true, bool preventXSS = true) { if (!allowHtmlTags) { @@ -34,7 +34,7 @@ public class MarkdownToHtmlRenderer : IMarkdownToHtmlRenderer, ITransientDepende html = _htmlSanitizer.Sanitize(html); } - return html; + return Task.FromResult(html); } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ar.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ar.json index 922059463f..3119bf618c 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ar.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ar.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "هل أنت متأكد من حذف هذه الصفحة؟", "PageId": "صفحة", "Pages": "الصفحات", - "PageSlugInformation": "سبيكة تستخدم على url. سيكون عنوان url الخاص بك هو \"/pages/{{slug}}\".", + "PageSlugInformation": "سبيكة تستخدم على url. سيكون عنوان url الخاص بك هو \"/{slug}}\".", "Permission:BlogManagement": "إدارة المدونة", "Permission:BlogManagement.Create": "إنشاء", "Permission:BlogManagement.Delete": "حذف", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/cs.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/cs.json index 9192b48abe..8ae9479b06 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/cs.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/cs.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Opravdu chcete smazat tuto stránku?", "PageId": "Strana", "Pages": "stránky", - "PageSlugInformation": "Na adrese URL je použit Slug. Vaše adresa URL bude '/pages/{{slug}}'.", + "PageSlugInformation": "Na adrese URL je použit Slug. Vaše adresa URL bude '/{{slug}}'.", "Permission:BlogManagement": "Správa blogu", "Permission:BlogManagement.Create": "Vytvořit", "Permission:BlogManagement.Delete": "Vymazat", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/de-DE.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/de-DE.json index 903a7e3d0a..857f7f1e1a 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/de-DE.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/de-DE.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Möchten Sie diese Seite wirklich löschen?", "PageId": "Buchseite", "Pages": "Seiten", - "PageSlugInformation": "Slug wird auf URL verwendet. Ihre URL lautet '/pages/{{slug}}'.", + "PageSlugInformation": "Slug wird auf URL verwendet. Ihre URL lautet '/{{slug}}'.", "Permission:BlogManagement": "Blog-Verwaltung", "Permission:BlogManagement.Create": "Schaffen", "Permission:BlogManagement.Delete": "Löschen", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/el.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/el.json index 222cbe0fbd..7a838b120a 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/el.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/el.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Είστε βέβαιοι ότι θα διαγράψετε αυτήν τη σελίδα;", "PageId": "Σελίδα", "Pages": "Σελίδες", - "PageSlugInformation": "Το Slug χρησιμοποιείται στο url. Το url σας θα είναι '/pages/{{slug}}'.", + "PageSlugInformation": "Το Slug χρησιμοποιείται στο url. Το url σας θα είναι '/{{slug}}'.", "Permission:BlogManagement": "Διαχείριση ιστολογίου", "Permission:BlogManagement.Create": "Δημιουργώ", "Permission:BlogManagement.Delete": "Διαγράφω", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json index 6057b5dc5e..0faaf04e81 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Are you sure to delete this page?", "PageId": "Page", "Pages": "Pages", - "PageSlugInformation": "Slug is used on url. Your url will be '/pages/{{slug}}'.", + "PageSlugInformation": "Slug is used on url. Your url will be '/{{slug}}'.", "Permission:BlogManagement": "Blog Management", "Permission:BlogManagement.Create": "Create", "Permission:BlogManagement.Delete": "Delete", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/es.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/es.json index 19df2c45a2..8e8750e530 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/es.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/es.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "¿Está seguro de eliminar esta página?", "PageId": "Página", "Pages": "Paginas", - "PageSlugInformation": "Slug se usa en la URL. Su URL será '/pages/{{slug}}'.", + "PageSlugInformation": "Slug se usa en la URL. Su URL será '/{{slug}}'.", "Permission:BlogManagement": "Gestión de blogs", "Permission:BlogManagement.Create": "Crear", "Permission:BlogManagement.Delete": "Borrar", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fa.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fa.json index 3ac961feef..855b6d091d 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fa.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fa.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "آیا مطمئن هستید که این صفحه را حذف می کنید؟", "PageId": "صفحه", "Pages": "صفحات", - "PageSlugInformation": "Slug در url استفاده می شود. آدرس اینترنتی شما '/pages/{{slug}}' خواهد بود.", + "PageSlugInformation": "Slug در url استفاده می شود. آدرس اینترنتی شما '/{{slug}}' خواهد بود.", "Permission:BlogManagement": "مدیریت وبلاگ", "Permission:BlogManagement.Create": "ایجاد", "Permission:BlogManagement.Delete": "حذف", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fi.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fi.json index 30a56fa9c0..438818cdfb 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fi.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fi.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Haluatko varmasti poistaa tämän sivun?", "PageId": "Sivu", "Pages": "Sivut", - "PageSlugInformation": "Etanaa käytetään URL-osoitteessa. URL-osoitteesi on '/pages/{{slug}}'.", + "PageSlugInformation": "Etanaa käytetään URL-osoitteessa. URL-osoitteesi on '/{{slug}}'.", "Permission:BlogManagement": "Blogin hallinta", "Permission:BlogManagement.Create": "Luoda", "Permission:BlogManagement.Delete": "Poistaa", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fr.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fr.json index 6d4e8f4cf5..5c789e996e 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fr.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fr.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Êtes-vous sûr de vouloir supprimer cette page?", "PageId": "Page", "Pages": "Pages", - "PageSlugInformation": "Slug est utilisé sur l'url. Votre URL sera '/pages/{{slug}}'.", + "PageSlugInformation": "Slug est utilisé sur l'url. Votre URL sera '/{{slug}}'.", "Permission:BlogManagement": "Gestion de blog", "Permission:BlogManagement.Create": "Créer", "Permission:BlogManagement.Delete": "Effacer", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/hi.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/hi.json index 732ca3d2de..8f69f2e25f 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/hi.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/hi.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "क्या आप इस पृष्ठ को हटाना सुनिश्चित कर रहे हैं?", "PageId": "पृष्ठ", "Pages": "पृष्ठों", - "PageSlugInformation": "स्लग का उपयोग url पर किया जाता है। आपका url '/pages/{{slug}}' होगा।", + "PageSlugInformation": "स्लग का उपयोग url पर किया जाता है। आपका url '/{{slug}}' होगा।", "Permission:BlogManagement": "ब्लॉग प्रबंधन", "Permission:BlogManagement.Create": "सृजन करना", "Permission:BlogManagement.Delete": "हटाएं", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/hu.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/hu.json index 49b7d5f828..ebeb5dad25 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/hu.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/hu.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Biztosan törlöd ezt az oldalt?", "PageId": "oldal", "Pages": "Oldalak", - "PageSlugInformation": "A Slug az url-en használatos. Az Ön URL-je a következő lesz: „/pages/{{slug}}”.", + "PageSlugInformation": "A Slug az url-en használatos. Az Ön URL-je a következő lesz: „/{{slug}}”.", "Permission:BlogManagement": "Blogkezelés", "Permission:BlogManagement.Create": "Teremt", "Permission:BlogManagement.Delete": "Töröl", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/it.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/it.json index f5bb342dc6..60c8d13744 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/it.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/it.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Sei sicuro di cancellare questa pagina?", "PageId": "Pagina", "Pages": "Pagine", - "PageSlugInformation": "Lo slug viene utilizzato sull'URL. Il tuo URL sarà '/pages/{{slug}}'.", + "PageSlugInformation": "Lo slug viene utilizzato sull'URL. Il tuo URL sarà '/{{slug}}'.", "Permission:BlogManagement": "Gestione del blog", "Permission:BlogManagement.Create": "Crea", "Permission:BlogManagement.Delete": "Elimina", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/nl.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/nl.json index b8adbbd5bb..39779d1d57 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/nl.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/nl.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Weet u zeker dat u deze pagina wilt verwijderen?", "PageId": "Bladzijde", "Pages": "Pagina's", - "PageSlugInformation": "Slug wordt gebruikt voor de url. Uw url wordt '/pages/{{slug}}'.", + "PageSlugInformation": "Slug wordt gebruikt voor de url. Uw url wordt '/{{slug}}'.", "Permission:BlogManagement": "Blogbeheer", "Permission:BlogManagement.Create": "Toevoegen", "Permission:BlogManagement.Delete": "Verwijderen", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/pl-PL.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/pl-PL.json index 6c5e77a7d3..5a2ed06a5d 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/pl-PL.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/pl-PL.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Czy na pewno chcesz usunąć tę stronę?", "PageId": "Strona", "Pages": "Strony", - "PageSlugInformation": "Slug jest używany na adresie URL. Twój adres URL to „/pages/{{slug}}”.", + "PageSlugInformation": "Slug jest używany na adresie URL. Twój adres URL to „/{{slug}}”.", "Permission:BlogManagement": "Zarządzanie blogiem", "Permission:BlogManagement.Create": "Tworzyć", "Permission:BlogManagement.Delete": "Kasować", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/pt-BR.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/pt-BR.json index 5ec2a64799..fff05fefdd 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/pt-BR.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/pt-BR.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Tem certeza que deseja deletar esta página?", "PageId": "Página", "Pages": "Páginas", - "PageSlugInformation": "Slug é usado na url. Sua url será '/pages/{{slug}}'.", + "PageSlugInformation": "Slug é usado na url. Sua url será '/{{slug}}'.", "Permission:BlogManagement": "Gerenciamento de blogs", "Permission:BlogManagement.Create": "Criar", "Permission:BlogManagement.Delete": "Excluir", @@ -181,6 +181,31 @@ "HasBlogPostWaitingForReviewMessage": "Você tem uma postagem para revisão. Clique para listar.", "SelectAStatus": "Selecione um status", "Status": "Status", - "CmsKit.BlogPost.ScrollIndex": "Barra de navegação rápida em postagens" + "CmsKit.BlogPost.ScrollIndex": "Barra de navegação rápida em postagens", + "Add": "Adicionar", + "AddWidget": "Adicionar Widget", + "PleaseConfigureWidgets": "Por favor, configure os widgets", + "SelectAnAuthor": "Selecione um Autor", + "InThisDocument": "Neste Documento", + "GoToTop": "Ir para o Topo", + "Feature:CmsKitGroup": "Cms Kit", + "Feature:BlogEnable": "Habilitar página de blog", + "Feature:BlogEnableDescription": "Habilitar página de blog no aplicativo.", + "Feature:CommentEnable": "Habilitar comentários", + "Feature:CommentEnableDescription": "Habilitar comentários no aplicativo.", + "Feature:GlobalResourceEnable": "Recursos globais ativados", + "Feature:GlobalResourceEnableDescription": "Habilitar recurso global no aplicativo.", + "Feature:MediaEnable": "Mídia ativada", + "Feature:MediaEnableDescription": "Mídia ativada no aplicativo.", + "Feature:MenuEnable": "Menu habilitado", + "Feature:MenuEnableDescription": "Menu habilitado no aplicativo.", + "Feature:PageEnable": "Página de paginação ativada", + "Feature:PageEnableDescription": "Página de paginação ativada no aplicativo.", + "Feature:RatingEnable": "Classificação ativada", + "Feature:RatingEnableDescription": "Classificação ativada no aplicativo.", + "Feature:ReactionEnable": "Reações habilitadas", + "Feature:ReactionEnableDescription": "Reações habilitadas no aplicativo.", + "Feature:TagEnable": "Habilitar tag", + "Feature:TagEnableDescription": "Habilitar tag no aplicativo." } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ro-RO.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ro-RO.json index 3e7e1caaa9..9cd519bb53 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ro-RO.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ro-RO.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Sunteţi sigur(ă) că vreţi să ştergeţi această pagină?", "PageId": "Pagina", "Pages": "Pagini", - "PageSlugInformation": "Slug este folosit pe url. Url-ul dumneavoastră va fi '/pages/{{slug}}'.", + "PageSlugInformation": "Slug este folosit pe url. Url-ul dumneavoastră va fi '/{{slug}}'.", "Permission:BlogManagement": "Administrare Blog", "Permission:BlogManagement.Create": "Creează", "Permission:BlogManagement.Delete": "Şterge", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ru.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ru.json index 289b952e1b..f95ee910e4 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ru.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ru.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Вы уверены, что хотите удалить эту страницу?", "PageId": "Страница", "Pages": "Страницы", - "PageSlugInformation": "Слаг используется для URL. Ваш URL-адрес будет '/pages/{{slug}}'.", + "PageSlugInformation": "Слаг используется для URL. Ваш URL-адрес будет '/{{slug}}'.", "Permission:BlogManagement": "Управление блогом", "Permission:BlogManagement.Create": "Создавать", "Permission:BlogManagement.Delete": "Удалить", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/sk.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/sk.json index d5873f42e1..2cf9410ca9 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/sk.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/sk.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Určite chcete túto stránku vymazať?", "PageId": "Stránka", "Pages": "Stránky", - "PageSlugInformation": "Slug sa používa v URL. Vaša URL bude '/pages/{{slug}}'.", + "PageSlugInformation": "Slug sa používa v URL. Vaša URL bude '/{{slug}}'.", "Permission:BlogManagement": "Správa blogov", "Permission:BlogManagement.Create": "Vytvoriť", "Permission:BlogManagement.Delete": "Zmazať", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/sl.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/sl.json index 0a79428aac..22f252ea51 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/sl.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/sl.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Ali ste prepričani, da želite izbrisati to stran?", "PageId": "stran", "Pages": "strani", - "PageSlugInformation": "Slug se uporablja na url-ju. Vaš url bo '/pages/{{slug}}'.", + "PageSlugInformation": "Slug se uporablja na url-ju. Vaš url bo '/{{slug}}'.", "Permission:BlogManagement": "Upravljanje blogov", "Permission:BlogManagement.Create": "Ustvari", "Permission:BlogManagement.Delete": "Izbriši", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json index c8865aa648..78fb34087b 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Bu sayfayı silmek istediğinize emin misiniz?", "PageId": "Sayfa", "Pages": "Sayfalar", - "PageSlugInformation": "Etiket URL'de kullanılır. Url şöyle görünür: '/pages/{{slug}}'.", + "PageSlugInformation": "Etiket URL'de kullanılır. Url şöyle görünür: '/{{slug}}'.", "Permission:BlogManagement": "Blog Yönetimi", "Permission:BlogManagement.Create": "Oluşturma", "Permission:BlogManagement.Delete": "Silme", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/vi.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/vi.json index b0ed51a5d6..a581da6362 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/vi.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/vi.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Bạn có chắc chắn xóa trang này không?", "PageId": "Trang", "Pages": "Các trang", - "PageSlugInformation": "Slug được sử dụng trên url. Url của bạn sẽ là '/pages/{{slug}}'.", + "PageSlugInformation": "Slug được sử dụng trên url. Url của bạn sẽ là '/{{slug}}'.", "Permission:BlogManagement": "Quản lý blog", "Permission:BlogManagement.Create": "Tạo ra", "Permission:BlogManagement.Delete": "Xóa bỏ", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/zh-Hans.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/zh-Hans.json index b312349ef4..bba6fff938 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/zh-Hans.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/zh-Hans.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "你确定删除这个页面吗?", "PageId": "页", "Pages": "页面", - "PageSlugInformation": "Slug用于url. 你的url将是 '/pages/{{slug}}'.", + "PageSlugInformation": "Slug用于url. 你的url将是 '/{{slug}}'.", "Permission:BlogManagement": "博客管理", "Permission:BlogManagement.Create": "创建", "Permission:BlogManagement.Delete": "删除", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/zh-Hant.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/zh-Hant.json index 49584e5af0..91a742deba 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/zh-Hant.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/zh-Hant.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "你確定刪除這個頁面嗎?", "PageId": "頁", "Pages": "頁面", - "PageSlugInformation": "Slug用於網址. 你的網址將是 '/pages/{{slug}}'.", + "PageSlugInformation": "Slug用於網址. 你的網址將是 '/{{slug}}'.", "Permission:BlogManagement": "部落格管理", "Permission:BlogManagement.Create": "創建", "Permission:BlogManagement.Delete": "刪除", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Pages/PageConsts.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Pages/PageConsts.cs index 9f03dc809f..ff07df87a1 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Pages/PageConsts.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Pages/PageConsts.cs @@ -2,7 +2,7 @@ namespace Volo.CmsKit.Pages; -public class PageConsts +public static class PageConsts { public const string EntityType = "Page"; @@ -16,7 +16,7 @@ public class PageConsts public static int MaxStyleLength { get; set; } = int.MaxValue; - private static string _urlPrefix = "/pages/"; + private static string _urlPrefix = "/"; public static string UrlPrefix { get => _urlPrefix; set => _urlPrefix = value.EnsureEndsWith('/').EnsureStartsWith('/'); diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/EntityTagManager.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/EntityTagManager.cs index 2707b8854c..98a401af17 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/EntityTagManager.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/EntityTagManager.cs @@ -1,9 +1,9 @@ -using JetBrains.Annotations; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; +using JetBrains.Annotations; using Volo.Abp.Domain.Services; namespace Volo.CmsKit.Tags; @@ -62,7 +62,7 @@ public class EntityTagManager : DomainService var deletedTags = existingTags.Where(x => !tags.Contains(x.Name)).ToList(); var addedTags = tags.Where(x => !existingTags.Any(a => a.Name == x)); - await EntityTagRepository.DeleteManyAsync(deletedTags.Select(s => s.Id).ToArray()); + await EntityTagRepository.DeleteManyAsync(deletedTags.Select(s => s.Id).ToArray(), entityId); foreach (var addedTag in addedTags) { @@ -85,6 +85,6 @@ public class EntityTagManager : DomainService [CanBeNull] Guid? tenantId, CancellationToken cancellationToken = default) { - return await EntityTagRepository.GetEntityIdsFilteredByTagNameAsync(tagName, entityType,tenantId, cancellationToken); + return await EntityTagRepository.GetEntityIdsFilteredByTagNameAsync(tagName, entityType, tenantId, cancellationToken); } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/IEntityTagRepository.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/IEntityTagRepository.cs index 5105635c82..098ac8e46c 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/IEntityTagRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/IEntityTagRepository.cs @@ -1,8 +1,8 @@ -using JetBrains.Annotations; -using System; +using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using JetBrains.Annotations; using Volo.Abp.Domain.Repositories; namespace Volo.CmsKit.Tags; @@ -15,7 +15,7 @@ public interface IEntityTagRepository : IBasicRepository [CanBeNull] Guid? tenantId, CancellationToken cancellationToken = default); - Task DeleteManyAsync(Guid[] tagIds, CancellationToken cancellationToken = default); + Task DeleteManyAsync(Guid[] tagIds, string entityId, CancellationToken cancellationToken = default); Task> GetEntityIdsFilteredByTagAsync( [NotNull] Guid tagId, @@ -25,6 +25,6 @@ public interface IEntityTagRepository : IBasicRepository Task> GetEntityIdsFilteredByTagNameAsync( [NotNull] string tagName, [NotNull] string entityType, - [CanBeNull] Guid? tenantId=null, - CancellationToken cancellationToken=default); + [CanBeNull] Guid? tenantId = null, + CancellationToken cancellationToken = default); } diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreEntityTagRepository.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreEntityTagRepository.cs index c9e501edc0..8dfeacfc36 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreEntityTagRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreEntityTagRepository.cs @@ -1,9 +1,9 @@ -using JetBrains.Annotations; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; +using JetBrains.Annotations; using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; @@ -19,11 +19,11 @@ public class EfCoreEntityTagRepository : EfCoreRepository(); - dbSet.RemoveRange(dbSet.Where(x => tagIds.Contains(x.TagId))); + dbSet.RemoveRange(dbSet.Where(x => tagIds.Contains(x.TagId) && x.EntityId == entityId)); await dbContext.SaveChangesAsync(GetCancellationToken(cancellationToken)); } @@ -56,18 +56,18 @@ public class EfCoreEntityTagRepository : EfCoreRepository> GetEntityIdsFilteredByTagNameAsync( [NotNull] string tagName, [NotNull] string entityType, - [CanBeNull] Guid? tenantId=null, - CancellationToken cancellationToken=default) + [CanBeNull] Guid? tenantId = null, + CancellationToken cancellationToken = default) { var dbContext = await GetDbContextAsync(); var result = from et in dbContext.Set() join t in dbContext.Set() on et.TagId equals t.Id - where t.Name == tagName - && t.EntityType == entityType - && et.TenantId == tenantId + where t.Name == tagName + && t.EntityType == entityType + && et.TenantId == tenantId && t.TenantId == tenantId && !t.IsDeleted - select et.EntityId; - return await result.ToListAsync(cancellationToken:GetCancellationToken(cancellationToken)); + select et.EntityId; + return await result.ToListAsync(cancellationToken: GetCancellationToken(cancellationToken)); } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoEntityTagRepository.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoEntityTagRepository.cs index e3835bfe42..b270255900 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoEntityTagRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoEntityTagRepository.cs @@ -1,15 +1,14 @@ -using JetBrains.Annotations; -using MongoDB.Driver; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; +using JetBrains.Annotations; +using MongoDB.Driver; using Volo.Abp; using Volo.Abp.Domain.Repositories.MongoDB; using Volo.Abp.MongoDB; using Volo.CmsKit.Tags; -using Tag = Volo.CmsKit.Tags.Tag; namespace Volo.CmsKit.MongoDB.Tags; @@ -20,12 +19,19 @@ public class MongoEntityTagRepository : MongoDbRepository.Filter.In(x => x.TagId, tagIds), token); + + var builder = Builders.Filter; + var filter = builder.And( + builder.In(x => x.TagId, tagIds), + builder.Eq(x => x.EntityId, entityId) + ); + + await collection.DeleteManyAsync(filter, token); } public virtual Task FindAsync( @@ -57,7 +63,7 @@ public class MongoEntityTagRepository : MongoDbRepository> GetEntityIdsFilteredByTagNameAsync( [NotNull] string tagName, [NotNull] string entityType, - [CanBeNull] Guid? tenantId=null, + [CanBeNull] Guid? tenantId = null, CancellationToken cancellationToken = default) { var dbContext = await GetDbContextAsync(); @@ -76,7 +82,7 @@ public class MongoEntityTagRepository : MongoDbRepository s.entityTag.EntityId); - + return await AsyncExecuter.ToListAsync(resultQueryable, GetCancellationToken(cancellationToken)); } } diff --git a/modules/cms-kit/test/Volo.CmsKit.TestBase/Tags/EntityTagRepository_Test.cs b/modules/cms-kit/test/Volo.CmsKit.TestBase/Tags/EntityTagRepository_Test.cs index c200fd01f3..a895f4a949 100644 --- a/modules/cms-kit/test/Volo.CmsKit.TestBase/Tags/EntityTagRepository_Test.cs +++ b/modules/cms-kit/test/Volo.CmsKit.TestBase/Tags/EntityTagRepository_Test.cs @@ -9,11 +9,11 @@ namespace Volo.CmsKit.Tags; public abstract class EntityTagRepository_Test : CmsKitTestBase where TStartupModule : IAbpModule { - private CmsKitTestData _cmsKitTestData; - private IEntityTagRepository _entityTagRepository; - private ITagRepository _tagRepository; + private readonly CmsKitTestData _cmsKitTestData; + private readonly IEntityTagRepository _entityTagRepository; + private readonly ITagRepository _tagRepository; - public EntityTagRepository_Test() + protected EntityTagRepository_Test() { _cmsKitTestData = GetRequiredService(); _entityTagRepository = GetRequiredService(); @@ -25,7 +25,7 @@ public abstract class EntityTagRepository_Test : CmsKitTestBase< { var relatedTags = await _tagRepository.GetAllRelatedTagsAsync(_cmsKitTestData.Content_1_EntityType, _cmsKitTestData.Content_1_EntityId); - await _entityTagRepository.DeleteManyAsync(relatedTags.Select(s => s.Id).ToArray()); + await _entityTagRepository.DeleteManyAsync(relatedTags.Select(s => s.Id).ToArray(), _cmsKitTestData.Content_1_EntityId); relatedTags = await _tagRepository.GetAllRelatedTagsAsync(_cmsKitTestData.Content_1_EntityType, _cmsKitTestData.Content_1_EntityId); @@ -35,7 +35,7 @@ public abstract class EntityTagRepository_Test : CmsKitTestBase< [Fact] public async Task GetEntityIdsFilteredByTagNameAsync_ShouldWorkProperly() { - var entityIds = await _entityTagRepository.GetEntityIdsFilteredByTagNameAsync(_cmsKitTestData.TagName_1, _cmsKitTestData.EntityType1); + var entityIds = await _entityTagRepository.GetEntityIdsFilteredByTagNameAsync(_cmsKitTestData.TagName_1, _cmsKitTestData.EntityType1); entityIds.ShouldNotBeNull(); entityIds.ShouldNotBeEmpty(); diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/pt-BR.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/pt-BR.json index 06ee0a6dfc..d926dfada9 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/pt-BR.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/pt-BR.json @@ -32,7 +32,7 @@ "DisplayName:GitHubAccessToken": "Token de acesso do GitHub", "DisplayName:GitHubUserAgent": "Usuário agente do GitHub", "DisplayName:GithubVersionProviderSource": "Fonte do provedor de versão do GitHub", - "DisplayName:VersionBranchPrefix": "Prefixo da ramificação da versão", + "DisplayName:VersionBranchPrefix": "Prefixo da Branch da versão", "DisplayName:All": "Puxe tudo", "DisplayName:LanguageCode": "Código de idioma", "DisplayName:Version": "Versão", @@ -55,6 +55,7 @@ "LanguageCode": "Código de idioma", "FileName": "Nome do arquivo", "LastCachedTime": "Tempo de cache", - "Project": "Projeto" + "Project": "Projeto", + "AdvancedFilters": "Filtros Avançados" } } \ No newline at end of file diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityRole.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityRole.cs index ce6c7d7049..0e86e4e526 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityRole.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityRole.cs @@ -62,7 +62,7 @@ public class IdentityRole : AggregateRoot, IMultiTenant Name = name; TenantId = tenantId; NormalizedName = name.ToUpperInvariant(); - ConcurrencyStamp = Guid.NewGuid().ToString(); + ConcurrencyStamp = Guid.NewGuid().ToString("N"); Claims = new Collection(); } diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUser.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUser.cs index 834f0d8d7a..eec620395c 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUser.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUser.cs @@ -158,7 +158,7 @@ public class IdentityUser : FullAuditedAggregateRoot, IUser NormalizedUserName = userName.ToUpperInvariant(); Email = email; NormalizedEmail = email.ToUpperInvariant(); - ConcurrencyStamp = Guid.NewGuid().ToString(); + ConcurrencyStamp = Guid.NewGuid().ToString("N"); SecurityStamp = Guid.NewGuid().ToString(); IsActive = true; diff --git a/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/IdentityUserStore_Tests.cs b/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/IdentityUserStore_Tests.cs index 8b08732378..65c3ff5a39 100644 --- a/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/IdentityUserStore_Tests.cs +++ b/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/IdentityUserStore_Tests.cs @@ -112,7 +112,7 @@ public class IdentityUserStore_Tests : AbpIdentityDomainTestBase (await _identityUserStore.UpdateAsync(user)).Succeeded.ShouldBeTrue(); - user.ConcurrencyStamp = Guid.NewGuid().ToString(); + user.ConcurrencyStamp = Guid.NewGuid().ToString("N"); var identityResult = await _identityUserStore.UpdateAsync(user); identityResult.Succeeded.ShouldBeFalse(); diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/pt-BR.json b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/pt-BR.json index 2952a0352c..6962ebcc4c 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/pt-BR.json +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/pt-BR.json @@ -4,10 +4,10 @@ "TheOpenIDConnectRequestCannotBeRetrieved": "Não foi possivel recuperar a requisição do OpenID Connect.", "TheUserDetailsCannotBbeRetrieved": "Não foi possivel recuperar os detalhes do usuário.", "TheApplicationDetailsCannotBeFound": "Os detalhes da aplicação não foram encontrados.", - "DetailsConcerningTheCallingClientApplicationCannotBeFound": "Os detalhes relativos ao aplicativo cliente requisitante não firam encontrados.", + "DetailsConcerningTheCallingClientApplicationCannotBeFound": "Os detalhes relativos ao aplicativo cliente requisitante não foram encontrados.", "TheSpecifiedGrantTypeIsNotImplemented.": "O tipo de permissão {0} não está implementando.", "Authorization": "Autorização", - "DoYouWantToGrantAccessToYourData": "Deseja permitir {0} acesse seus dados?", + "DoYouWantToGrantAccessToYourData": "Deseja permitir {0} acessar seus dados?", "ScopesRequested": "Escopo solicitado", "Accept": "Aceitar", "Deny": "Negar" diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Scopes/AbpOpenIddictScopeCache.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Scopes/AbpOpenIddictScopeCache.cs index af5999fcc5..267fb175e2 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Scopes/AbpOpenIddictScopeCache.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Scopes/AbpOpenIddictScopeCache.cs @@ -9,11 +9,11 @@ using Volo.Abp.DependencyInjection; namespace Volo.Abp.OpenIddict.Scopes; -public class AbpOpenIddictScopeCacheAbpOpenIddictAuthorizationCache : AbpOpenIddictCacheBase>, +public class AbpOpenIddictScopeCache : AbpOpenIddictCacheBase>, IOpenIddictScopeCache, ITransientDependency { - public AbpOpenIddictScopeCacheAbpOpenIddictAuthorizationCache( + public AbpOpenIddictScopeCache( IDistributedCache cache, IDistributedCache arrayCache, IOpenIddictScopeStore store) diff --git a/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Localization/Resources/pt-BR.json b/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Localization/Resources/pt-BR.json index d6fb96ed4e..f4b0675210 100644 --- a/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Localization/Resources/pt-BR.json +++ b/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Localization/Resources/pt-BR.json @@ -8,7 +8,7 @@ "VirtualFileName": "Nome do arquivo virtual", "FileContent": "Conteúdo do arquivo", "Size": "Tamanho", - "BackToRoot": "De volta à raiz", + "BackToRoot": "Voltar à raiz", "EmptyFileInfoList": "Não há arquivos virtuais" } } \ No newline at end of file diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyCompanyName.MyProjectName.AuthServer.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyCompanyName.MyProjectName.AuthServer.csproj index 3956046dd4..709044da51 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyCompanyName.MyProjectName.AuthServer.csproj +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyCompanyName.MyProjectName.AuthServer.csproj @@ -34,6 +34,7 @@ + @@ -48,6 +49,7 @@ + diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs index 57d4d22992..53a4a95786 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs @@ -2,6 +2,8 @@ using System; using System.IO; using System.Linq; using Localization.Resources.AbpUi; +using Medallion.Threading; +using Medallion.Threading.Redis; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.DataProtection; @@ -153,6 +155,13 @@ public class MyProjectNameAuthServerModule : AbpModule var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "MyProjectName-Protection-Keys"); } + + context.Services.AddSingleton(sp => + { + var connection = ConnectionMultiplexer + .Connect(configuration["Redis:Configuration"]); + return new RedisDistributedSynchronizationProvider(connection.GetDatabase()); + }); context.Services.AddCors(options => { diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyCompanyName.MyProjectName.Blazor.Server.Tiered.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyCompanyName.MyProjectName.Blazor.Server.Tiered.csproj index 395d347807..afc8e2a2c7 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyCompanyName.MyProjectName.Blazor.Server.Tiered.csproj +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyCompanyName.MyProjectName.Blazor.Server.Tiered.csproj @@ -18,6 +18,7 @@ + @@ -35,6 +36,7 @@ + diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyProjectNameBlazorModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyProjectNameBlazorModule.cs index b8c91610b9..b704418fbd 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyProjectNameBlazorModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyProjectNameBlazorModule.cs @@ -2,6 +2,8 @@ using System.IO; using Blazorise.Bootstrap5; using Blazorise.Icons.FontAwesome; +using Medallion.Threading; +using Medallion.Threading.Redis; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.Hosting; @@ -96,6 +98,7 @@ public class MyProjectNameBlazorModule : AbpModule ConfigureRouter(context); ConfigureMenu(configuration); ConfigureDataProtection(context, configuration, hostingEnvironment); + ConfigureDistributedLocking(context, configuration); ConfigureSwaggerServices(context.Services); } @@ -290,6 +293,18 @@ public class MyProjectNameBlazorModule : AbpModule dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "MyProjectName-Protection-Keys"); } } + + private void ConfigureDistributedLocking( + ServiceConfigurationContext context, + IConfiguration configuration) + { + context.Services.AddSingleton(sp => + { + var connection = ConnectionMultiplexer + .Connect(configuration["Redis:Configuration"]); + return new RedisDistributedSynchronizationProvider(connection.GetDatabase()); + }); + } public override void OnApplicationInitialization(ApplicationInitializationContext context) { diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj index 98f4b8a541..f9f4fdb651 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj @@ -14,9 +14,11 @@ + + diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs index dc32d493b1..457ab77fda 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs @@ -2,6 +2,8 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using Medallion.Threading; +using Medallion.Threading.Redis; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Cors; @@ -51,6 +53,7 @@ public class MyProjectNameHttpApiHostModule : AbpModule ConfigureCache(configuration); ConfigureVirtualFileSystem(context); ConfigureDataProtection(context, configuration, hostingEnvironment); + ConfigureDistributedLocking(context, configuration); ConfigureCors(context, configuration); ConfigureSwaggerServices(context, configuration); } @@ -158,6 +161,18 @@ public class MyProjectNameHttpApiHostModule : AbpModule dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "MyProjectName-Protection-Keys"); } } + + private void ConfigureDistributedLocking( + ServiceConfigurationContext context, + IConfiguration configuration) + { + context.Services.AddSingleton(sp => + { + var connection = ConnectionMultiplexer + .Connect(configuration["Redis:Configuration"]); + return new RedisDistributedSynchronizationProvider(connection.GetDatabase()); + }); + } private void ConfigureCors(ServiceConfigurationContext context, IConfiguration configuration) { diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj index 223b5d5fc0..49b8a7e2c4 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj @@ -15,6 +15,7 @@ + @@ -32,6 +33,7 @@ + diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs index 2b13b8e49b..beb85d4851 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs @@ -1,5 +1,7 @@ using System; using System.IO; +using Medallion.Threading; +using Medallion.Threading.Redis; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.Hosting; @@ -28,6 +30,7 @@ using Volo.Abp.Autofac; using Volo.Abp.AutoMapper; using Volo.Abp.Caching; using Volo.Abp.Caching.StackExchangeRedis; +using Volo.Abp.DistributedLocking; using Volo.Abp.Http.Client.IdentityModel.Web; using Volo.Abp.Http.Client.Web; using Volo.Abp.Identity.Web; @@ -53,6 +56,7 @@ namespace MyCompanyName.MyProjectName.Web; typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule), typeof(AbpAutofacModule), typeof(AbpCachingStackExchangeRedisModule), + typeof(AbpDistributedLockingModule), typeof(AbpSettingManagementWebModule), typeof(AbpHttpClientIdentityModelWebModule), typeof(AbpIdentityWebModule), @@ -83,6 +87,7 @@ public class MyProjectNameWebModule : AbpModule ConfigureBundles(); ConfigureCache(); ConfigureDataProtection(context, configuration, hostingEnvironment); + ConfigureDistributedLocking(context, configuration); ConfigureUrls(configuration); ConfigureAuthentication(context, configuration); ConfigureAutoMapper(); @@ -227,6 +232,18 @@ public class MyProjectNameWebModule : AbpModule dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "MyProjectName-Protection-Keys"); } } + + private void ConfigureDistributedLocking( + ServiceConfigurationContext context, + IConfiguration configuration) + { + context.Services.AddSingleton(sp => + { + var connection = ConnectionMultiplexer + .Connect(configuration["Redis:Configuration"]); + return new RedisDistributedSynchronizationProvider(connection.GetDatabase()); + }); + } public override void OnApplicationInitialization(ApplicationInitializationContext context) {