Browse Source

Merge remote-tracking branch 'abpframework/dev' into docs

pull/4317/head
liangshiwei 6 years ago
parent
commit
7c621f35a2
  1. 110
      docs/en/Guid-Generation.md
  2. 18
      docs/en/docs-nav.json
  3. 4
      framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs
  4. 4
      framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs
  5. 2
      framework/src/Volo.Abp.RabbitMQ/Volo.Abp.RabbitMQ.csproj
  6. 92
      npm/ng-packs/angular.json
  7. 4
      npm/ng-packs/apps/dev-app/src/polyfills.ts
  8. 34
      npm/ng-packs/apps/dev-app/tsconfig.prod.json
  9. 8
      npm/ng-packs/jest.config.js
  10. 61
      npm/ng-packs/package.json
  11. 2
      npm/ng-packs/packages/account-config/ng-package.json
  12. 2
      npm/ng-packs/packages/account-config/src/lib/account-config.module.ts
  13. 4
      npm/ng-packs/packages/account-config/tsconfig.lib.json
  14. 6
      npm/ng-packs/packages/account-config/tsconfig.lib.prod.json
  15. 4
      npm/ng-packs/packages/account/tsconfig.lib.json
  16. 6
      npm/ng-packs/packages/account/tsconfig.lib.prod.json
  17. 4
      npm/ng-packs/packages/core/package.json
  18. 2
      npm/ng-packs/packages/core/src/lib/directives/index.ts
  19. 2
      npm/ng-packs/packages/core/src/lib/states/profile.state.ts
  20. 2
      npm/ng-packs/packages/core/src/lib/states/replaceable-components.state.ts
  21. 10
      npm/ng-packs/packages/core/src/lib/tests/permission.directive.spec.ts
  22. 12
      npm/ng-packs/packages/core/src/lib/tests/visibility.directive.spec.ts
  23. 3
      npm/ng-packs/packages/core/src/public-api.ts
  24. 4
      npm/ng-packs/packages/core/tsconfig.lib.json
  25. 6
      npm/ng-packs/packages/core/tsconfig.lib.prod.json
  26. 4
      npm/ng-packs/packages/feature-management/tsconfig.lib.json
  27. 6
      npm/ng-packs/packages/feature-management/tsconfig.lib.prod.json
  28. 4
      npm/ng-packs/packages/identity-config/tsconfig.lib.json
  29. 6
      npm/ng-packs/packages/identity-config/tsconfig.lib.prod.json
  30. 6
      npm/ng-packs/packages/identity/ng-package.json
  31. 23
      npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts
  32. 1
      npm/ng-packs/packages/identity/src/lib/identity.module.ts
  33. 4
      npm/ng-packs/packages/identity/tsconfig.lib.json
  34. 6
      npm/ng-packs/packages/identity/tsconfig.lib.prod.json
  35. 4
      npm/ng-packs/packages/permission-management/tsconfig.lib.json
  36. 6
      npm/ng-packs/packages/permission-management/tsconfig.lib.prod.json
  37. 2
      npm/ng-packs/packages/setting-management-config/ng-package.json
  38. 4
      npm/ng-packs/packages/setting-management-config/tsconfig.lib.json
  39. 6
      npm/ng-packs/packages/setting-management-config/tsconfig.lib.prod.json
  40. 1
      npm/ng-packs/packages/setting-management/src/lib/setting-management.module.ts
  41. 4
      npm/ng-packs/packages/setting-management/tsconfig.lib.json
  42. 6
      npm/ng-packs/packages/setting-management/tsconfig.lib.prod.json
  43. 2
      npm/ng-packs/packages/tenant-management-config/ng-package.json
  44. 4
      npm/ng-packs/packages/tenant-management-config/tsconfig.lib.json
  45. 6
      npm/ng-packs/packages/tenant-management-config/tsconfig.lib.prod.json
  46. 18
      npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.ts
  47. 1
      npm/ng-packs/packages/tenant-management/src/lib/tenant-management.module.ts
  48. 4
      npm/ng-packs/packages/tenant-management/tsconfig.lib.json
  49. 6
      npm/ng-packs/packages/tenant-management/tsconfig.lib.prod.json
  50. 4
      npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html
  51. 2
      npm/ng-packs/packages/theme-basic/src/lib/states/layout.state.ts
  52. 8
      npm/ng-packs/packages/theme-basic/src/lib/theme-basic.module.ts
  53. 4
      npm/ng-packs/packages/theme-basic/tsconfig.lib.json
  54. 6
      npm/ng-packs/packages/theme-basic/tsconfig.lib.prod.json
  55. 8
      npm/ng-packs/packages/theme-shared/package.json
  56. 1
      npm/ng-packs/packages/theme-shared/src/lib/components/index.ts
  57. 6
      npm/ng-packs/packages/theme-shared/src/lib/components/modal/modal.component.ts
  58. 2
      npm/ng-packs/packages/theme-shared/src/lib/components/table/table.component.ts
  59. 4
      npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts
  60. 4
      npm/ng-packs/packages/theme-shared/tsconfig.lib.json
  61. 6
      npm/ng-packs/packages/theme-shared/tsconfig.lib.prod.json
  62. 3
      npm/ng-packs/scripts/build.ts
  63. 7
      npm/ng-packs/scripts/install-new-dependencies.ts
  64. 1
      npm/ng-packs/scripts/package.json
  65. 29
      npm/ng-packs/scripts/post-install.ts
  66. 1275
      npm/ng-packs/scripts/yarn.lock
  67. 11
      npm/ng-packs/source-code-requirements/tsconfig.lib.json
  68. 1
      npm/ng-packs/test-setup.ts
  69. 5613
      npm/ng-packs/yarn.lock

110
docs/en/Guid-Generation.md

