diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000000..5ecb45e142 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,14 @@ +### Description + +Resolves #xxxx (write the related issue number if available) + +TODO: Describe what this PR has changed, add screenshot or animated GIF if available, write if it is a breaking change, and how to fix the breaking changes for existing applications if so. + +### Checklist + +- [ ] I fully tested it as developer / designer and created unit / integration tests +- [ ] I documented it (or no need to document or I will create a separate documentation issue) + +### How to test it? + +Please describe how this can be tested by the test engineers if it is not already explicit - or remove this section if no need to description. diff --git a/.github/workflows/auto-pr.yml b/.github/workflows/auto-pr.yml index 1a7b797ef8..1babddae5a 100644 --- a/.github/workflows/auto-pr.yml +++ b/.github/workflows/auto-pr.yml @@ -1,13 +1,13 @@ -name: Merge branch dev with rel-7.0 +name: Merge branch dev with rel-7.1 on: push: branches: - - rel-7.0 + - rel-7.1 permissions: contents: read jobs: - merge-dev-with-rel-6-0: + merge-dev-with-rel-7-1: permissions: contents: write # for peter-evans/create-pull-request to create branch pull-requests: write # for peter-evans/create-pull-request to create a PR @@ -18,13 +18,13 @@ jobs: ref: dev - name: Reset promotion branch run: | - git fetch origin rel-7.0:rel-7.0 - git reset --hard rel-7.0 + git fetch origin rel-7.1:rel-7.1 + git reset --hard rel-7.1 - name: Create Pull Request uses: peter-evans/create-pull-request@v3 with: - branch: auto-merge/rel-7-0/${{github.run_number}} - title: Merge branch dev with rel-7.0 - body: This PR generated automatically to merge dev with rel-7.0. Please review the changed files before merging to prevent any errors that may occur. + branch: auto-merge/rel-7-1/${{github.run_number}} + title: Merge branch dev with rel-7.1 + body: This PR generated automatically to merge dev with rel-7.1. Please review the changed files before merging to prevent any errors that may occur. reviewers: ${{github.actor}} token: ${{ github.token }} diff --git a/.github/workflows/image-compression.yml b/.github/workflows/image-compression.yml index 4556622e4a..9eef6db59b 100644 --- a/.github/workflows/image-compression.yml +++ b/.github/workflows/image-compression.yml @@ -6,6 +6,7 @@ on: - "**.jpeg" - "**.png" - "**.webp" + - "**.gif" types: - opened - synchronize diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json index e8850644b1..34d20a3bda 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json @@ -421,7 +421,7 @@ "ContentCacheSlidingExpirationByDay": "Content Cache Sliding Expiration By Day", "MaxDaysForCaching": "Max Days For Caching", "Enabled": "Enabled", - "Menu:NugetPackagesContentCache": "NuGet Packages Content Cache", + "Menu:NugetPackagesContentCache": "NuGet Cache", "NugetPackagesContentCache": "NuGet Content Cache", "SlidingExpritionByDayInfo": "Gets or sets how long a cache entry can be inactive (e.g. not accessed) before it will be removed. This will not extend the entry lifetime beyond the absolute expiration.", "MaxDaysForCachingInfo": "Gets or sets an absolute expiration time, relative to now.", @@ -440,13 +440,18 @@ "VersionHistoryDeletionConfirmationMessage": "Are you sure you want to delete this version?", "CreateAbpConsultantLogoInfo": "Maximum file size: 1MB
Supported file types: jpg, jpeg, png, SVG, WebP", "UrlCode": "Url Code", - "Icon": "Icon", "Clear": "Clear", "Permission:AbpConsultant": "ABP Consultant", "Menu:AbpConsultants": "ABP Consultants", "CreateAbpConsultant": "Create ABP Consultant", "UrlCodeIsNotAvailable": "Url code is used by another ABP Consultant.", "AbpConsultants": "ABP Consultants", - "AbpConsultant": "ABP Consultant" + "AbpConsultant": "ABP Consultant", + "AbpConsultantEdit": "Edit ABP Consultant", + "AbpConsultantCreate": "Create ABP Consultant", + "WhoWeAreItem": "Who We Are Item", + "FieldIsRequired": "{0} is required.", + "FieldIsNotValid": " {0} is not valid.", + "InterestedLicenseType": "Interested License Type" } } diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json index ca8ed7326d..89f7648368 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json @@ -187,6 +187,24 @@ "SaveUpTo": "SAVE UP TO${0}K", "ImplementingDDD": "Implementing Domain Driven Design", "ExploreTheEBook": "Explore the E-Book", - "ExploreTheBook": "Explore the Book" + "ExploreTheBook": "Explore the Book", + "ConsultantType": "Consultancy Type", + "Expert": "ABP Expert", + "Partner": "ABP Partner", + "Industry": "Industry", + "Location": "Location", + "Contact": "Contact", + "Partner_Year": "Partnership Year", + "Info": "Info", + "SpokenLanguages": "Spoken Languages", + "SocialMedia": "Social Media", + "Activity": "Activity", + "Type": "Type", + "Contribution": "Contribution", + "WhoWeAre": "Who We Are", + "Icons": "Icons", + "Url": "Url", + "Icon": "Icon", + "RecentActivities": "Recent Activities" } } diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json index 51f2dd550a..6e5e69f079 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json @@ -369,7 +369,6 @@ "FreeTrial": "Free Trial", "AcceptsMarketingCommunications": " Yes, I`d like to receive ABP Commercial marketing communications.", "PurposeOfUsage": "Purpose of usage", - "Industry": "Industry", "Choose": "- Choose -", "CompanyOrganizationName": "Company / Organization name", "CompanySize": "Company size", diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json index 8cd1dc5a58..8cfb154295 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json @@ -13,7 +13,6 @@ "Status": "Status", "ContentSource": "Content Source", "Details": "Details", - "Url": "Url", "Title": "Title", "CreationTime": "Creation time", "Save": "Save", diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json index 751c5b6481..35698cd39c 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json @@ -409,26 +409,13 @@ "SeeTheScreenshot": "See the screenshot", "ApplicationModuleExplanation1": "Creates a reusable, fully layered application module solution.", "ApplicationModuleExplanation2": "You can use this option to create modules for your modular application.", - "Expert": "ABP Expert", "Expert_": "Expert", - "Partner": "ABP Partner", "Partner_": "Partnership", "WebSite": "Web Site", - "Industry": "Industry", - "Location": "Location", - "Contact": "Contact", - "ConsultantType": "Consultancy Type", "Expert_Year": "Expertise Year", - "Partner_Year": "Partnership Year", - "SpokenLanguages": "Spoken Languages", - "SocialMedia": "Social Media", "CompanyInfo": "Company Info", - "WhoWeAre": "Who We Are", - "RecentActivities": "Recent Activities", "Date": "Date", - "Activity": "Activity", - "Type": "Type", - "Contribution": "Contribution", - "Info": "Info" + "WhoWeAre_Partner": "Who We Are", + "WhoWeAre_Expert": "About Me" } } diff --git a/common.props b/common.props index faab44ccd2..262ed2cf6a 100644 --- a/common.props +++ b/common.props @@ -1,7 +1,7 @@ latest - 7.1.0 + 7.2.0 $(NoWarn);CS1591;CS0436 https://abp.io/assets/abp_nupkg.png https://abp.io/ diff --git a/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/POST.md b/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/POST.md new file mode 100644 index 0000000000..71494f09a6 --- /dev/null +++ b/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/POST.md @@ -0,0 +1,207 @@ +# ABP.IO Platform 7.1 RC Has Been Released + +Today, we are happy to release the [ABP Framework](https://abp.io/) and [ABP Commercial](https://commercial.abp.io/) version **7.1 RC** (Release Candidate). This blog post introduces the new features and important changes in this new version. + +Try this version and provide feedback for a more stable version of ABP v7.1! Thanks to all of you. + +## Get Started with the 7.1 RC + +Follow the steps below to try version 7.1.0 RC today: + +1) **Upgrade** the ABP CLI to version `7.1.0-rc.1` using a command line terminal: + +````bash +dotnet tool update Volo.Abp.Cli -g --version 7.1.0-rc.1 +```` + +**or install** it if you haven't before: + +````bash +dotnet tool install Volo.Abp.Cli -g --version 7.1.0-rc.1 +```` + +2) Create a **new application** with the `--preview` option: + +````bash +abp new BookStore --preview +```` + +See the [ABP CLI documentation](https://docs.abp.io/en/abp/latest/CLI) for all the available options. + +> You can also use the [Get Started](https://abp.io/get-started) page to generate a CLI command to create a new application. + +You can use any IDE that supports .NET 7.x, like [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/). + +## Migrating to 7.1 + +This version doesn't introduce any breaking changes. However, Entity Framework developers may need to add a new code-first database migration to their projects since we made some improvements to the existing entities of some application modules. + +## What's New with ABP Framework 7.1? + +In this section, I will introduce some major features released in this version. In addition to these features, so many enhancements have been made in this version too. + +Here is a brief list of the titles explained in the next sections: + +* Blazor WASM option added to Application Single Layer Startup Template +* Introducing the `IHasEntityVersion` interface and `EntitySynchronizer` base class +* Introducing the `DeleteDirectAsync` method for the `IRepository` interface +* Introducing the `IAbpHostEnvironment` interface +* Improvements on the eShopOnAbp project +* Others + +### Blazor WASM option added to Application Single Layer Startup Template + +We've created the [Application (Single Layer) Startup Template](https://docs.abp.io/en/abp/7.1/Startup-Templates/Application-Single-Layer) in v5.2 with three UI types: Angular, Blazor Server and MVC. At the moment, we didn't provide UI option for Blazor, because it required 3 projects at least (server-side, client-side and shared library between these two projects). + +In this version, we've added the Blazor WASM option to the **Application (Single Layer) Startup Template**. It still contains three projects (`blazor`, `host`, and `contracts`) but hosted by a single `host` project. + +You can use the following CLI command to create an `app-nolayers` template with the Blazor UI as the UI option: + +```bash +abp new TodoApp -t app-nolayers -u blazor --version 7.1.0-rc.1 +``` + +> You can check the [Quick Start documentation](https://docs.abp.io/en/abp/7.1/Tutorials/Todo/Single-Layer/Index?UI=Blazor&DB=EF) for a quick start with this template. + +### Introducing the `IHasEntityVersion` interface and `EntitySynchronizer` base class + +Entity synchronization is an important concept, especially in distributed applications and module development. If we have an entity that is related to other modules, we need to align/sync their data once the entity changes and versioning entity changes can also be good, so we can know whether they're synced or not. + +In this version, [@gdlcf88](https://github.com/gdlcf88) made a great contribution to the ABP Framework and introduced the `IHasEntityVersion` interface which adds **auto-versioning** to entity classes and `EntitySynchronizer` base class to **automatically sync an entity's properties from a source entity**. + +You can check the issue and documentation from the following links for more info: + +- [Issue: Entity synchronizers and a new EntityVersion audit property](https://github.com/abpframework/abp/issues/14196) +- [Versioning Entities](https://docs.abp.io/en/abp/7.1/Entities#versioning-entities) +- [Distributed Event Bus - Entity Synchronizer](https://docs.abp.io/en/abp/7.1/Distributed-Event-Bus#entity-synchronizer) + +> Note: The entities of some modules from the ABP Framework have implemented the `IHasEntityVersion` interface. Therefore, if you are upgrading your application from an earlier version, you need to create a new migration and apply it to your database. + +### Introducing the `DeleteDirectAsync` method for the `IRepository` interface + +EF 7 introduced a new [`ExecuteDeleteAsync`](https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-7.0/whatsnew#executeupdate-and-executedelete-bulk-updates) method that deletes entities without involving the change tracker into the process. Therefore, it's much faster. + +We've added the `DeleteDirectAsync` method to the `IRepository<>` interface to take the full power of EF 7. It deletes all entities that fit the given predicate. It directly deletes entities from the database, without fetching them. Therefore, some features (like **soft-delete**, **multi-tenancy**, and **audit logging)** won't work, so use this method carefully when you need it. And use the `DeleteAsync` method if you need those features. + +### Introducing the `IAbpHostEnvironment` interface + +Sometimes, while creating an application, we need to get the current hosting environment and take actions according to that. In such cases, we can use some services such as [IWebHostEnvironment](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.hosting.iwebhostenvironment?view=aspnetcore-7.0) or [IWebAssemblyHostEnvironment](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.webassembly.hosting.iwebassemblyhostenvironment) provided by .NET, in the final application. + +However, we can not use these services in a class library, which is used by the final application. ABP Framework provides the `IAbpHostEnvironment` service, which allows you to get the current environment name whenever you want. `IAbpHostEnvironment` is used by the ABP Framework in several places to perform specific actions by the environment. For example, ABP Framework reduces the cache duration on the **Development** environment for some services. + +**Usage:** + +```csharp +public class MyService +{ + private readonly IAbpHostEnvironment _abpHostEnvironment; + + public MyService(IAbpHostEnvironment abpHostEnvironment) + { + _abpHostEnvironment = abpHostEnvironment; + } + + public void MyMethod() + { + //getting the current environment name + var environmentName = _abpHostEnvironment.EnvironmentName; + + //check for the current environment + if (_abpHostEnvironment.IsDevelopment()) { /* ... */ } + } +} +``` + +You can inject the `IAbpHostEnvironment` into your service and get the current environment by using its `EnvironmentName` property. You can also check the current environment by using its extension methods such as `IsDevelopment()`. + +> Check the [ABP Application Startup](https://docs.abp.io/en/abp/7.1/Application-Startup) documentation for more information. + +### Improvements on the eShopOnAbp project + +K8s and Docker configurations have been made within this version (Dockerfiles and helm-charts have been added and image build scripts have been updated). See [#14083](https://github.com/abpframework/abp/issues/14083) for more information. + +### Others + +* Referral Links have been added to the CMS Kit Comment Feature (optional). You can specify common referral links (such as "nofollow" and "noreferrer") for links in the comments. See [#15458](https://github.com/abpframework/abp/issues/15458) for more information. +* ReCaptcha verification has been added to the CMS Kit Comment Feature (optional). You can enable ReCaptcha support to enable protection against bots. See the [documentation](https://docs.abp.io/en/abp/7.1/Modules/Cms-Kit/Comments) for more information. +* In the development environment, it is a must to reduce cache durations for some points. We typically don't have to invalidate the cache manually or wait on it for a certain time to be invalidated. For that purpose, we have reduced the cache durations for some points on the development environment. See [#14842](https://github.com/abpframework/abp/pull/14842) for more information. + +## What's New with ABP Commercial 7.1? + +We've also worked on [ABP Commercial](https://commercial.abp.io/) to align the new features and changes made in the ABP Framework. The following sections introduce a few new features coming with ABP Commercial 7.1. + +### Blazor WASM option added to Application Single Layer Pro Startup Template + +The [**Application (Single Layer) Startup Template**](https://docs.abp.io/en/commercial/latest/startup-templates/application-single-layer/index) with Blazor UI is also available for ABP Commercial customers with this version as explained above. + +You can use the following CLI command to create an `app-nolayers-pro` template with Blazor UI as the UI option: + +```bash +abp new TodoApp -t app-nolayers-pro -u blazor --version 7.1.0-rc.1 +``` + +You can also create an `app-nolayers-pro` template with Blazor UI via ABP Suite: + +![](suite-blazor-wasm-nolayers.png) + +### Suite - MAUI Blazor Code Generation + +We provided a new UI option "MAUI Blazor" for the `app-pro` template in the previous version and it's possible to create a `maui-blazor` application with both ABP CLI and ABP Suite. + +You can create an `app-pro` template with the MAUI Blazor as the UI option with the following ABP CLI command: + +```bash +abp new Acme.BookStore -t app-pro -u maui-blazor +``` + +In this version, we implemented the code generation for MAUI Blazor. You can create and generate CRUD pages for this new UI option as you do in other UI types. + +> Note: MAUI Blazor is currently only available with the `app-pro` template. + +### SaaS Module - Allowing entering a username while impersonating the tenant + +In the previous versions, we were able to impersonate a tenant from the [SaaS Module's Tenant Management UI](https://docs.abp.io/en/commercial/7.1/modules/saas#tenant-management). There was a constraint in this approach, which forced us to only impersonate the "admin" user. However, the tenant might change the admin user's username, or we may want to impersonate another user of the tenant. + +Thus, with this version, we decided to allow the impersonation of the tenant by the specified username. + +*You can click on the "Login with this tenant" action button:* + +![](saas-impersonation-1.png) + +*Then, Specify the admin name of the tenant:* + +![](saas-impersonation-2.png) + +## Community News + +### New ABP Community Posts + +* [Sergei Gorlovetsky](https://community.abp.io/members/Sergei.Gorlovetsky) has created two new community articles: + * [Why ABP Framework is one of the best tools for migration from legacy MS Access systems to latest Web app](https://community.abp.io/posts/why-abp-framework-is-one-of-the-best-tools-for-migration-from-legacy-ms-access-systems-to-latest-web-app-7l39eof0) + * [ABP Framework — 5 steps Go No Go Decision Tree](https://community.abp.io/posts/abp-framework-5-steps-go-no-go-decision-tree-2sy6r2st) +* [Onur Pıçakcı](https://github.com/onurpicakci) has created his first ABP community article that explains how to contribute to ABP Framework. You can read it 👉 [here](https://community.abp.io/posts/how-to-contribute-to-abp-framework-46dvzzvj). +* [Maliming](https://github.com/maliming) has created a new community article to show how to convert create/edit modals to a page. You can read it 👉 [here](https://community.abp.io/posts/converting-createedit-modal-to-page-4ps5v60m). + +We thank you all. We thank all the authors for contributing to the [ABP Community platform](https://community.abp.io/). + +### Volosoft Attended NDC London 2023 + +![](ndc-london.png) + +Core team members of the ABP Framework, [Halil Ibrahim Kalkan](https://twitter.com/hibrahimkalkan) and [Alper Ebicoglu](https://twitter.com/alperebicoglu) attended [NDC London 2023](https://ndclondon.com/) from the 23rd to the 27th of January. + +### Community Talks 2023.1: LeptonX Customization + +![](community-talks-conver-image.png) + +In this episode of ABP Community Talks, 2023.1; we'll talk about **LeptonX Customization**. We will dive into the details and show you how to customize the [LeptonX Theme](https://leptontheme.com/) with examples. + +The event will be live on Thursday, February 16, 2023 (20:00 - 21:00 UTC). + +> Register to listen and ask your questions now 👉 https://kommunity.com/volosoft/events/abp-community-talks-20231-leptonx-customization-03f9fd8c. + +## Conclusion + +This version comes with some new features and a lot of enhancements to the existing features. You can see the [Road Map](https://docs.abp.io/en/abp/7.1/Road-Map) documentation to learn about the release schedule and planned features for the next releases. Please try the ABP v7.1 RC and provide feedback to help us release a more stable version. + +Thanks for being a part of this community! diff --git a/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/community-talks-conver-image.png b/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/community-talks-conver-image.png new file mode 100644 index 0000000000..6d7ccb5b4c Binary files /dev/null and b/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/community-talks-conver-image.png differ diff --git a/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/cover-image.png b/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/cover-image.png new file mode 100644 index 0000000000..dd9e0475cb Binary files /dev/null and b/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/cover-image.png differ diff --git a/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/ndc-london.png b/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/ndc-london.png new file mode 100644 index 0000000000..cddf3d01b8 Binary files /dev/null and b/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/ndc-london.png differ diff --git a/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/saas-impersonation-1.png b/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/saas-impersonation-1.png new file mode 100644 index 0000000000..520cb6857a Binary files /dev/null and b/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/saas-impersonation-1.png differ diff --git a/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/saas-impersonation-2.png b/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/saas-impersonation-2.png new file mode 100644 index 0000000000..7b5c685f35 Binary files /dev/null and b/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/saas-impersonation-2.png differ diff --git a/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/suite-blazor-wasm-nolayers.png b/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/suite-blazor-wasm-nolayers.png new file mode 100644 index 0000000000..0f43c3cd2c Binary files /dev/null and b/docs/en/Blog-Posts/2023-02-08 v7_1_Preview/suite-blazor-wasm-nolayers.png differ diff --git a/docs/en/CLI.md b/docs/en/CLI.md index ee204898cf..9feb810730 100644 --- a/docs/en/CLI.md +++ b/docs/en/CLI.md @@ -138,6 +138,7 @@ For more samples, go to [ABP CLI Create Solution Samples](CLI-New-Command-Sample * `--ui` or `-u`: Specifies the UI framework. Default framework is `mvc`. Available frameworks: * `mvc`: ASP.NET Core MVC. * `angular`: Angular UI. + * `blazor`: Blazor UI. * `blazor-server`: Blazor Server UI. * `none`: Without UI. * `--database-provider` or `-d`: Specifies the database provider. Default provider is `ef`. Available providers: diff --git a/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/how-can-I-contribute-to-open-source-projects-on-github.md b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/how-can-I-contribute-to-open-source-projects-on-github.md new file mode 100644 index 0000000000..50b980cf8d --- /dev/null +++ b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/how-can-I-contribute-to-open-source-projects-on-github.md @@ -0,0 +1,105 @@ +# How to Contribute to ABP Framework + +## Introduction + +In this article I will explain how you can contribute to the open source ABP Framework. You will not only learn about the ABP Framework, but also how to contribute to an open source project, what are the standard rules, some git operations, etc. + +## What is Open Source? + +Open source software is code designed to be publicly available. Anyone can view, use, modify and distribute the project and code. The fact that the code is open source makes it a natural community and open for improvement. This enables ideas and thoughts to spread rapidly. + +## What is ABP Framework? + +ABP Framework is a complete infrastructure for building modern web applications following the best practices and guidelines of software development. ABP Framework is completely free, [open source](https://github.com/abpframework) and community driven. ABP is a modular framework and Application Modules provide pre-built application functionalities. + +## Before Contribution + +Before making any changes and trying to push them to the target repository we need to create a new [issue](https://github.com/abpframework/abp/issues) if there are no issues with the work. If there is an existing issue, you can proceed through this issue. This way, no other developer will work on the same issue and your PR will have a better chance to be accepted. + +Previous ABP Community Talk on this topic can be found [here](https://www.youtube.com/watch?v=Wz4Z-O-YoPg). + +## GitHub Issues +You may want to fix a known bug or work on a planned enhancement. See the [issue list](https://github.com/abpframework/abp/issues) on GitHub. + +## Feature Requests +If you have a feature idea for the framework or modules, create an issue on GitHub or attend an existing discussion. Then you can implement it if it's embraced by the community. + +## How to Contribute to an Open Source Software? +There are some steps to contribute to OSS projects. You can follow the steps below. + +## Step 1: Fork the Project + +The first thing we need to do now is to fork the open source project. Forking will create a copy of the project in your own GitHub account. This will allow users to make changes to the code without affecting the original repository. Just press the fork key in the project. + +![fork-image](images/fork-project-image.png) + +After forking, it will create a new repo in your own GitHub profile. + +![fork-image-profile](images/fork-project-profile.png) + +## Step 2: Clone the Project + +In order to develop the project, you need to clone it to your local. After clicking on the code button, select your preferred cloning method and copy the link. You can run the copied link on your local machine with the `git clone` command, but we will use GitHub Desktop. Press `Open with GitHub Desktop` and the repo will be installed on your local machine. + +or alternatively use the `git clone https://github.com/username/abp.git` command + +![clone-image](images/clone-image.png) + +## Step 3: Create a New Branch + +In this step, you need to create a new branch of your own before you start developing it. Open the repo on GitHub Desktop and create a new branch. When creating a new branch, be careful which branch you create it on. + +or alternatively use the `git checkout -b new-branch` command + +![branch-image](images/branch-image.png) + +## Step 4: Development + +Choose a suitable IDE to develop on the new branch you created. In order not to complicate things, we will create a `Developers.md` file and process it. Let's enter a sample text in the Developers file. + +![developer-list](images/developer-list.png) + +As you can see, all changes made to the repo are reflected directly on GitHub Desktop. + +![github-desktop-change](images/github-desktop-change.png) + +## Step 5: Commit + +The commit operation is used to save the changes you have made. It is useful to commit after certain operations are done in the project. It is useful to write a short sentence describing what you've done for the changes made in each commit. Press the `Commit to ` button to commit. + +or alternatively use the `git add .` and `git commit -m "Added the Developer List"` command + +![commit-image](images/commit-image.png) + +## Step 6: Publish the Changes + +The changes you have made so far are only visible on your local machine. You need to publish these changes to submit them to your forked repository. Please press the publish branch button to publish. + +or alternatively use the `git push origin new-branch` command + + +![push-image](images/git-push-image.png) + +## Step 7: Create a Pull Request + +After the push, the pull request `Create Pull Request` button will appear on GitHub Desktop. Click it and create a pull request. + +![github-desktop-pull-request](images/github-desktop-pull-request.png) + +You can also make a pull request from the repo in your GitHub profile. + +![compare-pull-request](images/pull-request-image.png) + +Before creating the pull request, make sure that the branch you created is making changes to the correct branch. After briefly describing your changes in the title and description, click the `Create pull request` button. This will send a pull request to the original repository. If the pull request is approved and merged by the community, your changes will also appear in the main repository. + +![open-pull-request](images/open-pull-request-image.png) + +That's it! You have contributed your development to an open source project. + +## Conclusion +In this article, I showed you how you could contribute to the ABP Framework, an open source and community driven project. Thank you for reading the article, I hope it was useful. See you soon! + +## References +- https://opensource.guide/how-to-contribute/ +- https://docs.abp.io/en/abp/latest/Contribution/Index + diff --git a/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/branch-image.png b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/branch-image.png new file mode 100644 index 0000000000..ed2e4f083f Binary files /dev/null and b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/branch-image.png differ diff --git a/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/clone-image.png b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/clone-image.png new file mode 100644 index 0000000000..6e22d8fbd3 Binary files /dev/null and b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/clone-image.png differ diff --git a/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/commit-image.png b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/commit-image.png new file mode 100644 index 0000000000..a24becb110 Binary files /dev/null and b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/commit-image.png differ diff --git a/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/developer-list.png b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/developer-list.png new file mode 100644 index 0000000000..87a7dfb948 Binary files /dev/null and b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/developer-list.png differ diff --git a/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/fork-project-image.png b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/fork-project-image.png new file mode 100644 index 0000000000..fc8e7f1efe Binary files /dev/null and b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/fork-project-image.png differ diff --git a/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/fork-project-profile.png b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/fork-project-profile.png new file mode 100644 index 0000000000..b6ade4ca1e Binary files /dev/null and b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/fork-project-profile.png differ diff --git a/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/git-push-image.png b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/git-push-image.png new file mode 100644 index 0000000000..ff3b37fef3 Binary files /dev/null and b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/git-push-image.png differ diff --git a/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/github-desktop-change.png b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/github-desktop-change.png new file mode 100644 index 0000000000..92125966ec Binary files /dev/null and b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/github-desktop-change.png differ diff --git a/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/github-desktop-pull-request.png b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/github-desktop-pull-request.png new file mode 100644 index 0000000000..44474b1967 Binary files /dev/null and b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/github-desktop-pull-request.png differ diff --git a/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/open-pull-request-image.png b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/open-pull-request-image.png new file mode 100644 index 0000000000..3f8df381ce Binary files /dev/null and b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/open-pull-request-image.png differ diff --git a/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/pull-request-image.png b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/pull-request-image.png new file mode 100644 index 0000000000..9eaacaf3db Binary files /dev/null and b/docs/en/Community-Articles/2023-01-30-How-To-Contribute-To-a-Open-Source-Software/images/pull-request-image.png differ diff --git a/docs/en/Community-Articles/2023-02-06-Converting-Create-Edit-Modal-To-Page/POST.md b/docs/en/Community-Articles/2023-02-06-Converting-Create-Edit-Modal-To-Page/POST.md new file mode 100644 index 0000000000..fb97c657f9 --- /dev/null +++ b/docs/en/Community-Articles/2023-02-06-Converting-Create-Edit-Modal-To-Page/POST.md @@ -0,0 +1,86 @@ +# Converting Create/Edit Modal to Page + +In this document we will explain how to convert BookStore's `Books` create & edit modals to regular razor pages. + +## Before +![before](images/old.gif) + +## Now +![after](images/new.gif) + +## Index page + +Repalce `abp-button(NewBookButton)` buttom with ` @L["NewBook"].Value`. + +## Index js file + +Remove the related codes of `createModal` and `editModal`. + +Change the `Edit row action` with `location.href = "/Books/EditModal?id=" + data.record.id;` + + +## Create/Edit Book page + +Remove `Layout = null;` and add some custom style and javascript code to `CreateModal.cshtml` & `EditModal.cshtml`. + +```csharp +@section styles { + +} +@section scripts { + +} +``` + +Add a `div` element with `abp-view-modal` class to wrap the `abp-dynamic-form`, Set size of `abp-modal` to `ExtraLarge` and remove the `AbpModalButtons.Cancel` button from `abp-modal-footer`. + +### CreateModal +```csharp +
+ + + + + + + + + +
+``` + +### EditModal +```csharp +
+ + + + + + + + + +
+``` + +You can check this Git commit for details. + +https://github.com/abpframework/abp-samples/commit/f3014e0ec422cb2d8816d0e00dd6ab9cc1adfc21 diff --git a/docs/en/Community-Articles/2023-02-06-Converting-Create-Edit-Modal-To-Page/images/new.gif b/docs/en/Community-Articles/2023-02-06-Converting-Create-Edit-Modal-To-Page/images/new.gif new file mode 100644 index 0000000000..391963011c Binary files /dev/null and b/docs/en/Community-Articles/2023-02-06-Converting-Create-Edit-Modal-To-Page/images/new.gif differ diff --git a/docs/en/Community-Articles/2023-02-06-Converting-Create-Edit-Modal-To-Page/images/old.gif b/docs/en/Community-Articles/2023-02-06-Converting-Create-Edit-Modal-To-Page/images/old.gif new file mode 100644 index 0000000000..a84714d4ee Binary files /dev/null and b/docs/en/Community-Articles/2023-02-06-Converting-Create-Edit-Modal-To-Page/images/old.gif differ diff --git a/docs/en/Dependency-Injection.md b/docs/en/Dependency-Injection.md index 47e60700bc..206c2c58a4 100644 --- a/docs/en/Dependency-Injection.md +++ b/docs/en/Dependency-Injection.md @@ -440,16 +440,16 @@ Use `ICachedServiceProvider` (instead of `ITransientCachedServiceProvider`) unle ## Advanced Features -### IServiceCollection.OnRegistred Event +### IServiceCollection.OnRegistered Event -You may want to perform an action for every service registered to the dependency injection. In the `PreConfigureServices` method of your module, register a callback using the `OnRegistred` method as shown below: +You may want to perform an action for every service registered to the dependency injection. In the `PreConfigureServices` method of your module, register a callback using the `OnRegistered` method as shown below: ````csharp public class AppModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) { - context.Services.OnRegistred(ctx => + context.Services.OnRegistered(ctx => { var type = ctx.ImplementationType; //... @@ -465,7 +465,7 @@ public class AppModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) { - context.Services.OnRegistred(ctx => + context.Services.OnRegistered(ctx => { if (ctx.ImplementationType.IsDefined(typeof(MyLogAttribute), true)) { @@ -478,7 +478,7 @@ public class AppModule : AbpModule This example simply checks if the service class has `MyLogAttribute` attribute and adds `MyLogInterceptor` to the interceptor list if so. -> Notice that `OnRegistred` callback might be called multiple times for the same service class if it exposes more than one service/interface. So, it's safe to use `Interceptors.TryAdd` method instead of `Interceptors.Add` method. See [the documentation](Dynamic-Proxying-Interceptors.md) of dynamic proxying / interceptors. +> Notice that `OnRegistered` callback might be called multiple times for the same service class if it exposes more than one service/interface. So, it's safe to use `Interceptors.TryAdd` method instead of `Interceptors.Add` method. See [the documentation](Dynamic-Proxying-Interceptors.md) of dynamic proxying / interceptors. ## 3rd-Party Providers diff --git a/docs/en/Entity-Framework-Core.md b/docs/en/Entity-Framework-Core.md index 568623a15d..fc17ddcd49 100644 --- a/docs/en/Entity-Framework-Core.md +++ b/docs/en/Entity-Framework-Core.md @@ -834,7 +834,7 @@ One advantage of using an interface for a DbContext is then it will be replaceab Once you properly define and use an interface for DbContext, then any other implementation can use the following ways to replace it: -**ReplaceDbContextAttribute** +#### ReplaceDbContext Attribute ```csharp [ReplaceDbContext(typeof(IBookStoreDbContext))] @@ -844,7 +844,7 @@ public class OtherDbContext : AbpDbContext, IBookStoreDbContext } ``` -**ReplaceDbContext option** +#### ReplaceDbContext Option ````csharp context.Services.AddAbpDbContext(options => @@ -856,6 +856,22 @@ context.Services.AddAbpDbContext(options => In this example, `OtherDbContext` implements `IBookStoreDbContext`. This feature allows you to have multiple DbContext (one per module) on development, but single DbContext (implements all interfaces of all DbContexts) on runtime. +#### Replacing with Multi-Tenancy + +It is also possible to replace a DbContext based on the [multi-tenancy](Multi-Tenancy.md) side. `ReplaceDbContext` attribute and `ReplaceDbContext` method can get a `MultiTenancySides` option with a default value of `MultiTenancySides.Both`. + +**Example:** Replace DbContext only for tenants, using the `ReplaceDbContext` attribute + +````csharp +[ReplaceDbContext(typeof(IBookStoreDbContext), MultiTenancySides.Tenant)] +```` + +**Example:** Replace DbContext only for the host side, using the `ReplaceDbContext` method + +````csharp +options.ReplaceDbContext(MultiTenancySides.Host); +```` + ### Split Queries ABP enables [split queries](https://docs.microsoft.com/en-us/ef/core/querying/single-split-queries) globally by default for better performance. You can change it as needed. diff --git a/docs/en/Migration-Guides/Abp-7_0.md b/docs/en/Migration-Guides/Abp-7_0.md index 05dc276e3d..65a1614603 100644 --- a/docs/en/Migration-Guides/Abp-7_0.md +++ b/docs/en/Migration-Guides/Abp-7_0.md @@ -110,6 +110,31 @@ See https://github.com/abpframework/abp/pull/13845 for more info. > You can ignore this if you don't use CMS Kit Module. +## Data migration environment + +Please call `AddDataMigrationEnvironment` method in the migration project. + +```cs +using (var application = await AbpApplicationFactory.CreateAsync(options => +{ + //... + options.AddDataMigrationEnvironment(); +})) +{ + //... +} +``` + +```cs +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddDataMigrationEnvironment(); +// Call AddDataMigrationEnvironment before AddApplicationAsync +await builder.AddApplicationAsync(); +//... +``` + +See https://github.com/abpframework/abp/pull/13985 for more info. + ## Devart.Data.Oracle.EFCore The `Devart.Data.Oracle.EFCore` package do not yet support EF Core 7.0, If you use `AbpEntityFrameworkCoreOracleDevartModule(Volo.Abp.EntityFrameworkCore.Oracle.Devart)` may not work as expected, We will release new packages as soon as they are updated. diff --git a/docs/en/Migration-Guides/Abp-7_1.md b/docs/en/Migration-Guides/Abp-7_1.md new file mode 100644 index 0000000000..7e579af217 --- /dev/null +++ b/docs/en/Migration-Guides/Abp-7_1.md @@ -0,0 +1,19 @@ +# ABP Version 7.1 Migration Guide + +This document is a guide for upgrading ABP v7.0 solutions to ABP v7.1. There are a few changes in this version that may affect your applications, please read it carefully and apply the necessary changes to your application. + +## Navigation Menu - `CustomData` type changed to `Dictionary` + +`ApplicationMenu` and `ApplicationMenuItem` classes' `CustomData` property type has been changed to `Dictionary`. So, if you use the optional `CustomData` property of these classes, change it accordingly. See [#15608](https://github.com/abpframework/abp/pull/15608) for more information. + +*Old usage:* + +```csharp +var menu = new ApplicationMenu("Home", L["Home"], "/", customData: new MyCustomData()); +``` + +*New usage:* + +```csharp +var menu = new ApplicationMenu("Home", L["Home"], "/").WithCustomData("CustomDataKey", new MyCustomData()); +``` \ No newline at end of file diff --git a/docs/en/Migration-Guides/Index.md b/docs/en/Migration-Guides/Index.md index 4e6fc6b114..8a693970b2 100644 --- a/docs/en/Migration-Guides/Index.md +++ b/docs/en/Migration-Guides/Index.md @@ -2,6 +2,7 @@ The following documents explain how to migrate your existing ABP applications. We write migration documents only if you need to take an action while upgrading your solution. Otherwise, you can easily upgrade your solution using the [abp update command](../Upgrading.md). +- [7.0 to 7.1](Abp-7_1.md) - [6.0 to 7.0](Abp-7_0.md) - [5.3 to 6.0](Abp-6_0.md) - [5.2 to 5.3](Abp-5_3.md) diff --git a/docs/en/Modules/Cms-Kit/Blogging.md b/docs/en/Modules/Cms-Kit/Blogging.md index 12039b1669..91c14d79e8 100644 --- a/docs/en/Modules/Cms-Kit/Blogging.md +++ b/docs/en/Modules/Cms-Kit/Blogging.md @@ -2,6 +2,12 @@ The blogging feature provides the necessary UI to manage and render blogs and blog posts. +## Enabling the Blogging Feature + +By default, CMS Kit features are disabled. Therefore, you need to enable the features you want, before starting to use it. You can use the [Global Feature](../../Global-Features.md) system to enable/disable CMS Kit features on development time. Alternatively, you can use the ABP Framework's [Feature System](https://docs.abp.io/en/abp/latest/Features) to disable a CMS Kit feature on runtime. + +> Check the ["How to Install" section of the CMS Kit Module documentation](Index.md#how-to-install) to see how to enable/disable CMS Kit features on development time. + ## User Interface ### Menu Items diff --git a/docs/en/Modules/Cms-Kit/Comments.md b/docs/en/Modules/Cms-Kit/Comments.md index ef476600eb..26aa7c0398 100644 --- a/docs/en/Modules/Cms-Kit/Comments.md +++ b/docs/en/Modules/Cms-Kit/Comments.md @@ -2,6 +2,12 @@ CMS kit provides a **comment** system to add the comment feature to any kind of resource, like blog posts, products, etc. +## Enabling the Comment Feature + +By default, CMS Kit features are disabled. Therefore, you need to enable the features you want, before starting to use it. You can use the [Global Feature](../../Global-Features.md) system to enable/disable CMS Kit features on development time. Alternatively, you can use the ABP Framework's [Feature System](https://docs.abp.io/en/abp/latest/Features) to disable a CMS Kit feature on runtime. + +> Check the ["How to Install" section of the CMS Kit Module documentation](Index.md#how-to-install) to see how to enable/disable CMS Kit features on development time. + ## Options The comment system provides a mechanism to group comment definitions by entity types. For example, if you want to use the comment system for blog posts and products, you need to define two entity types named `BlogPosts` and `Product`, and add comments under these entity types. @@ -16,7 +22,7 @@ Configure(options => }); ``` -> If you're using the blog feature, the ABP framework defines an entity type for the blog feature automatically. You can easily override or remove the predefined entity types in `Configure` method like shown above. +> If you're using the [Blogging Feature](Blogging.md), the ABP framework defines an entity type for the blog feature automatically. You can easily override or remove the predefined entity types in `Configure` method like shown above. `CmsKitCommentOptions` properties: diff --git a/docs/en/Modules/Cms-Kit/Global-Resources.md b/docs/en/Modules/Cms-Kit/Global-Resources.md index 7f639ad884..5e0e0154a0 100644 --- a/docs/en/Modules/Cms-Kit/Global-Resources.md +++ b/docs/en/Modules/Cms-Kit/Global-Resources.md @@ -2,6 +2,12 @@ CMS Kit Global Resources system allows to add global styles and scripts dynamically. +## Enabling the Global Resources Feature + +By default, CMS Kit features are disabled. Therefore, you need to enable the features you want, before starting to use it. You can use the [Global Feature](../../Global-Features.md) system to enable/disable CMS Kit features on development time. Alternatively, you can use the ABP Framework's [Feature System](https://docs.abp.io/en/abp/latest/Features) to disable a CMS Kit feature on runtime. + +> Check the ["How to Install" section of the CMS Kit Module documentation](Index.md#how-to-install) to see how to enable/disable CMS Kit features on development time. + ## The User Interface ### Menu items diff --git a/docs/en/Modules/Cms-Kit/Index.md b/docs/en/Modules/Cms-Kit/Index.md index 5b7f3b5366..e40f78922e 100644 --- a/docs/en/Modules/Cms-Kit/Index.md +++ b/docs/en/Modules/Cms-Kit/Index.md @@ -16,11 +16,12 @@ The following features are currently available: * Provides a [**global resources**](Global-Resources.md) system to add global styles and scripts dynamically. * Provides a [**Dynamic Widget**](Dynamic-Widget.md) system to create dynamic widgets for page and blog posts. -Click to a feature to understand and learn how to use it. +> You can click on the any feature links above to understand and learn how to use it. -All features are individually usable. If you disable a feature, it completely disappears from your application, even from the database tables, by the help of the [Global Features](../../Global-Features.md) system. +All features are individually usable. If you disable a feature, it completely disappears from your application, even from the database tables, with the help of the [Global Features](../../Global-Features.md) system. ## Pre Requirements + - This module depends on [BlobStoring](../../Blob-Storing.md) module for keeping media content. > Make sure `BlobStoring` module is installed and at least one provider is configured properly. For more information, check the [documentation](../../Blob-Storing.md). @@ -62,7 +63,7 @@ GlobalFeatureManager.Instance.Modules.CmsKit(cmsKit => This module follows the [module development best practices guide](https://docs.abp.io/en/abp/latest/Best-Practices/Index) and consists of several NuGet and NPM packages. See the guide if you want to understand the packages and relations between them. -CMS kit packages are designed for various usage scenarios. If you check the [CMS kit packages](https://www.nuget.org/packages?q=Volo.CmsKit), you will see that some packages have `Admin` and `Public` suffixes. The reason is that the module has two application layers, considering they might be used in different type of applications. These application layers uses a single domain layer. +CMS kit packages are designed for various usage scenarios. If you check the [CMS kit packages](https://www.nuget.org/packages?q=Volo.CmsKit), you will see that some packages have `Admin` and `Public` suffixes. The reason is that the module has two application layers, considering they might be used in different type of applications. These application layers uses a single domain layer: - `Volo.CmsKit.Admin.*` packages contain the functionalities required by admin (back office) applications. - `Volo.CmsKit.Public.*` packages contain the functionalities used in public websites where users read blog posts or leave comments. diff --git a/docs/en/Modules/Cms-Kit/Menus.md b/docs/en/Modules/Cms-Kit/Menus.md index 87486326da..b469c322ab 100644 --- a/docs/en/Modules/Cms-Kit/Menus.md +++ b/docs/en/Modules/Cms-Kit/Menus.md @@ -1,7 +1,13 @@ -# CMS Kit: Pages +# CMS Kit: Menus CMS Kit Menu system allows to manage public menus dynamically. +## Enabling the Menu Feature + +By default, CMS Kit features are disabled. Therefore, you need to enable the features you want, before starting to use it. You can use the [Global Feature](../../Global-Features.md) system to enable/disable CMS Kit features on development time. Alternatively, you can use the ABP Framework's [Feature System](https://docs.abp.io/en/abp/latest/Features) to disable a CMS Kit feature on runtime. + +> Check the ["How to Install" section of the CMS Kit Module documentation](Index.md#how-to-install) to see how to enable/disable CMS Kit features on development time. + ## The User Interface ### Menu items @@ -20,22 +26,18 @@ Menus page is used to manage dynamic public menus in the system. ![cms-kit-menus-page](../../images/cmskit-module-menus-page.png) - - -Created menus will be visible on public site. +The created menu items will be visible on the public-web side, as shown below: ![cms-kit-public-menus](../../images//cmskit-module-menus-public.png) -# Internals +## Internals -## Domain Layer +### Domain Layer #### Aggregates This module follows the [Entity Best Practices & Conventions](https://docs.abp.io/en/abp/latest/Best-Practices/Entities) guide. -##### Menus - - `MenuItem` (aggregate root): A Menu Item presents a single node at menu tree. #### Repositories diff --git a/docs/en/Modules/Cms-Kit/Pages.md b/docs/en/Modules/Cms-Kit/Pages.md index 7945bfd5ff..cc1f5074f4 100644 --- a/docs/en/Modules/Cms-Kit/Pages.md +++ b/docs/en/Modules/Cms-Kit/Pages.md @@ -2,6 +2,12 @@ CMS Kit Page system allows you to create dynamic pages by specifying URLs, which is the fundamental feature of a CMS. +## Enabling the Pages Feature + +By default, CMS Kit features are disabled. Therefore, you need to enable the features you want, before starting to use it. You can use the [Global Feature](../../Global-Features.md) system to enable/disable CMS Kit features on development time. Alternatively, you can use the ABP Framework's [Feature System](https://docs.abp.io/en/abp/latest/Features) to disable a CMS Kit feature on runtime. + +> Check the ["How to Install" section of the CMS Kit Module documentation](Index.md#how-to-install) to see how to enable/disable CMS Kit features on development time. + ## The User Interface ### Menu items @@ -24,5 +30,5 @@ You can create or edit an existing page on this page. ![pages-edit](../../images/cmskit-module-pages-edit.png) -When you create a page, you can access the created page via `/pages/{slug}` URL. +When you create a page, you can access the created page via `/{slug}` URL. diff --git a/docs/en/Modules/Cms-Kit/Ratings.md b/docs/en/Modules/Cms-Kit/Ratings.md index 8702feb24e..db58602c15 100644 --- a/docs/en/Modules/Cms-Kit/Ratings.md +++ b/docs/en/Modules/Cms-Kit/Ratings.md @@ -4,6 +4,12 @@ CMS kit provides a **rating** system to to add ratings feature to any kind of re ![ratings](../../images/cmskit-module-ratings.png) +## Enabling the Rating Feature + +By default, CMS Kit features are disabled. Therefore, you need to enable the features you want, before starting to use it. You can use the [Global Feature](../../Global-Features.md) system to enable/disable CMS Kit features on development time. Alternatively, you can use the ABP Framework's [Feature System](https://docs.abp.io/en/abp/latest/Features) to disable a CMS Kit feature on runtime. + +> Check the ["How to Install" section of the CMS Kit Module documentation](Index.md#how-to-install) to see how to enable/disable CMS Kit features on development time. + ## Options The rating system provides a mechanism to group ratings by entity types. For example, if you want to use the rating system for products, you need to define an entity type named `Product` and then add ratings under the defined entity type. @@ -17,7 +23,7 @@ Configure(options => }); ``` -> If you're using the blog feature, the ABP framework defines an entity type for the blog feature automatically. You can easily override or remove the predefined entity types in `Configure` method like shown above. +> If you're using the [Blogging Feature](Blogging.md), the ABP framework defines an entity type for the blog feature automatically. You can easily override or remove the predefined entity types in `Configure` method like shown above. `CmsKitRatingOptions` properties: diff --git a/docs/en/Modules/Cms-Kit/Reactions.md b/docs/en/Modules/Cms-Kit/Reactions.md index 86da9ccb72..457d5e0f26 100644 --- a/docs/en/Modules/Cms-Kit/Reactions.md +++ b/docs/en/Modules/Cms-Kit/Reactions.md @@ -8,6 +8,12 @@ Reaction component allows users to react to your content via pre-defined icons/e You can also customize the reaction icons shown in the reaction component. +## Enabling the Reaction Feature + +By default, CMS Kit features are disabled. Therefore, you need to enable the features you want, before starting to use it. You can use the [Global Feature](../../Global-Features.md) system to enable/disable CMS Kit features on development time. Alternatively, you can use the ABP Framework's [Feature System](https://docs.abp.io/en/abp/latest/Features) to disable a CMS Kit feature on runtime. + +> Check the ["How to Install" section of the CMS Kit Module documentation](Index.md#how-to-install) to see how to enable/disable CMS Kit features on development time. + ## Options Reaction system provides a mechanism to group reactions by entity types. For example, if you want to use the reaction system for products, you need to define an entity type named `Product`, and then add reactions under the defined entity type. @@ -32,7 +38,7 @@ Configure(options => }); ``` -> If you're using the comment or blog features, the ABP framework defines predefined reactions for these features automatically. +> If you're using the [Comment](Comments.md) or [Blogging](Blogging.md) features, the ABP framework defines predefined reactions for these features automatically. `CmsKitReactionOptions` properties: diff --git a/docs/en/Modules/Cms-Kit/Tags.md b/docs/en/Modules/Cms-Kit/Tags.md index 17bc5cf47f..8f91bc67c7 100644 --- a/docs/en/Modules/Cms-Kit/Tags.md +++ b/docs/en/Modules/Cms-Kit/Tags.md @@ -2,6 +2,12 @@ CMS kit provides a **tag** system to tag any kind of resources, like a blog post. +## Enabling the Tag Management Feature + +By default, CMS Kit features are disabled. Therefore, you need to enable the features you want, before starting to use it. You can use the [Global Feature](../../Global-Features.md) system to enable/disable CMS Kit features on development time. Alternatively, you can use the ABP Framework's [Feature System](https://docs.abp.io/en/abp/latest/Features) to disable a CMS Kit feature on runtime. + +> Check the ["How to Install" section of the CMS Kit Module documentation](Index.md#how-to-install) to see how to enable/disable CMS Kit features on development time. + ## Options The tag system provides a mechanism to group tags by entity types. For example, if you want to use the tag system for blog posts and products, you need to define two entity types named `BlogPosts` and `Product` and add tags under these entity types. @@ -17,7 +23,7 @@ Configure(options => }); ``` -> If you're using the blog feature, the ABP framework defines an entity type for the blog feature automatically. +> If you're using the [Blogging Feature](Blogging.md), the ABP framework defines an entity type for the blog feature automatically. `CmsKitTagOptions` properties: diff --git a/docs/en/Modules/Database-Tables.md b/docs/en/Modules/Database-Tables.md new file mode 100644 index 0000000000..8d0290b311 --- /dev/null +++ b/docs/en/Modules/Database-Tables.md @@ -0,0 +1,575 @@ +# Database Tables + +This documentation describes all database tables and their purposes. You can read this documentation to get general knowledge of the database tables that come from each module. + +## [Audit Logging Module](Audit-Logging.md) + +### AbpAuditLogs + +This table stores information about the audit logs in the application. Each record represents an audit log and tracks the actions performed in the application. + +### AbpAuditLogActions + +This table stores information about the actions performed in the application, which are logged for auditing purposes. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [AbpAuditLogs](#abpauditlogs) | Id | Links each action to a specific audit log. | + +### AbpEntityChanges + +This table stores information about entity changes in the application, which are logged for auditing purposes. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [AbpAuditLogs](#abpauditlogs) | Id | Links each entity change to a specific audit log. | + +### AbpEntityPropertyChanges + +This table stores information about property changes to entities in the application, which are logged for auditing purposes. + +## Uses + +| Table | Column | Description | +| --- | --- | --- | +| [AbpEntityChanges](#abpentitychanges) | Id | Links each property change to a specific entity change. | + +## [Background Jobs Module](Background-Jobs.md) + +### AbpBackgroundJobs + +This table stores information about the background jobs in the application and facilitates their efficient management and tracking. Each entry in the table contains details of a background job, including the job name, arguments, try count, next try time, last try time, abandoned status, and priority. + +## [Tenant Management Module](Tenant-Management.md) + +### AbpTenants + +This table stores information about the tenants. Each record represents a tenant and contains information about the tenant, such as name and other details. + +### AbpTenantConnectionStrings + +This table stores information about the tenant database connection strings. When you define a connection string for a tenant, a new record will be added to this table. You can query this database to get connection strings by tenants. + +## Uses + +| Table | Column | Description | +| --- | --- | --- | +| [AbpTenants](#abptenants) | Id | The `Id` column in the `AbpTenants` table is used to associate the tenant connection string with the corresponding tenant. | + +## Blogging Module + +### BlgUsers + +This table stores information about the blog users. When a new identity user is created, a new record will be added to this table. + +### BlgBlogs + +This table serves to store blog information and semantically separates the posts of each blog. + +### BlgPosts + +This table stores information about the blog posts. You can query this table to get blog posts by blogs. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [BlgBlogs](#blgblogs) | Id | To associate the blog post with the corresponding blog. | +### BlgComments + +This table stores information about the comments made on blog posts. You can query this table to get comments by posts. +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [BlgPosts](#blgposts) | Id | Links the comment to the corresponding blog post. | +| [BlgComments](#blgcomments) | Id | Links the comment to the parent comment. | + +### BlgTags + +This table stores information about the tags. When a new tag is used, a new record will be added to this table. You can query this table to get tags by blogs. + +### BlgPostTags + +This table is used to associate tags with blog posts in order to categorize and organize the content. You can query this table to get post tags by posts. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [BlgTags](#blgtags) | Id | Links the post tag to the corresponding tag. | +| [BlgPosts](#blgposts) | Id | Links the post tag to the corresponding blog post. | + +## [CMS Kit Module](Cms-Kit/Index.md) + +### CmsUsers + +This table stores information about the CMS Kit module users. When a new identity user is created, a new record will be added to this table. + +### CmsBlogs + +This table serves to store blog information and semantically separates the posts of each blog. + +### CmsBlogPosts + +This table stores information about the blog posts. You can query this table to get blog posts by blogs. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [CmsUsers](#cmsusers) | Id | Links the blog post to the corresponding author. | + +### CmsBlogFeatures + +This table stores information about the blog features. You can query this table to get blog features by blogs. + +### CmsComments + +This table is utilized by the [CMS Kit Comment system](Cms-Kit/Comments.md) to store comments made on the blog posts. You can query this table to get comments by posts. + +### CmsTags + +This table stores information about the tags. When a new tag is used, a new record will be added to this table. You can query this table to get tags by blogs. + +### CmsEntityTags + +This table is utilized by the [Tag Management system](Cms-Kit/Tags.md) to store tags and their relationship with various entities, thus enabling efficient categorization and organization of content. You can query this table to get entity tags by entities. + +### CmsGlobalResources + +This table is a database table for the [CMS Kit Global Resources system](Cms-Kit/Global-Resources.md), allowing dynamic addition of global styles and scripts. + +### CmsMediaDescriptors + +This table is utilized by the CMS kit module to manage media files by using the [BlobStoring](../Blob-Storing.md) module. + +### CmsMenuItems + +This table is used by the [CMS Kit Menu system](Cms-Kit/Menus.md) to manage and store information about dynamic public menus, including details such as menu item display names, URLs, and hierarchical relationships. + +### CmsPages + +This table is utilized by the [CMS Kit Page system](Cms-Kit/Pages.md) to store dynamic pages within the application, including information such as page URLs, titles, and content. + +### CmsRatings + +This table is utilized by the [CMS Kit Rating system](Cms-Kit/Ratings.md) to store ratings made on blog posts. You can query this table to get ratings by posts. + +### CmsUserReactions + +This table is utilized by the [CMS Kit Reaction system](Cms-Kit/Reactions.md) to store reactions made on blog posts. You can query this table to get reactions by posts. + +## [Docs Module](Docs.md) + +### DocsProjects + +This table stores project information to categorize documents according to different projects. + +### DocsDocuments + +This table retrieves the document if it's not found in the cache. The documentation is being updated when the content is retrieved from the database. + +### DocsDocumentContributors + +This table stores information about the contributors of the documents. You can query this table to get document contributors by documents. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [DocsDocuments](#docsdocuments) | Id | Links the document contributor to the corresponding document. | + +## [Feature Management Module](Feature-Management.md) + +### AbpFeatureGroups + +This table stores information about the feature groups in the application. For example, you can group all the features in the [`AbpFeatures`](#abpfeatures) table related to the `Identity` module under the `Identity` group. + +### AbpFeatures + +This table stores information about the features in the application. You can use the `Name` column to link each feature with its corresponding feature value in the [`AbpFeatureValues`](#abpfeaturevalues) table, so that you can easily manage and organize the features. + +### AbpFeatureValues + +This table stores the values of the features for different providers. You can use the `Name` column to link each feature value with its corresponding feature in the [`AbpFeatures`](#abpfeatures) table, so that you can easily manage and organize the features. + +## [Identity Module](Identity.md) + +### AbpUsers + +This table stores information about the identity users in the application. + +### AbpRoles + +This table stores information about the roles in the application. Roles are used to manage and control access to different parts of the application by assigning permissions and claims to roles and then assigning those roles to users. This table is important for managing and organizing the roles in the application, and for defining the access rights of the users. + +### AbpClaimTypes + +This table stores information about the claim types used in the application. You can use the `Name`, `Regex` columns to filter the claim types by name, and regex pattern respectively, so that you can easily manage and track the claim types in the application. + +### AbpLinkUsers + +This table is useful for linking multiple user accounts across different tenants or applications to a single user, allowing them to easily switch between their accounts. + +### AbpUserClaims + +This table can manage user-based access control by allowing to assign claims to users, which describes the access rights of the individual user. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [AbpUsers](#abpusers) | Id | Links the user claim to the corresponding user. | + +### AbpUserLogins + +This table can store information about the user's external logins such as login with Facebook, Google, etc. and it can also be used to track the login history of users. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [AbpUsers](#abpusers) | Id | Links the user login to the corresponding user. | + +### AbpUserRoles + +This table can manage user-based access control by allowing to assign roles to users, which describe the access rights of the individual user. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [AbpUsers](#abpusers) | Id | Links the user role to the corresponding user. | +| [AbpRoles](#abproles) | Id | Links the user role to the corresponding role. | + +### AbpUserTokens + +This table can store information about user's refresh tokens, access tokens and other tokens used in the application. It can also be used to invalidate or revoke user tokens. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [AbpUsers](#abpusers) | Id | Links the user token to the corresponding user. | + +### AbpOrganizationUnits + +This table is useful for creating and managing a hierarchical structure of the organization, allowing to group users and assign roles based on the organization structure. You can use the `Code`, `ParentId` columns to filter the organization units by code and parent id respectively, so that you can easily manage and track the organization units in the application. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [AbpOrganizationUnits](#abporganizationunits) | ParentId | Links the organization unit to its parent organization unit. | + +### AbpOrganizationUnitRoles + +This table is useful for managing role-based access control at the level of organization units, allowing to assign different roles to different parts of the organization structure. You can use the `OrganizationUnitId`, `RoleId` columns to filter the roles by organization unit id and role id respectively, so that you can easily manage and track the roles assigned to organization units in the application. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [AbpOrganizationUnits](#abporganizationunits) | Id | Links the organization unit role to the corresponding organization unit. | +| [AbpRoles](#abproles) | Id | Links the organization unit role to the corresponding role. | + +### AbpUserOrganizationUnits + +This table stores information about the organization units assigned to the users in the application. This table can manage user-organization unit relationships, and to group users based on the organization structure. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [AbpUsers](#abpusers) | Id | Links the user organization unit to the corresponding user. | +| [AbpOrganizationUnits](#abporganizationunits) | Id | Links the user organization unit to the corresponding organization unit. | + +### AbpRoleClaims + +This table is useful for managing role-based access control by allowing to assign claims to roles, which describes the access rights of the users that belong to that role. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [AbpRoles](#abproles) | Id | Links the role claim to the corresponding role. | + +### AbpSecurityLogs + +This table logs important operations and changes related to user accounts, allowing users to save the security logs for future reference. + +## [Permission Management](Permission-Management.md) + +### AbpPermissionGroups + +This table is important for managing and organizing the permissions in the application, by grouping them into logical categories. + +### AbpPermissions + +This table is important for managing and controlling access to different parts of the application and for defining the granular permissions that make up the larger permissions or roles. + +### AbpPermissionGrants + +The table stores and manage the permissions in the application and to keep track of permissions that are granted, to whom and when. Columns such as `Name`, `ProviderName`, `ProviderKey`, `TenantId` can be used to filter the granted permissions by name, provider name, provider key, and tenant id respectively, so that you can easily manage and track the granted permissions in the application. + +## [Setting Management](Setting-Management.md) + +### AbpSettings + +This table stores key-value pairs of settings for the application, and it allows dynamic configuration of the application without the need for recompilation. + +## [OpenIddict](OpenIddict.md) + +### OpenIddictApplications + +This table can store information about the OpenID Connect applications, including the client id, client secret, redirect URI, and other relevant information. It can also be used to authenticate and authorize clients using OpenID Connect protocol. + +### OpenIddictAuthorizations + +This table stores the OpenID Connect authorization data in the application. It can also be used to manage and validate the authorization grants issued to clients and users. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [OpenIddictApplications](#openiddictapplications) | Id | Links the authorization to the corresponding application. | + +### OpenIddictTokens + +This table can store information about the OpenID Connect tokens, including the token payload, expiration, type, and other relevant information. It can also be used to manage and validate the tokens issued to clients and users, such as access tokens and refresh tokens, and to control access to protected resources. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [OpenIddictApplications](#openiddictapplications) | Id | Links the token to the corresponding application. | +| [OpenIddictAuthorizations](#openiddictauthorizations) | Id | Links the token to the corresponding authorization. | + +### OpenIddictScopes + +This table can store information about the OpenID Connect scopes, including the name and description of the scope. It can also be used to define the permissions or access rights associated with the scopes, which are then used to control access to protected resources. + +## [IdentityServer](IdentityServer.md) + +### IdentityServerApiResources + +This table can store information about the API resources, including the resource name, display name, description, and other relevant information. It can also be used to define the scopes, claims, and properties associated with the API resources, which are then used to control access to protected resources. + +### IdentityServerIdentityResources + +This table can store information about the identity resources, including the name, display name, description, and enabled status. + +### IdentityServerClients + +This table can store information about the clients, including the client id, client name, client URI and other relevant information. It can also be used to define the scopes, claims, and properties associated with the clients, which are then used to control access to protected resources. + +### IdentityServerApiScopes + +This table can store information about the API scopes, including the scope name, display name, description, and other relevant information. It can also be used to define the claims and properties associated with the API scopes, which are then used to control access to protected resources. + +### IdentityServerApiResourceClaims + +This table can store information about the claims of an API resource, including the claim type and API resource id. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [IdentityServerApiResources](#identityserverapiresources) | Id | Links the claim to the corresponding API resource. | + +### IdentityServerIdentityResourceClaims + +This table can store information about the claims of an identity resource, including the claim type and identity resource id. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [IdentityServerIdentityResources](#identityserveridentityresources) | Id | Links the claim to the corresponding identity resource. | + +### IdentityServerClientClaims + +This table can store information about the claims of a client, including the claim type, claim value and client id. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [IdentityServerClients](#identityserverclients) | Id | Links the claim to the corresponding client. | + +### IdentityServerApiScopeClaims + +This table can store information about the claims of an API scope, including the claim type and API scope id. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [IdentityServerApiScopes](#identityserverapiscopes) | Id | Links the claim to the corresponding API scope. | + +### IdentityServerApiResourceProperties + +This table can store information about properties, including the property key and value, and the associated API resource. These properties can store additional metadata or configuration information related to the API resources. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [IdentityServerApiResources](#identityserverapiresources) | Id | Links the property to the corresponding API resource. | + +### IdentityServerIdentityResourceProperties + +This table can store information about properties, including the property key and value, and the associated identity resource. These properties can store additional metadata or configuration information related to the identity resources. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [IdentityServerIdentityResources](#identityserveridentityresources) | Id | Links the property to the corresponding identity resource. | + +### IdentityServerClientProperties + +This table can be store information about the properties of a client, including the key, value and client id. These properties can store additional metadata or configuration information related to the clients. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [IdentityServerClients](#identityserverclients) | Id | Links the property to the corresponding client. | + +### IdentityServerApiScopeProperties + +This table can store information about the properties of an API scope, including the key, value and API scope id. These properties can store additional metadata or configuration information related to the API scopes. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [IdentityServerApiScopes](#identityserverapiscopes) | Id | Links the property to the corresponding API scope. | + +### IdentityServerApiResourceScopes + +This table can store information about the scopes of an API resource, including the scope name and API resource id. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [IdentityServerApiResources](#identityserverapiresources) | Id | Links the scope to the corresponding API resource. | + +### IdentityServerClientScopes + + This table can store information about the scopes of a client, including the scope and client id. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [IdentityServerClients](#identityserverclients) | Id | Links the scope to the corresponding client. | + +### IdentityServerApiResourceSecrets + +This table can store information about the secrets of an API resource, including the secret value, expiration date, and API resource id. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [IdentityServerApiResources](#identityserverapiresources) | Id | Links the secret to the corresponding API resource. | + +### IdentityServerClientSecrets + +This table can store information about the secrets of a client, including the secret value, expiration date, and client id. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [IdentityServerClients](#identityserverclients) | Id | Links the secret to the corresponding client. | + +### IdentityServerClientCorsOrigins + +This table can store information about the CORS origins of a client, including the origin and client id. It can also be used to manage and validate the CORS origins of a client. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [IdentityServerClients](#identityserverclients) | Id | Links the CORS origin to the corresponding client. | + +### IdentityServerClientGrantTypes + +This table can store information about the grant types of a client, including the grant type and client id. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [IdentityServerClients](#identityserverclients) | Id | Links the grant type to the corresponding client. | + +### IdentityServerClientIdPRestrictions + +This table can store information about the identity provider restrictions of a client, including the identity provider and client id. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [IdentityServerClients](#identityserverclients) | Id | Links the identity provider restriction to the corresponding client. | + +### IdentityServerClientPostLogoutRedirectUris + +This table can store information about the post logout redirect URIs of a client, including the post logout redirect URI and client id. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [IdentityServerClients](#identityserverclients) | Id | Links the post logout redirect URI to the corresponding client. | + +### IdentityServerClientRedirectUris + +This table can store information about the redirect URIs of a client, including the redirect URI and client id. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [IdentityServerClients](#identityserverclients) | Id | Links the redirect URI to the corresponding client. | + +### IdentityServerDeviceFlowCodes + +This table can store information about the device flow codes, including the user code, device code, subject id, client id, creation time, expiration, data and session id. + +### IdentityServerPersistedGrants + +This table can store information about the persisted grants, including the key, type, subject id, client id, creation time, expiration, and data. + +## Others + +### AbpBlobContainers + +This table is important for providing a better user experience by allowing the application to support multiple containers and providing BLOB-specific features. + +### AbpBlobs + +This table stores the binary data of BLOBs (binary large objects) in the application. Each BLOB is related to a container in the [AbpBlobContainers](#abpblobcontainers) table, where the container name, tenant id and other properties of the container can be found. + +#### Foreign Keys + +| Table | Column | Description | +| --- | --- | --- | +| [AbpBlobContainers](#abpblobcontainers) | Id | Links the BLOB to the corresponding container. | + +### AbpLocalizationResources + +This table stores the localization resources for the application. This table is important for providing a better user experience by allowing the application to support multiple resources and providing localized text and other localization-specific features. + +### AbpLocalizationTexts + +The table contains the resource name, culture name, and a json encoded value which holds the key-value pair of localization text. It allows for efficient storage and management of localization texts and allows for easy update or addition of new translations for specific resources and cultures. diff --git a/docs/en/MongoDB.md b/docs/en/MongoDB.md index d99c40da43..bfdac23104 100644 --- a/docs/en/MongoDB.md +++ b/docs/en/MongoDB.md @@ -393,7 +393,7 @@ One advantage of using interface for a MongoDbContext is then it becomes replace Once you properly define and use an interface for a MongoDbContext , then any other implementation can use the following ways to replace it: -**ReplaceDbContextAttribute** +#### ReplaceDbContext Attribute ```csharp [ReplaceDbContext(typeof(IBookStoreMongoDbContext))] @@ -403,7 +403,7 @@ public class OtherMongoDbContext : AbpMongoDbContext, IBookStoreMongoDbContext } ``` -**ReplaceDbContext option** +#### ReplaceDbContext Option ```csharp context.Services.AddMongoDbContext(options => @@ -415,6 +415,22 @@ context.Services.AddMongoDbContext(options => In this example, `OtherMongoDbContext` implements `IBookStoreMongoDbContext`. This feature allows you to have multiple MongoDbContext (one per module) on development, but single MongoDbContext (implements all interfaces of all MongoDbContexts) on runtime. +#### Replacing with Multi-Tenancy + +It is also possible to replace a DbContext based on the [multi-tenancy](Multi-Tenancy.md) side. `ReplaceDbContext` attribute and `ReplaceDbContext` method can get a `MultiTenancySides` option with a default value of `MultiTenancySides.Both`. + +**Example:** Replace DbContext only for tenants, using the `ReplaceDbContext` attribute + +````csharp +[ReplaceDbContext(typeof(IBookStoreDbContext), MultiTenancySides.Tenant)] +```` + +**Example:** Replace DbContext only for the host side, using the `ReplaceDbContext` method + +````csharp +options.ReplaceDbContext(MultiTenancySides.Host); +```` + ### Customize Bulk Operations If you have better logic or using an external library for bulk operations, you can override the logic via implementing `IMongoDbBulkOperationProvider`. diff --git a/docs/en/Repositories.md b/docs/en/Repositories.md index a1a5ac5cce..23ed2371dd 100644 --- a/docs/en/Repositories.md +++ b/docs/en/Repositories.md @@ -164,6 +164,14 @@ If your entity is a soft-delete entity, you can use the `HardDeleteAsync` method > See the [Data Filtering](Data-Filtering.md) documentation for more about soft-delete. +### Delete Direct + +`DeleteDirectAsync` method of the repository deletes all entities those fit to the given predicate. It directly deletes entities from database, without fetching them. + +Some features (like soft-delete, multi-tenancy and audit logging) won't work, so use this method carefully when you need it. Use the `DeleteAsync` method if you need to these features. + +> Currently only [EF Core supports it](https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-7.0/whatsnew#basic-executedelete-examples), For the ORMs doesn't support direct delete, we will fallback to the existing `DeleteAsync` method. + ### Ensure Entities Exists The `EnsureExistsAsync` extension method accepts entity id or entities query expression to ensure entities exist, otherwise, it will throw `EntityNotFoundException`. diff --git a/docs/en/Startup-Templates/Application-Single-Layer.md b/docs/en/Startup-Templates/Application-Single-Layer.md index 7574ae3f7b..02a743c5ee 100644 --- a/docs/en/Startup-Templates/Application-Single-Layer.md +++ b/docs/en/Startup-Templates/Application-Single-Layer.md @@ -32,19 +32,18 @@ abp new Acme.BookStore -t app-nolayers This template provides multiple UI frameworks: * `mvc`: ASP.NET Core MVC UI with Razor Pages (default) +* `blazor`: Blazor UI * `blazor-server`: Blazor Server UI * `angular`: Angular UI * `none`: Without UI (for HTTP API development) -> This template doesn't have Blazor WebAssembly UI, because it requires 3 projects at least (server-side, UI and shared library between these two projects). We are recommending to use the layered [application startup template](Application.md) for Blazor WebAssembly projects. - Use the `-u` (or `--ui`) option to specify the UI framework while creating the solution: ```bash abp new Acme.BookStore -t app-nolayers -u angular ``` -This example specifies the UI type (the `-u` option) as `angular`. You can also specify `mvc`, `blazor-server` or `none` for the UI type. +This example specifies the UI type (the `-u` option) as `angular`. You can also specify `mvc`, `blazor`, `blazor-server` or `none` for the UI type. ### Specify the Database Provider diff --git a/docs/en/Themes/LeptonXLite/Angular.md b/docs/en/Themes/LeptonXLite/Angular.md index 7ebb649aca..56b003e606 100644 --- a/docs/en/Themes/LeptonXLite/Angular.md +++ b/docs/en/Themes/LeptonXLite/Angular.md @@ -14,11 +14,15 @@ To add `LeptonX-lite` into your project, - Install `@abp/ng.theme.lepton-x` -`yarn add @abp/ng.theme.lepton-x@preview` +```bash +yarn add @abp/ng.theme.lepton-x +``` - Install `bootstrap-icons` -`yarn add bootstrap-icons` +```bash +yarn add bootstrap-icons +``` - Then, we need to edit the styles array in `angular.json` to replace the existing style with the new one in the following link : diff --git a/docs/en/Tutorials/Todo/Single-Layer/Index.md b/docs/en/Tutorials/Todo/Single-Layer/Index.md index bc7fbb9a05..fe09c57e3f 100644 --- a/docs/en/Tutorials/Todo/Single-Layer/Index.md +++ b/docs/en/Tutorials/Todo/Single-Layer/Index.md @@ -3,7 +3,7 @@ ````json //[doc-params] { - "UI": ["MVC", "BlazorServer", "NG"], + "UI": ["MVC", "Blazor", "BlazorServer", "NG"], "DB": ["EF", "Mongo"] } ```` @@ -14,6 +14,38 @@ This is a single-part quick-start tutorial to build a simple todo application wi You can find the source code of the completed application [here](https://github.com/abpframework/abp-samples/tree/master/TodoApp-SingleLayer). +{{if UI=="Blazor"}} +We are currently preparing a video tutorial for Blazor UI. You can watch other tutorials for the three UI types from [here](https://www.youtube.com/playlist?list=PLsNclT2aHJcPqZxk7D4tU8LtTeCFcN_ci). +{{else}} +This documentation has a video tutorial on **YouTube**!! You can watch it here: +{{end}} + +{{if UI=="MVC" && DB =="EF"}} + + + +{{else if UI=="BlazorServer" && DB=="EF"}} + + + +{{else if UI=="NG" && DB=="EF"}} + + + +{{else if UI=="MVC" && DB=="Mongo"}} + + + +{{else if UI=="BlazorServer" && DB=="Mongo"}} + + + +{{else if UI=="NG" && DB=="Mongo"}} + + + +{{end}} + ## Pre-Requirements * An IDE (e.g. [Visual Studio](https://visualstudio.microsoft.com/vs/)) that supports [.NET 7.0+](https://dotnet.microsoft.com/download/dotnet) development. @@ -36,13 +68,23 @@ dotnet tool install -g Volo.Abp.Cli Then create an empty folder, open a command-line terminal and execute the following command in the terminal: ````bash -abp new TodoApp -t app-nolayers{{if UI=="BlazorServer"}} -u blazor-server{{else if UI=="NG"}} -u angular{{end}}{{if DB=="Mongo"}} -d mongodb{{end}} +abp new TodoApp -t app-nolayers{{if UI=="BlazorServer"}} -u blazor-server{{else if UI=="Blazor"}} -u blazor{{else if UI=="NG"}} -u angular{{end}}{{if DB=="Mongo"}} -d mongodb{{end}} ```` {{if UI=="NG"}} This will create a new solution, named *TodoApp*, with `angular` and `aspnet-core` folders. Once the solution is ready, open the solution (in the `aspnet-core` folder) with your favorite IDE. +{{else if UI=="Blazor"}} + +This will create a new solution with three projects: + +* A `blazor` application that contains the Blazor code, the client-side. +* A `host` application, hosts and serves the `blazor` application. +* A `contracts` project, shared library between these two projects. + +Once the solution is ready, open it in your favorite IDE. + {{else}} This will create a new solution with a single project, named *TodoApp*. Once the solution is ready, open it in your favorite IDE. @@ -51,7 +93,7 @@ This will create a new solution with a single project, named *TodoApp*. Once the ### Create the Database -You can run the following command in the root directory of your project (in the same folder of the `.csproj` file) to create the database and seed the initial data: +You can run the following command in the {{if UI=="Blazor"}} directory of your `TodoApp.Host` project {{else}}root directory of your project (in the same folder of the `.csproj` file){{end}} to create the database and seed the initial data: ```bash dotnet run --migrate-database @@ -65,6 +107,14 @@ This command will create the database and seed the initial data for you. Then yo It is good to run the application before starting the development. Running the application is pretty straight-forward, you can run the application with any IDE that supports .NET or by running the `dotnet run` CLI command in the directory of your project: +{{else if UI=="Blazor"}} + +It is good to run the application before starting the development. Running the application is pretty straight-forward, you just need to run the `TodoApp.Host` application with any IDE that supports .NET or by running the `dotnet run` CLI command in the directory of your project. + +> **Note:** The `host` application hosts and serves the `blazor` application. Therefore, you should run the `host` application only. + +After the application runs, open the application in your default browser: + {{else if UI=="NG"}} It is good to run the application before starting the development. The solution has two main applications: @@ -96,12 +146,12 @@ All right. We can start coding! ## Defining the Entity -This application will have a single [entity](../../../Entities.md) and we can start by creating it. So, create a new `TodoItem` class under the `Entities` folder of the project: +This application will have a single [entity](../../../Entities.md) and we can start by creating it. So, create a new `TodoItem` class under the `Entities` folder of {{if UI=="Blazor"}}the `TodoApp.Host` project{{else}}the project{{end}}: ````csharp using Volo.Abp.Domain.Entities; -namespace TodoApp.Entities; +namespace TodoApp{{if UI=="Blazor"}}.{{end}}Entities; public class TodoItem : BasicAggregateRoot { @@ -151,7 +201,7 @@ We've mapped the `TodoItem` entity to the `TodoItems` table in the database. The The startup solution is configured to use Entity Framework Core [Code First Migrations](https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations). Since we've changed the database mapping configuration, we should create a new migration and apply changes to the database. -Open a command-line terminal in the root directory of your project and type the following command: +Open a command-line terminal in the {{if UI=="Blazor"}} directory of your `TodoApp.Host` project {{else}}root directory of your project (in the same folder of the `.csproj` file){{end}} and type the following command: ````bash dotnet ef migrations add Added_TodoItem @@ -202,7 +252,7 @@ Before starting to implement these use cases, first we need to create a DTO clas ### Creating the Data Transfer Object (DTO) -[Application services](../../../Application-Services.md) typically get and return DTOs ([Data Transfer Objects](../../../Data-Transfer-Objects.md)) instead of entities. So, create a new `TodoItemDto` class under the `Services/Dtos` folder: +[Application services](../../../Application-Services.md) typically get and return DTOs ([Data Transfer Objects](../../../Data-Transfer-Objects.md)) instead of entities. So, create a new `TodoItemDto` class under the `Services/Dtos` folder{{if UI=="Blazor"}} of your `TodoApp.Contracts` project{{end}}: ```csharp namespace TodoApp.Services.Dtos; @@ -216,18 +266,50 @@ public class TodoItemDto This is a very simple DTO class that has the same properties as the `TodoItem` entity. Now, we are ready to implement our use-cases. +{{if UI=="Blazor"}} + +### The Application Service Interface + +Create a `ITodoAppService` interface under the `Services` folder of the `TodoApp.Contracts` project, as shown below: + +```csharp +using TodoApp.Services.Dtos; +using Volo.Abp.Application.Services; + +namespace TodoApp.Services; + +public interface ITodoAppService : IApplicationService +{ + Task> GetListAsync(); + + Task CreateAsync(string text); + + Task DeleteAsync(Guid id); +} +``` + +{{end}} + ### The Application Service Implementation -Create a `TodoAppService` class under the `Services` folder of your project, as shown below: +Create a `TodoAppService` class under the `Services` folder of {{if UI=="Blazor"}}your `TodoApp.Host` project{{else}}your project{{end}}, as shown below: ```csharp +{{if UI=="Blazor"}} +using TodoApp.Services; +using TodoApp.Services.Dtos; using TodoApp.Entities; using Volo.Abp.Application.Services; using Volo.Abp.Domain.Repositories; +{{else}} +using TodoApp.Entities; +using Volo.Abp.Application.Services; +using Volo.Abp.Domain.Repositories; +{{end}} namespace TodoApp.Services; -public class TodoAppService : ApplicationService +public class TodoAppService : ApplicationService{{if UI=="Blazor"}}, ITodoAppService{{end}} { private readonly IRepository _todoItemRepository; @@ -472,23 +554,29 @@ If you open [Swagger UI](https://swagger.io/tools/swagger-ui/) by entering the ` ![todo-api](../todo-api.png) -{{else if UI=="BlazorServer"}} +{{else if UI=="Blazor" || UI=="BlazorServer"}} ### Index.razor.cs -Open the `Index.razor.cs` file in the `Pages` folder and replace the content with the following code block: +Open the `Index.razor.cs` file in the `Pages` folder{{if UI=="Blazor"}} in your `Todo.Blazor` project{{end}} and replace the content with the following code block: ```csharp +{{if UI=="Blazor"}} using Microsoft.AspNetCore.Components; using TodoApp.Services; using TodoApp.Services.Dtos; +{{else}} +using Microsoft.AspNetCore.Components; +using TodoApp.Services; +using TodoApp.Services.Dtos; +{{end}} namespace TodoApp.Pages; public partial class Index { [Inject] - private TodoAppService TodoAppService { get; set; } + private {{if UI=="Blazor"}}ITodoAppService{{else}}TodoAppService{{end}} TodoAppService { get; set; } private List TodoItems { get; set; } = new List(); private string NewTodoText { get; set; } @@ -514,7 +602,7 @@ public partial class Index } ``` -This class uses the `TodoAppService` to get the list of todo items. It manipulates the `TodoItems` list after create and delete operations. This way, we don't need to refresh the whole todo list from the server. +This class uses the {{if UI=="Blazor"}}`ITodoAppService`{{else}}`TodoAppService`{{end}} to get the list of todo items. It manipulates the `TodoItems` list after create and delete operations. This way, we don't need to refresh the whole todo list from the server. ### Index.razor @@ -592,7 +680,7 @@ As the final touch, open the `Index.razor.css` file in the `Pages` folder and re This is a simple styling for the todo page. We believe that you can do much better :) -Now, you can run the application again to see the result. +Now, you can run the {{if UI=="Blazor"}}`TodoApp.Host` project{{else}}application{{end}} again to see the result. {{else if UI=="NG"}} diff --git a/docs/en/UI/Angular/HTTP-Requests.md b/docs/en/UI/Angular/HTTP-Requests.md index 57a058ef36..a0e53df9c9 100644 --- a/docs/en/UI/Angular/HTTP-Requests.md +++ b/docs/en/UI/Angular/HTTP-Requests.md @@ -298,3 +298,15 @@ export function handleHttpErrors(injector: Injector, httpError: HttpErrorRespons return throwError(httpError) } ``` + + +### How to Skip HTTP interceptors and ABP headers + +The ABP Framework adds several HTTP headers to the HttpClient, such as the "Auth token" or "tenant Id". +The ABP Server must possess the information but the ABP user may not want to send this informations to an external server. +ExternalHttpClient and IS EXTERNAL REQUEST HttpContext Token were added in V6.0.4. +The ABP Http interceptors check the value of the `IS_EXTERNAL_REQUEST` token. If the token is True then ABP-specific headers won't be added to Http Request. +The `ExternalHttpClient` extends from `HTTPClient` and sets the `IS_EXTERNAL_REQUEST` context token to true. +When you are using `ExternalHttpClient` as HttpClient in your components, it does not add ABP-specific headers. + +Note: With `IS_EXTERNAL_REQUEST` or without it, ABP loading service works. diff --git a/docs/en/UI/Angular/Modal.md b/docs/en/UI/Angular/Modal.md index 144f38e842..903e98f1fd 100644 --- a/docs/en/UI/Angular/Modal.md +++ b/docs/en/UI/Angular/Modal.md @@ -57,7 +57,7 @@ You can add the `abp-modal` to your component very quickly. See an example: @Component(/* component metadata */) export class SampleComponent { - isModelOpen = false + isModalOpen = false } ``` diff --git a/docs/en/UI/AspNetCore/Navigation-Menu.md b/docs/en/UI/AspNetCore/Navigation-Menu.md index 97e3d1a47d..f0776f47ec 100644 --- a/docs/en/UI/AspNetCore/Navigation-Menu.md +++ b/docs/en/UI/AspNetCore/Navigation-Menu.md @@ -100,7 +100,7 @@ There are more options of a menu item (the constructor of the `ApplicationMenuIt * `url` (`string`): The URL of the menu item. * `icon` (`string`): An icon name. Free [Font Awesome](https://fontawesome.com/) icon classes are supported out of the box. Example: `fa fa-book`. You can use any CSS font icon class as long as you include the necessary CSS files to your application. * `order` (`int`): The order of the menu item. Default value is `1000`. Items are sorted by the adding order unless you specify an order value. -* `customData` (`object`): A custom object that you can associate to the menu item and use it while rendering the menu item. +* `customData` (`Dictionary`): A dictionary that allows storing custom objects that you can associate with the menu item and use it while rendering the menu item. * `target` (`string`): Target of the menu item. Can be `null` (default), "\_*blank*", "\_*self*", "\_*parent*", "\_*top*" or a frame name for web applications. * `elementId` (`string`): Can be used to render the element with a specific HTML `id` attribute. * `cssClass` (`string`): Additional string classes for the menu item. diff --git a/docs/en/UI/Blazor/Basic-Theme.md b/docs/en/UI/Blazor/Basic-Theme.md index 4060f097ba..e4124d9a2c 100644 --- a/docs/en/UI/Blazor/Basic-Theme.md +++ b/docs/en/UI/Blazor/Basic-Theme.md @@ -85,6 +85,27 @@ You can simply override the styles in the Global Styles file of your application See the [Customization / Overriding Components](Customization-Overriding-Components.md) to learn how you can replace components, customize and extend the user interface. +### Overriding the Menu Item +Basic theme supports overriding a single menu item with a custom component. You can create a custom component and call `UseComponent` extension method of Basic Theme in the **MenuContributor**. + +```csharp +using Volo.Abp.AspNetCore.Components.Web.BasicTheme.Navigation; + +//... + +context.Menu.Items.Add( + new ApplicationMenuItem("Custom.1", "My Custom Menu", "#") + .UseComponent(typeof(MyMenuItemComponent))); +``` + +```html + +``` + ### Copy & Customize You can run the following [ABP CLI](../../CLI.md) command in **Blazor{{if UI == "Blazor"}}WebAssembly{{else}} Server{{end}}** project directory to copy the source code to your solution: diff --git a/docs/en/UI/Blazor/Overall.md b/docs/en/UI/Blazor/Overall.md index 835bf4eab6..f38c0c257b 100644 --- a/docs/en/UI/Blazor/Overall.md +++ b/docs/en/UI/Blazor/Overall.md @@ -88,7 +88,7 @@ There are a set of standard libraries that comes pre-installed and supported by * [Twitter Bootstrap](https://getbootstrap.com/) as the fundamental HTML/CSS framework. * [Blazorise](https://github.com/stsrki/Blazorise) as a component library that supports the Bootstrap and adds extra components like Data Grid and Tree. * [FontAwesome](https://fontawesome.com/) as the fundamental CSS font library. -* [Flag Icon](https://github.com/lipis/flag-icon-css) as a library to show flags of countries. +* [Flag Icon](https://github.com/lipis/flag-icons) as a library to show flags of countries. These libraries are selected as the base libraries and available to the applications and modules. diff --git a/docs/en/UI/Blazor/Theming.md b/docs/en/UI/Blazor/Theming.md index d8cec07cb3..2496df9b20 100644 --- a/docs/en/UI/Blazor/Theming.md +++ b/docs/en/UI/Blazor/Theming.md @@ -48,7 +48,7 @@ All the themes must depend on the [Volo.Abp.AspNetCore.Components.Server.Theming * [Twitter Bootstrap](https://getbootstrap.com/) as the fundamental HTML/CSS framework. * [Blazorise](https://github.com/stsrki/Blazorise) as a component library that supports the Bootstrap and adds extra components like Data Grid and Tree. * [FontAwesome](https://fontawesome.com/) as the fundamental CSS font library. -* [Flag Icon](https://github.com/lipis/flag-icon-css) as a library to show flags of countries. +* [Flag Icon](https://github.com/lipis/flag-icons) as a library to show flags of countries. These libraries are selected as the base libraries and available to the applications and modules. diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index a09a1d1741..351bfde88f 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -1397,6 +1397,15 @@ { "text": "Virtual File Explorer", "path": "Modules/Virtual-File-Explorer.md" + }, + { + "text": "Common", + "items":[ + { + "text": "Database Tables", + "path": "Modules/Database-Tables.md" + } + ] } ] }, diff --git a/docs/zh-Hans/CLI.md b/docs/zh-Hans/CLI.md index 2097acdad7..994089853a 100644 --- a/docs/zh-Hans/CLI.md +++ b/docs/zh-Hans/CLI.md @@ -129,6 +129,7 @@ abp new Acme.BookStore * `--ui` 或者 `-u`: 指定ui框架.默认`mvc`框架.其他选项: * `mvc`: ASP.NET Core MVC. * `angular`: Angular. + * `blazor`: Blazor UI. * `blazor-server`: Blazor Server. * `none`: 不包含UI. * `--database-provider` 或 `-d`: 或者 `-d`: 指定数据库提供程序.默认是 `ef`.其他选项: diff --git a/docs/zh-Hans/Dependency-Injection.md b/docs/zh-Hans/Dependency-Injection.md index 2264a12930..2c22c123ab 100644 --- a/docs/zh-Hans/Dependency-Injection.md +++ b/docs/zh-Hans/Dependency-Injection.md @@ -270,16 +270,16 @@ using (var scope = _serviceProvider.CreateScope()) ## 高级特性 -### IServiceCollection.OnRegistred 事件 +### IServiceCollection.OnRegistered 事件 -你可能想在注册到依赖注入的每个服务上执行一个操作, 在你的模块的 `PreConfigureServices` 方法中, 使用 `OnRegistred` 方法注册一个回调(callback) , 如下所示: +你可能想在注册到依赖注入的每个服务上执行一个操作, 在你的模块的 `PreConfigureServices` 方法中, 使用 `OnRegistered` 方法注册一个回调(callback) , 如下所示: ````csharp public class AppModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) { - context.Services.OnRegistred(ctx => + context.Services.OnRegistered(ctx => { var type = ctx.ImplementationType; //... @@ -295,7 +295,7 @@ public class AppModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) { - context.Services.OnRegistred(ctx => + context.Services.OnRegistered(ctx => { if (ctx.ImplementationType.IsDefined(typeof(MyLogAttribute), true)) { @@ -308,7 +308,7 @@ public class AppModule : AbpModule 这个示例判断一个服务类是否具有 `MyLogAttribute` 特性, 如果有的话就添加一个 `MyLogInterceptor` 到拦截器集合中. -> 注意, 如果服务类公开了多于一个服务或接口, `OnRegistred` 回调(callback)可能被同一服务类多次调用. 因此, 较安全的方法是使用 `Interceptors.TryAdd` 方法而不是 `Interceptors.Add` 方法. 请参阅动态代理(dynamic proxying)/拦截器 [文档](Dynamic-Proxying-Interceptors.md). +> 注意, 如果服务类公开了多于一个服务或接口, `OnRegistered` 回调(callback)可能被同一服务类多次调用. 因此, 较安全的方法是使用 `Interceptors.TryAdd` 方法而不是 `Interceptors.Add` 方法. 请参阅动态代理(dynamic proxying)/拦截器 [文档](Dynamic-Proxying-Interceptors.md). ## 第三方提供程序 diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Security/ApplicationConfigurationChangedService.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Security/ApplicationConfigurationChangedService.cs new file mode 100644 index 0000000000..9803a7991d --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Security/ApplicationConfigurationChangedService.cs @@ -0,0 +1,15 @@ +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.AspNetCore.Components.Web.Security; + +public delegate void ApplicationConfigurationChangedHandler(); + +public class ApplicationConfigurationChangedService : IScopedDependency +{ + public event ApplicationConfigurationChangedHandler Changed; + + public void NotifyChanged() + { + Changed?.Invoke(); + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyCachedApplicationConfigurationClient.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyCachedApplicationConfigurationClient.cs index c3ba260a88..79a2dacd9a 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyCachedApplicationConfigurationClient.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyCachedApplicationConfigurationClient.cs @@ -1,4 +1,6 @@ using System.Threading.Tasks; +using Microsoft.AspNetCore.Components.Authorization; +using Volo.Abp.AspNetCore.Components.Web.Security; using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ClientProxies; using Volo.Abp.AspNetCore.Mvc.Client; @@ -10,23 +12,31 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly; public class WebAssemblyCachedApplicationConfigurationClient : ICachedApplicationConfigurationClient, ITransientDependency { protected AbpApplicationConfigurationClientProxy ApplicationConfigurationClientProxy { get; } - + protected AbpApplicationLocalizationClientProxy ApplicationLocalizationClientProxy { get; } protected ApplicationConfigurationCache Cache { get; } protected ICurrentTenantAccessor CurrentTenantAccessor { get; } + protected ApplicationConfigurationChangedService ApplicationConfigurationChangedService { get; } + + protected AuthenticationStateProvider AuthenticationStateProvider { get; } + public WebAssemblyCachedApplicationConfigurationClient( AbpApplicationConfigurationClientProxy applicationConfigurationClientProxy, ApplicationConfigurationCache cache, - ICurrentTenantAccessor currentTenantAccessor, - AbpApplicationLocalizationClientProxy applicationLocalizationClientProxy) + ICurrentTenantAccessor currentTenantAccessor, + AbpApplicationLocalizationClientProxy applicationLocalizationClientProxy, + ApplicationConfigurationChangedService applicationConfigurationChangedService, + AuthenticationStateProvider authenticationStateProvider) { ApplicationConfigurationClientProxy = applicationConfigurationClientProxy; Cache = cache; CurrentTenantAccessor = currentTenantAccessor; ApplicationLocalizationClientProxy = applicationLocalizationClientProxy; + ApplicationConfigurationChangedService = applicationConfigurationChangedService; + AuthenticationStateProvider = authenticationStateProvider; } public virtual async Task InitializeAsync() @@ -45,9 +55,11 @@ public class WebAssemblyCachedApplicationConfigurationClient : ICachedApplicatio ); configurationDto.Localization.Resources = localizationDto.Resources; - + Cache.Set(configurationDto); + ApplicationConfigurationChangedService.NotifyChanged(); + CurrentTenantAccessor.Current = new BasicTenantInfo( configurationDto.CurrentTenant.Id, configurationDto.CurrentTenant.Name diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Grid/AbpColumnTagHelper.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Grid/AbpColumnTagHelper.cs index 3d5f94d18b..bbb6afd1ec 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Grid/AbpColumnTagHelper.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Grid/AbpColumnTagHelper.cs @@ -16,6 +16,8 @@ public class AbpColumnTagHelper : AbpTagHelper ProcessSizeClass(context, output, TagHelper.SizeMd, "-md"); ProcessSizeClass(context, output, TagHelper.SizeLg, "-lg"); ProcessSizeClass(context, output, TagHelper.SizeXl, "-xl"); + ProcessSizeClass(context, output, TagHelper.SizeXxl, "-xxl"); } protected virtual void ProcessOffsetClasses(TagHelperContext context, TagHelperOutput output) @@ -33,6 +34,7 @@ public class AbpColumnTagHelperService : AbpTagHelperService ProcessOffsetClass(context, output, TagHelper.OffsetMd, "-md"); ProcessOffsetClass(context, output, TagHelper.OffsetLg, "-lg"); ProcessOffsetClass(context, output, TagHelper.OffsetXl, "-xl"); + ProcessOffsetClass(context, output, TagHelper.OffsetXxl, "-xxl"); } protected virtual void ProcessSizeClass(TagHelperContext context, TagHelperOutput output, ColumnSize size, string breakpoint) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/FlagIconCss/FlagIconCssStyleContributor.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/FlagIconCss/FlagIconCssStyleContributor.cs index 3181d8e1a2..9e5754f393 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/FlagIconCss/FlagIconCssStyleContributor.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/FlagIconCss/FlagIconCssStyleContributor.cs @@ -7,6 +7,13 @@ public class FlagIconCssStyleContributor : BundleContributor { public override void ConfigureBundle(BundleConfigurationContext context) { - context.Files.AddIfNotContains("/libs/flag-icon-css/css/flag-icons.min.css"); + if (context.FileProvider.GetFileInfo("/libs/flag-icons/css/flag-icons.min.css").Exists) + { + context.Files.AddIfNotContains("/libs/flag-icons/css/flag-icons.min.css"); + } + else if (context.FileProvider.GetFileInfo("/libs/flag-icon-css/css/flag-icons.min.css").Exists) + { + context.Files.AddIfNotContains("/libs/flag-icon-css/css/flag-icons.min.css"); + } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/AbpAspNetCoreMvcUiWidgetsModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/AbpAspNetCoreMvcUiWidgetsModule.cs index 54d766ec08..23b3d08602 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/AbpAspNetCoreMvcUiWidgetsModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/AbpAspNetCoreMvcUiWidgetsModule.cs @@ -39,7 +39,7 @@ public class AbpAspNetCoreMvcUiWidgetsModule : AbpModule { var widgetTypes = new List(); - services.OnRegistred(context => + services.OnRegistered(context => { if (WidgetAttribute.IsWidget(context.ImplementationType)) { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs index f8316da3d8..15abd26b1e 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs @@ -1,7 +1,10 @@ using System; +using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; namespace Volo.Abp.AspNetCore.Mvc.Authentication; @@ -9,15 +12,17 @@ public abstract class ChallengeAccountController : AbpController { protected string[] ChallengeAuthenticationSchemas { get; } protected string AuthenticationType { get; } + protected string[] ForbidSchemes { get; } protected ChallengeAccountController(string[] challengeAuthenticationSchemas = null) { ChallengeAuthenticationSchemas = challengeAuthenticationSchemas ?? new[] { "oidc" }; AuthenticationType = "Identity.Application"; + ForbidSchemes = Array.Empty(); } [HttpGet] - public ActionResult Login(string returnUrl = "", string returnUrlHash = "") + public virtual ActionResult Login(string returnUrl = "", string returnUrlHash = "") { if (CurrentUser.IsAuthenticated) { @@ -28,7 +33,7 @@ public abstract class ChallengeAccountController : AbpController } [HttpGet] - public async Task Logout(string returnUrl = "", string returnUrlHash = "") + public virtual async Task Logout(string returnUrl = "", string returnUrlHash = "") { await HttpContext.SignOutAsync(); @@ -41,7 +46,7 @@ public abstract class ChallengeAccountController : AbpController } [HttpGet] - public async Task FrontChannelLogout(string sid) + public virtual async Task FrontChannelLogout(string sid) { if (User.Identity != null && User.Identity.IsAuthenticated) { @@ -54,4 +59,21 @@ public abstract class ChallengeAccountController : AbpController return NoContent(); } + + [HttpGet] + public virtual Task AccessDenied(string returnUrl = "", string returnUrlHash = "") + { + return Task.FromResult(Challenge( + new AuthenticationProperties + { + RedirectUri = GetRedirectUrl(returnUrl, returnUrlHash) + }, + ForbidSchemes.IsNullOrEmpty() + ? new[] + { + HttpContext.RequestServices.GetRequiredService>().Value.DefaultForbidScheme + } + : ForbidSchemes + )); + } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/MvcCoreBuilderExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/MvcCoreBuilderExtensions.cs index 9777265abd..4fc5a04859 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/MvcCoreBuilderExtensions.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/MvcCoreBuilderExtensions.cs @@ -20,6 +20,8 @@ public static class MvcCoreBuilderExtensions options.JsonSerializerOptions.Converters.Add(new AbpStringToEnumFactory()); options.JsonSerializerOptions.Converters.Add(new AbpStringToBooleanConverter()); + options.JsonSerializerOptions.Converters.Add(new AbpStringToGuidConverter()); + options.JsonSerializerOptions.Converters.Add(new AbpNullableStringToGuidConverter()); options.JsonSerializerOptions.Converters.Add(new ObjectToInferredTypesConverter()); options.JsonSerializerOptions.TypeInfoResolver = new AbpDefaultJsonTypeInfoResolver(serviceProvider diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpAspNetCoreSignalRModule.cs b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpAspNetCoreSignalRModule.cs index 903e60a16f..13400a7ff9 100644 --- a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpAspNetCoreSignalRModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpAspNetCoreSignalRModule.cs @@ -91,7 +91,7 @@ public class AbpAspNetCoreSignalRModule : AbpModule { var hubTypes = new List(); - services.OnRegistred(context => + services.OnRegistered(context => { if (IsHubClass(context) && !IsDisabledForAutoMap(context)) { diff --git a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Security/AbpSecurityHeadersMiddleware.cs b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Security/AbpSecurityHeadersMiddleware.cs index 0245cf11bc..37c18f6b70 100644 --- a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Security/AbpSecurityHeadersMiddleware.cs +++ b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Security/AbpSecurityHeadersMiddleware.cs @@ -28,9 +28,6 @@ public class AbpSecurityHeadersMiddleware : IMiddleware, ITransientDependency /*The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a ,