From ae215f76f6b01699223dff2c933661e196613142 Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Mon, 5 Dec 2022 17:07:58 +0300 Subject: [PATCH 1/4] Fix permission modal parent-child relations --- .../permission-management.component.ts | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.ts b/npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.ts index e503396540..1ca5163ccd 100644 --- a/npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.ts +++ b/npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.ts @@ -164,25 +164,16 @@ export class PermissionManagementComponent return; setTimeout(() => { - this.permissions = this.permissions - .map(per => { - if (clickedPermission.name === per.name) { - return { ...per, isGranted: !per.isGranted }; - } else if (clickedPermission.name === per.parentName && clickedPermission.isGranted) { - return { ...per, isGranted: false }; - } else if (clickedPermission.parentName === per.name && !clickedPermission.isGranted) { - return { ...per, isGranted: true }; - } - - return per; - }) - .map((per, index, permissions) => { - const childrens = permissions.filter(p => p.parentName === per.name); - if (childrens.length > 0 && childrens.every(x => !x.isGranted)) { - return { ...per, isGranted: false }; - } - return per; - }); + this.permissions = this.permissions.map(per => { + if (clickedPermission.name === per.name) { + return { ...per, isGranted: !per.isGranted }; + } else if (clickedPermission.name === per.parentName && clickedPermission.isGranted) { + return { ...per, isGranted: false }; + } else if (clickedPermission.parentName === per.name && !clickedPermission.isGranted) { + return { ...per, isGranted: true }; + } + return per; + }); this.setTabCheckboxState(); this.setGrantCheckboxState(); }, 0); From 71d330bf0da8bffdd7ddf25728631d9676a38edd Mon Sep 17 00:00:00 2001 From: muhammedaltug Date: Tue, 6 Dec 2022 14:43:20 +0300 Subject: [PATCH 2/4] fix initial language conflict --- .../core/src/lib/services/session-state.service.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/npm/ng-packs/packages/core/src/lib/services/session-state.service.ts b/npm/ng-packs/packages/core/src/lib/services/session-state.service.ts index be521f33c1..d0902f40e3 100644 --- a/npm/ng-packs/packages/core/src/lib/services/session-state.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/session-state.service.ts @@ -31,7 +31,7 @@ export class SessionStateService { } private setInitialLanguage() { - if (this.getLanguage()) return; + const appLanguage = this.getLanguage(); this.configState .getDeep$('localization.currentCulture.cultureName') @@ -43,8 +43,9 @@ export class SessionStateService { if (lang.includes(';')) { lang = lang.split(';')[0]; } - - this.setLanguage(lang); + if (appLanguage !== lang) { + this.setLanguage(lang); + } }); } From b31350637720d204da74e222bed890baa484c6e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 6 Dec 2022 15:56:14 +0300 Subject: [PATCH 3/4] Added the initial "Distributed / Microservice Solutions" document --- docs/en/Deployment/Distributed-Microservice.md | 4 ++++ docs/en/Deployment/Index.md | 1 + docs/en/docs-nav.json | 4 ++++ 3 files changed, 9 insertions(+) create mode 100644 docs/en/Deployment/Distributed-Microservice.md diff --git a/docs/en/Deployment/Distributed-Microservice.md b/docs/en/Deployment/Distributed-Microservice.md new file mode 100644 index 0000000000..fb2c4032e8 --- /dev/null +++ b/docs/en/Deployment/Distributed-Microservice.md @@ -0,0 +1,4 @@ +# Deploying Distributed / Microservice Solutions + +The ABP Framework is designed to consider distributed and microservice systems, where you have multiple applications and/or services communicating internally. All of its features are compatible with distributed scenarios. This document highlights some points you should care when you deploy your distributed or microservice solution. + diff --git a/docs/en/Deployment/Index.md b/docs/en/Deployment/Index.md index 1ca688ca0f..849d3bd4f3 100644 --- a/docs/en/Deployment/Index.md +++ b/docs/en/Deployment/Index.md @@ -9,3 +9,4 @@ However, there are some topics that you should care about when you are deploying * [Configuring for Production](Configuring-Production.md): Notes for some essential configurations for production environments. * [Optimization for Production](Optimizing-Production.md): Tips and suggestions for optimizing your application on production environments. * [Deploying to a Clustered Environment](Clustered-Environment.md): Explains how to configure your application when you want to run multiple instances of your application concurrently. +* [Deploying Distributed / Microservice Solutions](Distributed-Microservice.md): Deployment notes for solutions consisting of multiple applications and/or services. diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index 7cce0c6bbb..8732428ecd 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -1311,6 +1311,10 @@ "text": "Deploying to a Clustered Environment", "path": "Deployment/Clustered-Environment.md" }, + { + "text": "Distributed / Microservice Solutions", + "path": "Distributed-Microservice.md" + }, { "text": "Optimizing for Production", "path": "Deployment/Optimizing-Production.md" From 928f34c13504c94055632522c0fa17500a1a2c52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 6 Dec 2022 16:33:17 +0300 Subject: [PATCH 4/4] Add Application Name & Instance Id to the Distributed-Microservice.md Also, reordered the items under the fundamentals menu item --- docs/en/Application-Startup.md | 3 + docs/en/Audit-Logging.md | 2 +- .../en/Deployment/Distributed-Microservice.md | 31 +++++++++ docs/en/docs-nav.json | 68 ++++++++++--------- 4 files changed, 71 insertions(+), 33 deletions(-) create mode 100644 docs/en/Application-Startup.md diff --git a/docs/en/Application-Startup.md b/docs/en/Application-Startup.md new file mode 100644 index 0000000000..6dd6df6a03 --- /dev/null +++ b/docs/en/Application-Startup.md @@ -0,0 +1,3 @@ +## ABP Application Startup + +TODO \ No newline at end of file diff --git a/docs/en/Audit-Logging.md b/docs/en/Audit-Logging.md index b3bc4335e1..92fc64ce40 100644 --- a/docs/en/Audit-Logging.md +++ b/docs/en/Audit-Logging.md @@ -42,7 +42,7 @@ Here, a list of the options you can configure: * `AlwaysLogOnException` (default: `true`): If you set to true, it always saves the audit log on an exception/error case without checking other options (except `IsEnabled`, which completely disables the audit logging). * `IsEnabledForGetRequests` (default: `false`): HTTP GET requests should not make any change in the database normally and audit log system doesn't save audit log objects for GET request. Set this to `true` to enable it also for the GET requests. * `DisableLogActionInfo` (default: `false`):If you set to true, Will no longer log `AuditLogActionInfo`. -* `ApplicationName`: If multiple applications saving audit logs into a single database, set this property to your application name, so you can distinguish the logs of different applications. +* `ApplicationName`: If multiple applications saving audit logs into a single database, set this property to your application name, so you can distinguish the logs of different applications. If you don't set, it is set from the `IApplicationInfoAccessor.ApplicationName` value, which is the entry assembly name by default. * `IgnoredTypes`: A list of `Type`s to be ignored for audit logging. If this is an entity type, changes for this type of entities will not be saved. This list is also used while serializing the action parameters. * `EntityHistorySelectors`: A list of selectors those are used to determine if an entity type is selected for saving the entity change. See the section below for details. * `Contributors`: A list of `AuditLogContributor` implementations. A contributor is a way of extending the audit log system. See the "Audit Log Contributors" section below. diff --git a/docs/en/Deployment/Distributed-Microservice.md b/docs/en/Deployment/Distributed-Microservice.md index fb2c4032e8..39c9e8b70d 100644 --- a/docs/en/Deployment/Distributed-Microservice.md +++ b/docs/en/Deployment/Distributed-Microservice.md @@ -2,3 +2,34 @@ The ABP Framework is designed to consider distributed and microservice systems, where you have multiple applications and/or services communicating internally. All of its features are compatible with distributed scenarios. This document highlights some points you should care when you deploy your distributed or microservice solution. +## Application Name & Instance Id + +ABP provides `IApplicationInfoAccessor` service that provides the following properties: + +* `ApplicationName`: A human-readable name for an application. It is a unique value for an application. +* `InstanceId`: A random (GUID) value generated by the ABP Framework each time you start the application. + +These values are used by the ABP Framework for several places to distinguish the application and the application instance (process) in the system. For example, [audit logging](../Audit-Logging.md) system saves the `ApplicationName` in each audit log record written by the related application, so you can understand which application has created the audit log entry. So, if your system consists of multiple applications saving audit logs to a single point, you should be sure that each application has a different `ApplicationName`. + +The `ApplicationName` property's value is set automatically from the **entry assembly's name** (generally, the project name in a .NET solution) by default, which is proper for most cases, since each application typically has a unique entry assembly name. + +There are two ways to set the application name to a different value. In this first approach, you can set the `ApplicationName` property in your application's [configuration](../Configuration.md). The easiest way is to add an `ApplicationName` field to your `appsettings.json` file: + +````json +{ + "ApplicationName": "Services.Ordering" +} +```` + +Alternatively, you can set `AbpApplicationCreationOptions.ApplicationName` while creating the ABP application. You can find the `AddApplication` or `AddApplicationAsync` call in your solution (typically in the `Program.cs` file), and set the `ApplicationName` option as shown below: + +````csharp +await builder.AddApplicationAsync(options => +{ + options.ApplicationName = "Services.Ordering"; +}); +```` + + + +s diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index 8732428ecd..7e748b3cbc 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -154,48 +154,38 @@ "text": "Fundamentals", "items": [ { - "text": "Dependency Injection", - "path": "Dependency-Injection.md", - "items": [ - { - "text": "AutoFac Integration", - "path": "Autofac-Integration.md" - } - ] - }, - { - "text": "Configuration", - "path": "Configuration.md" - }, - { - "text": "Options", - "path": "Options.md" + "text": "Application Startup", + "path": "Application-Startup.md" }, { "text": "Authorization", "path": "Authorization.md" }, { - "text": "Validation", - "path": "Validation.md", + "text": "Caching", + "path": "Caching.md", "items": [ { - "text": "FluentValidation Integration", - "path": "FluentValidation.md" + "text": "Redis Cache", + "path": "Redis-Cache.md" } ] }, { - "text": "Localization", - "path": "Localization.md" + "text": "Configuration", + "path": "Configuration.md" }, { - "text": "Caching", - "path": "Caching.md", + "text": "Connection Strings", + "path": "Connection-Strings.md" + }, + { + "text": "Dependency Injection", + "path": "Dependency-Injection.md", "items": [ { - "text": "Redis Cache", - "path": "Redis-Cache.md" + "text": "AutoFac Integration", + "path": "Autofac-Integration.md" } ] }, @@ -204,20 +194,34 @@ "path": "Exception-Handling.md" }, { - "text": "Settings", - "path": "Settings.md" + "text": "Localization", + "path": "Localization.md" }, { - "text": "Connection Strings", - "path": "Connection-Strings.md" + "text": "Logging", + "path": "Logging.md" }, { "text": "Object Extensions", "path": "Object-Extensions.md" }, { - "text": "Logging", - "path": "Logging.md" + "text": "Options", + "path": "Options.md" + }, + { + "text": "Settings", + "path": "Settings.md" + }, + { + "text": "Validation", + "path": "Validation.md", + "items": [ + { + "text": "FluentValidation Integration", + "path": "FluentValidation.md" + } + ] } ] },