@ -1,3 +1,109 @@
## Guid Generation
# GUID Generation
TODO
GUID is a common **primary key type** that is used in database management systems. ABP Framework prefers GUID as the primary for pre-built [application modules](Modules/Index.md). Also, `ICurrentUser.Id` property ([see](CurrentUser.md)) is type of GUID, that means the ABP Framework assumes that the User Id is always GUID.
## Why Prefer GUID?
GUID has advantages and disadvantages. You can find many articles on the web related to this topic, so we will not discuss all again, but will list the most fundamental advantages:
* It is **usable** in all database providers.
* It allows to **determine the primary key** on the client side, without needing a **database round trip** to generate the Id value. This can be more performant while inserting new records to the database and allows us to know the PK before interacting to the database.
* GUIDs are **naturally unique** which has some advantages in the following situations if;
* You need to integrate to **external** systems.
* You need to **split or merge** different tables.
* You are creating **distributed systems**.
* GUIDs are impossible to guess, so they can be **more secure** compared to auto-increment Id values in some cases.
While there are some disadvantages (just search it on the web), we found these advantages much more important while designing the ABP Framework.
## IGuidGenerator
The most important problem with GUID is that it is **not sequential by default**. When you use the GUID as the primary key and set it as the **clustered index** (which is default) for your table, it brings a significant **performance problem on insert** (because inserting new record may need to re-order the existing records).
So, **never use `Guid.NewGuid()` to create Ids** for your entities!
One good solution to this problem is to generate **sequential GUIDs**, which is provided by the ABP Framework out of the box. `IGuidGenerator` service creates sequential GUIDs (implemented by the `SequentialGuidGenerator` by default). Use `IGuidGenerator.Create()` when you need to manually set Id of an [entity](Entities.md).
**Example: An entity with GUID primary key and creating the entity**
Assume that you've a `Product` [entity](Entities.md) that has a `Guid` key:
````csharp
using System;
using Volo.Abp.Domain.Entities;
namespace AbpDemo
{
public class Product : AggregateRoot<Guid>
{
public string Name { get; set; }
private Product() { /* This constructor is used by the ORM/database provider */ }
public Product(Guid id, string name)
: base(id)
{
Name = name;
}
}
}
````
And you want to create a new product:
````csharp
using System;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Guids;
namespace AbpDemo
{
public class MyProductService : ITransientDependency
{
private readonly IRepository<Product, Guid> _productRepository;
private readonly IGuidGenerator _guidGenerator;
public MyProductService(
IRepository<Product, Guid> productRepository,
IGuidGenerator guidGenerator)
{
_productRepository = productRepository;
_guidGenerator = guidGenerator;
}
public async Task CreateAsync(string productName)
{
var product = new Product(_guidGenerator.Create(), productName);
await _productRepository.InsertAsync(product);
}
}
}
````
This service injects the `IGuidGenerator` in the constructor. If your class is an [application service](Application-Services.md) or deriving from one of the other base classes, you can directly use the `GuidGenerator` base property which is a pre-injected `IGuidGenerator` instance.
## Options
### AbpSequentialGuidGeneratorOptions
`AbpSequentialGuidGeneratorOptions` is the [option class](Options.md) that is used to configure the sequential GUID generation. It has a single property:
* `DefaultSequentialGuidType` (`enum` of type `SequentialGuidType`): The strategy used while generating GUID values.
Database providers behaves differently while processing GUIDs, so you should set it based on your database provider. `SequentialGuidType` has the following `enum` members:
* `SequentialAtEnd` (**default**) works well with the [SQL Server](Entity-Framework-Core.md).
* `SequentialAsString` is used by [MySQL](Entity-Framework-Core-MySQL.md) and [PostgreSQL](Entity-Framework-Core-PostgreSQL.md).
* `SequentialAsBinary` is used by [Oracle](Entity-Framework-Core-Oracle.md).
Configure this option in the `ConfigureServices` method of your [module](Module-Development-Basics.md), as shown below:
````csharp
Configure<AbpSequentialGuidGeneratorOptions>(options =>
{
options.DefaultSequentialGuidType = SequentialGuidType.SequentialAsBinary;
});
````

18
docs/en/docs-nav.json

@ -214,22 +214,8 @@
"path": "Text-Templating.md"
},
{
"text": "Object Serialization"
},
{
"text": "JSON Serialization"
},
{
"text": "Emailing"
},
{
"text": "GUIDs"
},
{
"text": "Threading"
},
{
"text": "Timing"
"text": "GUID Generation",
"path": "Guid-Generation.md"
}
]
},

4
framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs

@ -181,7 +181,7 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
var context = new JobExecutionContext(
scope.ServiceProvider,
JobConfiguration.JobType,
Serializer.Deserialize(ea.Body, typeof(TArgs))
Serializer.Deserialize(ea.Body.ToArray(), typeof(TArgs))
);
try
@ -210,4 +210,4 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
}
}
}
}
}

4
framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs

@ -83,7 +83,7 @@ namespace Volo.Abp.EventBus.RabbitMq
return;
}
var eventData = Serializer.Deserialize(ea.Body, eventType);
var eventData = Serializer.Deserialize(ea.Body.ToArray(), eventType);
await TriggerHandlersAsync(eventType, eventData);
}
@ -237,4 +237,4 @@ namespace Volo.Abp.EventBus.RabbitMq
return false;
}
}
}
}

2
framework/src/Volo.Abp.RabbitMQ/Volo.Abp.RabbitMQ.csproj

@ -15,7 +15,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="RabbitMQ.Client" Version="5.1.2" />
<PackageReference Include="RabbitMQ.Client" Version="6.1.0" />
<ProjectReference Include="..\Volo.Abp.Json\Volo.Abp.Json.csproj" />
<ProjectReference Include="..\Volo.Abp.Threading\Volo.Abp.Threading.csproj" />
</ItemGroup>

92
npm/ng-packs/angular.json

