mirror of https://github.com/abpframework/abp.git
1718 changed files with 35336 additions and 53307 deletions
@ -1,4 +1,4 @@ |
|||
## Domain Services Best Practices & Conventions |
|||
## Domain Services Best Practices & Conventions |
|||
|
|||
> **This document is not ready yet. Please see the [Domain Services](../Domain-Services.md) document.** |
|||
|
|||
|
|||
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 26 KiB |
@ -0,0 +1,88 @@ |
|||
# How to override localization strings of depending modules |
|||
|
|||
## Source Code |
|||
|
|||
You can find the source of the example solution used in this article [here](https://github.com/abpframework/abp-samples/tree/master/DocumentationSamples/ExtendLocalizationResource). |
|||
|
|||
## Getting Started |
|||
|
|||
This example is based on the following document |
|||
https://docs.abp.io/en/abp/latest/Localization#extending-existing-resource |
|||
|
|||
We will change the default `DisplayName:Abp.Timing.Timezone` and `Description:Abp.Timing.Timezone` of [`AbpTimingResource`](https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Timing/Volo/Abp/Timing/Localization/AbpTimingResource.cs) and add localized text in [Russian language(`ru`)](https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Timing/Volo/Abp/Timing/Localization/en.json). |
|||
|
|||
I created the `AbpTiming` folder in the `Localization` directory of the `ExtendLocalizationResource.Domain.Shared` project. |
|||
|
|||
Create `en.json` and `ru.json` in its directory. |
|||
|
|||
`en.json` |
|||
```json |
|||
{ |
|||
"culture": "en", |
|||
"texts": { |
|||
"DisplayName:Abp.Timing.Timezone": "My Time zone", |
|||
"Description:Abp.Timing.Timezone": "My Application time zone" |
|||
} |
|||
} |
|||
``` |
|||
|
|||
`ru.json` |
|||
```json |
|||
{ |
|||
"culture": "ru", |
|||
"texts": { |
|||
"DisplayName:Abp.Timing.Timezone": "Часовой пояс", |
|||
"Description:Abp.Timing.Timezone": "Часовой пояс приложения" |
|||
} |
|||
} |
|||
``` |
|||
|
|||
 |
|||
|
|||
We have below content in `ExtendLocalizationResource.Domain.Shared.csproj` file, See [Virtual-File-System](https://docs.abp.io/en/abp/latest/Virtual-File-System#working-with-the-embedded-files) understand how it works. |
|||
|
|||
```xml |
|||
<ItemGroup> |
|||
<EmbeddedResource Include="Localization\ExtendLocalizationResource\*.json" /> |
|||
<Content Remove="Localization\ExtendLocalizationResource\*.json" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="5.0.*" /> |
|||
</ItemGroup> |
|||
``` |
|||
|
|||
Change the code of the `ConfigureServices` method in `ExtendLocalizationResourceDomainSharedModule`. |
|||
|
|||
```cs |
|||
Configure<AbpLocalizationOptions>(options => |
|||
{ |
|||
options.Resources |
|||
.Add<ExtendLocalizationResourceResource>("en") |
|||
.AddBaseTypes(typeof(AbpValidationResource)) |
|||
.AddVirtualJson("/Localization/ExtendLocalizationResource"); |
|||
|
|||
//add following code |
|||
options.Resources |
|||
.Get<AbpTimingResource>() |
|||
.AddVirtualJson("/Localization/AbpTiming"); |
|||
|
|||
options.DefaultResourceType = typeof(ExtendLocalizationResourceResource); |
|||
}); |
|||
``` |
|||
|
|||
Execute `ExtendLocalizationResource.DbMigrator` to migrate the database and run `ExtendLocalizationResource.Web`. |
|||
|
|||
We have changed the English localization text and added Russian localization. |
|||
|
|||
### Index page |
|||
|
|||
```cs |
|||
<p>@AbpTimingResource["DisplayName:Abp.Timing.Timezone"]</p> |
|||
@using(CultureHelper.Use("ru")) |
|||
{ |
|||
<p>@AbpTimingResource["DisplayName:Abp.Timing.Timezone"]</p> |
|||
} |
|||
``` |
|||
|
|||
 |
|||
@ -1,3 +1,3 @@ |
|||
# Configuration |
|||
# Configuration |
|||
|
|||
ASP.NET Core has an flexible and extensible key-value based configuration system. In fact, the configuration system is a part of Microsoft.Extensions libraries and it is independent from ASP.NET Core. That means it can be used in any type of application. See [Microsoft's documentation](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/) to learn the configuration infrastructure. ABP framework is 100% compatible with the configuration system. |
|||
@ -1 +1 @@ |
|||
This document has been [moved to here](Testing.md). |
|||
This document has been [moved to here](Testing.md). |
|||
@ -1,3 +1,3 @@ |
|||
# JSON |
|||
# JSON |
|||
|
|||
TODO |
|||
@ -0,0 +1,101 @@ |
|||
# Angular UI v4.x to v5.0 Migration Guide |
|||
|
|||
## Breaking Changes |
|||
|
|||
### Overall |
|||
|
|||
See the overall list of breaking changes: |
|||
|
|||
- Bootstrap 5 implementation [#10067](https://github.com/abpframework/abp/issues/10067) |
|||
- Remove NGXS dependency & states [#9952](https://github.com/abpframework/abp/issues/9952) |
|||
- Install @angular/localize package to startup templates [#10099](https://github.com/abpframework/abp/issues/10099) |
|||
- Create new secondary entrypoints and move the related proxies to there [#10060](https://github.com/abpframework/abp/issues/10060) |
|||
- Move SettingTabsService to @abp/ng.setting-management/config package from @abp/ng.core [#10061](https://github.com/abpframework/abp/issues/10061) |
|||
- Make the @abp/ng.account dependent on @abp/ng.identity [#10059](https://github.com/abpframework/abp/issues/10059) |
|||
- Set default abp-modal size medium [#10118](https://github.com/abpframework/abp/issues/10118) |
|||
- Update all dependency versions to the latest [#9806](https://github.com/abpframework/abp/issues/9806) |
|||
- Chart.js big include with CommonJS warning [#7472](https://github.com/abpframework/abp/issues/7472) |
|||
|
|||
### Angular v12 |
|||
|
|||
The new ABP Angular UI is based on Angular v12. We started to compile Angular UI packages with the Ivy compilation. Therefore, **new packages only work with Angular v12**. If you are still on the older version of Angular v12, you have to update to Angular v12. The update is usually very easy. See [Angular Update Guide](https://update.angular.io/?l=2&v=11.0-12.0) for further information. |
|||
|
|||
### Bootstrap 5 |
|||
|
|||
TODO |
|||
|
|||
### NGXS has been removed |
|||
|
|||
We aim to make the ABP Framework free of any state-management solutions. ABP developers should be able to use the ABP Framework with any library/framework of their choice. So, we decided to remove NGXS from ABP packages. |
|||
|
|||
If you'd like to use NGXS after upgrading to v5.0, you have to install the NGXS to your project. The package can be installed with the following command: |
|||
|
|||
```bash |
|||
npm install @ngxs/store |
|||
|
|||
# or |
|||
|
|||
yarn add @ngxs/store |
|||
``` |
|||
|
|||
NGXS states and actions, some namespaces have been removed. See [this issue](https://github.com/abpframework/abp/issues/9952) for the details. |
|||
|
|||
If you don't want to use the NGXS, you should remove all NGXS related imports, injections, etc., from your project. |
|||
|
|||
### @angular/localize package |
|||
|
|||
[`@angular/localize`](https://angular.io/api/localize) dependency has been removed from `@abp/ng.core` package. The package must be installed in your app. Run the following command to install: |
|||
|
|||
```bash |
|||
npm install @angular/localize |
|||
|
|||
# or |
|||
|
|||
yarn add @angular/localize |
|||
``` |
|||
|
|||
> ABP Angular UI packages are not dependent on the `@angular/localize` package. However, some packages (like `@ng-bootstrap/ng-bootstrap`) depend on the package. Thus, this package needs to be installed in your project. |
|||
|
|||
### Proxy endpoints |
|||
|
|||
New endpoints named proxy have been created, related proxies have moved. |
|||
For example; before v5.0, `IdentityUserService` could be imported from `@abp/ng.identity`. As of v5.0, the service can be imported from `@abp/ng.identity/proxy`. See an example: |
|||
|
|||
```ts |
|||
import { IdentityUserService } from '@abp/ng.identity/proxy'; |
|||
|
|||
@Component({}) |
|||
export class YourComponent { |
|||
constructor(private identityUserService: IdentityUserService) {} |
|||
} |
|||
``` |
|||
|
|||
Following proxies have been affected: |
|||
|
|||
- `@abp/ng.account` to `@abp/ng.account.core/proxy` |
|||
- `@abp/ng.feature-management` to `@abp/ng.feature-management/proxy` |
|||
- `@abp/ng.identity` to `@abp/ng.identity/proxy` |
|||
- `@abp/ng.permission-management` to `@abp/ng.permission-management/proxy` |
|||
- `@abp/ng.tenant-management` to `@abp/ng.tenant-management/proxy` |
|||
- **ProfileService** is deleted from `@abp/ng.core`. Instead, you can import it from `@abp/ng.identity/proxy` |
|||
|
|||
### SettingTabsService |
|||
|
|||
**SettingTabsService** has moved from `@abp/ng.core` to `@abp/ng.setting-management/config`. |
|||
|
|||
### ChartComponent |
|||
|
|||
[`ChartComponent`](../UI/Angular/Chart-Component.md) has moved from `@abp/ng.theme.shared` to `@abp/ng.components/chart.js`. To use the component, you need to import the `ChartModule` to your module as follows: |
|||
|
|||
```ts |
|||
import { ChartModule } from '@abp/ng.components/chart.js'; |
|||
|
|||
@NgModule({ |
|||
imports: [ |
|||
ChartModule, |
|||
// ... |
|||
], |
|||
// ... |
|||
}) |
|||
export class YourFeatureModule {} |
|||
``` |
|||
@ -0,0 +1,51 @@ |
|||
# ABP Framework v4.x to v5.0 Migration Guide |
|||
|
|||
## IdentityUser |
|||
|
|||
`IsActive <bool>` property is added to the `IdentityUser`. This flag will be checked during the authentication of the users. See the related [PR](https://github.com/abpframework/abp/pull/10185). |
|||
**After the migration, set this property to `true` for the existing users: `UPDATE AbpUsers SET IsActive=1`** |
|||
|
|||
For EFCore you can set `defaultValue` to `true` in the migration class: |
|||
(This will add the column with `true` value for the existing records.) |
|||
|
|||
```cs |
|||
public partial class AddIsActiveToIdentityUser : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AddColumn<bool>( |
|||
name: "IsActive", |
|||
table: "AbpUsers", |
|||
type: "bit", |
|||
nullable: false, |
|||
defaultValue: true); // Default is false. |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropColumn( |
|||
name: "IsActive", |
|||
table: "AbpUsers"); |
|||
} |
|||
} |
|||
``` |
|||
|
|||
For document base databases like MongoDB, you need to manually update the `IsActive` field for the existing user records. |
|||
|
|||
## MongoDB |
|||
|
|||
ABP Framework will serialize the datetime based on [AbpClockOptions](https://docs.abp.io/en/abp/latest/Timing#clock-options) starting from ABP v5.0. It was saving `DateTime` values as UTC in MongoDB. Check out [MongoDB Datetime Serialization Options](https://mongodb.github.io/mongo-csharp-driver/2.13/reference/bson/mapping/#datetime-serialization-options). |
|||
|
|||
To revert back this feature, set `UseAbpClockHandleDateTime = false` in `AbpMongoDbOptions`: |
|||
|
|||
```cs |
|||
services.Configure<AbpMongoDbOptions>(x => x.UseAbpClockHandleDateTime = false); |
|||
``` |
|||
|
|||
## IApiScopeRepository |
|||
|
|||
`GetByNameAsync` method renamed as `FindByNameAsync`. |
|||
|
|||
## Angular UI |
|||
|
|||
See the [Angular UI 5.0 Migration Guide](Abp-5_0-Angular.md). |
|||
@ -1,7 +1,7 @@ |
|||
# ABP Framework Migration Guides |
|||
|
|||
* [4.2 to 4.3](Abp-4_3.md) |
|||
* [4.x to 4.2](Abp-4_2.md) |
|||
* [3.3.x to 4.0](Abp-4_0.md) |
|||
* [2.9.x to 3.0](../UI/Angular/Migration-Guide-v3.md) |
|||
|
|||
- [4.x to 5.0](Abp-5_0.md) |
|||
- [4.2 to 4.3](Abp-4_3.md) |
|||
- [4.x to 4.2](Abp-4_2.md) |
|||
- [3.3.x to 4.0](Abp-4_0.md) |
|||
- [2.9.x to 3.0](../UI/Angular/Migration-Guide-v3.md) |
|||
|
|||
@ -1,3 +1,3 @@ |
|||
# RabbitMQ |
|||
# RabbitMQ |
|||
|
|||
TODO! |
|||
@ -0,0 +1,249 @@ |
|||
# Chart Component |
|||
|
|||
ABP Chart component exposed by `@abp/ng.components/chart.js` is based on [`charts.js`](https://www.chartjs.org/) v3+. You don't need to install the `chart.js` package. Since the `@abp/ng.components` is dependent on the `chart.js`, the package is already installed in your project. |
|||
|
|||
> Chart component loads `chart.js` script lazy. So it does not increase the bundle size. |
|||
|
|||
## How to Use |
|||
|
|||
First of all, need to import the `ChartModule` to your feature module as follows: |
|||
|
|||
```ts |
|||
// your-feature.module.ts |
|||
|
|||
import { ChartModule } from '@abp/ng.components/chart.js'; |
|||
import { ChartDemoComponent } from './chart-demo.component'; |
|||
|
|||
@NgModule({ |
|||
imports: [ |
|||
ChartModule, |
|||
// ... |
|||
], |
|||
declarations: [ChartDemoComponent], |
|||
// ... |
|||
}) |
|||
export class YourFeatureModule {} |
|||
``` |
|||
|
|||
Then, `abp-chart` component can be used. See an example: |
|||
|
|||
```ts |
|||
// chart-demo.component.ts |
|||
|
|||
import { Component } from '@angular/core'; |
|||
|
|||
@Component({ |
|||
selector: 'app-chart-demo', |
|||
template: ` <abp-chart type="pie" [data]="data"></abp-chart> `, |
|||
}) |
|||
export class ChartDemoComponent { |
|||
data = { |
|||
labels: ['Data 1', 'Data 2', 'Data 3'], |
|||
datasets: [ |
|||
{ |
|||
label: 'Dataset 1', |
|||
data: [40, 15, 45], |
|||
backgroundColor: ['#ff7675', '#fdcb6e', '#0984e3'], |
|||
}, |
|||
], |
|||
}; |
|||
} |
|||
``` |
|||
|
|||
> **Important Note**: Changing the chart data without creating a new data instance does not trigger change detection. In order to chart to redraw itself, a new data object needs to be created. |
|||
|
|||
See the result: |
|||
|
|||
 |
|||
|
|||
## Examples |
|||
|
|||
### Doughnut |
|||
|
|||
```ts |
|||
import { Component } from '@angular/core'; |
|||
|
|||
@Component({ |
|||
selector: 'app-chart-demo', |
|||
template: ` |
|||
<abp-chart |
|||
type="doughnut" |
|||
[data]="data" |
|||
[options]="options" |
|||
width="400px" |
|||
height="400px" |
|||
></abp-chart> |
|||
`, |
|||
}) |
|||
export class ChartDemoComponent { |
|||
data = { |
|||
labels: ['Data 1', 'Data 2', 'Data 3'], |
|||
datasets: [ |
|||
{ |
|||
label: 'Dataset 1', |
|||
data: [40, 15, 45], |
|||
backgroundColor: ['#a0e6c3', '#f0ea4c', '#5b9dc3'], |
|||
}, |
|||
], |
|||
}; |
|||
|
|||
options = { |
|||
plugins: { |
|||
title: { |
|||
display: true, |
|||
text: 'Doughnut Chart', |
|||
fontSize: 16, |
|||
}, |
|||
legend: { |
|||
position: 'bottom', |
|||
}, |
|||
}, |
|||
}; |
|||
} |
|||
``` |
|||
|
|||
Result: |
|||
|
|||
 |
|||
|
|||
### Bar |
|||
|
|||
```ts |
|||
import { Component } from '@angular/core'; |
|||
|
|||
@Component({ |
|||
selector: 'app-chart-demo', |
|||
template: ` |
|||
<abp-chart |
|||
type="bar" |
|||
[data]="data" |
|||
width="400px" |
|||
height="400px" |
|||
></abp-chart> |
|||
`, |
|||
}) |
|||
export class ChartDemoComponent { |
|||
data = { |
|||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], |
|||
datasets: [ |
|||
{ |
|||
label: 'First dataset', |
|||
backgroundColor: '#42A5F5', |
|||
data: [65, 59, 80, 81, 56, 55, 40], |
|||
}, |
|||
{ |
|||
label: 'Second dataset', |
|||
backgroundColor: '#FFA726', |
|||
data: [28, 48, 40, 19, 86, 27, 90], |
|||
}, |
|||
], |
|||
}; |
|||
} |
|||
``` |
|||
|
|||
Result: |
|||
|
|||
 |
|||
|
|||
### Radar |
|||
|
|||
```ts |
|||
import { Component } from '@angular/core'; |
|||
|
|||
@Component({ |
|||
selector: 'app-chart-demo', |
|||
template: ` |
|||
<abp-chart |
|||
type="radar" |
|||
[data]="data" |
|||
width="400px" |
|||
height="400px" |
|||
></abp-chart> |
|||
|
|||
<button class="btn btn-primary-outline mt-4" (click)="addDataset()"> |
|||
Add dataset |
|||
</button> |
|||
`, |
|||
}) |
|||
export class ChartDemoComponent { |
|||
data = { |
|||
labels: [ |
|||
'January', |
|||
'February', |
|||
'March', |
|||
'April', |
|||
'May', |
|||
'June', |
|||
'July', |
|||
'August', |
|||
'September', |
|||
'October', |
|||
'November', |
|||
'December', |
|||
], |
|||
datasets: [ |
|||
{ |
|||
label: 'Dataset 1', |
|||
backgroundColor: 'rgba(179,181,198,0.2)', |
|||
borderColor: 'rgba(179,181,198,1)', |
|||
data: [65, 59, 90, 81, 56, 55, 40, 35, 82, 51, 62, 95], |
|||
}, |
|||
{ |
|||
label: 'Dataset 2', |
|||
backgroundColor: 'rgba(255,99,132,0.2)', |
|||
borderColor: 'rgba(255,99,132,1)', |
|||
data: [28, 48, 40, 58, 96, 27, 100, 44, 85, 77, 71, 39], |
|||
}, |
|||
], |
|||
}; |
|||
|
|||
addDataset() { |
|||
this.data = { |
|||
...this.data, |
|||
datasets: [ |
|||
...this.data.datasets, |
|||
{ |
|||
label: 'Dataset 3', |
|||
backgroundColor: 'rgba(54,162,235,0.2)', |
|||
borderColor: 'rgba(54, 162, 235, 1)', |
|||
data: [90, 95, 98, 91, 99, 96, 89, 95, 98, 93, 92, 90], |
|||
}, |
|||
], |
|||
}; |
|||
} |
|||
} |
|||
``` |
|||
|
|||
Result: |
|||
|
|||
 |
|||
|
|||
See the [`chart.js` samples](https://www.chartjs.org/docs/latest/samples) for more examples. |
|||
|
|||
## API |
|||
|
|||
### `abp-chart` |
|||
|
|||
#### Properties |
|||
|
|||
| Name | Description | Type | Default | |
|||
| --------------- | ---------------------------------------------------------------- | ----------------------- | ------- | |
|||
| `[type]` | Type of the chart. | `string` | null | |
|||
| `[data]` | Chart data to display | `any` | null | |
|||
| `[options]` | Chart options to customize | `any` | null | |
|||
| `[plugins]` | Chart plugins to customize behaviour | `any` | null | |
|||
| `[width]` | Witdh of the chart | `string` | null | |
|||
| `[height]` | Height of the chart | `string` | null | |
|||
| `[responsive]` | Whether the chart is responsive | `boolean` | true | |
|||
| `(dataSelect)` | A callback that executes when an element on the chart is clicked | `EventEmitter<any>` | - | |
|||
| `(initialized)` | A callback that executes when the chart is initialized | `EventEmitter<boolean>` | - | |
|||
|
|||
#### Methods |
|||
|
|||
| Name | Description | Parameters | |
|||
| ---------------- | ------------------------------------------------------------------- | ---------- | |
|||
| `refresh` | Redraws the chart | - | |
|||
| `reinit` | Destroys the chart then creates it again | - | |
|||
| `getBase64Image` | Returns a base 64 encoded string of the chart in it's current state | - | |
|||
| `generateLegend` | Returns an HTML string of a legend for the chart | - | |
|||
| `getCanvas` | Returns the canvas HTML element | - | |
|||
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 3.2 MiB |
@ -1,3 +1,3 @@ |
|||
# Audit Logging |
|||
# Audit Logging |
|||
|
|||
Façam |
|||
@ -1,3 +1,3 @@ |
|||
# ABP Documentation |
|||
# ABP Documentation |
|||
|
|||
Façam! |
|||
@ -1,3 +1,3 @@ |
|||
# Emailing |
|||
# Emailing |
|||
|
|||
Façam! |
|||
@ -1,3 +1,3 @@ |
|||
# Integration Tests |
|||
# Integration Tests |
|||
|
|||
Façam! |
|||
@ -1,3 +1,3 @@ |
|||
# Emailing |
|||
# Emailing |
|||
|
|||
Façam! |
|||
@ -1,3 +1,3 @@ |
|||
# Settings |
|||
# Settings |
|||
|
|||
Façam! |
|||
@ -1,3 +1,3 @@ |
|||
# Specifications |
|||
# Specifications |
|||
|
|||
Façam! |
|||
@ -1,3 +1,3 @@ |
|||
# Testing |
|||
# Testing |
|||
|
|||
Façam! |
|||
@ -1,3 +1,3 @@ |
|||
## 领域服务最佳实践 & 约定 |
|||
## 领域服务最佳实践 & 约定 |
|||
|
|||
TODO |
|||
@ -1,3 +1,3 @@ |
|||
# ABP Documentation |
|||
# ABP Documentation |
|||
|
|||
待添加 |
|||
|
|||
@ -1,3 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -1,3 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue