diff --git a/npm/ng-packs/packages/core/src/lib/core.module.ts b/npm/ng-packs/packages/core/src/lib/core.module.ts index 597e114d4a..8cf9a90886 100644 --- a/npm/ng-packs/packages/core/src/lib/core.module.ts +++ b/npm/ng-packs/packages/core/src/lib/core.module.ts @@ -187,7 +187,7 @@ export class CoreModule { }, { provide: HTTP_INTERCEPTORS, - useClass: ApiInterceptor, + useExisting: ApiInterceptor, multi: true, }, { diff --git a/npm/ng-packs/packages/core/src/lib/interceptors/api.interceptor.ts b/npm/ng-packs/packages/core/src/lib/interceptors/api.interceptor.ts index 2bcdadaf22..b27c7fa80a 100644 --- a/npm/ng-packs/packages/core/src/lib/interceptors/api.interceptor.ts +++ b/npm/ng-packs/packages/core/src/lib/interceptors/api.interceptor.ts @@ -6,7 +6,9 @@ import { SessionState } from '../states'; import { StartLoader, StopLoader } from '../actions/loader.actions'; import { finalize } from 'rxjs/operators'; -@Injectable() +@Injectable({ + providedIn: 'root', +}) export class ApiInterceptor implements HttpInterceptor { constructor(private oAuthService: OAuthService, private store: Store) {} diff --git a/npm/ng-packs/packages/core/src/lib/models/application-configuration.ts b/npm/ng-packs/packages/core/src/lib/models/application-configuration.ts index 1f3bb65f4e..c974f842a2 100644 --- a/npm/ng-packs/packages/core/src/lib/models/application-configuration.ts +++ b/npm/ng-packs/packages/core/src/lib/models/application-configuration.ts @@ -63,10 +63,15 @@ export namespace ApplicationConfiguration { export interface CurrentUser { email: string; + emailVerified: false; id: string; isAuthenticated: boolean; roles: string[]; tenantId: string; userName: string; + name: string; + phoneNumber: string; + phoneNumberVerified: boolean; + surName: 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 3ebb6dc193..1a1e7c1aeb 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 @@ -17,6 +17,8 @@ import { LIST_QUERY_DEBOUNCE_TIME } from '../tokens/list.token'; export class ListService implements OnDestroy { private _filter = ''; set filter(value: string) { + if (this._filter !== value) this._page = 0; + this._filter = value; this.get(); } diff --git a/npm/ng-packs/packages/schematics/src/commands/api/schema.json b/npm/ng-packs/packages/schematics/src/commands/api/schema.json index db58ed73ce..d003d3a4b2 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/schema.json +++ b/npm/ng-packs/packages/schematics/src/commands/api/schema.json @@ -29,7 +29,7 @@ "$source": "argv", "index": 2 }, - "x-prompt": "Plese enter source Angular project for API definition URL & root namespace resolution. (default: workspace \"defaultProject\")" + "x-prompt": "Please enter source Angular project for API definition URL & root namespace resolution. (default: workspace \"defaultProject\")" }, "target": { "description": "Target Angular project to place the generated code", @@ -38,7 +38,7 @@ "$source": "argv", "index": 3 }, - "x-prompt": "Plese enter target Angular project to place the generated code. (default: workspace \"defaultProject\")" + "x-prompt": "Please enter target Angular project to place the generated code. (default: workspace \"defaultProject\")" } }, "required": [] diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy-add/schema.json b/npm/ng-packs/packages/schematics/src/commands/proxy-add/schema.json index c817882730..8ac8fb2b68 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy-add/schema.json +++ b/npm/ng-packs/packages/schematics/src/commands/proxy-add/schema.json @@ -29,7 +29,7 @@ "$source": "argv", "index": 2 }, - "x-prompt": "Plese enter source Angular project for API definition URL & root namespace resolution. (default: workspace \"defaultProject\")" + "x-prompt": "Please enter source Angular project for API definition URL & root namespace resolution. (default: workspace \"defaultProject\")" }, "target": { "description": "Target Angular project to place the generated code", @@ -38,7 +38,7 @@ "$source": "argv", "index": 3 }, - "x-prompt": "Plese enter target Angular project to place the generated code. (default: workspace \"defaultProject\")" + "x-prompt": "Please enter target Angular project to place the generated code. (default: workspace \"defaultProject\")" } }, "required": [] diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy-index/schema.json b/npm/ng-packs/packages/schematics/src/commands/proxy-index/schema.json index 632c6d7e51..9447cd397b 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy-index/schema.json +++ b/npm/ng-packs/packages/schematics/src/commands/proxy-index/schema.json @@ -11,7 +11,7 @@ "$source": "argv", "index": 0 }, - "x-prompt": "Plese enter target Angular project to place the generated code. (default: workspace \"defaultProject\")" + "x-prompt": "Please enter target Angular project to place the generated code. (default: workspace \"defaultProject\")" } }, "required": [] diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy-refresh/schema.json b/npm/ng-packs/packages/schematics/src/commands/proxy-refresh/schema.json index c817882730..8ac8fb2b68 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy-refresh/schema.json +++ b/npm/ng-packs/packages/schematics/src/commands/proxy-refresh/schema.json @@ -29,7 +29,7 @@ "$source": "argv", "index": 2 }, - "x-prompt": "Plese enter source Angular project for API definition URL & root namespace resolution. (default: workspace \"defaultProject\")" + "x-prompt": "Please enter source Angular project for API definition URL & root namespace resolution. (default: workspace \"defaultProject\")" }, "target": { "description": "Target Angular project to place the generated code", @@ -38,7 +38,7 @@ "$source": "argv", "index": 3 }, - "x-prompt": "Plese enter target Angular project to place the generated code. (default: workspace \"defaultProject\")" + "x-prompt": "Please enter target Angular project to place the generated code. (default: workspace \"defaultProject\")" } }, "required": [] diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy-remove/schema.json b/npm/ng-packs/packages/schematics/src/commands/proxy-remove/schema.json index c817882730..8ac8fb2b68 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy-remove/schema.json +++ b/npm/ng-packs/packages/schematics/src/commands/proxy-remove/schema.json @@ -29,7 +29,7 @@ "$source": "argv", "index": 2 }, - "x-prompt": "Plese enter source Angular project for API definition URL & root namespace resolution. (default: workspace \"defaultProject\")" + "x-prompt": "Please enter source Angular project for API definition URL & root namespace resolution. (default: workspace \"defaultProject\")" }, "target": { "description": "Target Angular project to place the generated code", @@ -38,7 +38,7 @@ "$source": "argv", "index": 3 }, - "x-prompt": "Plese enter target Angular project to place the generated code. (default: workspace \"defaultProject\")" + "x-prompt": "Please enter target Angular project to place the generated code. (default: workspace \"defaultProject\")" } }, "required": [] diff --git a/npm/ng-packs/packages/schematics/src/utils/namespace.ts b/npm/ng-packs/packages/schematics/src/utils/namespace.ts index 88c574db8a..779c7b9770 100644 --- a/npm/ng-packs/packages/schematics/src/utils/namespace.ts +++ b/npm/ng-packs/packages/schematics/src/utils/namespace.ts @@ -7,6 +7,8 @@ export function parseNamespace(solution: string, type: string) { .slice(0, -1) .join('.'); + if (solution === namespace) return ''; + solution.split('.').reduceRight((acc, part) => { acc = `${part}\\.${acc}`; const regex = new RegExp(`^${acc}(Controllers\\.)?`); diff --git a/npm/ng-packs/packages/theme-shared/src/lib/directives/ngx-datatable-list.directive.ts b/npm/ng-packs/packages/theme-shared/src/lib/directives/ngx-datatable-list.directive.ts index b721e1142a..7dc81ab6b9 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/directives/ngx-datatable-list.directive.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/directives/ngx-datatable-list.directive.ts @@ -18,6 +18,7 @@ import { Subscription } from 'rxjs'; }) export class NgxDatatableListDirective implements OnChanges, OnDestroy, OnInit { private subscription = new Subscription(); + private querySubscription = new Subscription(); @Input() list: ListService; @@ -66,16 +67,28 @@ export class NgxDatatableListDirective implements OnChanges, OnDestroy, OnInit { this.subscription.add(sub); } + private subscribeToQuery() { + this.querySubscription.add( + this.list.query$.subscribe(() => { + if (this.list.page !== this.table.offset) this.table.offset = this.list.page; + }), + ); + } + ngOnChanges({ list }: SimpleChanges) { if (!list.firstChange) return; const { maxResultCount, page } = list.currentValue; this.table.limit = maxResultCount; this.table.offset = page; + + this.querySubscription.unsubscribe(); + this.subscribeToQuery(); } ngOnDestroy() { this.subscription.unsubscribe(); + this.querySubscription.unsubscribe(); } ngOnInit() { diff --git a/npm/ng-packs/scripts/build.ts b/npm/ng-packs/scripts/build.ts index 8ced29ec77..312351b346 100644 --- a/npm/ng-packs/scripts/build.ts +++ b/npm/ng-packs/scripts/build.ts @@ -36,9 +36,8 @@ import fse from 'fs-extra'; '--angular', '--prod', '--no-watch', - '--all-packages', - '--excluded-packages', - '@abp/ng.schematics,@abp/ng.core,@abp/ng.theme.shared,@abp/ng.components,@abp/ng.feature-management,@abp/ng.permission-management', + '--packages', + '@abp/ng.feature-management,@abp/ng.permission-management', ], { stdout: 'inherit', cwd: '../' }, ); @@ -51,8 +50,9 @@ import fse from 'fs-extra'; '--angular', '--prod', '--no-watch', - '--packages', - '@abp/ng.feature-management,@abp/ng.permission-management', + '--all-packages', + '--excluded-packages', + '@abp/ng.schematics,@abp/ng.core,@abp/ng.theme.shared,@abp/ng.components,@abp/ng.feature-management,@abp/ng.permission-management', ], { stdout: 'inherit', cwd: '../' }, );