@ -14,6 +14,11 @@
"options": {
"tsConfig": "packages/core/tsconfig.lib.json",
"project": "packages/core/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "packages/core/tsconfig.lib.prod.json"
}
}
},
"test": {
@ -43,6 +48,11 @@
"options": {
"tsConfig": "packages/theme-shared/tsconfig.lib.json",
"project": "packages/theme-shared/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "packages/theme-shared/tsconfig.lib.prod.json"
}
}
},
"test": {
@ -64,7 +74,6 @@
}
}
},
"theme-basic": {
"projectType": "library",
"root": "packages/theme-basic",
@ -76,6 +85,11 @@
"options": {
"tsConfig": "packages/theme-basic/tsconfig.lib.json",
"project": "packages/theme-basic/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "packages/theme-basic/tsconfig.lib.prod.json"
}
}
},
"test": {
@ -108,6 +122,11 @@
"options": {
"tsConfig": "packages/account/tsconfig.lib.json",
"project": "packages/account/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "packages/account/tsconfig.lib.prod.json"
}
}
},
"test": {
@ -140,6 +159,11 @@
"options": {
"tsConfig": "packages/permission-management/tsconfig.lib.json",
"project": "packages/permission-management/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "packages/permission-management/tsconfig.lib.prod.json"
}
}
},
"test": {
@ -155,8 +179,7 @@
"tsConfig": [
"packages/permission-management/tsconfig.lib.json",
"packages/permission-management/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**"]
]
}
}
}
@ -172,6 +195,11 @@
"options": {
"tsConfig": "packages/identity/tsconfig.lib.json",
"project": "packages/identity/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "packages/identity/tsconfig.lib.prod.json"
}
}
},
"test": {
@ -204,6 +232,11 @@
"options": {
"tsConfig": "packages/feature-management/tsconfig.lib.json",
"project": "packages/feature-management/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "packages/feature-management/tsconfig.lib.prod.json"
}
}
},
"test": {
@ -219,8 +252,7 @@
"tsConfig": [
"packages/feature-management/tsconfig.lib.json",
"packages/feature-management/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**"]
]
}
}
}
@ -236,6 +268,11 @@
"options": {
"tsConfig": "packages/tenant-management/tsconfig.lib.json",
"project": "packages/tenant-management/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "packages/tenant-management/tsconfig.lib.prod.json"
}
}
},
"test": {
@ -251,8 +288,7 @@
"tsConfig": [
"packages/tenant-management/tsconfig.lib.json",
"packages/tenant-management/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**"]
]
}
}
}
@ -268,6 +304,11 @@
"options": {
"tsConfig": "packages/setting-management/tsconfig.lib.json",
"project": "packages/setting-management/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "packages/setting-management/tsconfig.lib.prod.json"
}
}
},
"test": {
@ -283,8 +324,7 @@
"tsConfig": [
"packages/setting-management/tsconfig.lib.json",
"packages/setting-management/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**"]
]
}
}
}
@ -300,6 +340,11 @@
"options": {
"tsConfig": "packages/setting-management-config/tsconfig.lib.json",
"project": "packages/setting-management-config/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "packages/setting-management-config/tsconfig.lib.prod.json"
}
}
},
"test": {
@ -315,8 +360,7 @@
"tsConfig": [
"packages/setting-management-config/tsconfig.lib.json",
"packages/setting-management-config/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**"]
]
}
}
}
@ -332,6 +376,11 @@
"options": {
"tsConfig": "packages/identity-config/tsconfig.lib.json",
"project": "packages/identity-config/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "packages/identity-config/tsconfig.lib.prod.json"
}
}
},
"test": {
@ -364,6 +413,11 @@
"options": {
"tsConfig": "packages/account-config/tsconfig.lib.json",
"project": "packages/account-config/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "packages/account-config/tsconfig.lib.prod.json"
}
}
},
"test": {
@ -396,6 +450,11 @@
"options": {
"tsConfig": "packages/tenant-management-config/tsconfig.lib.json",
"project": "packages/tenant-management-config/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "packages/tenant-management-config/tsconfig.lib.prod.json"
}
}
},
"test": {
@ -411,8 +470,7 @@
"tsConfig": [
"packages/tenant-management-config/tsconfig.lib.json",
"packages/tenant-management-config/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**"]
]
}
}
}
@ -436,9 +494,9 @@
"main": "apps/dev-app/src/main.ts",
"polyfills": "apps/dev-app/src/polyfills.ts",
"tsConfig": "apps/dev-app/tsconfig.prod.json",
"aot": false,
"assets": ["apps/dev-app/src/favicon.ico", "apps/dev-app/src/assets"],
"aot": true,
"extractCss": true,
"assets": ["apps/dev-app/src/favicon.ico", "apps/dev-app/src/assets"],
"styles": [
{
"input": "node_modules/@abp/ng.theme.shared/styles/bootstrap-rtl.min.css",
@ -477,7 +535,6 @@
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
@ -539,5 +596,8 @@
}
}
},
"cli": {
"analytics": false
},
"defaultProject": "dev-app"
}

4
npm/ng-packs/apps/dev-app/src/polyfills.ts

@ -1,3 +1,7 @@
/***************************************************************************************************
* Load `$localize` onto the global scope - used if i18n tags appear in Angular templates.
*/
import '@angular/localize/init';
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.

34
npm/ng-packs/apps/dev-app/tsconfig.prod.json

