diff --git a/npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts b/npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts
index dd7789220f..67db73a5a6 100644
--- a/npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts
+++ b/npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts
@@ -17,7 +17,8 @@ export class PersonalSettingsComponent
implements
OnInit,
Account.PersonalSettingsComponentInputs,
- Account.PersonalSettingsComponentOutputs {
+ Account.PersonalSettingsComponentOutputs
+{
form: FormGroup;
inProgress: boolean;
diff --git a/npm/ng-packs/packages/account/src/lib/models/account.ts b/npm/ng-packs/packages/account/src/lib/models/account.ts
index ef5ad926a2..97c8c3649e 100644
--- a/npm/ng-packs/packages/account/src/lib/models/account.ts
+++ b/npm/ng-packs/packages/account/src/lib/models/account.ts
@@ -1,12 +1,10 @@
-import { TemplateRef } from '@angular/core';
+/* eslint-disable @typescript-eslint/no-empty-interface */
export namespace Account {
- //tslint:disable
export interface TenantBoxComponentInputs {}
export interface TenantBoxComponentOutputs {}
export interface PersonalSettingsComponentInputs {}
export interface PersonalSettingsComponentOutputs {}
export interface ChangePasswordComponentInputs {}
export interface ChangePasswordComponentOutputs {}
- // tslint:enable
}
diff --git a/npm/ng-packs/packages/account/src/lib/proxy/account/account.service.ts b/npm/ng-packs/packages/account/src/lib/proxy/account/account.service.ts
index adeb2ee5c9..4d62086f7f 100644
--- a/npm/ng-packs/packages/account/src/lib/proxy/account/account.service.ts
+++ b/npm/ng-packs/packages/account/src/lib/proxy/account/account.service.ts
@@ -10,28 +10,34 @@ export class AccountService {
apiName = 'AbpAccount';
register = (input: RegisterDto) =>
- this.restService.request
({
- method: 'POST',
- url: '/api/account/register',
- body: input,
- },
- { apiName: this.apiName });
+ this.restService.request(
+ {
+ method: 'POST',
+ url: '/api/account/register',
+ body: input,
+ },
+ { apiName: this.apiName },
+ );
resetPassword = (input: ResetPasswordDto) =>
- this.restService.request({
- method: 'POST',
- url: '/api/account/reset-password',
- body: input,
- },
- { apiName: this.apiName });
+ this.restService.request(
+ {
+ method: 'POST',
+ url: '/api/account/reset-password',
+ body: input,
+ },
+ { apiName: this.apiName },
+ );
sendPasswordResetCode = (input: SendPasswordResetCodeDto) =>
- this.restService.request({
- method: 'POST',
- url: '/api/account/send-password-reset-code',
- body: input,
- },
- { apiName: this.apiName });
+ this.restService.request(
+ {
+ method: 'POST',
+ url: '/api/account/send-password-reset-code',
+ body: input,
+ },
+ { apiName: this.apiName },
+ );
constructor(private restService: RestService) {}
}
diff --git a/npm/ng-packs/packages/account/src/lib/proxy/account/web/areas/account/controllers/account.service.ts b/npm/ng-packs/packages/account/src/lib/proxy/account/web/areas/account/controllers/account.service.ts
index 8adf5385b0..75b07bf963 100644
--- a/npm/ng-packs/packages/account/src/lib/proxy/account/web/areas/account/controllers/account.service.ts
+++ b/npm/ng-packs/packages/account/src/lib/proxy/account/web/areas/account/controllers/account.service.ts
@@ -9,27 +9,33 @@ export class AccountService {
apiName = 'AbpAccount';
checkPasswordByLogin = (login: UserLoginInfo) =>
- this.restService.request({
- method: 'POST',
- url: '/api/account/check-password',
- body: login,
- },
- { apiName: this.apiName });
+ this.restService.request(
+ {
+ method: 'POST',
+ url: '/api/account/check-password',
+ body: login,
+ },
+ { apiName: this.apiName },
+ );
loginByLogin = (login: UserLoginInfo) =>
- this.restService.request({
- method: 'POST',
- url: '/api/account/login',
- body: login,
- },
- { apiName: this.apiName });
+ this.restService.request(
+ {
+ method: 'POST',
+ url: '/api/account/login',
+ body: login,
+ },
+ { apiName: this.apiName },
+ );
logout = () =>
- this.restService.request({
- method: 'GET',
- url: '/api/account/logout',
- },
- { apiName: this.apiName });
+ this.restService.request(
+ {
+ method: 'GET',
+ url: '/api/account/logout',
+ },
+ { apiName: this.apiName },
+ );
constructor(private restService: RestService) {}
}
diff --git a/npm/ng-packs/packages/account/src/test-setup.ts b/npm/ng-packs/packages/account/src/test-setup.ts
new file mode 100644
index 0000000000..1100b3e8a6
--- /dev/null
+++ b/npm/ng-packs/packages/account/src/test-setup.ts
@@ -0,0 +1 @@
+import 'jest-preset-angular/setup-jest';
diff --git a/npm/ng-packs/packages/account/tsconfig.json b/npm/ng-packs/packages/account/tsconfig.json
new file mode 100644
index 0000000000..62ebbd9464
--- /dev/null
+++ b/npm/ng-packs/packages/account/tsconfig.json
@@ -0,0 +1,13 @@
+{
+ "extends": "../../tsconfig.base.json",
+ "files": [],
+ "include": [],
+ "references": [
+ {
+ "path": "./tsconfig.lib.json"
+ },
+ {
+ "path": "./tsconfig.spec.json"
+ }
+ ]
+}
diff --git a/npm/ng-packs/packages/account/tsconfig.lib.json b/npm/ng-packs/packages/account/tsconfig.lib.json
index 4f48db2e46..bbcc12b1c7 100644
--- a/npm/ng-packs/packages/account/tsconfig.lib.json
+++ b/npm/ng-packs/packages/account/tsconfig.lib.json
@@ -1,19 +1,14 @@
{
- "extends": "../../tsconfig.prod.json",
+ "extends": "./tsconfig.json",
"compilerOptions": {
- "outDir": "../../out-tsc/lib",
+ "outDir": "../../dist/out-tsc",
"target": "es2015",
"declaration": true,
+ "declarationMap": true,
"inlineSources": true,
"types": [],
"lib": ["dom", "es2018"]
},
- "angularCompilerOptions": {
- "skipTemplateCodegen": true,
- "strictMetadataEmit": true,
- "fullTemplateTypeCheck": true,
- "strictInjectionParameters": true,
- "enableResourceInlining": true
- },
- "exclude": ["src/test.ts", "**/*.spec.ts"]
+ "exclude": ["src/test-setup.ts", "**/*.spec.ts"],
+ "include": ["**/*.ts"]
}
diff --git a/npm/ng-packs/packages/account/tsconfig.lib.prod.json b/npm/ng-packs/packages/account/tsconfig.lib.prod.json
index b1d501abbc..85cd584a48 100644
--- a/npm/ng-packs/packages/account/tsconfig.lib.prod.json
+++ b/npm/ng-packs/packages/account/tsconfig.lib.prod.json
@@ -1,6 +1,11 @@
+/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.lib.json",
+ "compilerOptions": {
+ "declarationMap": false
+ },
"angularCompilerOptions": {
- "enableIvy": false
+ "compilationMode": "partial",
+ "enableIvy": true
}
-}
\ No newline at end of file
+}
diff --git a/npm/ng-packs/packages/account/tsconfig.spec.json b/npm/ng-packs/packages/account/tsconfig.spec.json
index 02f312c262..a42c4b02fb 100644
--- a/npm/ng-packs/packages/account/tsconfig.spec.json
+++ b/npm/ng-packs/packages/account/tsconfig.spec.json
@@ -1,11 +1,11 @@
{
- "extends": "../../tsconfig.prod.json",
+ "extends": "./tsconfig.json",
"compilerOptions": {
- "emitDecoratorMetadata": true,
- "esModuleInterop": true,
"outDir": "../../dist/out-tsc",
"module": "commonjs",
- "types": ["jest", "node"]
+ "types": ["jest", "node"],
+ "esModuleInterop": true
},
+ "files": ["src/test-setup.ts"],
"include": ["**/*.spec.ts", "**/*.d.ts"]
}
diff --git a/npm/ng-packs/packages/account/tslint.json b/npm/ng-packs/packages/account/tslint.json
deleted file mode 100644
index 8c3919ea62..0000000000
--- a/npm/ng-packs/packages/account/tslint.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "extends": "../../tslint.json",
- "rules": {
- "directive-selector": [
- true,
- "attribute",
- "abp",
- "camelCase"
- ],
- "component-selector": [
- true,
- "element",
- "abp",
- "kebab-case"
- ]
- }
-}
diff --git a/npm/ng-packs/packages/components/.eslintrc.json b/npm/ng-packs/packages/components/.eslintrc.json
new file mode 100644
index 0000000000..9c51584494
--- /dev/null
+++ b/npm/ng-packs/packages/components/.eslintrc.json
@@ -0,0 +1,36 @@
+{
+ "extends": ["../../.eslintrc.json"],
+ "ignorePatterns": ["!**/*"],
+ "overrides": [
+ {
+ "files": ["*.ts"],
+ "extends": [
+ "plugin:@nrwl/nx/angular",
+ "plugin:@angular-eslint/template/process-inline-templates"
+ ],
+ "rules": {
+ "@angular-eslint/directive-selector": [
+ "error",
+ {
+ "type": "attribute",
+ "prefix": "abp",
+ "style": "camelCase"
+ }
+ ],
+ "@angular-eslint/component-selector": [
+ "error",
+ {
+ "type": "element",
+ "prefix": "abp",
+ "style": "kebab-case"
+ }
+ ]
+ }
+ },
+ {
+ "files": ["*.html"],
+ "extends": ["plugin:@nrwl/nx/angular-template"],
+ "rules": {}
+ }
+ ]
+}
diff --git a/npm/ng-packs/packages/components/jest.config.js b/npm/ng-packs/packages/components/jest.config.js
index 48e73119db..82ce530095 100644
--- a/npm/ng-packs/packages/components/jest.config.js
+++ b/npm/ng-packs/packages/components/jest.config.js
@@ -1,6 +1,20 @@
-const jestConfig = require('../../jest.config');
-
module.exports = {
- ...jestConfig,
- name: 'components',
+ displayName: 'components',
+ preset: '../../jest.preset.js',
+ setupFilesAfterEnv: ['/src/test-setup.ts'],
+ globals: {
+ 'ts-jest': {
+ tsconfig: '/tsconfig.spec.json',
+ stringifyContentPathRegex: '\\.(html|svg)$',
+ },
+ },
+ coverageDirectory: '../../coverage/packages/components',
+ transform: {
+ '^.+\\.(ts|js|html)$': 'jest-preset-angular',
+ },
+ snapshotSerializers: [
+ 'jest-preset-angular/build/serializers/no-ng-attributes',
+ 'jest-preset-angular/build/serializers/ng-snapshot',
+ 'jest-preset-angular/build/serializers/html-comment',
+ ],
};
diff --git a/npm/ng-packs/packages/components/ng-package.json b/npm/ng-packs/packages/components/ng-package.json
index c7afa1d2c1..a5343f978a 100644
--- a/npm/ng-packs/packages/components/ng-package.json
+++ b/npm/ng-packs/packages/components/ng-package.json
@@ -1,7 +1,6 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
- "dest": "../../dist/components",
- "assets": ["./styles/**/*"],
+ "dest": "../../dist/packages/components",
"lib": {
"entryFile": "src/public-api.ts"
},
diff --git a/npm/ng-packs/packages/components/ngcc.config.js b/npm/ng-packs/packages/components/ngcc.config.js
deleted file mode 100644
index b475a18996..0000000000
--- a/npm/ng-packs/packages/components/ngcc.config.js
+++ /dev/null
@@ -1,8 +0,0 @@
-module.exports = {
- entryPoints: {
- '.': {},
- './tree': {},
- './page': {},
- './dist': { ignore: true },
- },
-};
diff --git a/npm/ng-packs/packages/components/package.json b/npm/ng-packs/packages/components/package.json
index 2056b457f9..767261b15a 100644
--- a/npm/ng-packs/packages/components/package.json
+++ b/npm/ng-packs/packages/components/package.json
@@ -1,6 +1,6 @@
{
"name": "@abp/ng.components",
- "version": "4.4.0-rc.2",
+ "version": "4.4.0",
"homepage": "https://abp.io",
"repository": {
"type": "git",
diff --git a/npm/ng-packs/packages/components/page/ng-package.json b/npm/ng-packs/packages/components/page/ng-package.json
index 827df3978e..530fd56dca 100644
--- a/npm/ng-packs/packages/components/page/ng-package.json
+++ b/npm/ng-packs/packages/components/page/ng-package.json
@@ -1,6 +1,6 @@
{
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
- "dest": "../../../dist/components/page",
+ "dest": "../../../dist/packages/components/page",
"lib": {
"entryFile": "src/public-api.ts"
}
diff --git a/npm/ng-packs/packages/components/page/src/page-parts.component.ts b/npm/ng-packs/packages/components/page/src/page-parts.component.ts
index 8438593268..720a14c4a9 100644
--- a/npm/ng-packs/packages/components/page/src/page-parts.component.ts
+++ b/npm/ng-packs/packages/components/page/src/page-parts.component.ts
@@ -8,27 +8,21 @@ export enum PageParts {
@Component({
selector: 'abp-page-title-container',
- template: `
-
- `,
+ template: ` `,
encapsulation: ViewEncapsulation.None,
})
export class PageTitleContainerComponent {}
@Component({
selector: 'abp-page-breadcrumb-container',
- template: `
-
- `,
+ template: ` `,
encapsulation: ViewEncapsulation.None,
})
export class PageBreadcrumbContainerComponent {}
@Component({
selector: 'abp-page-toolbar-container',
- template: `
-
- `,
+ template: ` `,
encapsulation: ViewEncapsulation.None,
})
export class PageToolbarContainerComponent {}
diff --git a/npm/ng-packs/packages/components/page/src/page.module.ts b/npm/ng-packs/packages/components/page/src/page.module.ts
index 3f12543be7..d9d237cbdb 100644
--- a/npm/ng-packs/packages/components/page/src/page.module.ts
+++ b/npm/ng-packs/packages/components/page/src/page.module.ts
@@ -1,15 +1,15 @@
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { UiExtensionsModule } from '@abp/ng.theme.shared/extensions';
-import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { CoreModule } from '@abp/ng.core';
-import { PageComponent } from './page.component';
+import { ThemeSharedModule } from '@abp/ng.theme.shared';
+import { UiExtensionsModule } from '@abp/ng.theme.shared/extensions';
+import { CommonModule } from '@angular/common';
+import { NgModule } from '@angular/core';
+import { PagePartDirective } from './page-part.directive';
import {
- PageTitleContainerComponent,
PageBreadcrumbContainerComponent,
+ PageTitleContainerComponent,
PageToolbarContainerComponent,
} from './page-parts.component';
-import { PagePartDirective } from './page-part.directive';
+import { PageComponent } from './page.component';
const exportedDeclarations = [
PageComponent,
@@ -22,6 +22,6 @@ const exportedDeclarations = [
@NgModule({
declarations: [...exportedDeclarations],
imports: [CommonModule, UiExtensionsModule, CoreModule, ThemeSharedModule],
- exports: [...exportedDeclarations],
+ exports: [...exportedDeclarations, UiExtensionsModule],
})
export class PageModule {}
diff --git a/npm/ng-packs/packages/components/src/test-setup.ts b/npm/ng-packs/packages/components/src/test-setup.ts
new file mode 100644
index 0000000000..1100b3e8a6
--- /dev/null
+++ b/npm/ng-packs/packages/components/src/test-setup.ts
@@ -0,0 +1 @@
+import 'jest-preset-angular/setup-jest';
diff --git a/npm/ng-packs/packages/components/tree/ng-package.json b/npm/ng-packs/packages/components/tree/ng-package.json
index c7a2782c24..0a2a39f416 100644
--- a/npm/ng-packs/packages/components/tree/ng-package.json
+++ b/npm/ng-packs/packages/components/tree/ng-package.json
@@ -1,6 +1,6 @@
{
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
- "dest": "../../../dist/components/tree",
+ "dest": "../../../dist/packages/components/tree",
"lib": {
"entryFile": "src/public-api.ts"
}
diff --git a/npm/ng-packs/packages/components/tsconfig.json b/npm/ng-packs/packages/components/tsconfig.json
new file mode 100644
index 0000000000..62ebbd9464
--- /dev/null
+++ b/npm/ng-packs/packages/components/tsconfig.json
@@ -0,0 +1,13 @@
+{
+ "extends": "../../tsconfig.base.json",
+ "files": [],
+ "include": [],
+ "references": [
+ {
+ "path": "./tsconfig.lib.json"
+ },
+ {
+ "path": "./tsconfig.spec.json"
+ }
+ ]
+}
diff --git a/npm/ng-packs/packages/components/tsconfig.lib.json b/npm/ng-packs/packages/components/tsconfig.lib.json
index 4f48db2e46..bbcc12b1c7 100644
--- a/npm/ng-packs/packages/components/tsconfig.lib.json
+++ b/npm/ng-packs/packages/components/tsconfig.lib.json
@@ -1,19 +1,14 @@
{
- "extends": "../../tsconfig.prod.json",
+ "extends": "./tsconfig.json",
"compilerOptions": {
- "outDir": "../../out-tsc/lib",
+ "outDir": "../../dist/out-tsc",
"target": "es2015",
"declaration": true,
+ "declarationMap": true,
"inlineSources": true,
"types": [],
"lib": ["dom", "es2018"]
},
- "angularCompilerOptions": {
- "skipTemplateCodegen": true,
- "strictMetadataEmit": true,
- "fullTemplateTypeCheck": true,
- "strictInjectionParameters": true,
- "enableResourceInlining": true
- },
- "exclude": ["src/test.ts", "**/*.spec.ts"]
+ "exclude": ["src/test-setup.ts", "**/*.spec.ts"],
+ "include": ["**/*.ts"]
}
diff --git a/npm/ng-packs/packages/components/tsconfig.lib.prod.json b/npm/ng-packs/packages/components/tsconfig.lib.prod.json
index b1d501abbc..85cd584a48 100644
--- a/npm/ng-packs/packages/components/tsconfig.lib.prod.json
+++ b/npm/ng-packs/packages/components/tsconfig.lib.prod.json
@@ -1,6 +1,11 @@
+/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.lib.json",
+ "compilerOptions": {
+ "declarationMap": false
+ },
"angularCompilerOptions": {
- "enableIvy": false
+ "compilationMode": "partial",
+ "enableIvy": true
}
-}
\ No newline at end of file
+}
diff --git a/npm/ng-packs/packages/components/tsconfig.spec.json b/npm/ng-packs/packages/components/tsconfig.spec.json
index 02f312c262..a42c4b02fb 100644
--- a/npm/ng-packs/packages/components/tsconfig.spec.json
+++ b/npm/ng-packs/packages/components/tsconfig.spec.json
@@ -1,11 +1,11 @@
{
- "extends": "../../tsconfig.prod.json",
+ "extends": "./tsconfig.json",
"compilerOptions": {
- "emitDecoratorMetadata": true,
- "esModuleInterop": true,
"outDir": "../../dist/out-tsc",
"module": "commonjs",
- "types": ["jest", "node"]
+ "types": ["jest", "node"],
+ "esModuleInterop": true
},
+ "files": ["src/test-setup.ts"],
"include": ["**/*.spec.ts", "**/*.d.ts"]
}
diff --git a/npm/ng-packs/packages/components/tslint.json b/npm/ng-packs/packages/components/tslint.json
deleted file mode 100644
index 9d39c7dc74..0000000000
--- a/npm/ng-packs/packages/components/tslint.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "extends": "../../tslint.json",
- "rules": {
- "directive-selector": [true, "attribute", "abp", "camelCase"],
- "component-selector": [true, "element", "abp", "kebab-case"]
- }
-}
diff --git a/npm/ng-packs/packages/core/.eslintrc.json b/npm/ng-packs/packages/core/.eslintrc.json
new file mode 100644
index 0000000000..9c51584494
--- /dev/null
+++ b/npm/ng-packs/packages/core/.eslintrc.json
@@ -0,0 +1,36 @@
+{
+ "extends": ["../../.eslintrc.json"],
+ "ignorePatterns": ["!**/*"],
+ "overrides": [
+ {
+ "files": ["*.ts"],
+ "extends": [
+ "plugin:@nrwl/nx/angular",
+ "plugin:@angular-eslint/template/process-inline-templates"
+ ],
+ "rules": {
+ "@angular-eslint/directive-selector": [
+ "error",
+ {
+ "type": "attribute",
+ "prefix": "abp",
+ "style": "camelCase"
+ }
+ ],
+ "@angular-eslint/component-selector": [
+ "error",
+ {
+ "type": "element",
+ "prefix": "abp",
+ "style": "kebab-case"
+ }
+ ]
+ }
+ },
+ {
+ "files": ["*.html"],
+ "extends": ["plugin:@nrwl/nx/angular-template"],
+ "rules": {}
+ }
+ ]
+}
diff --git a/npm/ng-packs/packages/core/jest.config.js b/npm/ng-packs/packages/core/jest.config.js
index 9886cf4d3d..5b27da11ff 100644
--- a/npm/ng-packs/packages/core/jest.config.js
+++ b/npm/ng-packs/packages/core/jest.config.js
@@ -1,6 +1,20 @@
-const jestConfig = require('../../jest.config');
-
module.exports = {
- ...jestConfig,
- name: 'core',
+ displayName: 'core',
+ preset: '../../jest.preset.js',
+ setupFilesAfterEnv: ['/src/test-setup.ts'],
+ globals: {
+ 'ts-jest': {
+ tsconfig: '/tsconfig.spec.json',
+ stringifyContentPathRegex: '\\.(html|svg)$',
+ },
+ },
+ coverageDirectory: '../../coverage/packages/core',
+ transform: {
+ '^.+\\.(ts|js|html)$': 'jest-preset-angular',
+ },
+ snapshotSerializers: [
+ 'jest-preset-angular/build/serializers/no-ng-attributes',
+ 'jest-preset-angular/build/serializers/ng-snapshot',
+ 'jest-preset-angular/build/serializers/html-comment',
+ ],
};
diff --git a/npm/ng-packs/packages/core/locale/ng-package.json b/npm/ng-packs/packages/core/locale/ng-package.json
index f2542d13fb..fae7a02024 100644
--- a/npm/ng-packs/packages/core/locale/ng-package.json
+++ b/npm/ng-packs/packages/core/locale/ng-package.json
@@ -1,6 +1,6 @@
{
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
- "dest": "../../dist/core/locale",
+ "dest": "../../../dist/packages/core/locale",
"lib": {
"entryFile": "src/public-api.ts"
}
diff --git a/npm/ng-packs/packages/core/ng-package.json b/npm/ng-packs/packages/core/ng-package.json
index c613dcd94a..2faa7507f1 100644
--- a/npm/ng-packs/packages/core/ng-package.json
+++ b/npm/ng-packs/packages/core/ng-package.json
@@ -1,10 +1,9 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
- "dest": "../../dist/core",
+ "dest": "../../dist/packages/core",
"lib": {
"entryFile": "src/public-api.ts"
},
- "deleteDestPath": false,
"allowedNonPeerDependencies": [
"@abp/utils",
"@angular/localize",
diff --git a/npm/ng-packs/packages/core/package.json b/npm/ng-packs/packages/core/package.json
index 1e4903cfc1..3d115bc8e1 100644
--- a/npm/ng-packs/packages/core/package.json
+++ b/npm/ng-packs/packages/core/package.json
@@ -1,6 +1,6 @@
{
"name": "@abp/ng.core",
- "version": "4.4.0-rc.2",
+ "version": "4.4.0",
"homepage": "https://abp.io",
"repository": {
"type": "git",
diff --git a/npm/ng-packs/packages/core/src/lib/abstracts/ng-model.component.ts b/npm/ng-packs/packages/core/src/lib/abstracts/ng-model.component.ts
index 7176803b74..cb3fe34f98 100644
--- a/npm/ng-packs/packages/core/src/lib/abstracts/ng-model.component.ts
+++ b/npm/ng-packs/packages/core/src/lib/abstracts/ng-model.component.ts
@@ -1,14 +1,13 @@
-import { ControlValueAccessor } from '@angular/forms';
import { ChangeDetectorRef, Component, Injector, Input } from '@angular/core';
+import { ControlValueAccessor } from '@angular/forms';
// Not an abstract class on purpose. Do not change!
-// tslint:disable-next-line: use-component-selector
@Component({ template: '' })
export class AbstractNgModelComponent implements ControlValueAccessor {
protected _value: T;
protected cdRef: ChangeDetectorRef;
- onChange: (value: T) => {};
- onTouched: () => {};
+ onChange: (value: T) => void;
+ onTouched: () => void;
@Input()
disabled: boolean;
@@ -17,14 +16,14 @@ export class AbstractNgModelComponent implements ControlValueAcc
readonly: boolean;
@Input()
- valueFn: (value: U, previousValue?: T) => T = value => (value as any) as T;
+ valueFn: (value: U, previousValue?: T) => T = value => value as any as T;
@Input()
valueLimitFn: (value: T, previousValue?: T) => any = value => false;
@Input()
set value(value: T) {
- value = this.valueFn((value as any) as U, this._value);
+ value = this.valueFn(value as any as U, this._value);
if (this.valueLimitFn(value, this._value) !== false || this.readonly) return;
@@ -41,7 +40,6 @@ export class AbstractNgModelComponent implements ControlValueAcc
}
constructor(public injector: Injector) {
- // tslint:disable-next-line: deprecation
this.cdRef = injector.get(ChangeDetectorRef);
}
diff --git a/npm/ng-packs/packages/core/src/lib/components/replaceable-route-container.component.ts b/npm/ng-packs/packages/core/src/lib/components/replaceable-route-container.component.ts
index 6c0dabd511..9d60fcda84 100644
--- a/npm/ng-packs/packages/core/src/lib/components/replaceable-route-container.component.ts
+++ b/npm/ng-packs/packages/core/src/lib/components/replaceable-route-container.component.ts
@@ -27,8 +27,9 @@ export class ReplaceableRouteContainerComponent implements OnInit {
ngOnInit() {
this.defaultComponent = this.route.snapshot.data.replaceableComponent.defaultComponent;
- this.componentKey = (this.route.snapshot.data
- .replaceableComponent as ReplaceableComponents.RouteData).key;
+ this.componentKey = (
+ this.route.snapshot.data.replaceableComponent as ReplaceableComponents.RouteData
+ ).key;
const component$ = this.replaceableComponents
.get$(this.componentKey)
diff --git a/npm/ng-packs/packages/core/src/lib/components/router-outlet.component.ts b/npm/ng-packs/packages/core/src/lib/components/router-outlet.component.ts
index 1fc5d002ac..fee29d9dd8 100644
--- a/npm/ng-packs/packages/core/src/lib/components/router-outlet.component.ts
+++ b/npm/ng-packs/packages/core/src/lib/components/router-outlet.component.ts
@@ -2,8 +2,6 @@ import { Component } from '@angular/core';
@Component({
selector: 'abp-router-outlet',
- template: `
-
- `,
+ template: ` `,
})
export class RouterOutletComponent {}
diff --git a/npm/ng-packs/packages/core/src/lib/directives/autofocus.directive.ts b/npm/ng-packs/packages/core/src/lib/directives/autofocus.directive.ts
index 7fb7de34d1..40b0fe0b0b 100644
--- a/npm/ng-packs/packages/core/src/lib/directives/autofocus.directive.ts
+++ b/npm/ng-packs/packages/core/src/lib/directives/autofocus.directive.ts
@@ -1,8 +1,8 @@
-import { Directive, ElementRef, Input, AfterViewInit } from '@angular/core';
+import { AfterViewInit, Directive, ElementRef, Input } from '@angular/core';
@Directive({
- // tslint:disable-next-line: directive-selector
- selector: '[autofocus]'
+ // eslint-disable-next-line @angular-eslint/directive-selector
+ selector: '[autofocus]',
})
export class AutofocusDirective implements AfterViewInit {
@Input('autofocus')
diff --git a/npm/ng-packs/packages/core/src/lib/directives/debounce.directive.ts b/npm/ng-packs/packages/core/src/lib/directives/debounce.directive.ts
index f35b0c6768..431305738a 100644
--- a/npm/ng-packs/packages/core/src/lib/directives/debounce.directive.ts
+++ b/npm/ng-packs/packages/core/src/lib/directives/debounce.directive.ts
@@ -4,7 +4,7 @@ import { debounceTime } from 'rxjs/operators';
import { SubscriptionService } from '../services/subscription.service';
@Directive({
- // tslint:disable-next-line: directive-selector
+ // eslint-disable-next-line @angular-eslint/directive-selector
selector: '[input.debounce]',
providers: [SubscriptionService],
})
diff --git a/npm/ng-packs/packages/core/src/lib/directives/ellipsis.directive.ts b/npm/ng-packs/packages/core/src/lib/directives/ellipsis.directive.ts
index 1837d1d8e1..1c178da1af 100644
--- a/npm/ng-packs/packages/core/src/lib/directives/ellipsis.directive.ts
+++ b/npm/ng-packs/packages/core/src/lib/directives/ellipsis.directive.ts
@@ -1,4 +1,11 @@
-import { AfterViewInit, ChangeDetectorRef, Directive, ElementRef, HostBinding, Input } from '@angular/core';
+import {
+ AfterViewInit,
+ ChangeDetectorRef,
+ Directive,
+ ElementRef,
+ HostBinding,
+ Input,
+} from '@angular/core';
@Directive({
selector: '[abpEllipsis]',
diff --git a/npm/ng-packs/packages/core/src/lib/directives/for.directive.ts b/npm/ng-packs/packages/core/src/lib/directives/for.directive.ts
index ba3efd7c21..3e17d0ac3c 100644
--- a/npm/ng-packs/packages/core/src/lib/directives/for.directive.ts
+++ b/npm/ng-packs/packages/core/src/lib/directives/for.directive.ts
@@ -11,23 +11,32 @@ import {
TrackByFunction,
ViewContainerRef,
} from '@angular/core';
-import compare from 'just-compare';
import clone from 'just-clone';
+import compare from 'just-compare';
export type CompareFn = (value: T, comparison: T) => boolean;
class AbpForContext {
- constructor(public $implicit: any, public index: number, public count: number, public list: any[]) {}
+ constructor(
+ public $implicit: any,
+ public index: number,
+ public count: number,
+ public list: any[],
+ ) {}
}
class RecordView {
- constructor(public record: IterableChangeRecord, public view: EmbeddedViewRef) {}
+ constructor(
+ public record: IterableChangeRecord,
+ public view: EmbeddedViewRef,
+ ) {}
}
@Directive({
selector: '[abpFor]',
})
export class ForDirective implements OnChanges {
+ // eslint-disable-next-line @angular-eslint/no-input-rename
@Input('abpForOf')
items: any[];
@@ -73,24 +82,26 @@ export class ForDirective implements OnChanges {
private iterateOverAppliedOperations(changes: IterableChanges) {
const rw: RecordView[] = [];
- changes.forEachOperation((record: IterableChangeRecord, previousIndex: number, currentIndex: number) => {
- if (record.previousIndex == null) {
- const view = this.vcRef.createEmbeddedView(
- this.tempRef,
- new AbpForContext(null, -1, -1, this.items),
- currentIndex,
- );
-
- rw.push(new RecordView(record, view));
- } else if (currentIndex == null) {
- this.vcRef.remove(previousIndex);
- } else {
- const view = this.vcRef.get(previousIndex);
- this.vcRef.move(view, currentIndex);
-
- rw.push(new RecordView(record, view as EmbeddedViewRef));
- }
- });
+ changes.forEachOperation(
+ (record: IterableChangeRecord, previousIndex: number, currentIndex: number) => {
+ if (record.previousIndex == null) {
+ const view = this.vcRef.createEmbeddedView(
+ this.tempRef,
+ new AbpForContext(null, -1, -1, this.items),
+ currentIndex,
+ );
+
+ rw.push(new RecordView(record, view));
+ } else if (currentIndex == null) {
+ this.vcRef.remove(previousIndex);
+ } else {
+ const view = this.vcRef.get(previousIndex);
+ this.vcRef.move(view, currentIndex);
+
+ rw.push(new RecordView(record, view as EmbeddedViewRef));
+ }
+ },
+ );
for (let i = 0, l = rw.length; i < l; i++) {
rw[i].view.context.$implicit = rw[i].record.item;
@@ -114,7 +125,6 @@ export class ForDirective implements OnChanges {
private projectItems(items: any[]): void {
if (!items.length && this.emptyRef) {
this.vcRef.clear();
- // tslint:disable-next-line: no-unused-expression
this.vcRef.createEmbeddedView(this.emptyRef).rootNodes;
this.isShowEmptyRef = true;
this.differ = null;
@@ -143,7 +153,9 @@ export class ForDirective implements OnChanges {
private sortItems(items: any[]) {
if (this.orderBy) {
- items.sort((a, b) => (a[this.orderBy] > b[this.orderBy] ? 1 : a[this.orderBy] < b[this.orderBy] ? -1 : 0));
+ items.sort((a, b) =>
+ a[this.orderBy] > b[this.orderBy] ? 1 : a[this.orderBy] < b[this.orderBy] ? -1 : 0,
+ );
} else {
items.sort();
}
@@ -155,7 +167,11 @@ export class ForDirective implements OnChanges {
const compareFn = this.compareFn;
- if (typeof this.filterBy !== 'undefined' && typeof this.filterVal !== 'undefined' && this.filterVal !== '') {
+ if (
+ typeof this.filterBy !== 'undefined' &&
+ typeof this.filterVal !== 'undefined' &&
+ this.filterVal !== ''
+ ) {
items = items.filter(item => compareFn(item[this.filterBy], this.filterVal));
}
diff --git a/npm/ng-packs/packages/core/src/lib/directives/form-submit.directive.ts b/npm/ng-packs/packages/core/src/lib/directives/form-submit.directive.ts
index 5f42a65681..2ca2b9757d 100644
--- a/npm/ng-packs/packages/core/src/lib/directives/form-submit.directive.ts
+++ b/npm/ng-packs/packages/core/src/lib/directives/form-submit.directive.ts
@@ -16,7 +16,7 @@ import { SubscriptionService } from '../services/subscription.service';
type Controls = { [key: string]: FormControl } | FormGroup[];
@Directive({
- // tslint:disable-next-line: directive-selector
+ // eslint-disable-next-line @angular-eslint/directive-selector
selector: 'form[ngSubmit][formGroup]',
providers: [SubscriptionService],
})
diff --git a/npm/ng-packs/packages/core/src/lib/directives/replaceable-template.directive.ts b/npm/ng-packs/packages/core/src/lib/directives/replaceable-template.directive.ts
index 489d1afabc..0a5509aeec 100644
--- a/npm/ng-packs/packages/core/src/lib/directives/replaceable-template.directive.ts
+++ b/npm/ng-packs/packages/core/src/lib/directives/replaceable-template.directive.ts
@@ -19,15 +19,18 @@ import { ReplaceableComponents } from '../models/replaceable-components';
import { ReplaceableComponentsService } from '../services/replaceable-components.service';
import { SubscriptionService } from '../services/subscription.service';
-@Directive({ selector: '[abpReplaceableTemplate]', providers: [SubscriptionService] })
+@Directive({
+ selector: '[abpReplaceableTemplate]',
+ providers: [SubscriptionService],
+})
export class ReplaceableTemplateDirective implements OnInit, OnChanges {
@Input('abpReplaceableTemplate')
data: ReplaceableComponents.ReplaceableTemplateDirectiveInput;
- providedData = { inputs: {}, outputs: {} } as ReplaceableComponents.ReplaceableTemplateData<
- any,
- any
- >;
+ providedData = {
+ inputs: {},
+ outputs: {},
+ } as ReplaceableComponents.ReplaceableTemplateData;
context = {} as any;
@@ -106,7 +109,7 @@ export class ReplaceableTemplateDirective implements OnInit, OnChanges {
if (this.data.inputs) {
for (const key in this.data.inputs) {
- if (this.data.inputs.hasOwnProperty(key)) {
+ if (Object.prototype.hasOwnProperty.call(this.data.inputs, key)) {
if (!compare(this.defaultComponentRef[key], this.data.inputs[key].value)) {
this.defaultComponentRef[key] = this.data.inputs[key].value;
}
@@ -116,7 +119,7 @@ export class ReplaceableTemplateDirective implements OnInit, OnChanges {
if (this.data.outputs) {
for (const key in this.data.outputs) {
- if (this.data.outputs.hasOwnProperty(key)) {
+ if (Object.prototype.hasOwnProperty.call(this.data.outputs, key)) {
if (!this.defaultComponentSubscriptions[key]) {
this.defaultComponentSubscriptions[key] = this.defaultComponentRef[key].subscribe(
value => {
diff --git a/npm/ng-packs/packages/core/src/lib/directives/stop-propagation.directive.ts b/npm/ng-packs/packages/core/src/lib/directives/stop-propagation.directive.ts
index 12c035cc19..52722e95a9 100644
--- a/npm/ng-packs/packages/core/src/lib/directives/stop-propagation.directive.ts
+++ b/npm/ng-packs/packages/core/src/lib/directives/stop-propagation.directive.ts
@@ -3,7 +3,7 @@ import { fromEvent } from 'rxjs';
import { SubscriptionService } from '../services/subscription.service';
@Directive({
- // tslint:disable-next-line: directive-selector
+ // eslint-disable-next-line @angular-eslint/directive-selector
selector: '[click.stop]',
providers: [SubscriptionService],
})
diff --git a/npm/ng-packs/packages/core/src/lib/directives/visibility.directive.ts b/npm/ng-packs/packages/core/src/lib/directives/visibility.directive.ts
index 6cb341117d..b85440d486 100644
--- a/npm/ng-packs/packages/core/src/lib/directives/visibility.directive.ts
+++ b/npm/ng-packs/packages/core/src/lib/directives/visibility.directive.ts
@@ -22,8 +22,7 @@ export class VisibilityDirective implements AfterViewInit {
this.focusedElement = this.elRef.nativeElement;
}
- let observer: MutationObserver;
- observer = new MutationObserver(mutations => {
+ const observer = new MutationObserver(mutations => {
mutations.forEach(mutation => {
if (!mutation.target) return;
diff --git a/npm/ng-packs/packages/core/src/lib/models/dtos.ts b/npm/ng-packs/packages/core/src/lib/models/dtos.ts
index 49c1d8e735..b9b349f513 100644
--- a/npm/ng-packs/packages/core/src/lib/models/dtos.ts
+++ b/npm/ng-packs/packages/core/src/lib/models/dtos.ts
@@ -5,7 +5,7 @@ export class ListResultDto {
constructor(initialValues: Partial> = {}) {
for (const key in initialValues) {
- if (initialValues.hasOwnProperty(key)) {
+ if (Object.prototype.hasOwnProperty.call(initialValues, key)) {
this[key] = initialValues[key];
}
}
@@ -25,7 +25,10 @@ export class LimitedResultRequestDto {
constructor(initialValues: Partial = {}) {
for (const key in initialValues) {
- if (initialValues.hasOwnProperty(key) && initialValues[key] !== undefined) {
+ if (
+ Object.prototype.hasOwnProperty.call(initialValues, key) &&
+ initialValues[key] !== undefined
+ ) {
this[key] = initialValues[key];
}
}
@@ -53,7 +56,7 @@ export class EntityDto {
constructor(initialValues: Partial> = {}) {
for (const key in initialValues) {
- if (initialValues.hasOwnProperty(key)) {
+ if (Object.prototype.hasOwnProperty.call(initialValues, key)) {
this[key] = initialValues[key];
}
}
@@ -71,7 +74,7 @@ export class CreationAuditedEntityDto extends EntityDto extends CreationAuditedEntityDto {
creator?: TUserDto;
@@ -93,7 +96,7 @@ export class AuditedEntityDto extends CreationAuditedEntit
export class AuditedEntityWithUserDto<
TUserDto,
- TPrimaryKey = string
+ TPrimaryKey = string,
> extends AuditedEntityDto {
creator?: TUserDto;
lastModifier?: TUserDto;
@@ -115,7 +118,7 @@ export class FullAuditedEntityDto extends AuditedEntityDto
export class FullAuditedEntityWithUserDto<
TUserDto,
- TPrimaryKey = string
+ TPrimaryKey = string,
> extends FullAuditedEntityDto {
creator?: TUserDto;
lastModifier?: TUserDto;
@@ -131,7 +134,7 @@ export class ExtensibleObject {
constructor(initialValues: Partial = {}) {
for (const key in initialValues) {
- if (initialValues.hasOwnProperty(key)) {
+ if (Object.prototype.hasOwnProperty.call(initialValues, key)) {
this[key] = initialValues[key];
}
}
@@ -147,7 +150,7 @@ export class ExtensibleEntityDto extends ExtensibleObject {
}
export class ExtensibleCreationAuditedEntityDto<
- TPrimaryKey = string
+ TPrimaryKey = string,
> extends ExtensibleEntityDto {
creationTime: Date | string;
creatorId?: string;
@@ -158,7 +161,7 @@ export class ExtensibleCreationAuditedEntityDto<
}
export class ExtensibleAuditedEntityDto<
- TPrimaryKey = string
+ TPrimaryKey = string,
> extends ExtensibleCreationAuditedEntityDto {
lastModificationTime?: Date | string;
lastModifierId?: string;
@@ -170,7 +173,7 @@ export class ExtensibleAuditedEntityDto<
export class ExtensibleAuditedEntityWithUserDto<
TPrimaryKey = string,
- TUserDto = any
+ TUserDto = any,
> extends ExtensibleAuditedEntityDto {
creator: TUserDto;
lastModifier: TUserDto;
@@ -182,7 +185,7 @@ export class ExtensibleAuditedEntityWithUserDto<
export class ExtensibleCreationAuditedEntityWithUserDto<
TPrimaryKey = string,
- TUserDto = any
+ TUserDto = any,
> extends ExtensibleCreationAuditedEntityDto {
creator: TUserDto;
@@ -194,7 +197,7 @@ export class ExtensibleCreationAuditedEntityWithUserDto<
}
export class ExtensibleFullAuditedEntityDto<
- TPrimaryKey = string
+ TPrimaryKey = string,
> extends ExtensibleAuditedEntityDto {
isDeleted: boolean;
deleterId?: string;
@@ -207,7 +210,7 @@ export class ExtensibleFullAuditedEntityDto<
export class ExtensibleFullAuditedEntityWithUserDto<
TPrimaryKey = string,
- TUserDto = any
+ TUserDto = any,
> extends ExtensibleFullAuditedEntityDto {
creator: TUserDto;
lastModifier: TUserDto;
diff --git a/npm/ng-packs/packages/core/src/lib/models/replaceable-components.ts b/npm/ng-packs/packages/core/src/lib/models/replaceable-components.ts
index 1c59ff3a05..d20768e7ff 100644
--- a/npm/ng-packs/packages/core/src/lib/models/replaceable-components.ts
+++ b/npm/ng-packs/packages/core/src/lib/models/replaceable-components.ts
@@ -1,6 +1,6 @@
-import { Type, EventEmitter } from '@angular/core';
+import { EventEmitter, Type } from '@angular/core';
+import { Subject } from 'rxjs';
import { ABP } from './common';
-import { Subject, BehaviorSubject } from 'rxjs';
export namespace ReplaceableComponents {
export interface State {
@@ -14,7 +14,7 @@ export namespace ReplaceableComponents {
export interface ReplaceableTemplateDirectiveInput<
I,
- O extends { [K in keyof O]: EventEmitter | Subject }
+ O extends { [K in keyof O]: EventEmitter | Subject },
> {
inputs: { -readonly [K in keyof I]: { value: I[K]; twoWay?: boolean } };
outputs: { -readonly [K in keyof O]: (value: ABP.ExtractFromOutput) => void };
@@ -23,7 +23,7 @@ export namespace ReplaceableComponents {
export interface ReplaceableTemplateData<
I,
- O extends { [K in keyof O]: EventEmitter | Subject }
+ O extends { [K in keyof O]: EventEmitter | Subject },
> {
inputs: ReplaceableTemplateInputs;
outputs: ReplaceableTemplateOutputs;
@@ -35,7 +35,7 @@ export namespace ReplaceableComponents {
};
export type ReplaceableTemplateOutputs<
- T extends { [K in keyof T]: EventEmitter | Subject }
+ T extends { [K in keyof T]: EventEmitter | Subject },
> = {
[K in keyof T]: (value: ABP.ExtractFromOutput) => void;
};
diff --git a/npm/ng-packs/packages/core/src/lib/models/utility.ts b/npm/ng-packs/packages/core/src/lib/models/utility.ts
index 3f183d3944..6c13dca4ee 100644
--- a/npm/ng-packs/packages/core/src/lib/models/utility.ts
+++ b/npm/ng-packs/packages/core/src/lib/models/utility.ts
@@ -1,4 +1,3 @@
-/* tslint:disable:ban-types */
import { TemplateRef, Type } from '@angular/core';
export type DeepPartial = Partible extends never
@@ -10,6 +9,7 @@ export type DeepPartial = Partible extends never
type Partible = T extends Primitive | Array | Node
? never
: {
+ // eslint-disable-next-line @typescript-eslint/ban-types
[K in keyof T]: T[K] extends Function ? never : T[K];
} extends T
? T
diff --git a/npm/ng-packs/packages/core/src/lib/pipes/sort.pipe.ts b/npm/ng-packs/packages/core/src/lib/pipes/sort.pipe.ts
index 4d634f33c7..c44ca6f075 100644
--- a/npm/ng-packs/packages/core/src/lib/pipes/sort.pipe.ts
+++ b/npm/ng-packs/packages/core/src/lib/pipes/sort.pipe.ts
@@ -5,11 +5,7 @@ export type SortOrder = 'asc' | 'desc';
name: 'abpSort',
})
export class SortPipe implements PipeTransform {
- transform(
- value: any[],
- sortOrder: SortOrder | string = 'asc',
- sortKey?: string,
- ): any {
+ transform(value: any[], sortOrder: SortOrder | string = 'asc', sortKey?: string): any {
sortOrder = sortOrder && (sortOrder.toLowerCase() as any);
if (!value || (sortOrder !== 'asc' && sortOrder !== 'desc')) return value;
diff --git a/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending/models.ts b/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending/models.ts
index c72a9abc9b..b16411f5a3 100644
--- a/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending/models.ts
+++ b/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending/models.ts
@@ -1,3 +1,4 @@
+/* eslint-disable @typescript-eslint/ban-types */
export interface EntityExtensionDto {
properties: Record;
diff --git a/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy/models.ts b/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy/models.ts
index 2c948099b4..a88493c5c7 100644
--- a/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy/models.ts
+++ b/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy/models.ts
@@ -1,4 +1,3 @@
-
export interface FindTenantResultDto {
success: boolean;
tenantId?: string;
diff --git a/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/http/modeling/models.ts b/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/http/modeling/models.ts
index b23c8e5a2d..c4b1e9b5ee 100644
--- a/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/http/modeling/models.ts
+++ b/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/http/modeling/models.ts
@@ -1,3 +1,4 @@
+/* eslint-disable @typescript-eslint/ban-types */
export interface ActionApiDescriptionModel {
uniqueName?: string;
diff --git a/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/localization/models.ts b/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/localization/models.ts
index c881e7da2b..e46e9b6d3c 100644
--- a/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/localization/models.ts
+++ b/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/localization/models.ts
@@ -1,4 +1,3 @@
-
export interface LanguageInfo {
cultureName?: string;
uiCultureName?: string;
diff --git a/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/models.ts b/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/models.ts
index 5f16437958..f6f19c97ad 100644
--- a/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/models.ts
+++ b/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/models.ts
@@ -1,4 +1,3 @@
-
export interface NameValue {
name?: string;
value: T;
diff --git a/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts b/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts
index eb2a0d30b6..69cf23e8a4 100644
--- a/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts
+++ b/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
-import { Observable } from 'rxjs';
-import { map, tap } from 'rxjs/operators';
+import { Observable, Subject } from 'rxjs';
+import { map, take, switchMap } from 'rxjs/operators';
import { ApplicationConfigurationDto } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/models';
import { InternalStore } from '../utils/internal-store-utils';
import { AbpApplicationConfigurationService } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service';
@@ -15,14 +15,29 @@ export class ConfigStateService {
return this.store.sliceUpdate;
}
- constructor(private abpConfigService: AbpApplicationConfigurationService) {}
+ private updateSubject = new Subject();
+ constructor(private abpConfigService: AbpApplicationConfigurationService) {
+ this.initUpdateStream();
+ }
+
+ private initUpdateStream() {
+ this.updateSubject
+ .pipe(switchMap(() => this.abpConfigService.get()))
+ .subscribe(res => this.setState(res));
+ }
+
+ /**
+ * @deprecated do not use this method directly, instead call refreshAppState
+ * This method will be private in v5.0
+ */
setState(state: ApplicationConfigurationDto) {
this.store.set(state);
}
refreshAppState() {
- return this.abpConfigService.get().pipe(tap(res => this.setState(res)));
+ this.updateSubject.next();
+ return this.createOnUpdateStream(state => state).pipe(take(1));
}
getOne$(key: string) {
diff --git a/npm/ng-packs/packages/core/src/lib/services/list.service.ts b/npm/ng-packs/packages/core/src/lib/services/list.service.ts
index c77ba9cdb4..dc79e67f66 100644
--- a/npm/ng-packs/packages/core/src/lib/services/list.service.ts
+++ b/npm/ng-packs/packages/core/src/lib/services/list.service.ts
@@ -82,6 +82,8 @@ export class ListService implements OnDes
private destroy$ = new Subject();
+ private delay: MonoTypeOperatorFunction;
+
get isLoading$(): Observable {
return this._isLoading$.asObservable();
}
@@ -95,8 +97,6 @@ export class ListService implements OnDes
this.next();
};
- private delay: MonoTypeOperatorFunction;
-
constructor(injector: Injector) {
const delay = injector.get(LIST_QUERY_DEBOUNCE_TIME, 300);
this.delay = delay ? debounceTime(delay) : tap();
@@ -131,12 +131,12 @@ export class ListService implements OnDes
}
private next() {
- this._query$.next(({
+ this._query$.next({
filter: this._filter || undefined,
maxResultCount: this._maxResultCount,
skipCount: this._page * this._maxResultCount,
sorting: this._sortOrder ? `${this._sortKey} ${this._sortOrder}` : undefined,
- } as any) as QueryParamsType);
+ } as any as QueryParamsType);
}
}
diff --git a/npm/ng-packs/packages/core/src/lib/services/localization.service.ts b/npm/ng-packs/packages/core/src/lib/services/localization.service.ts
index dc229a4c22..fe6e410f24 100644
--- a/npm/ng-packs/packages/core/src/lib/services/localization.service.ts
+++ b/npm/ng-packs/packages/core/src/lib/services/localization.service.ts
@@ -1,10 +1,9 @@
import { registerLocaleData } from '@angular/common';
import { Injectable, Injector, isDevMode, Optional, SkipSelf } from '@angular/core';
import { from, Observable, Subject } from 'rxjs';
-import { filter, map, mapTo, switchMap, tap } from 'rxjs/operators';
+import { filter, map, mapTo, switchMap } from 'rxjs/operators';
import { ABP } from '../models/common';
import { Config } from '../models/config';
-import { AbpApplicationConfigurationService } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service';
import { ApplicationConfigurationDto } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/models';
import { CORE_OPTIONS } from '../tokens/options.token';
import { createLocalizer, createLocalizerWithFallback } from '../utils/localization-utils';
@@ -35,7 +34,6 @@ export class LocalizationService {
@SkipSelf()
otherInstance: LocalizationService,
private configState: ConfigStateService,
- private appConfigService: AbpApplicationConfigurationService,
) {
if (otherInstance) throw new Error('LocalizationService should have only one instance.');
@@ -49,12 +47,7 @@ export class LocalizationService {
filter(
lang => this.configState.getDeep('localization.currentCulture.cultureName') !== lang,
),
- switchMap(lang =>
- this.appConfigService
- .get()
- .pipe(tap(res => this.configState.setState(res)))
- .pipe(mapTo(lang)),
- ),
+ switchMap(lang => this.configState.refreshAppState().pipe(mapTo(lang))),
switchMap(lang => from(this.registerLocale(lang).then(() => lang))),
)
.subscribe(lang => this._languageChange$.next(lang));
diff --git a/npm/ng-packs/packages/core/src/lib/services/routes.service.ts b/npm/ng-packs/packages/core/src/lib/services/routes.service.ts
index 02c88b4901..13461491e3 100644
--- a/npm/ng-packs/packages/core/src/lib/services/routes.service.ts
+++ b/npm/ng-packs/packages/core/src/lib/services/routes.service.ts
@@ -6,6 +6,7 @@ import { BaseTreeNode, createTreeFromList, TreeNode } from '../utils/tree-utils'
import { ConfigStateService } from './config-state.service';
import { PermissionService } from './permission.service';
+// eslint-disable-next-line @typescript-eslint/ban-types
export abstract class AbstractTreeService {
abstract id: string;
abstract parentId: string;
diff --git a/npm/ng-packs/packages/core/src/lib/services/track-by.service.ts b/npm/ng-packs/packages/core/src/lib/services/track-by.service.ts
index aa72942ec0..5cce22d4a3 100644
--- a/npm/ng-packs/packages/core/src/lib/services/track-by.service.ts
+++ b/npm/ng-packs/packages/core/src/lib/services/track-by.service.ts
@@ -1,11 +1,18 @@
import { Injectable, TrackByFunction } from '@angular/core';
import { O } from 'ts-toolbelt';
-export const trackBy = (key: keyof T): TrackByFunction => (_, item) => item[key];
+export const trackBy =
+ (key: keyof T): TrackByFunction =>
+ (_, item) =>
+ item[key];
-export const trackByDeep = (
- ...keys: T extends object ? O.Paths : never
-): TrackByFunction => (_, item) => keys.reduce((acc, key) => acc[key], item);
+export const trackByDeep =
+ (
+ // eslint-disable-next-line @typescript-eslint/ban-types
+ ...keys: T extends object ? O.Paths : never
+ ): TrackByFunction =>
+ (_, item) =>
+ keys.reduce((acc, key) => acc[key], item);
@Injectable({
providedIn: 'root',
diff --git a/npm/ng-packs/packages/core/src/lib/states/config.state.ts b/npm/ng-packs/packages/core/src/lib/states/config.state.ts
index 4cc2dc741d..385bf6f634 100644
--- a/npm/ng-packs/packages/core/src/lib/states/config.state.ts
+++ b/npm/ng-packs/packages/core/src/lib/states/config.state.ts
@@ -1,19 +1,16 @@
-import { HttpClient, HttpErrorResponse } from '@angular/common/http';
+import { HttpErrorResponse } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Action, createSelector, Selector, State, StateContext, Store } from '@ngxs/store';
-import { of, throwError } from 'rxjs';
-import { catchError, distinctUntilChanged, switchMap, tap } from 'rxjs/operators';
+import compare from 'just-compare';
+import { throwError } from 'rxjs';
+import { catchError, distinctUntilChanged } from 'rxjs/operators';
import snq from 'snq';
import { GetAppConfiguration, PatchConfigState, SetEnvironment } from '../actions/config.actions';
import { RestOccurError } from '../actions/rest.actions';
-import { ApplicationConfiguration } from '../models/application-configuration';
import { Config } from '../models/config';
import { ConfigStateService } from '../services/config-state.service';
import { EnvironmentService } from '../services/environment.service';
-import { SessionStateService } from '../services/session-state.service';
import { interpolate } from '../utils/string-utils';
-import compare from 'just-compare';
-import { ApplicationConfigurationDto } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/models';
/**
* @deprecated Use ConfigStateService instead. To be deleted in v5.0.
@@ -143,11 +140,16 @@ export class ConfigState {
}
static getLocalizationResource(resourceName: string) {
- const selector = createSelector([ConfigState], (state: Config.State): {
- [key: string]: string;
- } => {
- return state.localization.values[resourceName];
- });
+ const selector = createSelector(
+ [ConfigState],
+ (
+ state: Config.State,
+ ): {
+ [key: string]: string;
+ } => {
+ return state.localization.values[resourceName];
+ },
+ );
return selector;
}
@@ -217,9 +219,7 @@ export class ConfigState {
}
constructor(
- private http: HttpClient,
private store: Store,
- private sessionState: SessionStateService,
private environmentService: EnvironmentService,
private configState: ConfigStateService,
) {
@@ -245,15 +245,12 @@ export class ConfigState {
addData({ patchState, dispatch }: StateContext) {
const apiName = 'default';
const api = this.store.selectSnapshot(ConfigState.getApiUrl(apiName));
- return this.http
- .get(`${api}/api/abp/application-configuration`)
- .pipe(
- tap(configuration => this.configState.setState(configuration)),
- catchError((err: HttpErrorResponse) => {
- dispatch(new RestOccurError(err));
- return throwError(err);
- }),
- );
+ return this.configState.refreshAppState().pipe(
+ catchError((err: HttpErrorResponse) => {
+ dispatch(new RestOccurError(err));
+ return throwError(err);
+ }),
+ );
}
@Action(SetEnvironment)
diff --git a/npm/ng-packs/packages/core/src/lib/strategies/auth-flow.strategy.ts b/npm/ng-packs/packages/core/src/lib/strategies/auth-flow.strategy.ts
index 4cb959ac45..001d0e8842 100644
--- a/npm/ng-packs/packages/core/src/lib/strategies/auth-flow.strategy.ts
+++ b/npm/ng-packs/packages/core/src/lib/strategies/auth-flow.strategy.ts
@@ -13,7 +13,6 @@ import { from, Observable, of, pipe } from 'rxjs';
import { filter, switchMap, tap } from 'rxjs/operators';
import { RestOccurError } from '../actions/rest.actions';
import { LoginParams } from '../models/auth';
-import { AbpApplicationConfigurationService } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service';
import { ConfigStateService } from '../services/config-state.service';
import { EnvironmentService } from '../services/environment.service';
import { SessionStateService } from '../services/session-state.service';
@@ -32,7 +31,6 @@ export abstract class AuthFlowStrategy {
protected oAuthService: OAuthService;
protected oAuthConfig: AuthConfig;
protected sessionState: SessionStateService;
- protected appConfigService: AbpApplicationConfigurationService;
protected tenantKey: string;
abstract checkIfInternalAuth(queryParams?: Params): boolean;
@@ -47,7 +45,6 @@ export abstract class AuthFlowStrategy {
this.environment = injector.get(EnvironmentService);
this.configState = injector.get(ConfigStateService);
this.oAuthService = injector.get(OAuthService);
- this.appConfigService = injector.get(AbpApplicationConfigurationService);
this.sessionState = injector.get(SessionStateService);
this.oAuthConfig = this.environment.getEnvironment().oAuthConfig;
this.tenantKey = injector.get(TENANT_KEY);
@@ -84,11 +81,9 @@ export abstract class AuthFlowStrategy {
.pipe(
filter(event => event instanceof OAuthErrorEvent),
tap(() => clearOAuthStorage()),
- switchMap(() => this.appConfigService.get()),
+ switchMap(() => this.configState.refreshAppState()),
)
- .subscribe(res => {
- this.configState.setState(res);
- });
+ .subscribe();
}
}
@@ -148,9 +143,7 @@ export class AuthPasswordFlowStrategy extends AuthFlowStrategy {
} else {
this.oAuthService.logOut();
removeRememberMe();
- this.appConfigService.get().subscribe(res => {
- this.configState.setState(res);
- });
+ this.configState.refreshAppState().subscribe();
}
});
}
@@ -188,9 +181,8 @@ export class AuthPasswordFlowStrategy extends AuthFlowStrategy {
const router = this.injector.get(Router);
return pipe(
- switchMap(() => this.appConfigService.get()),
- tap(res => {
- this.configState.setState(res);
+ switchMap(() => this.configState.refreshAppState()),
+ tap(() => {
setRememberMe(params.rememberMe);
if (params.redirectUrl) router.navigate([params.redirectUrl]);
}),
@@ -201,9 +193,8 @@ export class AuthPasswordFlowStrategy extends AuthFlowStrategy {
const router = this.injector.get(Router);
return from(this.oAuthService.revokeTokenAndLogout(queryParams)).pipe(
- switchMap(() => this.appConfigService.get()),
- tap(res => {
- this.configState.setState(res);
+ switchMap(() => this.configState.refreshAppState()),
+ tap(() => {
router.navigateByUrl('/');
removeRememberMe();
}),
diff --git a/npm/ng-packs/packages/core/src/lib/strategies/context.strategy.ts b/npm/ng-packs/packages/core/src/lib/strategies/context.strategy.ts
index 21007eae1c..36676c58a6 100644
--- a/npm/ng-packs/packages/core/src/lib/strategies/context.strategy.ts
+++ b/npm/ng-packs/packages/core/src/lib/strategies/context.strategy.ts
@@ -4,14 +4,13 @@ import { InferredContextOf, InferredInstanceOf } from '../models';
export abstract class ContextStrategy {
constructor(public context: Partial>) {}
- /* tslint:disable-next-line:no-unused-variable */
setContext(componentRef?: ComponentRef>): Partial> {
return this.context;
}
}
export class NoContextStrategy<
- T extends Type | TemplateRef = any
+ T extends Type | TemplateRef = any,
> extends ContextStrategy {
constructor() {
super(undefined);
diff --git a/npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts
index dad7a2c524..4cc69158ef 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts
@@ -1,11 +1,12 @@
+import { HttpClientTestingModule } from '@angular/common/http/testing';
import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest';
-import { ApplicationConfiguration } from '../models/application-configuration';
+import { Store } from '@ngxs/store';
import {
ApplicationConfigurationDto,
CurrentUserDto,
} from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/models';
import { ConfigStateService } from '../services';
-import { CoreTestingModule } from '@abp/ng.core/testing';
+import { CORE_OPTIONS } from '../tokens';
export const CONFIG_STATE_DATA = {
environment: {
@@ -106,7 +107,11 @@ describe('ConfigState', () => {
const createService = createServiceFactory({
service: ConfigStateService,
- imports: [CoreTestingModule.withConfig()],
+ imports: [HttpClientTestingModule],
+ providers: [
+ { provide: CORE_OPTIONS, useValue: { skipGetAppConfiguration: true } },
+ { provide: Store, useValue: {} },
+ ],
});
beforeEach(() => {
diff --git a/npm/ng-packs/packages/core/src/lib/tests/container.strategy.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/container.strategy.spec.ts
index e85e7b5a50..d34de7d6ec 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/container.strategy.spec.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/container.strategy.spec.ts
@@ -6,10 +6,10 @@ import {
} from '../strategies';
describe('ClearContainerStrategy', () => {
- const containerRef = ({
+ const containerRef = {
clear: jest.fn(),
length: 7,
- } as any) as ViewContainerRef;
+ } as any as ViewContainerRef;
describe('#getIndex', () => {
it('should return 0', () => {
@@ -29,10 +29,10 @@ describe('ClearContainerStrategy', () => {
});
describe('InsertIntoContainerStrategy', () => {
- const containerRef = ({
+ const containerRef = {
clear: jest.fn(),
length: 7,
- } as any) as ViewContainerRef;
+ } as any as ViewContainerRef;
describe('#getIndex', () => {
test.each`
@@ -61,10 +61,10 @@ describe('InsertIntoContainerStrategy', () => {
});
describe('CONTAINER_STRATEGY', () => {
- const containerRef = ({
+ const containerRef = {
clear: jest.fn(),
length: 7,
- } as any) as ViewContainerRef;
+ } as any as ViewContainerRef;
test.each`
name | Strategy | index
diff --git a/npm/ng-packs/packages/core/src/lib/tests/environment.service.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/environment.service.spec.ts
index 95c2b58a6c..a1c44d8a7b 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/environment.service.spec.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/environment.service.spec.ts
@@ -3,7 +3,7 @@ import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest';
import { Environment } from '../models';
import { EnvironmentService } from '../services';
-export const ENVIRONMENT_DATA = ({
+export const ENVIRONMENT_DATA = {
production: false,
application: {
name: 'MyProjectName',
@@ -23,7 +23,7 @@ export const ENVIRONMENT_DATA = ({
localization: {
defaultResourceName: 'MyProjectName',
},
-} as any) as Environment;
+} as any as Environment;
describe('ConfigState', () => {
let spectator: SpectatorService;
diff --git a/npm/ng-packs/packages/core/src/lib/tests/for.directive.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/for.directive.spec.ts
index 1405935b62..d83be2ff0e 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/for.directive.spec.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/for.directive.spec.ts
@@ -51,9 +51,12 @@ describe('ForDirective', () => {
describe('trackBy', () => {
const trackByFn = (_, item) => item;
beforeEach(() => {
- spectator = createDirective('', {
- hostProps: { items, trackByFn },
- });
+ spectator = createDirective(
+ '',
+ {
+ hostProps: { items, trackByFn },
+ },
+ );
directive = spectator.directive;
});
diff --git a/npm/ng-packs/packages/core/src/lib/tests/initial-utils.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/initial-utils.spec.ts
index 60569180d1..49efd0141e 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/initial-utils.spec.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/initial-utils.spec.ts
@@ -54,7 +54,6 @@ describe('InitialUtils', () => {
const environmentService = spectator.inject(EnvironmentService);
const configStateService = spectator.inject(ConfigStateService);
const sessionStateService = spectator.inject(SessionStateService);
- const applicationConfigurationService = spectator.inject(AbpApplicationConfigurationService);
const parseTenantFromUrlSpy = jest.spyOn(multiTenancyUtils, 'parseTenantFromUrl');
const getRemoteEnvSpy = jest.spyOn(environmentUtils, 'getRemoteEnv');
parseTenantFromUrlSpy.mockReturnValue(Promise.resolve());
@@ -64,11 +63,9 @@ describe('InitialUtils', () => {
currentTenant: { id: 'test', name: 'testing' },
} as ApplicationConfigurationDto;
- const getConfigurationSpy = jest.spyOn(applicationConfigurationService, 'get');
- getConfigurationSpy.mockReturnValue(of(appConfigRes));
-
const environmentSetStateSpy = jest.spyOn(environmentService, 'setState');
- const configSetStateSpy = jest.spyOn(configStateService, 'setState');
+ const configRefreshAppStateSpy = jest.spyOn(configStateService, 'refreshAppState');
+ configRefreshAppStateSpy.mockReturnValue(of(appConfigRes));
const sessionSetTenantSpy = jest.spyOn(sessionStateService, 'setTenant');
const configStateGetOneSpy = jest.spyOn(configStateService, 'getOne');
@@ -81,9 +78,8 @@ describe('InitialUtils', () => {
await getInitialData(mockInjector)();
expect(typeof getInitialData(mockInjector)).toBe('function');
+ expect(configRefreshAppStateSpy).toHaveBeenCalled();
expect(environmentSetStateSpy).toHaveBeenCalledWith(environment);
- expect(getConfigurationSpy).toHaveBeenCalled();
- expect(configSetStateSpy).toHaveBeenCalledWith(appConfigRes);
expect(sessionSetTenantSpy).toHaveBeenCalledWith(appConfigRes.currentTenant);
});
});
diff --git a/npm/ng-packs/packages/core/src/lib/tests/internal-store.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/internal-store.spec.ts
index c0728db069..3fb3cb5f02 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/internal-store.spec.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/internal-store.spec.ts
@@ -17,13 +17,17 @@ const mockInitialState = {
type MockState = typeof mockInitialState;
-const deepPatch1: DeepPartial = { foo: { bar: { baz: [() => {}] } } };
+const deepPatch1: DeepPartial = {
+ foo: { bar: { baz: [() => {}] } },
+};
const deepPatchExpected1: MockState = clone(mockInitialState);
deepPatchExpected1.foo.bar.baz = deepPatch1.foo.bar.baz;
-const deepPatch2: DeepPartial = { foo: { bar: { qux: Promise.resolve() } } };
+const deepPatch2: DeepPartial = {
+ foo: { bar: { qux: Promise.resolve() } },
+};
const deepPatchExpected2: MockState = clone(mockInitialState);
-deepPatchExpected2.foo.bar.qux = deepPatch2.foo.bar.qux;
+deepPatchExpected2.foo.bar.qux = deepPatch2.foo.bar.qux as any;
const deepPatch3: DeepPartial = { foo: { n: 1 } };
const deepPatchExpected3: MockState = clone(mockInitialState);
@@ -49,7 +53,9 @@ const patch2: Partial = {
const patchExpected2: MockState = clone(mockInitialState);
patchExpected2.foo = patch2.foo;
-const patch3: Partial = { foo: { n: 1 } as typeof mockInitialState.foo };
+const patch3: Partial = {
+ foo: { n: 1 } as typeof mockInitialState.foo,
+};
const patchExpected3: MockState = clone(mockInitialState);
patchExpected3.foo = patch3.foo;
diff --git a/npm/ng-packs/packages/core/src/lib/tests/lazy-load-utils.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/lazy-load-utils.spec.ts
index 7afb343e80..4d4d55caf7 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/lazy-load-utils.spec.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/lazy-load-utils.spec.ts
@@ -55,7 +55,7 @@ describe('Lazy Load Utils', () => {
it('should emit error event on fail and clear callbacks', done => {
const error = new CustomEvent('error');
const parentNode = { removeChild: jest.fn() };
- const element = ({ parentNode } as any) as HTMLLinkElement;
+ const element = { parentNode } as any as HTMLLinkElement;
fromLazyLoad(
element,
@@ -84,7 +84,7 @@ describe('Lazy Load Utils', () => {
it('should emit load event on success and clear callbacks', done => {
const success = new CustomEvent('load');
const parentNode = { removeChild: jest.fn() };
- const element = ({ parentNode } as any) as HTMLLinkElement;
+ const element = { parentNode } as any as HTMLLinkElement;
fromLazyLoad(
element,
diff --git a/npm/ng-packs/packages/core/src/lib/tests/localization.service.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/localization.service.spec.ts
index b130afcc23..c8d89f54e4 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/localization.service.spec.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/localization.service.spec.ts
@@ -74,7 +74,6 @@ describe('LocalizationService', () => {
spectator.inject(Injector),
null,
null,
- {} as any,
);
} catch (error) {
expect((error as Error).message).toBe('LocalizationService should have only one instance.');
diff --git a/npm/ng-packs/packages/core/src/lib/tests/permission.guard.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/permission.guard.spec.ts
index ef5b3cd1ab..e654b9ef65 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/permission.guard.spec.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/permission.guard.spec.ts
@@ -1,4 +1,5 @@
import { APP_BASE_HREF } from '@angular/common';
+import { HttpClientTestingModule } from '@angular/common/http/testing';
import { Component } from '@angular/core';
import { RouterModule } from '@angular/router';
import { createServiceFactory, SpectatorService, SpyObject } from '@ngneat/spectator/jest';
@@ -6,8 +7,9 @@ import { Actions, Store } from '@ngxs/store';
import { of } from 'rxjs';
import { RestOccurError } from '../actions';
import { PermissionGuard } from '../guards/permission.guard';
-import { RoutesService } from '../services/routes.service';
import { PermissionService } from '../services';
+import { RoutesService } from '../services/routes.service';
+import { CORE_OPTIONS } from '../tokens';
describe('PermissionGuard', () => {
let spectator: SpectatorService;
@@ -24,15 +26,19 @@ describe('PermissionGuard', () => {
mocks: [PermissionService, Store],
declarations: [DummyComponent],
imports: [
- RouterModule.forRoot([
- {
- path: 'test',
- component: DummyComponent,
- data: {
- requiredPolicy: 'TestPolicy',
- },
- },
-], { relativeLinkResolution: 'legacy' }),
+ HttpClientTestingModule,
+ RouterModule.forRoot(
+ [
+ {
+ path: 'test',
+ component: DummyComponent,
+ data: {
+ requiredPolicy: 'TestPolicy',
+ },
+ },
+ ],
+ { relativeLinkResolution: 'legacy' },
+ ),
],
providers: [
{
@@ -47,6 +53,7 @@ describe('PermissionGuard', () => {
},
},
},
+ { provide: CORE_OPTIONS, useValue: { skipGetAppConfiguration: true } },
],
});
@@ -74,7 +81,9 @@ describe('PermissionGuard', () => {
guard.canActivate({ data: { requiredPolicy: 'test' } } as any, null).subscribe(res => {
expect(res).toBe(false);
expect(spy.mock.calls[0][0] instanceof RestOccurError).toBeTruthy();
- expect((spy.mock.calls[0][0] as RestOccurError).payload).toEqual({ status: 403 });
+ expect((spy.mock.calls[0][0] as RestOccurError).payload).toEqual({
+ status: 403,
+ });
done();
});
});
diff --git a/npm/ng-packs/packages/core/src/lib/tests/profile.service.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/profile.service.spec.ts
index 33106e0e29..894a7c20cf 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/profile.service.spec.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/profile.service.spec.ts
@@ -8,7 +8,7 @@ describe('ProfileService', () => {
let environmentService: SpyObject;
const createHttp = createHttpFactory({
- dataService: ProfileService,
+ service: ProfileService,
providers: [
RestService,
{ provide: CORE_OPTIONS, useValue: {} },
diff --git a/npm/ng-packs/packages/core/src/lib/tests/projection.strategy.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/projection.strategy.spec.ts
index a0b3bb61bb..1f1927366a 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/projection.strategy.spec.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/projection.strategy.spec.ts
@@ -57,7 +57,7 @@ describe('ComponentProjectionStrategy', () => {
describe('#injectContent', () => {
it('should should insert content into container and return a ComponentRef', () => {
const strategy = new ComponentProjectionStrategy(TestComponent, containerStrategy);
- componentRef = strategy.injectContent(spectator);
+ componentRef = strategy.injectContent({ get: spectator.inject });
spectator.detectChanges();
const div = spectator.query('div.foo');
@@ -72,7 +72,7 @@ describe('ComponentProjectionStrategy', () => {
containerStrategy,
contextStrategy,
);
- componentRef = strategy.injectContent(spectator);
+ componentRef = strategy.injectContent({ get: spectator.inject });
spectator.detectChanges();
const div = spectator.query('div.foo');
@@ -114,7 +114,7 @@ describe('RootComponentProjectionStrategy', () => {
describe('#injectContent', () => {
it('should should insert content into body and return a ComponentRef', () => {
const strategy = new RootComponentProjectionStrategy(TestComponent);
- componentRef = strategy.injectContent(spectator);
+ componentRef = strategy.injectContent({ get: spectator.inject });
spectator.detectChanges();
const div = document.querySelector('body > ng-component > div.foo');
@@ -127,7 +127,7 @@ describe('RootComponentProjectionStrategy', () => {
it('should be able to map context to projected component', () => {
const contextStrategy = CONTEXT_STRATEGY.Component({ bar: 'bar' });
const strategy = new RootComponentProjectionStrategy(TestComponent, contextStrategy);
- componentRef = strategy.injectContent(spectator);
+ componentRef = strategy.injectContent({ get: spectator.inject });
spectator.detectChanges();
const div = document.querySelector('body > ng-component > div.foo');
@@ -194,7 +194,9 @@ describe('TemplateProjectionStrategy', () => {
it('should be able to map context to projected template', () => {
const templateRef = spectator.component.templateRef;
- const contextStrategy = CONTEXT_STRATEGY.Template({ $implicit: 'bar' });
+ const contextStrategy = CONTEXT_STRATEGY.Template({
+ $implicit: 'bar',
+ });
const strategy = new TemplateProjectionStrategy(
templateRef,
containerStrategy,
@@ -212,7 +214,7 @@ describe('TemplateProjectionStrategy', () => {
describe('PROJECTION_STRATEGY', () => {
const content = undefined;
- const containerRef = ({ length: 0 } as any) as ViewContainerRef;
+ const containerRef = { length: 0 } as any as ViewContainerRef;
let context: any;
test.each`
diff --git a/npm/ng-packs/packages/core/src/lib/tests/replaceable-template.directive.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/replaceable-template.directive.spec.ts
index 300f9e64d7..38ebd34428 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/replaceable-template.directive.spec.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/replaceable-template.directive.spec.ts
@@ -1,4 +1,4 @@
-import { Component, EventEmitter, Inject, Input, OnInit, Optional, Output } from '@angular/core';
+import { Component, EventEmitter, Inject, Input, Optional, Output } from '@angular/core';
import { Router } from '@angular/router';
import { createDirectiveFactory, SpectatorDirective } from '@ngneat/spectator/jest';
import { BehaviorSubject } from 'rxjs';
@@ -11,7 +11,7 @@ import { ReplaceableComponentsService } from '../services/replaceable-components
template: ' default
',
exportAs: 'abpDefaultComponent',
})
-class DefaultComponent implements OnInit {
+class DefaultComponent {
@Input()
oneWay;
@@ -24,8 +24,6 @@ class DefaultComponent implements OnInit {
@Output()
readonly someOutput = new EventEmitter();
- ngOnInit() {}
-
setTwoWay(value) {
this.twoWay = value;
this.twoWayChange.emit(value);
diff --git a/npm/ng-packs/packages/core/src/lib/tests/rest.service.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/rest.service.spec.ts
index e9d0ab5ebc..15c20aee18 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/rest.service.spec.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/rest.service.spec.ts
@@ -15,7 +15,7 @@ describe('HttpClient testing', () => {
const api = 'https://abp.io';
const createHttp = createHttpFactory({
- dataService: RestService,
+ service: RestService,
providers: [EnvironmentService, { provide: CORE_OPTIONS, useValue: { environment: {} } }],
mocks: [OAuthService, Store],
});
diff --git a/npm/ng-packs/packages/core/src/lib/tests/route-utils.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/route-utils.spec.ts
index 3945a6527d..43b93d6747 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/route-utils.spec.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/route-utils.spec.ts
@@ -5,7 +5,6 @@ import { RouterOutletComponent } from '../components';
import { RoutesService } from '../services/routes.service';
import { findRoute, getRoutePath } from '../utils/route-utils';
-// tslint:disable-next-line
@Component({ template: '' })
class DummyComponent {}
@@ -23,7 +22,7 @@ describe('Route Utils', () => {
'should find $expected in $count turns when path is $path',
async ({ path, expected, count }) => {
const find = jest.fn(cb => (cb(node) ? node : null));
- const routes = ({ find } as any) as RoutesService;
+ const routes = { find } as any as RoutesService;
const route = findRoute(routes, path);
expect(route).toBe(expected);
expect(find).toHaveBeenCalledTimes(count);
diff --git a/npm/ng-packs/packages/core/src/lib/tests/router-outlet.component.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/router-outlet.component.spec.ts
index b7e79b9c08..1de681bc60 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/router-outlet.component.spec.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/router-outlet.component.spec.ts
@@ -4,11 +4,16 @@ import { RouterOutletComponent } from '../components/router-outlet.component';
describe('RouterOutletComponent', () => {
let spectator: Spectator;
- const createHost = createHostFactory({ component: RouterOutletComponent, imports: [RouterTestingModule] });
+ const createHost = createHostFactory({
+ component: RouterOutletComponent,
+ imports: [RouterTestingModule],
+ });
it('should have a router-outlet element', () => {
spectator = createHost('');
expect((spectator.debugElement.nativeElement as HTMLElement).children.length).toBe(1);
- expect((spectator.debugElement.nativeElement as HTMLElement).children[0].tagName).toBe('ROUTER-OUTLET');
+ expect((spectator.debugElement.nativeElement as HTMLElement).children[0].tagName).toBe(
+ 'ROUTER-OUTLET',
+ );
});
});
diff --git a/npm/ng-packs/packages/core/src/lib/tests/routes.handler.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/routes.handler.spec.ts
index 777df39c60..a8c5d92734 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/routes.handler.spec.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/routes.handler.spec.ts
@@ -18,8 +18,8 @@ describe('Routes Handler', () => {
const routes = [];
const add = jest.fn(routes.push.bind(routes));
- const mockRoutesService = ({ add } as unknown) as RoutesService;
- const mockRouter = ({ config } as unknown) as Router;
+ const mockRoutesService = { add } as unknown as RoutesService;
+ const mockRouter = { config } as unknown as Router;
const handler = new RoutesHandler(mockRoutesService, mockRouter);
@@ -30,7 +30,7 @@ describe('Routes Handler', () => {
it('should not add routes when there is no router', () => {
const routes = [];
const add = jest.fn(routes.push.bind(routes));
- const mockRoutesService = ({ add } as unknown) as RoutesService;
+ const mockRoutesService = { add } as unknown as RoutesService;
const handler = new RoutesHandler(mockRoutesService, null);
diff --git a/npm/ng-packs/packages/core/src/lib/tests/routes.service.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/routes.service.spec.ts
index 8f68be56de..d8f482f9d9 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/routes.service.spec.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/routes.service.spec.ts
@@ -1,7 +1,7 @@
import { Subject } from 'rxjs';
import { take } from 'rxjs/operators';
import { RoutesService } from '../services';
-import { DummyInjector, mockActions } from './utils/common.utils';
+import { DummyInjector } from './utils/common.utils';
import { mockPermissionService } from './utils/permission-service.spec.utils';
const updateStream$ = new Subject();
diff --git a/npm/ng-packs/packages/core/src/lib/tests/sort.pipe.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/sort.pipe.spec.ts
index b69d139091..0d60ab0b21 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/sort.pipe.spec.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/sort.pipe.spec.ts
@@ -17,13 +17,7 @@ describe('SortPipe', () => {
});
test('should sort object array in given order with given key', () => {
- const array = [
- { key: 5 },
- { key: 'b' },
- { key: 1 },
- { key: 'a' },
- { key: null },
- ];
+ const array = [{ key: 5 }, { key: 'b' }, { key: 1 }, { key: 'a' }, { key: null }];
expect(pipe.transform(array, 'asc', 'key')).toEqual([
{ key: 1 },
diff --git a/npm/ng-packs/packages/core/src/lib/tests/utils/common.utils.ts b/npm/ng-packs/packages/core/src/lib/tests/utils/common.utils.ts
index ba05659736..327119bb00 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/utils/common.utils.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/utils/common.utils.ts
@@ -3,14 +3,14 @@ import { Store } from '@ngxs/store';
import { AbstractType, InjectFlags, InjectionToken, Injector, Type } from '@angular/core';
export const mockActions = new Subject();
-export const mockStore = ({
+export const mockStore = {
selectSnapshot() {
return true;
},
select(): Observable {
return of(null);
},
-} as unknown) as Store;
+} as unknown as Store;
export class DummyInjector extends Injector {
constructor(public payload: { [key: string]: any }) {
diff --git a/npm/ng-packs/packages/core/src/lib/utils/auth-utils.ts b/npm/ng-packs/packages/core/src/lib/utils/auth-utils.ts
index 44da3f7c4a..10fe1e1177 100644
--- a/npm/ng-packs/packages/core/src/lib/utils/auth-utils.ts
+++ b/npm/ng-packs/packages/core/src/lib/utils/auth-utils.ts
@@ -4,7 +4,6 @@ import { OAuthStorage, TokenResponse } from 'angular-oauth2-oidc';
import { pipe } from 'rxjs';
import { switchMap, tap } from 'rxjs/operators';
import { LoginParams } from '../models/auth';
-import { AbpApplicationConfigurationService } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service';
import { ConfigStateService } from '../services/config-state.service';
const cookieKey = 'rememberMe';
@@ -15,13 +14,11 @@ export function pipeToLogin(
injector: Injector,
) {
const configState = injector.get(ConfigStateService);
- const appConfigService = injector.get(AbpApplicationConfigurationService);
const router = injector.get(Router);
return pipe(
- switchMap(() => appConfigService.get()),
- tap(res => {
- configState.setState(res);
+ switchMap(() => configState.refreshAppState()),
+ tap(() => {
setRememberMe(params.rememberMe);
if (params.redirectUrl) router.navigate([params.redirectUrl]);
}),
diff --git a/npm/ng-packs/packages/core/src/lib/utils/common-utils.ts b/npm/ng-packs/packages/core/src/lib/utils/common-utils.ts
index 3b0446240b..31a1970fdc 100644
--- a/npm/ng-packs/packages/core/src/lib/utils/common-utils.ts
+++ b/npm/ng-packs/packages/core/src/lib/utils/common-utils.ts
@@ -1,6 +1,5 @@
export function noop() {
- // tslint:disable-next-line: only-arrow-functions
- const fn = function() {};
+ const fn = function () {};
return fn;
}
diff --git a/npm/ng-packs/packages/core/src/lib/utils/date-extensions.ts b/npm/ng-packs/packages/core/src/lib/utils/date-extensions.ts
index 8f0d17504d..6c6c1453ad 100644
--- a/npm/ng-packs/packages/core/src/lib/utils/date-extensions.ts
+++ b/npm/ng-packs/packages/core/src/lib/utils/date-extensions.ts
@@ -6,7 +6,7 @@ declare global {
}
}
-Date.prototype.toLocalISOString = function(this: Date): string {
+Date.prototype.toLocalISOString = function (this: Date): string {
const timezoneOffset = this.getTimezoneOffset();
return new Date(this.getTime() - timezoneOffset * 60000).toISOString();
diff --git a/npm/ng-packs/packages/core/src/lib/utils/generator-utils.ts b/npm/ng-packs/packages/core/src/lib/utils/generator-utils.ts
index a5fd4c9c65..7b95e71a59 100644
--- a/npm/ng-packs/packages/core/src/lib/utils/generator-utils.ts
+++ b/npm/ng-packs/packages/core/src/lib/utils/generator-utils.ts
@@ -1,5 +1,3 @@
-// tslint:disable: no-bitwise
-
export function uuid(a?: any): string {
return a
? (a ^ ((Math.random() * 16) >> (a / 4))).toString(16)
diff --git a/npm/ng-packs/packages/core/src/lib/utils/initial-utils.ts b/npm/ng-packs/packages/core/src/lib/utils/initial-utils.ts
index 87982d8bd0..9c14d14b6d 100644
--- a/npm/ng-packs/packages/core/src/lib/utils/initial-utils.ts
+++ b/npm/ng-packs/packages/core/src/lib/utils/initial-utils.ts
@@ -5,7 +5,6 @@ import { tap, catchError } from 'rxjs/operators';
import { throwError } from 'rxjs';
import { ABP } from '../models/common';
import { Environment } from '../models/environment';
-import { AbpApplicationConfigurationService } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service';
import { CurrentTenantDto } from '../proxy/volo/abp/asp-net-core/mvc/multi-tenancy/models';
import { AuthService } from '../services/auth.service';
import { ConfigStateService } from '../services/config-state.service';
@@ -21,7 +20,6 @@ export function getInitialData(injector: Injector) {
const fn = async () => {
const environmentService = injector.get(EnvironmentService);
const configState = injector.get(ConfigStateService);
- const appConfigService = injector.get(AbpApplicationConfigurationService);
const options = injector.get(CORE_OPTIONS) as ABP.Root;
environmentService.setState(options.environment as Environment);
@@ -31,10 +29,9 @@ export function getInitialData(injector: Injector) {
if (options.skipGetAppConfiguration) return;
- return appConfigService
- .get()
+ return configState
+ .refreshAppState()
.pipe(
- tap(res => configState.setState(res)),
tap(() => checkAccessToken(injector)),
tap(() => {
const currentTenant = configState.getOne('currentTenant') as CurrentTenantDto;
diff --git a/npm/ng-packs/packages/core/src/lib/utils/lazy-load-utils.ts b/npm/ng-packs/packages/core/src/lib/utils/lazy-load-utils.ts
index f602bf06ef..6bf80143ea 100644
--- a/npm/ng-packs/packages/core/src/lib/utils/lazy-load-utils.ts
+++ b/npm/ng-packs/packages/core/src/lib/utils/lazy-load-utils.ts
@@ -33,8 +33,7 @@ export function fromLazyLoad(
}
function createErrorHandler(observer: Observer, element: HTMLElement) {
- /* tslint:disable-next-line:only-arrow-functions */
- return function(event: Event | string) {
+ return function (event: Event | string) {
clearCallbacks(element);
element.parentNode.removeChild(element);
observer.error(event);
diff --git a/npm/ng-packs/packages/core/src/lib/utils/number-utils.ts b/npm/ng-packs/packages/core/src/lib/utils/number-utils.ts
index ebd44b67c6..e817379d1b 100644
--- a/npm/ng-packs/packages/core/src/lib/utils/number-utils.ts
+++ b/npm/ng-packs/packages/core/src/lib/utils/number-utils.ts
@@ -1,4 +1,3 @@
export function isNumber(value: string | number): boolean {
- /* tslint:disable-next-line:triple-equals */
return value == Number(value);
}
diff --git a/npm/ng-packs/packages/core/src/lib/utils/rxjs-utils.ts b/npm/ng-packs/packages/core/src/lib/utils/rxjs-utils.ts
index 7e77bddba5..4a237abbfc 100644
--- a/npm/ng-packs/packages/core/src/lib/utils/rxjs-utils.ts
+++ b/npm/ng-packs/packages/core/src/lib/utils/rxjs-utils.ts
@@ -1,4 +1,3 @@
-// tslint:disable: max-line-length
import { Observable, Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@@ -9,24 +8,24 @@ function isFunction(value) {
/**
* @deprecated no longer working, please use SubscriptionService (https://docs.abp.io/en/abp/latest/UI/Angular/Subscription-Service) instead.
*/
-export const takeUntilDestroy = (componentInstance, destroyMethodName = 'ngOnDestroy') => (
- source: Observable,
-) => {
- const originalDestroy = componentInstance[destroyMethodName];
- if (isFunction(originalDestroy) === false) {
- throw new Error(
- `${componentInstance.constructor.name} is using untilDestroyed but doesn't implement ${destroyMethodName}`,
- );
- }
- if (!componentInstance['__takeUntilDestroy']) {
- componentInstance['__takeUntilDestroy'] = new Subject();
+export const takeUntilDestroy =
+ (componentInstance, destroyMethodName = 'ngOnDestroy') =>
+ (source: Observable) => {
+ const originalDestroy = componentInstance[destroyMethodName];
+ if (isFunction(originalDestroy) === false) {
+ throw new Error(
+ `${componentInstance.constructor.name} is using untilDestroyed but doesn't implement ${destroyMethodName}`,
+ );
+ }
+ if (!componentInstance['__takeUntilDestroy']) {
+ componentInstance['__takeUntilDestroy'] = new Subject();
- componentInstance[destroyMethodName] = function() {
- // tslint:disable-next-line: no-unused-expression
- isFunction(originalDestroy) && originalDestroy.apply(this, arguments);
- componentInstance['__takeUntilDestroy'].next(true);
- componentInstance['__takeUntilDestroy'].complete();
- };
- }
- return source.pipe(takeUntil(componentInstance['__takeUntilDestroy']));
-};
+ componentInstance[destroyMethodName] = function () {
+ // eslint-disable-next-line prefer-rest-params
+ isFunction(originalDestroy) && originalDestroy.apply(this, arguments);
+ componentInstance['__takeUntilDestroy'].next(true);
+ componentInstance['__takeUntilDestroy'].complete();
+ };
+ }
+ return source.pipe(takeUntil(componentInstance['__takeUntilDestroy']));
+ };
diff --git a/npm/ng-packs/packages/core/src/lib/utils/tree-utils.ts b/npm/ng-packs/packages/core/src/lib/utils/tree-utils.ts
index 235820abd6..6f8a6313d3 100644
--- a/npm/ng-packs/packages/core/src/lib/utils/tree-utils.ts
+++ b/npm/ng-packs/packages/core/src/lib/utils/tree-utils.ts
@@ -1,3 +1,4 @@
+/* eslint-disable @typescript-eslint/ban-types */
export class BaseTreeNode {
children: TreeNode[] = [];
isLeaf = true;
diff --git a/npm/ng-packs/packages/core/src/lib/validators/credit-card.validator.ts b/npm/ng-packs/packages/core/src/lib/validators/credit-card.validator.ts
index b4ca128ef5..91948e37c4 100644
--- a/npm/ng-packs/packages/core/src/lib/validators/credit-card.validator.ts
+++ b/npm/ng-packs/packages/core/src/lib/validators/credit-card.validator.ts
@@ -22,7 +22,6 @@ function isValidCreditCard(value: string): boolean {
for (let i = value.length; i > 0; i--) {
const digit = Number(value[i - 1]) * multiplier;
- /* tslint:disable-next-line:no-bitwise */
checksum += (digit % 10) + ~~(digit / 10);
multiplier = (multiplier * 2) % 3;
diff --git a/npm/ng-packs/packages/core/src/public-api.ts b/npm/ng-packs/packages/core/src/public-api.ts
index e37884c3a1..906e9fc769 100644
--- a/npm/ng-packs/packages/core/src/public-api.ts
+++ b/npm/ng-packs/packages/core/src/public-api.ts
@@ -8,24 +8,24 @@ export * from './lib/actions';
export * from './lib/components';
export * from './lib/constants';
export * from './lib/core.module';
-export * from './lib/localization.module';
export * from './lib/directives';
export * from './lib/enums';
export * from './lib/guards';
export * from './lib/interceptors';
+export * from './lib/localization.module';
export * from './lib/models';
export * from './lib/pipes';
+export * from './lib/proxy/pages/abp/multi-tenancy';
+export * from './lib/proxy/volo/abp/asp-net-core/mvc/api-exploring';
+export * from './lib/proxy/volo/abp/asp-net-core/mvc/application-configurations';
+export * from './lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending';
+export * from './lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy';
+export * from './lib/proxy/volo/abp/http/modeling';
+export * from './lib/proxy/volo/abp/localization';
+export * from './lib/proxy/volo/abp/models';
export * from './lib/services';
export * from './lib/states';
export * from './lib/strategies';
export * from './lib/tokens';
export * from './lib/utils';
export * from './lib/validators';
-export * from './lib/proxy/volo/abp/asp-net-core/mvc/api-exploring';
-export * from './lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy';
-export * from './lib/proxy/volo/abp/asp-net-core/mvc/application-configurations';
-export * from './lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending';
-export * from './lib/proxy/volo/abp/http/modeling';
-export * from './lib/proxy/volo/abp/models';
-export * from './lib/proxy/volo/abp/localization';
-export * from './lib/proxy/pages/abp/multi-tenancy';
diff --git a/npm/ng-packs/packages/core/src/test-setup.ts b/npm/ng-packs/packages/core/src/test-setup.ts
new file mode 100644
index 0000000000..1100b3e8a6
--- /dev/null
+++ b/npm/ng-packs/packages/core/src/test-setup.ts
@@ -0,0 +1 @@
+import 'jest-preset-angular/setup-jest';
diff --git a/npm/ng-packs/packages/core/testing/ng-package.json b/npm/ng-packs/packages/core/testing/ng-package.json
index e647bd0d3e..c2afe62d54 100644
--- a/npm/ng-packs/packages/core/testing/ng-package.json
+++ b/npm/ng-packs/packages/core/testing/ng-package.json
@@ -1,6 +1,6 @@
{
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
- "dest": "../../dist/core/testing",
+ "dest": "../../../dist/packages/core/testing",
"lib": {
"entryFile": "src/public-api.ts"
}
diff --git a/npm/ng-packs/packages/core/tsconfig.json b/npm/ng-packs/packages/core/tsconfig.json
new file mode 100644
index 0000000000..692cc17b32
--- /dev/null
+++ b/npm/ng-packs/packages/core/tsconfig.json
@@ -0,0 +1,16 @@
+{
+ "extends": "../../tsconfig.base.json",
+ "files": [],
+ "include": [],
+ "references": [
+ {
+ "path": "./tsconfig.lib.json"
+ },
+ {
+ "path": "./tsconfig.spec.json"
+ }
+ ],
+ "compilerOptions": {
+ "allowSyntheticDefaultImports": true,
+ }
+}
diff --git a/npm/ng-packs/packages/core/tsconfig.lib.json b/npm/ng-packs/packages/core/tsconfig.lib.json
index 4f48db2e46..bbcc12b1c7 100644
--- a/npm/ng-packs/packages/core/tsconfig.lib.json
+++ b/npm/ng-packs/packages/core/tsconfig.lib.json
@@ -1,19 +1,14 @@
{
- "extends": "../../tsconfig.prod.json",
+ "extends": "./tsconfig.json",
"compilerOptions": {
- "outDir": "../../out-tsc/lib",
+ "outDir": "../../dist/out-tsc",
"target": "es2015",
"declaration": true,
+ "declarationMap": true,
"inlineSources": true,
"types": [],
"lib": ["dom", "es2018"]
},
- "angularCompilerOptions": {
- "skipTemplateCodegen": true,
- "strictMetadataEmit": true,
- "fullTemplateTypeCheck": true,
- "strictInjectionParameters": true,
- "enableResourceInlining": true
- },
- "exclude": ["src/test.ts", "**/*.spec.ts"]
+ "exclude": ["src/test-setup.ts", "**/*.spec.ts"],
+ "include": ["**/*.ts"]
}
diff --git a/npm/ng-packs/packages/core/tsconfig.lib.prod.json b/npm/ng-packs/packages/core/tsconfig.lib.prod.json
index b1d501abbc..573fb7bef3 100644
--- a/npm/ng-packs/packages/core/tsconfig.lib.prod.json
+++ b/npm/ng-packs/packages/core/tsconfig.lib.prod.json
@@ -1,6 +1,11 @@
+/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.lib.json",
+ "compilerOptions": {
+ "declarationMap": false,
+ },
"angularCompilerOptions": {
- "enableIvy": false
+ "compilationMode": "partial",
+ "enableIvy": true
}
-}
\ No newline at end of file
+}
diff --git a/npm/ng-packs/packages/core/tsconfig.spec.json b/npm/ng-packs/packages/core/tsconfig.spec.json
index 02f312c262..a42c4b02fb 100644
--- a/npm/ng-packs/packages/core/tsconfig.spec.json
+++ b/npm/ng-packs/packages/core/tsconfig.spec.json
@@ -1,11 +1,11 @@
{
- "extends": "../../tsconfig.prod.json",
+ "extends": "./tsconfig.json",
"compilerOptions": {
- "emitDecoratorMetadata": true,
- "esModuleInterop": true,
"outDir": "../../dist/out-tsc",
"module": "commonjs",
- "types": ["jest", "node"]
+ "types": ["jest", "node"],
+ "esModuleInterop": true
},
+ "files": ["src/test-setup.ts"],
"include": ["**/*.spec.ts", "**/*.d.ts"]
}
diff --git a/npm/ng-packs/packages/core/tslint.json b/npm/ng-packs/packages/core/tslint.json
deleted file mode 100644
index 8c3919ea62..0000000000
--- a/npm/ng-packs/packages/core/tslint.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "extends": "../../tslint.json",
- "rules": {
- "directive-selector": [
- true,
- "attribute",
- "abp",
- "camelCase"
- ],
- "component-selector": [
- true,
- "element",
- "abp",
- "kebab-case"
- ]
- }
-}
diff --git a/npm/ng-packs/packages/feature-management/.eslintrc.json b/npm/ng-packs/packages/feature-management/.eslintrc.json
new file mode 100644
index 0000000000..9c51584494
--- /dev/null
+++ b/npm/ng-packs/packages/feature-management/.eslintrc.json
@@ -0,0 +1,36 @@
+{
+ "extends": ["../../.eslintrc.json"],
+ "ignorePatterns": ["!**/*"],
+ "overrides": [
+ {
+ "files": ["*.ts"],
+ "extends": [
+ "plugin:@nrwl/nx/angular",
+ "plugin:@angular-eslint/template/process-inline-templates"
+ ],
+ "rules": {
+ "@angular-eslint/directive-selector": [
+ "error",
+ {
+ "type": "attribute",
+ "prefix": "abp",
+ "style": "camelCase"
+ }
+ ],
+ "@angular-eslint/component-selector": [
+ "error",
+ {
+ "type": "element",
+ "prefix": "abp",
+ "style": "kebab-case"
+ }
+ ]
+ }
+ },
+ {
+ "files": ["*.html"],
+ "extends": ["plugin:@nrwl/nx/angular-template"],
+ "rules": {}
+ }
+ ]
+}
diff --git a/npm/ng-packs/packages/feature-management/jest.config.js b/npm/ng-packs/packages/feature-management/jest.config.js
index 327a1a8391..3e548f35eb 100644
--- a/npm/ng-packs/packages/feature-management/jest.config.js
+++ b/npm/ng-packs/packages/feature-management/jest.config.js
@@ -1,6 +1,20 @@
-const jestConfig = require('../../jest.config');
-
module.exports = {
- ...jestConfig,
- name: 'feature-management',
+ displayName: 'feature-management',
+ preset: '../../jest.preset.js',
+ setupFilesAfterEnv: ['/src/test-setup.ts'],
+ globals: {
+ 'ts-jest': {
+ tsconfig: '/tsconfig.spec.json',
+ stringifyContentPathRegex: '\\.(html|svg)$',
+ },
+ },
+ coverageDirectory: '../../coverage/packages/feature-management',
+ transform: {
+ '^.+\\.(ts|js|html)$': 'jest-preset-angular',
+ },
+ snapshotSerializers: [
+ 'jest-preset-angular/build/serializers/no-ng-attributes',
+ 'jest-preset-angular/build/serializers/ng-snapshot',
+ 'jest-preset-angular/build/serializers/html-comment',
+ ],
};
diff --git a/npm/ng-packs/packages/feature-management/ng-package.json b/npm/ng-packs/packages/feature-management/ng-package.json
index f2282c2e6e..fd7341bd25 100644
--- a/npm/ng-packs/packages/feature-management/ng-package.json
+++ b/npm/ng-packs/packages/feature-management/ng-package.json
@@ -1,6 +1,6 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
- "dest": "../../dist/feature-management",
+ "dest": "../../dist/packages/feature-management",
"lib": {
"entryFile": "src/public-api.ts"
},
diff --git a/npm/ng-packs/packages/feature-management/package.json b/npm/ng-packs/packages/feature-management/package.json
index 60690ef01b..85b5956f98 100644
--- a/npm/ng-packs/packages/feature-management/package.json
+++ b/npm/ng-packs/packages/feature-management/package.json
@@ -1,6 +1,6 @@
{
"name": "@abp/ng.feature-management",
- "version": "4.4.0-rc.2",
+ "version": "4.4.0",
"homepage": "https://abp.io",
"repository": {
"type": "git",
diff --git a/npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.ts b/npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.ts
index 4bda77b4fb..e40779eba4 100644
--- a/npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.ts
+++ b/npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.ts
@@ -1,12 +1,8 @@
-import {
- AbpApplicationConfigurationService,
- ConfigStateService,
- TrackByService,
-} from '@abp/ng.core';
+import { ConfigStateService, TrackByService } from '@abp/ng.core';
import { LocaleDirection } from '@abp/ng.theme.shared';
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Store } from '@ngxs/store';
-import { finalize, tap } from 'rxjs/operators';
+import { finalize } from 'rxjs/operators';
import { FeatureManagement } from '../../models/feature-management';
import { FeaturesService } from '../../proxy/feature-management/features.service';
import {
@@ -29,7 +25,8 @@ enum ValueTypes {
export class FeatureManagementComponent
implements
FeatureManagement.FeatureManagementComponentInputs,
- FeatureManagement.FeatureManagementComponentOutputs {
+ FeatureManagement.FeatureManagementComponentOutputs
+{
@Input()
providerKey: string;
@@ -70,7 +67,6 @@ export class FeatureManagementComponent
protected service: FeaturesService,
protected store: Store,
protected configState: ConfigStateService,
- protected appConfigService: AbpApplicationConfigurationService,
) {}
openModal() {
@@ -122,10 +118,7 @@ export class FeatureManagementComponent
if (!this.providerKey) {
// to refresh host's features
- this.appConfigService
- .get()
- .pipe(tap(res => this.configState.setState(res)))
- .subscribe();
+ this.configState.refreshAppState().subscribe();
}
});
}
diff --git a/npm/ng-packs/packages/feature-management/src/lib/directives/free-text-input.directive.ts b/npm/ng-packs/packages/feature-management/src/lib/directives/free-text-input.directive.ts
index f72729375a..6b6556dcfa 100644
--- a/npm/ng-packs/packages/feature-management/src/lib/directives/free-text-input.directive.ts
+++ b/npm/ng-packs/packages/feature-management/src/lib/directives/free-text-input.directive.ts
@@ -1,4 +1,4 @@
-import { Directive, Input, HostBinding } from '@angular/core';
+import { Directive, HostBinding, Input } from '@angular/core';
// TODO: improve this type
export interface FreeTextType {
@@ -20,6 +20,7 @@ export const INPUT_TYPES = {
})
export class FreeTextInputDirective {
_feature: FreeTextType;
+ // eslint-disable-next-line @angular-eslint/no-input-rename
@Input('abpFeatureManagementFreeText') set feature(val: FreeTextType) {
this._feature = val;
this.setInputType();
diff --git a/npm/ng-packs/packages/feature-management/src/lib/proxy/feature-management/features.service.ts b/npm/ng-packs/packages/feature-management/src/lib/proxy/feature-management/features.service.ts
index c1ff025b1b..cdc12ad36d 100644
--- a/npm/ng-packs/packages/feature-management/src/lib/proxy/feature-management/features.service.ts
+++ b/npm/ng-packs/packages/feature-management/src/lib/proxy/feature-management/features.service.ts
@@ -9,21 +9,25 @@ export class FeaturesService {
apiName = 'AbpFeatureManagement';
get = (providerName: string, providerKey: string) =>
- this.restService.request({
- method: 'GET',
- url: '/api/feature-management/features',
- params: { providerName, providerKey },
- },
- { apiName: this.apiName });
+ this.restService.request(
+ {
+ method: 'GET',
+ url: '/api/feature-management/features',
+ params: { providerName, providerKey },
+ },
+ { apiName: this.apiName },
+ );
update = (providerName: string, providerKey: string, input: UpdateFeaturesDto) =>
- this.restService.request({
- method: 'PUT',
- url: '/api/feature-management/features',
- params: { providerName, providerKey },
- body: input,
- },
- { apiName: this.apiName });
+ this.restService.request(
+ {
+ method: 'PUT',
+ url: '/api/feature-management/features',
+ params: { providerName, providerKey },
+ body: input,
+ },
+ { apiName: this.apiName },
+ );
constructor(private restService: RestService) {}
}
diff --git a/npm/ng-packs/packages/feature-management/src/lib/proxy/validation/string-values/models.ts b/npm/ng-packs/packages/feature-management/src/lib/proxy/validation/string-values/models.ts
index f4f9381611..215effbe2e 100644
--- a/npm/ng-packs/packages/feature-management/src/lib/proxy/validation/string-values/models.ts
+++ b/npm/ng-packs/packages/feature-management/src/lib/proxy/validation/string-values/models.ts
@@ -1,3 +1,4 @@
+/* eslint-disable @typescript-eslint/ban-types */
export interface IStringValueType {
name: string;
diff --git a/npm/ng-packs/packages/feature-management/src/public-api.ts b/npm/ng-packs/packages/feature-management/src/public-api.ts
index 1d9ef938b8..10c71be72a 100644
--- a/npm/ng-packs/packages/feature-management/src/public-api.ts
+++ b/npm/ng-packs/packages/feature-management/src/public-api.ts
@@ -1,5 +1,6 @@
-export * from './lib/feature-management.module';
export * from './lib/components';
+export * from './lib/directives';
export * from './lib/enums/components';
+export * from './lib/feature-management.module';
export * from './lib/proxy/feature-management';
export * from './lib/proxy/validation/string-values';
diff --git a/npm/ng-packs/packages/feature-management/src/test-setup.ts b/npm/ng-packs/packages/feature-management/src/test-setup.ts
new file mode 100644
index 0000000000..1100b3e8a6
--- /dev/null
+++ b/npm/ng-packs/packages/feature-management/src/test-setup.ts
@@ -0,0 +1 @@
+import 'jest-preset-angular/setup-jest';
diff --git a/npm/ng-packs/packages/feature-management/tsconfig.json b/npm/ng-packs/packages/feature-management/tsconfig.json
new file mode 100644
index 0000000000..62ebbd9464
--- /dev/null
+++ b/npm/ng-packs/packages/feature-management/tsconfig.json
@@ -0,0 +1,13 @@
+{
+ "extends": "../../tsconfig.base.json",
+ "files": [],
+ "include": [],
+ "references": [
+ {
+ "path": "./tsconfig.lib.json"
+ },
+ {
+ "path": "./tsconfig.spec.json"
+ }
+ ]
+}
diff --git a/npm/ng-packs/packages/feature-management/tsconfig.lib.json b/npm/ng-packs/packages/feature-management/tsconfig.lib.json
index 4f48db2e46..bbcc12b1c7 100644
--- a/npm/ng-packs/packages/feature-management/tsconfig.lib.json
+++ b/npm/ng-packs/packages/feature-management/tsconfig.lib.json
@@ -1,19 +1,14 @@
{
- "extends": "../../tsconfig.prod.json",
+ "extends": "./tsconfig.json",
"compilerOptions": {
- "outDir": "../../out-tsc/lib",
+ "outDir": "../../dist/out-tsc",
"target": "es2015",
"declaration": true,
+ "declarationMap": true,
"inlineSources": true,
"types": [],
"lib": ["dom", "es2018"]
},
- "angularCompilerOptions": {
- "skipTemplateCodegen": true,
- "strictMetadataEmit": true,
- "fullTemplateTypeCheck": true,
- "strictInjectionParameters": true,
- "enableResourceInlining": true
- },
- "exclude": ["src/test.ts", "**/*.spec.ts"]
+ "exclude": ["src/test-setup.ts", "**/*.spec.ts"],
+ "include": ["**/*.ts"]
}
diff --git a/npm/ng-packs/packages/feature-management/tsconfig.lib.prod.json b/npm/ng-packs/packages/feature-management/tsconfig.lib.prod.json
index b1d501abbc..85cd584a48 100644
--- a/npm/ng-packs/packages/feature-management/tsconfig.lib.prod.json
+++ b/npm/ng-packs/packages/feature-management/tsconfig.lib.prod.json
@@ -1,6 +1,11 @@
+/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.lib.json",
+ "compilerOptions": {
+ "declarationMap": false
+ },
"angularCompilerOptions": {
- "enableIvy": false
+ "compilationMode": "partial",
+ "enableIvy": true
}
-}
\ No newline at end of file
+}
diff --git a/npm/ng-packs/packages/feature-management/tsconfig.spec.json b/npm/ng-packs/packages/feature-management/tsconfig.spec.json
index 02f312c262..a42c4b02fb 100644
--- a/npm/ng-packs/packages/feature-management/tsconfig.spec.json
+++ b/npm/ng-packs/packages/feature-management/tsconfig.spec.json
@@ -1,11 +1,11 @@
{
- "extends": "../../tsconfig.prod.json",
+ "extends": "./tsconfig.json",
"compilerOptions": {
- "emitDecoratorMetadata": true,
- "esModuleInterop": true,
"outDir": "../../dist/out-tsc",
"module": "commonjs",
- "types": ["jest", "node"]
+ "types": ["jest", "node"],
+ "esModuleInterop": true
},
+ "files": ["src/test-setup.ts"],
"include": ["**/*.spec.ts", "**/*.d.ts"]
}
diff --git a/npm/ng-packs/packages/feature-management/tslint.json b/npm/ng-packs/packages/feature-management/tslint.json
deleted file mode 100644
index 081ce1077e..0000000000
--- a/npm/ng-packs/packages/feature-management/tslint.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "extends": "../../tslint.json",
- "rules": {
- "interface-name": false,
- "directive-selector": [true, "attribute", "abp", "camelCase"],
- "component-selector": [true, "element", "abp", "kebab-case"]
- }
-}
diff --git a/npm/ng-packs/packages/identity/.eslintrc.json b/npm/ng-packs/packages/identity/.eslintrc.json
new file mode 100644
index 0000000000..9c51584494
--- /dev/null
+++ b/npm/ng-packs/packages/identity/.eslintrc.json
@@ -0,0 +1,36 @@
+{
+ "extends": ["../../.eslintrc.json"],
+ "ignorePatterns": ["!**/*"],
+ "overrides": [
+ {
+ "files": ["*.ts"],
+ "extends": [
+ "plugin:@nrwl/nx/angular",
+ "plugin:@angular-eslint/template/process-inline-templates"
+ ],
+ "rules": {
+ "@angular-eslint/directive-selector": [
+ "error",
+ {
+ "type": "attribute",
+ "prefix": "abp",
+ "style": "camelCase"
+ }
+ ],
+ "@angular-eslint/component-selector": [
+ "error",
+ {
+ "type": "element",
+ "prefix": "abp",
+ "style": "kebab-case"
+ }
+ ]
+ }
+ },
+ {
+ "files": ["*.html"],
+ "extends": ["plugin:@nrwl/nx/angular-template"],
+ "rules": {}
+ }
+ ]
+}
diff --git a/npm/ng-packs/packages/identity/config/ng-package.json b/npm/ng-packs/packages/identity/config/ng-package.json
index 48b66ee803..1a45764aaf 100644
--- a/npm/ng-packs/packages/identity/config/ng-package.json
+++ b/npm/ng-packs/packages/identity/config/ng-package.json
@@ -1,6 +1,6 @@
{
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
- "dest": "../../dist/identity/config",
+ "dest": "../../../dist/packages/identity/config",
"lib": {
"entryFile": "src/public-api.ts"
}
diff --git a/npm/ng-packs/packages/identity/jest.config.js b/npm/ng-packs/packages/identity/jest.config.js
index 3ab73ba573..0ef650e156 100644
--- a/npm/ng-packs/packages/identity/jest.config.js
+++ b/npm/ng-packs/packages/identity/jest.config.js
@@ -1,6 +1,20 @@
-const jestConfig = require('../../jest.config');
-
module.exports = {
- ...jestConfig,
- name: 'identity',
+ displayName: 'identity',
+ preset: '../../jest.preset.js',
+ setupFilesAfterEnv: ['/src/test-setup.ts'],
+ globals: {
+ 'ts-jest': {
+ tsconfig: '/tsconfig.spec.json',
+ stringifyContentPathRegex: '\\.(html|svg)$',
+ },
+ },
+ coverageDirectory: '../../coverage/packages/identity',
+ transform: {
+ '^.+\\.(ts|js|html)$': 'jest-preset-angular',
+ },
+ snapshotSerializers: [
+ 'jest-preset-angular/build/serializers/no-ng-attributes',
+ 'jest-preset-angular/build/serializers/ng-snapshot',
+ 'jest-preset-angular/build/serializers/html-comment',
+ ],
};
diff --git a/npm/ng-packs/packages/identity/ng-package.json b/npm/ng-packs/packages/identity/ng-package.json
index c51f2a9422..a0824f39e5 100644
--- a/npm/ng-packs/packages/identity/ng-package.json
+++ b/npm/ng-packs/packages/identity/ng-package.json
@@ -1,8 +1,11 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
- "dest": "../../dist/identity",
+ "dest": "../../dist/packages/identity",
"lib": {
"entryFile": "src/public-api.ts"
},
- "allowedNonPeerDependencies": ["@abp/ng.theme.shared", "@abp/ng.permission-management"]
+ "allowedNonPeerDependencies": [
+ "@abp/ng.theme.shared",
+ "@abp/ng.permission-management"
+ ]
}
diff --git a/npm/ng-packs/packages/identity/ngcc.config.js b/npm/ng-packs/packages/identity/ngcc.config.js
deleted file mode 100644
index 93f34d5655..0000000000
--- a/npm/ng-packs/packages/identity/ngcc.config.js
+++ /dev/null
@@ -1,7 +0,0 @@
-module.exports = {
- entryPoints: {
- '.': {},
- './config': {},
- './dist': { ignore: true },
- },
-};
diff --git a/npm/ng-packs/packages/identity/package.json b/npm/ng-packs/packages/identity/package.json
index 56369843f3..37da33811e 100644
--- a/npm/ng-packs/packages/identity/package.json
+++ b/npm/ng-packs/packages/identity/package.json
@@ -1,6 +1,6 @@
{
"name": "@abp/ng.identity",
- "version": "4.4.0-rc.2",
+ "version": "4.4.0",
"homepage": "https://abp.io",
"repository": {
"type": "git",
diff --git a/npm/ng-packs/packages/identity/src/lib/proxy/identity/identity-role.service.ts b/npm/ng-packs/packages/identity/src/lib/proxy/identity/identity-role.service.ts
index 5fd029c43d..edbc094037 100644
--- a/npm/ng-packs/packages/identity/src/lib/proxy/identity/identity-role.service.ts
+++ b/npm/ng-packs/packages/identity/src/lib/proxy/identity/identity-role.service.ts
@@ -10,49 +10,65 @@ export class IdentityRoleService {
apiName = 'AbpIdentity';
create = (input: IdentityRoleCreateDto) =>
- this.restService.request({
- method: 'POST',
- url: '/api/identity/roles',
- body: input,
- },
- { apiName: this.apiName });
+ this.restService.request(
+ {
+ method: 'POST',
+ url: '/api/identity/roles',
+ body: input,
+ },
+ { apiName: this.apiName },
+ );
delete = (id: string) =>
- this.restService.request({
- method: 'DELETE',
- url: `/api/identity/roles/${id}`,
- },
- { apiName: this.apiName });
+ this.restService.request(
+ {
+ method: 'DELETE',
+ url: `/api/identity/roles/${id}`,
+ },
+ { apiName: this.apiName },
+ );
get = (id: string) =>
- this.restService.request({
- method: 'GET',
- url: `/api/identity/roles/${id}`,
- },
- { apiName: this.apiName });
+ this.restService.request(
+ {
+ method: 'GET',
+ url: `/api/identity/roles/${id}`,
+ },
+ { apiName: this.apiName },
+ );
getAllList = () =>
- this.restService.request>({
- method: 'GET',
- url: '/api/identity/roles/all',
- },
- { apiName: this.apiName });
+ this.restService.request>(
+ {
+ method: 'GET',
+ url: '/api/identity/roles/all',
+ },
+ { apiName: this.apiName },
+ );
getList = (input: PagedAndSortedResultRequestDto) =>
- this.restService.request>({
- method: 'GET',
- url: '/api/identity/roles',
- params: { sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
- },
- { apiName: this.apiName });
+ this.restService.request>(
+ {
+ method: 'GET',
+ url: '/api/identity/roles',
+ params: {
+ sorting: input.sorting,
+ skipCount: input.skipCount,
+ maxResultCount: input.maxResultCount,
+ },
+ },
+ { apiName: this.apiName },
+ );
update = (id: string, input: IdentityRoleUpdateDto) =>
- this.restService.request({
- method: 'PUT',
- url: `/api/identity/roles/${id}`,
- body: input,
- },
- { apiName: this.apiName });
+ this.restService.request(
+ {
+ method: 'PUT',
+ url: `/api/identity/roles/${id}`,
+ body: input,
+ },
+ { apiName: this.apiName },
+ );
constructor(private restService: RestService) {}
}
diff --git a/npm/ng-packs/packages/identity/src/lib/proxy/identity/identity-user-lookup.service.ts b/npm/ng-packs/packages/identity/src/lib/proxy/identity/identity-user-lookup.service.ts
index af4583aa28..50eeef604e 100644
--- a/npm/ng-packs/packages/identity/src/lib/proxy/identity/identity-user-lookup.service.ts
+++ b/npm/ng-packs/packages/identity/src/lib/proxy/identity/identity-user-lookup.service.ts
@@ -11,34 +11,47 @@ export class IdentityUserLookupService {
apiName = 'AbpIdentity';
findById = (id: string) =>
- this.restService.request({
- method: 'GET',
- url: `/api/identity/users/lookup/${id}`,
- },
- { apiName: this.apiName });
+ this.restService.request(
+ {
+ method: 'GET',
+ url: `/api/identity/users/lookup/${id}`,
+ },
+ { apiName: this.apiName },
+ );
findByUserName = (userName: string) =>
- this.restService.request({
- method: 'GET',
- url: `/api/identity/users/lookup/by-username/${userName}`,
- },
- { apiName: this.apiName });
+ this.restService.request(
+ {
+ method: 'GET',
+ url: `/api/identity/users/lookup/by-username/${userName}`,
+ },
+ { apiName: this.apiName },
+ );
getCount = (input: UserLookupCountInputDto) =>
- this.restService.request({
- method: 'GET',
- url: '/api/identity/users/lookup/count',
- params: { filter: input.filter },
- },
- { apiName: this.apiName });
+ this.restService.request(
+ {
+ method: 'GET',
+ url: '/api/identity/users/lookup/count',
+ params: { filter: input.filter },
+ },
+ { apiName: this.apiName },
+ );
search = (input: UserLookupSearchInputDto) =>
- this.restService.request>({
- method: 'GET',
- url: '/api/identity/users/lookup/search',
- params: { filter: input.filter, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
- },
- { apiName: this.apiName });
+ this.restService.request>(
+ {
+ method: 'GET',
+ url: '/api/identity/users/lookup/search',
+ params: {
+ filter: input.filter,
+ sorting: input.sorting,
+ skipCount: input.skipCount,
+ maxResultCount: input.maxResultCount,
+ },
+ },
+ { apiName: this.apiName },
+ );
constructor(private restService: RestService) {}
}
diff --git a/npm/ng-packs/packages/identity/src/lib/proxy/identity/identity-user.service.ts b/npm/ng-packs/packages/identity/src/lib/proxy/identity/identity-user.service.ts
index fe69946ff1..7e3b22a96a 100644
--- a/npm/ng-packs/packages/identity/src/lib/proxy/identity/identity-user.service.ts
+++ b/npm/ng-packs/packages/identity/src/lib/proxy/identity/identity-user.service.ts
@@ -4,7 +4,8 @@ import type {
IdentityUserCreateDto,
IdentityUserDto,
IdentityUserUpdateDto,
- IdentityUserUpdateRolesDto } from './models';
+ IdentityUserUpdateRolesDto,
+} from './models';
import { RestService } from '@abp/ng.core';
import type { ListResultDto, PagedResultDto } from '@abp/ng.core';
import { Injectable } from '@angular/core';
@@ -16,78 +17,103 @@ export class IdentityUserService {
apiName = 'AbpIdentity';
create = (input: IdentityUserCreateDto) =>
- this.restService.request({
- method: 'POST',
- url: '/api/identity/users',
- body: input,
- },
- { apiName: this.apiName });
+ this.restService.request(
+ {
+ method: 'POST',
+ url: '/api/identity/users',
+ body: input,
+ },
+ { apiName: this.apiName },
+ );
delete = (id: string) =>
- this.restService.request({
- method: 'DELETE',
- url: `/api/identity/users/${id}`,
- },
- { apiName: this.apiName });
+ this.restService.request(
+ {
+ method: 'DELETE',
+ url: `/api/identity/users/${id}`,
+ },
+ { apiName: this.apiName },
+ );
findByEmail = (email: string) =>
- this.restService.request({
- method: 'GET',
- url: `/api/identity/users/by-email/${email}`,
- },
- { apiName: this.apiName });
+ this.restService.request(
+ {
+ method: 'GET',
+ url: `/api/identity/users/by-email/${email}`,
+ },
+ { apiName: this.apiName },
+ );
findByUsername = (username: string) =>
- this.restService.request({
- method: 'GET',
- url: '/api/identity/users/by-username/{userName}',
- },
- { apiName: this.apiName });
+ this.restService.request