Tenant Switching Component
-You can switch between existing tenants by using the tenant switching component in the child pages of the `AccountLayoutComponent` (like Login page). Angular UI sends the selected tenant id to the backend as `__tenant` header on each request. +You can switch between existing tenants by using the tenant switching box in the child pages of the MVC Account Public Module (like Login page). Angular UI gets selected tenant from `application-configuration` response and sends the tenant id to the backend as `__tenant` header on each request. -## Domain Tenant Resolver +## Domain/Subdomain Tenant Resolver + +> **Note:** If you are going to implement the steps below, you should also implement the domain/subdomain tenant resolver feature for the backend. See the [Domain/Subdomain Tenant Resolver section in Multi-Tenancy document](../../Multi-Tenancy#domain-subdomain-tenant-resolver) to learn the backend implementation. Angular UI can get the tenant name from the app running URL. You can determine the current tenant by subdomain (like mytenant1.mydomain.com) or by the whole domain (like mytenant.com). To do this, you need to set the `application.baseUrl` property in the environment: diff --git a/docs/en/UI/Angular/Page-Alerts.md b/docs/en/UI/Angular/Page-Alerts.md new file mode 100644 index 0000000000..e59d620432 --- /dev/null +++ b/docs/en/UI/Angular/Page-Alerts.md @@ -0,0 +1,64 @@ +# Page Alerts + +A page alert is useful for displaying an important message to the user. The ABP Framework provides an easy way to show the following alert to the user. + + + +You can simply import `PageAlertService` from `@abp/ng.theme.shared` and utilize it as follows: + +```typescript +import { PageAlertService } from '@abp/ng.theme.shared'; + +@Component({ + // ... +}) +export class MyComponent { + constructor(private service: PageAlertService) {} + + showWarning() { + this.service.show({ + type: 'warning', + message: + 'We will have a service interruption between 02:00 AM and 04:00 AM at October 23, 2023!', + title: 'Service Interruption', + }); + } +} +``` + +## `SHOW` + +The method `show` accepts a single object that is type of `PageAlert` + +```typescript +export interface PageAlert { + type: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark'; + message: string; + title?: string; + dismissible?: boolean; + messageLocalizationParams?: string[]; + titleLocalizationParams?: string[]; +} +``` + +* `type` (Required): Defines what type of alert will be shown +* `message` (Required): The message who will be shown, also works with localization as well. +* `title` (Optional): The title of the message. If it is not provided, the title will be hidden. +* `dismissible` (Optional): Default is `true`. If enabled, a button on the top right corner will be shown to the users so that they can dismiss the message. +* `messageLocalizationParams` and `titleLocalizationParams` (Optional): If the message and/or the title is a key for localization service and contains some parameters, these fields could be used to pass those parameters. + +### An example with Localization + +```typescript +this.service.show({ + type: 'danger', + message: 'AbpAccount::PagerInfo{0}{1}{2}', + messageLocalizationParams: ['10', '20', '30'], + title: 'AbpAccount::EntityNotFoundErrorMessage', + titleLocalizationParams: ['Test', 'id123'], +}); +``` + + + + diff --git a/docs/en/UI/Angular/images/page-alert-warning-example.png b/docs/en/UI/Angular/images/page-alert-warning-example.png new file mode 100644 index 0000000000..253a811a22 Binary files /dev/null and b/docs/en/UI/Angular/images/page-alert-warning-example.png differ diff --git a/docs/en/UI/Angular/images/page-alert-with-params-example.png b/docs/en/UI/Angular/images/page-alert-with-params-example.png new file mode 100644 index 0000000000..8fc5236de3 Binary files /dev/null and b/docs/en/UI/Angular/images/page-alert-with-params-example.png differ diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index 250fed91f0..517da0239f 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -754,6 +754,10 @@ "text": "Config State Service", "path": "UI/Angular/Config-State-Service.md" }, + { + "text": "Authorization", + "path": "UI/Angular/Authorization.md" + }, { "text": "HTTP Requests", "path": "UI/Angular/HTTP-Requests.md" @@ -818,6 +822,10 @@ { "text": "Toast Overlay", "path": "UI/Angular/Toaster-Service.md" + }, + { + "text": "Page Alerts", + "path": "UI/Angular/Page-Alerts.md" } ] }, diff --git a/docs/zh-Hans/Entity-Framework-Core-Other-DBMS.md b/docs/zh-Hans/Entity-Framework-Core-Other-DBMS.md index fb8ad15787..56a37396ea 100644 --- a/docs/zh-Hans/Entity-Framework-Core-Other-DBMS.md +++ b/docs/zh-Hans/Entity-Framework-Core-Other-DBMS.md @@ -62,22 +62,25 @@ MySQL连接字符串与SQL Server连接字符串不同. 所以检查你的解决 通常需要更改 `.DbMigrator` 和 `.Web` 项目里面的 `appsettings.json` ,但它取决于你的解决方案结构. -## 更改迁移DbContext +## 更改迁移DbContext Factory -MySQL DBMS与SQL Server有一些细微的差异. 某些模块数据库映射配置(尤其是字段长度)会导致MySQL出现问题. 例如某些[IdentityServer模块](Modules/IdentityServer.md)表就存在这样的问题,它提供了一个选项可以根据你的DBMS配置字段. +启动模板包含***YourProjectName*MigrationsDbContextFactory**类,这是EF Core控制台命令所必须的类(比如[Add-Migration](https://docs.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/#generating--running-migrations)和[Update-Database](https://docs.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/#generating--running-migrations)),在切换到MySql数据库时,我们同时也需要修改`DbContextOptionsBuilder` -启动模板包含*YourProjectName*MigrationsDbContext,它负责维护和迁移数据库架构. 此DbContext基本上调用依赖模块的扩展方法来配置其数据库表. +在 *YourProjectName*MigrationsDbContextFactory 类中找到以下代码: -打开 *YourProjectName*MigrationsDbContext 更改 `builder.ConfigureIdentityServer();` 行,如下所示: +````csharp +var builder = new DbContextOptionsBuilder