@ -3,34 +3,12 @@
"compilerOptions": {
"outDir": "../../out-tsc/app",
"types": [],
"paths": {
"@abp/ng.core": ["packages/core/src/public-api.ts"],
"@abp/ng.core/*": ["packages/core/src/lib/*"],
"@abp/ng.theme.shared": ["packages/theme-shared/src/public-api.ts"],
"@abp/ng.theme.shared/*": ["packages/theme-shared/src/lib/*"],
"@abp/ng.theme.basic": ["packages/theme-basic/src/public-api.ts"],
"@abp/ng.theme.basic/*": ["packages/theme-basic/src/lib/*"],
"@abp/ng.account": ["packages/account/src/public-api.ts"],
"@abp/ng.account/*": ["packages/account/src/lib/*"],
"@abp/ng.account.config": ["packages/account-config/src/public-api.ts"],
"@abp/ng.account.config/*": ["packages/account-config/src/lib/*"],
"@abp/ng.identity": ["packages/identity/src/public-api.ts"],
"@abp/ng.identity/*": ["packages/identity/src/lib/*"],
"@abp/ng.identity.config": ["packages/identity-config/src/public-api.ts"],
"@abp/ng.identity.config/*": ["packages/identity-config/src/lib/*"],
"@abp/ng.tenant-management": ["packages/tenant-management/src/public-api.ts"],
"@abp/ng.tenant-management/*": ["packages/tenant-management/src/lib/*"],
"@abp/ng.tenant-management.config": ["packages/tenant-management-config/src/public-api.ts"],
"@abp/ng.tenant-management.config/*": ["packages/tenant-management-config/src/lib/*"],
"@abp/ng.setting-management": ["packages/setting-management/src/public-api.ts"],
"@abp/ng.setting-management/*": ["packages/setting-management/src/lib/*"],
"@abp/ng.setting-management.config": ["packages/setting-management-config/src/public-api.ts"],
"@abp/ng.setting-management.config/*": ["packages/setting-management-config/src/lib/*"],
"@abp/ng.permission-management": ["packages/permission-management/src/public-api.ts"],
"@abp/ng.permission-management/*": ["packages/permission-management/src/lib/*"],
"@abp/ng.feature-management": ["packages/feature-management/src/public-api.ts"],
"@abp/ng.feature-management/*": ["packages/feature-management/src/lib/*"]
}
"paths": {}
},
"angularCompilerOptions": {
"enableIvy": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
},
"files": ["src/main.ts", "src/polyfills.ts"],
"include": ["src/**/*.ts"],

8
npm/ng-packs/jest.config.js

@ -12,8 +12,8 @@ module.exports = {
coverageReporters: ['html'],
preset: 'jest-preset-angular',
setupFilesAfterEnv: ['<rootDir>/test-setup.ts', 'jest-canvas-mock'],
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
],
// snapshotSerializers: [
// 'jest-preset-angular/AngularSnapshotSerializer.js',
// 'jest-preset-angular/HTMLCommentSerializer.js',
// ],
};

61
npm/ng-packs/package.json

@ -19,6 +19,7 @@
"ci:test": "ng test --coverage=false",
"ci:build": "cd scripts && yarn build:prod",
"lerna": "lerna",
"postinstall": "cd scripts && npm install && npm run post-install",
"generate:changelog": "conventional-changelog -p angular -i CHANGELOG.md -s"
},
"devDependencies": {
@ -36,42 +37,42 @@
"@abp/ng.theme.basic": "~2.9.0",
"@abp/ng.theme.shared": "~2.9.0",
"@abp/utils": "^2.9.0",
"@angular-builders/jest": "^8.2.0",
"@angular-devkit/build-angular": "~0.803.21",
"@angular-devkit/build-ng-packagr": "~0.803.21",
"@angular/animations": "~8.2.14",
"@angular/cli": "~8.3.21",
"@angular/common": "~8.2.14",
"@angular/compiler": "~8.2.14",
"@angular/compiler-cli": "~8.2.14",
"@angular/core": "~8.2.14",
"@angular/forms": "~8.2.14",
"@angular/language-service": "~8.2.14",
"@angular/localize": "~9.1.0",
"@angular/platform-browser": "~8.2.14",
"@angular/platform-browser-dynamic": "~8.2.14",
"@angular/router": "~8.2.14",
"@fortawesome/fontawesome-free": "^5.12.1",
"@ng-bootstrap/ng-bootstrap": "^5.3.0",
"@angular-builders/jest": "^9.0.1",
"@angular-devkit/build-angular": "~0.901.7",
"@angular-devkit/build-ng-packagr": "~0.901.7",
"@angular/animations": "~9.1.9",
"@angular/cli": "~9.1.7",
"@angular/common": "~9.1.9",
"@angular/compiler": "~9.1.9",
"@angular/compiler-cli": "~9.1.9",
"@angular/core": "~9.1.9",
"@angular/forms": "~9.1.9",
"@angular/language-service": "~9.1.9",
"@angular/localize": "~9.1.9",
"@angular/platform-browser": "~9.1.9",
"@angular/platform-browser-dynamic": "~9.1.9",
"@angular/router": "~9.1.9",
"@fortawesome/fontawesome-free": "^5.13.0",
"@ng-bootstrap/ng-bootstrap": "^6.1.0",
"@ngneat/spectator": "^4.5.0",
"@ngx-validate/core": "^0.0.7",
"@ngxs/devtools-plugin": "^3.5.1",
"@ngxs/logger-plugin": "^3.5.1",
"@ngx-validate/core": "^0.0.8",
"@ngxs/devtools-plugin": "^3.6.2",
"@ngxs/logger-plugin": "^3.6.2",
"@ngxs/router-plugin": "^3.6.2",
"@ngxs/storage-plugin": "^3.6.2",
"@ngxs/store": "^3.6.2",
"@types/jest": "^24.0.18",
"@types/node": "~8.9.4",
"@types/jest": "^25.2.3",
"@types/node": "^12.11.1",
"angular-oauth2-oidc": "^8.0.4",
"bootstrap": "^4.4.1",
"bootstrap": "^4.5.0",
"chart.js": "^2.9.3",
"codelyzer": "^5.1.2",
"conventional-changelog-cli": "^2.0.31",
"cz-conventional-changelog": "3.0.2",
"font-awesome": "^4.7.0",
"jest": "^24.9.0",
"jest-canvas-mock": "^2.1.2",
"jest-preset-angular": "^7.1.1",
"jest": "^25.0.0",
"jest-canvas-mock": "^2.2.0",
"jest-preset-angular": "^8.2.0",
"just-clone": "^3.1.0",
"just-compare": "^1.3.0",
"lerna": "^3.19.0",
@ -80,15 +81,15 @@
"ngxs-schematic": "^1.1.9",
"prettier": "^1.18.2",
"protractor": "~5.4.0",
"rxjs": "~6.4.0",
"rxjs": "~6.5.4",
"snq": "^1.0.3",
"symlink-manager": "^1.4.3",
"symlink-manager": "^1.5.0",
"ts-node": "~7.0.0",
"ts-toolbelt": "^6.3.6",
"tsickle": "^0.37.0",
"tslint": "~5.20.0",
"typescript": "~3.5.3",
"zone.js": "~0.9.1"
"typescript": "~3.8.0",
"zone.js": "~0.10.2"
},
"dependencies": {
"tslib": "^1.10.0"

2
npm/ng-packs/packages/account-config/ng-package.json

@ -4,4 +4,4 @@
"lib": {
"entryFile": "src/public-api.ts"
}
}
}

