@abp/ng.theme.shared 7.4.0-rc.1 → 7.4.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/components/http-error-wrapper/http-error-wrapper.component.mjs +8 -5
- package/esm2022/lib/handlers/error.handler.mjs +10 -11
- package/esm2022/lib/models/common.mjs +1 -1
- package/esm2022/lib/services/create-error-component.service.mjs +15 -11
- package/esm2022/lib/services/router-error-handler.service.mjs +4 -2
- package/esm2022/lib/services/status-code-error-handler.service.mjs +36 -36
- package/fesm2022/abp-ng.theme.shared.mjs +62 -56
- package/fesm2022/abp-ng.theme.shared.mjs.map +1 -1
- package/lib/components/http-error-wrapper/http-error-wrapper.component.d.ts +7 -4
- package/lib/handlers/error.handler.d.ts +13 -10
- package/lib/models/common.d.ts +2 -2
- package/lib/services/create-error-component.service.d.ts +11 -9
- package/lib/services/router-error-handler.service.d.ts +6 -4
- package/lib/services/status-code-error-handler.service.d.ts +11 -9
- package/package.json +3 -3
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AfterViewInit, ApplicationRef, ComponentFactoryResolver, ElementRef, Injector, OnDestroy, OnInit, Type } from '@angular/core';
|
|
1
|
+
import { ApplicationRef, Injector, OnInit, ComponentFactoryResolver, ElementRef, Type, AfterViewInit, OnDestroy } from '@angular/core';
|
|
3
2
|
import { Subject } from 'rxjs';
|
|
3
|
+
import { LocalizationParam, SubscriptionService } from '@abp/ng.core';
|
|
4
|
+
import { ErrorScreenErrorCodes } from '../../models';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class HttpErrorWrapperComponent implements AfterViewInit, OnDestroy
|
|
6
|
+
export declare class HttpErrorWrapperComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
6
7
|
private subscription;
|
|
8
|
+
protected readonly document: Document;
|
|
9
|
+
protected readonly window: Window & typeof globalThis;
|
|
7
10
|
appRef: ApplicationRef;
|
|
8
11
|
cfRes: ComponentFactoryResolver;
|
|
9
12
|
injector: Injector;
|
|
10
|
-
status:
|
|
13
|
+
status: ErrorScreenErrorCodes;
|
|
11
14
|
title: LocalizationParam;
|
|
12
15
|
details: LocalizationParam;
|
|
13
16
|
customComponent: Type<any> | undefined;
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
import { HttpErrorResponse } from '@angular/common/http';
|
|
2
1
|
import { Injector } from '@angular/core';
|
|
2
|
+
import { HttpErrorResponse } from '@angular/common/http';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
|
+
import { HttpErrorReporterService } from '@abp/ng.core';
|
|
4
5
|
import { CustomHttpErrorHandlerService } from '../models/common';
|
|
5
6
|
import { Confirmation } from '../models/confirmation';
|
|
7
|
+
import { ConfirmationService } from '../services/confirmation.service';
|
|
8
|
+
import { RouterErrorHandlerService } from '../services/router-error-handler.service';
|
|
6
9
|
import * as i0 from "@angular/core";
|
|
7
10
|
export declare class ErrorHandler {
|
|
8
11
|
protected injector: Injector;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
protected httpErrorConfig: import("../models/common").HttpErrorConfig;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
protected readonly httpErrorReporter: HttpErrorReporterService;
|
|
13
|
+
protected readonly confirmationService: ConfirmationService;
|
|
14
|
+
protected readonly routerErrorHandlerService: RouterErrorHandlerService;
|
|
15
|
+
protected readonly httpErrorConfig: import("../models/common").HttpErrorConfig;
|
|
16
|
+
protected readonly customErrorHandlers: CustomHttpErrorHandlerService[];
|
|
17
|
+
protected readonly defaultHttpErrorHandler: (_: any, err: HttpErrorResponse) => Observable<never>;
|
|
18
|
+
protected readonly httpErrorHandler: import("../models/common").HttpErrorHandler | ((_: any, err: HttpErrorResponse) => Observable<never>);
|
|
16
19
|
constructor(injector: Injector);
|
|
17
20
|
protected listenToRouterError(): void;
|
|
18
21
|
protected listenToRestError(): void;
|
|
19
|
-
|
|
22
|
+
protected executeErrorHandler: (error: HttpErrorResponse) => Observable<any>;
|
|
20
23
|
protected sortHttpErrorHandlers(a: CustomHttpErrorHandlerService, b: CustomHttpErrorHandlerService): number;
|
|
21
|
-
|
|
24
|
+
protected handleError(err: unknown): void;
|
|
22
25
|
protected showError(): Observable<Confirmation.Status>;
|
|
23
26
|
protected filterRestErrors: ({ status }: HttpErrorResponse) => boolean;
|
|
24
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<ErrorHandler, never>;
|
package/lib/models/common.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface RootParams {
|
|
|
8
8
|
validation?: Partial<Validation.Config>;
|
|
9
9
|
confirmationIcons?: Partial<ConfirmationIcons>;
|
|
10
10
|
}
|
|
11
|
-
export type ErrorScreenErrorCodes = 401 | 403 | 404 | 500;
|
|
11
|
+
export type ErrorScreenErrorCodes = 0 | 401 | 403 | 404 | 500;
|
|
12
12
|
export interface HttpErrorConfig {
|
|
13
13
|
skipHandledErrorCodes?: ErrorScreenErrorCodes[] | number[];
|
|
14
14
|
errorScreen?: {
|
|
@@ -22,5 +22,5 @@ export type LocaleDirection = 'ltr' | 'rtl';
|
|
|
22
22
|
export interface CustomHttpErrorHandlerService {
|
|
23
23
|
readonly priority: number;
|
|
24
24
|
canHandle(error: unknown): boolean;
|
|
25
|
-
execute():
|
|
25
|
+
execute(): void;
|
|
26
26
|
}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { ComponentFactoryResolver, ComponentRef, RendererFactory2 } from '@angular/core';
|
|
1
|
+
import { ComponentFactoryResolver, ComponentRef, Injector, RendererFactory2 } from '@angular/core';
|
|
2
|
+
import { RouterEvents } from '@abp/ng.core';
|
|
2
3
|
import { HttpErrorWrapperComponent } from '../components/http-error-wrapper/http-error-wrapper.component';
|
|
3
4
|
import { ErrorScreenErrorCodes } from '../models/common';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
export declare class CreateErrorComponentService {
|
|
6
|
-
protected
|
|
7
|
-
protected
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
protected readonly document: Document;
|
|
8
|
+
protected readonly rendererFactory: RendererFactory2;
|
|
9
|
+
protected readonly cfRes: ComponentFactoryResolver;
|
|
10
|
+
protected readonly routerEvents: RouterEvents;
|
|
11
|
+
protected readonly injector: Injector;
|
|
12
|
+
protected readonly httpErrorConfig: import("../models/common").HttpErrorConfig;
|
|
11
13
|
componentRef: ComponentRef<HttpErrorWrapperComponent> | null;
|
|
12
|
-
private getErrorHostElement;
|
|
13
|
-
canCreateCustomError(status: ErrorScreenErrorCodes): boolean;
|
|
14
14
|
constructor();
|
|
15
15
|
protected listenToRouterDataResolved(): void;
|
|
16
|
-
|
|
16
|
+
protected getErrorHostElement(): HTMLElement;
|
|
17
|
+
protected isCloseIconHidden(): boolean;
|
|
18
|
+
canCreateCustomError(status: ErrorScreenErrorCodes): boolean;
|
|
17
19
|
execute(instance: Partial<HttpErrorWrapperComponent>): void;
|
|
18
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<CreateErrorComponentService, never>;
|
|
19
21
|
static ɵprov: i0.ɵɵInjectableDeclaration<CreateErrorComponentService>;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { NavigationError } from '@angular/router';
|
|
2
|
+
import { RouterEvents } from '@abp/ng.core';
|
|
3
|
+
import { CreateErrorComponentService } from '../services';
|
|
2
4
|
import * as i0 from "@angular/core";
|
|
3
5
|
export declare class RouterErrorHandlerService {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
listen(): void;
|
|
6
|
+
protected readonly routerEvents: RouterEvents;
|
|
7
|
+
protected readonly httpErrorConfig: import("../models").HttpErrorConfig;
|
|
8
|
+
protected readonly createErrorComponentService: CreateErrorComponentService;
|
|
8
9
|
protected filterRouteErrors: (navigationError: NavigationError) => boolean;
|
|
10
|
+
listen(): void;
|
|
9
11
|
show404Page(): void;
|
|
10
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<RouterErrorHandlerService, never>;
|
|
11
13
|
static ɵprov: i0.ɵɵInjectableDeclaration<RouterErrorHandlerService>;
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { Confirmation, CustomHttpErrorHandlerService } from '../models';
|
|
2
|
-
import { LocalizationParam } from '@abp/ng.core';
|
|
2
|
+
import { AuthService, LocalizationParam } from '@abp/ng.core';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
|
+
import { ConfirmationService } from './confirmation.service';
|
|
5
|
+
import { CreateErrorComponentService } from './create-error-component.service';
|
|
4
6
|
import * as i0 from "@angular/core";
|
|
5
7
|
export declare class StatusCodeErrorHandlerService implements CustomHttpErrorHandlerService {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
protected readonly confirmationService: ConfirmationService;
|
|
9
|
+
protected readonly createErrorComponentService: CreateErrorComponentService;
|
|
10
|
+
protected readonly authService: AuthService;
|
|
11
|
+
protected readonly handledStatusCodes: readonly [401, 403, 404, 500];
|
|
12
|
+
protected status: typeof this.handledStatusCodes[number];
|
|
9
13
|
readonly priority: 0;
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
protected navigateToLogin(): void;
|
|
15
|
+
protected showConfirmation(message: LocalizationParam, title: LocalizationParam): Observable<Confirmation.Status>;
|
|
16
|
+
protected showPage(): void;
|
|
12
17
|
canHandle({ status }: {
|
|
13
18
|
status: any;
|
|
14
19
|
}): boolean;
|
|
15
20
|
execute(): void;
|
|
16
|
-
private navigateToLogin;
|
|
17
|
-
protected showConfirmation(message: LocalizationParam, title: LocalizationParam): Observable<Confirmation.Status>;
|
|
18
|
-
protected showPage(): void;
|
|
19
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<StatusCodeErrorHandlerService, never>;
|
|
20
22
|
static ɵprov: i0.ɵɵInjectableDeclaration<StatusCodeErrorHandlerService>;
|
|
21
23
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abp/ng.theme.shared",
|
|
3
|
-
"version": "7.4.0-rc.
|
|
3
|
+
"version": "7.4.0-rc.3",
|
|
4
4
|
"homepage": "https://abp.io",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/abpframework/abp.git"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@abp/ng.core": "~7.4.0-rc.
|
|
10
|
+
"@abp/ng.core": "~7.4.0-rc.3",
|
|
11
11
|
"@fortawesome/fontawesome-free": "^5.15.4",
|
|
12
12
|
"@ng-bootstrap/ng-bootstrap": "^15.0.0",
|
|
13
13
|
"@ngx-validate/core": "^0.2.0",
|
|
@@ -60,6 +60,6 @@
|
|
|
60
60
|
},
|
|
61
61
|
"sideEffects": false,
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@abp/ng.oauth": "7.4.0-rc.
|
|
63
|
+
"@abp/ng.oauth": "7.4.0-rc.3"
|
|
64
64
|
}
|
|
65
65
|
}
|