2
npm/ng-packs/packages/account-config/src/lib/account-config.module.ts

@ -21,7 +21,7 @@ export const ACCOUNT_OPTIONS = new InjectionToken('ACCOUNT_OPTIONS');
providers: [{ provide: APP_INITIALIZER, multi: true, deps: [AccountConfigService], useFactory: noop }],
})
export class AccountConfigModule {
static forRoot(options = {} as AccountConfigOptions): ModuleWithProviders {
static forRoot(options = {} as AccountConfigOptions): ModuleWithProviders<AccountConfigModule> {
return {
ngModule: AccountConfigModule,
providers: [

4
npm/ng-packs/packages/account-config/tsconfig.lib.json

@ -9,13 +9,11 @@
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true,
"enableIvy": false
"enableResourceInlining": true
},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}

6
npm/ng-packs/packages/account-config/tsconfig.lib.prod.json

@ -0,0 +1,6 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}

4
npm/ng-packs/packages/account/tsconfig.lib.json

@ -9,13 +9,11 @@
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true,
"enableIvy": false
"enableResourceInlining": true
},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}

6
npm/ng-packs/packages/account/tsconfig.lib.prod.json

@ -0,0 +1,6 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}

4
npm/ng-packs/packages/core/package.json

@ -7,8 +7,8 @@
"url": "https://github.com/abpframework/abp.git"
},
"dependencies": {
"@abp/utils": "^2.7.0",
"@angular/localize": "~9.1.0",
"@abp/utils": "^2.9.0",
"@angular/localize": "~9.1.9",
"@ngxs/router-plugin": "^3.6.2",
"@ngxs/storage-plugin": "^3.6.2",
"@ngxs/store": "^3.6.2",

2
npm/ng-packs/packages/core/src/lib/directives/index.ts

@ -6,3 +6,5 @@ export * from './init.directive';
export * from './permission.directive';
export * from './replaceable-template.directive';
export * from './visibility.directive';
export * from './debounce.directive';
export * from './stop-propagation.directive';

2
npm/ng-packs/packages/core/src/lib/states/profile.state.ts

@ -1,9 +1,9 @@
import { Injectable } from '@angular/core';
import { Action, Selector, State, StateContext } from '@ngxs/store';
import { tap } from 'rxjs/operators';
import { ChangePassword, GetProfile, UpdateProfile } from '../actions/profile.actions';
import { Profile } from '../models/profile';
import { ProfileService } from '../services/profile.service';
import { Injectable } from '@angular/core';
@State<Profile.State>({
name: 'ProfileState',

2
npm/ng-packs/packages/core/src/lib/states/replaceable-components.state.ts

@ -1,8 +1,8 @@
import { Injectable } from '@angular/core';
import { State, Action, StateContext, Selector, createSelector } from '@ngxs/store';
import { AddReplaceableComponent } from '../actions/replaceable-components.actions';
import { ReplaceableComponents } from '../models/replaceable-components';
import snq from 'snq';
import { Injectable } from '@angular/core';
@State<ReplaceableComponents.State>({
name: 'ReplaceableComponentsState',

10
npm/ng-packs/packages/core/src/lib/tests/permission.directive.spec.ts

@ -15,7 +15,9 @@ describe('PermissionDirective', () => {
describe('with condition', () => {
beforeEach(() => {
spectator = createDirective(`<div id="test-element" [abpPermission]="'test'">Testing Permission Directive</div>`);
spectator = createDirective(
`<div id="test-element" [abpPermission]="'test'">Testing Permission Directive</div>`,
);
directive = spectator.directive;
});
@ -27,13 +29,15 @@ describe('PermissionDirective', () => {
grantedPolicy$.next(true);
expect(spectator.query('#test-element')).toBeTruthy();
grantedPolicy$.next(false);
expect(spectator.query('#test-element')).toBeFalsy();
// expect(spectator.query('#test-element')).toBeFalsy(); // TODO: change detection problem should be fixed
});
});
describe('without condition', () => {
beforeEach(() => {
spectator = createDirective('<div id="test-element" abpPermission>Testing Permission Directive</div>');
spectator = createDirective(
'<div id="test-element" abpPermission>Testing Permission Directive</div>',
);
directive = spectator.directive;
});

12
npm/ng-packs/packages/core/src/lib/tests/visibility.directive.spec.ts

@ -18,7 +18,7 @@ describe('VisibilityDirective', () => {
expect(directive).toBeTruthy();
});
it('should be removed', done => {
xit('should be removed', done => {
setTimeout(() => {
expect(spectator.query('div')).toBeFalsy();
done();
@ -58,11 +58,13 @@ describe('VisibilityDirective', () => {
describe('without content and with focused element', () => {
beforeEach(() => {
spectator = createDirective('<div id="main" [abpVisibility]="container"></div><div #container></div>');
spectator = createDirective(
'<div id="main" [abpVisibility]="container"></div><div #container></div>',
);
directive = spectator.directive;
});
it('should be removed', done => {
xit('should be removed', done => {
setTimeout(() => {
expect(spectator.query('#main')).toBeFalsy();
done();
@ -76,7 +78,7 @@ describe('VisibilityDirective', () => {
directive = spectator.directive;
});
it('should remove the main div element when content removed', done => {
xit('should remove the main div element when content removed', done => {
spectator.query('#content').remove();
setTimeout(() => {
@ -103,7 +105,7 @@ describe('VisibilityDirective', () => {
directive = spectator.directive;
});
it('should remove the main div element when content removed', done => {
xit('should remove the main div element when content removed', done => {
spectator.query('#content').remove();
setTimeout(() => {

3
npm/ng-packs/packages/core/src/public-api.ts

@ -7,7 +7,8 @@ export * from './lib/abstracts';
export * from './lib/actions';
export * from './lib/components';
export * from './lib/constants';
export { CoreModule } from './lib/core.module';
export * from './lib/core.module';
export * from './lib/localization.module';
export * from './lib/directives';
export * from './lib/enums';
export * from './lib/guards';

4
npm/ng-packs/packages/core/tsconfig.lib.json

@ -9,13 +9,11 @@
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true,
"enableIvy": false
"enableResourceInlining": true
},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}

6
npm/ng-packs/packages/core/tsconfig.lib.prod.json

@ -0,0 +1,6 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}

4
npm/ng-packs/packages/feature-management/tsconfig.lib.json

@ -9,13 +9,11 @@
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true,
"enableIvy": false
"enableResourceInlining": true
},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}

6
npm/ng-packs/packages/feature-management/tsconfig.lib.prod.json

@ -0,0 +1,6 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}

4
npm/ng-packs/packages/identity-config/tsconfig.lib.json

@ -9,13 +9,11 @@
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true,
"enableIvy": false
"enableResourceInlining": true
},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}

6
npm/ng-packs/packages/identity-config/tsconfig.lib.prod.json

@ -0,0 +1,6 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}

6
npm/ng-packs/packages/identity/ng-package.json

@ -4,5 +4,9 @@
"lib": {
"entryFile": "src/public-api.ts"
},
"whitelistedNonPeerDependencies": ["@abp/ng.theme.shared", "@abp/ng.permission-management", "@abp/ng.identity.config"]
"whitelistedNonPeerDependencies": [
"@abp/ng.theme.shared",
"@abp/ng.permission-management",
"@abp/ng.identity.config"
]
}

23
npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts

@ -1,30 +1,17 @@
import { ABP } from '@abp/ng.core';
import { ePermissionManagementComponents } from '@abp/ng.permission-management';
import { Confirmation, ConfirmationService, getPasswordValidators } from '@abp/ng.theme.shared';
import { Component, OnInit, TemplateRef, TrackByFunction, ViewChild } from '@angular/core';
import {
AbstractControl,
FormArray,
FormBuilder,
FormControl,
FormGroup,
Validators,
} from '@angular/forms';
import { AbstractControl, FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { Select, Store } from '@ngxs/store';
import { Observable } from 'rxjs';
import { finalize, pluck, switchMap, take } from 'rxjs/operators';
import snq from 'snq';
import {
CreateUser,
DeleteUser,
GetUserById,
GetUserRoles,
GetUsers,
UpdateUser,
} from '../../actions/identity.actions';
import { CreateUser, DeleteUser, GetUserById, GetUserRoles, GetUsers, UpdateUser } from '../../actions/identity.actions';
import { Identity } from '../../models/identity';
import { IdentityService } from '../../services/identity.service';
import { IdentityState } from '../../states/identity.state';
import { ePermissionManagementComponents } from '@abp/ng.permission-management';
@Component({
selector: 'abp-users',
templateUrl: './users.component.html',
@ -36,7 +23,7 @@ export class UsersComponent implements OnInit {
@Select(IdentityState.getUsersTotalCount)
totalCount$: Observable<number>;
@ViewChild('modalContent', { static: false })
@ViewChild('modalContent', {static: false})
modalContent: TemplateRef<any>;
form: FormGroup;

1
npm/ng-packs/packages/identity/src/lib/identity.module.ts

@ -12,6 +12,7 @@ import { NgxValidateCoreModule } from '@ngx-validate/core';
@NgModule({
declarations: [RolesComponent, UsersComponent],
exports: [RolesComponent, UsersComponent],
imports: [
NgxsModule.forFeature([IdentityState]),
CoreModule,

4
npm/ng-packs/packages/identity/tsconfig.lib.json

@ -9,13 +9,11 @@
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true,
"enableIvy": false
"enableResourceInlining": true
},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}

6
npm/ng-packs/packages/identity/tsconfig.lib.prod.json

@ -0,0 +1,6 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}

4
npm/ng-packs/packages/permission-management/tsconfig.lib.json

@ -9,13 +9,11 @@
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true,
"enableIvy": false
"enableResourceInlining": true
},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}

6
npm/ng-packs/packages/permission-management/tsconfig.lib.prod.json

@ -0,0 +1,6 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}

2
npm/ng-packs/packages/setting-management-config/ng-package.json

@ -4,4 +4,4 @@
"lib": {
"entryFile": "src/public-api.ts"
}
}
}

4
npm/ng-packs/packages/setting-management-config/tsconfig.lib.json

@ -9,13 +9,11 @@
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true,
"enableIvy": false
"enableResourceInlining": true
},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}

6
npm/ng-packs/packages/setting-management-config/tsconfig.lib.prod.json

@ -0,0 +1,6 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}

1
npm/ng-packs/packages/setting-management/src/lib/setting-management.module.ts

@ -8,6 +8,7 @@ import { SettingManagementState } from './states/setting-management.state';
@NgModule({
declarations: [SettingManagementComponent],
exports: [SettingManagementComponent],
imports: [
SettingManagementRoutingModule,
CoreModule,

4
npm/ng-packs/packages/setting-management/tsconfig.lib.json

@ -9,13 +9,11 @@
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true,
"enableIvy": false
"enableResourceInlining": true
},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}

6
npm/ng-packs/packages/setting-management/tsconfig.lib.prod.json

@ -0,0 +1,6 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}

2
npm/ng-packs/packages/tenant-management-config/ng-package.json

@ -4,4 +4,4 @@
"lib": {
"entryFile": "src/public-api.ts"
}
}
}

4
npm/ng-packs/packages/tenant-management-config/tsconfig.lib.json

@ -9,13 +9,11 @@
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true,
"enableIvy": false
"enableResourceInlining": true
},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}

6
npm/ng-packs/packages/tenant-management-config/tsconfig.lib.prod.json

@ -0,0 +1,6 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}

18
npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.ts

@ -1,20 +1,14 @@
import { ABP } from '@abp/ng.core';
import { ConfirmationService, Confirmation, getPasswordValidators } from '@abp/ng.theme.shared';
import { Component, OnInit, TemplateRef, ViewChild, ChangeDetectorRef } from '@angular/core';
import { eFeatureManagementComponents } from '@abp/ng.feature-management';
import { Confirmation, ConfirmationService, getPasswordValidators } from '@abp/ng.theme.shared';
import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Select, Store } from '@ngxs/store';
import { Observable } from 'rxjs';
import { finalize, pluck, switchMap, take } from 'rxjs/operators';
import {
CreateTenant,
DeleteTenant,
GetTenantById,
GetTenants,
UpdateTenant,
} from '../../actions/tenant-management.actions';
import { CreateTenant, DeleteTenant, GetTenantById, GetTenants, UpdateTenant } from '../../actions/tenant-management.actions';
import { TenantManagementService } from '../../services/tenant-management.service';
import { TenantManagementState } from '../../states/tenant-management.state';
import { eFeatureManagementComponents } from '@abp/ng.feature-management';
interface SelectedModalContent {
type: 'saveConnStr' | 'saveTenant';
@ -75,10 +69,10 @@ export class TenantsComponent implements OnInit {
return this.defaultConnectionStringForm.get('defaultConnectionString').value;
}
@ViewChild('tenantModalTemplate', { static: false })
@ViewChild('tenantModalTemplate')
tenantModalTemplate: TemplateRef<any>;
@ViewChild('connectionStringModalTemplate', { static: false })
@ViewChild('connectionStringModalTemplate')
connectionStringModalTemplate: TemplateRef<any>;
get isDisabledSaveButton(): boolean {

1
npm/ng-packs/packages/tenant-management/src/lib/tenant-management.module.ts

@ -11,6 +11,7 @@ import { NgxValidateCoreModule } from '@ngx-validate/core';
@NgModule({
declarations: [TenantsComponent],
exports: [TenantsComponent],
imports: [
TenantManagementRoutingModule,
NgxsModule.forFeature([TenantManagementState]),

4
npm/ng-packs/packages/tenant-management/tsconfig.lib.json

@ -10,13 +10,11 @@
"paths": {}
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true,
"enableIvy": false
"enableResourceInlining": true
},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}

6
npm/ng-packs/packages/tenant-management/tsconfig.lib.prod.json

@ -0,0 +1,6 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}

4
npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html

@ -47,9 +47,7 @@
</nav>
<div
[@slideFromBottom]="
outlet && outlet.isActivated && outlet.activatedRoute && outlet.activatedRoute.routeConfig.path
"
[@slideFromBottom]="outlet?.isActivated && outlet.activatedRoute?.routeConfig?.path"
class="container"
>
<router-outlet #outlet="outlet"></router-outlet>

2
npm/ng-packs/packages/theme-basic/src/lib/states/layout.state.ts

@ -1,8 +1,8 @@
import { Injectable } from '@angular/core';
import { Action, Selector, State, StateContext } from '@ngxs/store';
import snq from 'snq';
import { AddNavigationElement, RemoveNavigationElementByName } from '../actions/layout.actions';
import { Layout } from '../models/layout';
import { Injectable } from '@angular/core';
@State<Layout.State>({
name: 'LayoutState',

8
npm/ng-packs/packages/theme-basic/src/lib/theme-basic.module.ts

@ -52,7 +52,13 @@ export const LAYOUTS = [ApplicationLayoutComponent, AccountLayoutComponent, Empt
errorTemplate: ValidationErrorComponent,
}),
],
exports: [...LAYOUTS, LogoComponent, ValidationErrorComponent],
exports: [
...LAYOUTS,
ValidationErrorComponent,
LogoComponent,
NavItemsComponent,
RoutesComponent,
],
entryComponents: [...LAYOUTS, ValidationErrorComponent],
})
export class ThemeBasicModule {

4
npm/ng-packs/packages/theme-basic/tsconfig.lib.json

@ -9,13 +9,11 @@
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true,
"enableIvy": false
"enableResourceInlining": true
},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}

6
npm/ng-packs/packages/theme-basic/tsconfig.lib.prod.json

@ -0,0 +1,6 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}

8
npm/ng-packs/packages/theme-shared/package.json

@ -8,10 +8,10 @@
},
"dependencies": {
"@abp/ng.core": "~2.9.0",
"@fortawesome/fontawesome-free": "^5.12.1",
"@ng-bootstrap/ng-bootstrap": "^5.3.0",
"@ngx-validate/core": "^0.0.7",
"bootstrap": "^4.4.1",
"@fortawesome/fontawesome-free": "^5.13.0",
"@ng-bootstrap/ng-bootstrap": "^6.1.0",
"@ngx-validate/core": "^0.0.8",
"bootstrap": "^4.5.0",
"chart.js": "^2.9.3"
},
"publishConfig": {

1
npm/ng-packs/packages/theme-shared/src/lib/components/index.ts

@ -10,3 +10,4 @@ export * from './sort-order-icon/sort-order-icon.component';
export * from './table-empty-message/table-empty-message.component';
export * from './table/table.component';
export * from './toast/toast.component';
export * from './toast-container/toast-container.component';

6
npm/ng-packs/packages/theme-shared/src/lib/components/modal/modal.component.ts

@ -60,11 +60,11 @@ export class ModalComponent implements OnDestroy {
@ContentChild(ButtonComponent, { static: false, read: ButtonComponent })
abpSubmit: ButtonComponent;
@ContentChild('abpHeader', { static: false }) abpHeader: TemplateRef<any>;
@ContentChild('abpHeader', {static: false}) abpHeader: TemplateRef<any>;
@ContentChild('abpBody', { static: false }) abpBody: TemplateRef<any>;
@ContentChild('abpBody', {static: false}) abpBody: TemplateRef<any>;
@ContentChild('abpFooter', { static: false }) abpFooter: TemplateRef<any>;
@ContentChild('abpFooter', {static: false}) abpFooter: TemplateRef<any>;
@ContentChild('abpClose', { static: false, read: ElementRef })
abpClose: ElementRef<any>;

2
npm/ng-packs/packages/theme-shared/src/lib/components/table/table.component.ts

@ -54,7 +54,7 @@ export class TableComponent implements OnInit {
@Output()
readonly pageChange = new EventEmitter<number>();
@ViewChild('wrapper', { read: ElementRef, static: false })
@ViewChild('wrapper', { read: ElementRef })
wrapperRef: ElementRef<HTMLDivElement>;
@Input()

4
npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts

@ -65,6 +65,7 @@ export function appendScript(injector: Injector) {
SortOrderIconComponent,
LoadingDirective,
TableSortDirective,
ToastContainerComponent,
],
exports: [
BreadcrumbComponent,
@ -82,6 +83,7 @@ export function appendScript(injector: Injector) {
SortOrderIconComponent,
LoadingDirective,
TableSortDirective,
ToastContainerComponent,
],
providers: [DatePipe],
entryComponents: [
@ -95,7 +97,7 @@ export function appendScript(injector: Injector) {
export class ThemeSharedModule {
constructor(private errorHandler: ErrorHandler) {}
static forRoot(options = {} as RootParams): ModuleWithProviders {
static forRoot(options = {} as RootParams): ModuleWithProviders<ThemeSharedModule> {
return {
ngModule: ThemeSharedModule,
providers: [

4
npm/ng-packs/packages/theme-shared/tsconfig.lib.json

@ -9,13 +9,11 @@
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true,
"enableIvy": false
"enableResourceInlining": true
},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}

6
npm/ng-packs/packages/theme-shared/tsconfig.lib.prod.json

@ -0,0 +1,6 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}

3
npm/ng-packs/scripts/build.ts

@ -17,6 +17,7 @@ import program from 'commander';
'symlink',
'copy',
'--angular',
'--prod',
'--no-watch',
'--sync',
'--packages',
@ -31,6 +32,7 @@ import program from 'commander';
'symlink',
'copy',
'--angular',
'--prod',
'--no-watch',
'--all-packages',
'--excluded-packages',
@ -45,6 +47,7 @@ import program from 'commander';
'symlink',
'copy',
'--angular',
'--prod',
'--no-watch',
'--packages',
'@abp/ng.feature-management,@abp/ng.permission-management,@abp/ng.account.config,@abp/ng.identity.config,@abp/ng.setting-management.config,@abp/ng.tenant-management.config',

7
npm/ng-packs/scripts/install-new-dependencies.ts

@ -25,7 +25,8 @@ const updateAndInstall = async () => {
.reduce((acc, key) => ({ ...acc, [key]: packageJson.devDependencies[key] }), {});
});
console.warn('Searching the packages on NPM to check if it is exist. It takes a while.');
// tslint:disable-next-line: no-console
console.log('Searching the packages on NPM to check if it is exist. It takes a while.');
Object.keys(packageJson.devDependencies).forEach(pkg => {
const isPackageExistOnNPM = !(
execa.sync('npm', ['search', pkg]).stdout.indexOf('No matches found for') > -1
@ -41,6 +42,10 @@ const updateAndInstall = async () => {
stdout: 'inherit',
cwd: '../',
});
await execa('yarn', ['post-install'], {
stdout: 'inherit',
});
} catch (error) {
console.error(error.stderr);
process.exit(1);

1
npm/ng-packs/scripts/package.json

@ -8,6 +8,7 @@
"build:prod": "ts-node -r tsconfig-paths/register prod-build.ts",
"publish-packages": "ts-node -r tsconfig-paths/register publish.ts",
"install-new-dependencies": "ts-node -r tsconfig-paths/register install-new-dependencies.ts",
"post-install": "ts-node -r tsconfig-paths/register post-install.ts",
"replace-with-tilde": "ts-node -r tsconfig-paths/register replace-with-tilde.ts",
"sync": "ts-node -r tsconfig-paths/register sync.ts"
},

29
npm/ng-packs/scripts/post-install.ts

@ -0,0 +1,29 @@
import execa from 'execa';
import fse from 'fs-extra';
(async () => {
rename(true);
try {
await execa('yarn', ['ngcc'], {
stdout: 'inherit',
cwd: '../',
});
} catch (error) {
rename(false);
console.error(error);
process.exit(1);
}
rename(false);
})();
async function rename(prodToMain: boolean) {
try {
await fse.rename('../tsconfig.json', `../tsconfig.${prodToMain ? 'temp' : 'prod'}.json`);
await fse.rename(`../tsconfig.${prodToMain ? 'prod' : 'temp'}.json`, '../tsconfig.json');
} catch (error) {
console.error(error);
process.exit(1);
}
}

1275
npm/ng-packs/scripts/yarn.lock

File diff suppressed because it is too large

11
npm/ng-packs/source-code-requirements/tsconfig.lib.json

@ -6,18 +6,13 @@
"declaration": true,
"inlineSources": true,
"types": [],
"lib": [
"dom",
"es2018"
]
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"enableIvy": false,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"enableResourceInlining": true
},
"exclude": [
"src/test.ts",
"**/*.spec.ts"
]
"exclude": ["src/test.ts", "**/*.spec.ts"]
}

1
npm/ng-packs/test-setup.ts

@ -1,2 +1,3 @@
import '@angular/localize/init';
import 'jest-preset-angular';
import 'jest-canvas-mock';

5613
npm/ng-packs/yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save