@abp/ng.theme.shared 7.3.2 → 7.4.0-rc.1
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/extensions/lib/components/extensible-table/extensible-table.component.mjs +4 -1
- package/esm2022/extensions/lib/components/grid-actions/grid-actions.component.mjs +3 -3
- package/esm2022/extensions/lib/models/actions.mjs +4 -2
- package/esm2022/extensions/lib/models/entity-actions.mjs +3 -1
- package/esm2022/lib/components/index.mjs +2 -1
- package/esm2022/lib/components/internet-connection-status/internet-connection-status.component.mjs +29 -0
- package/esm2022/lib/constants/default-errors.mjs +52 -0
- package/esm2022/lib/handlers/error.handler.mjs +39 -249
- package/esm2022/lib/models/common.mjs +1 -1
- package/esm2022/lib/models/nav-item.mjs +1 -1
- package/esm2022/lib/providers/error-handlers.provider.mjs +28 -0
- package/esm2022/lib/providers/index.mjs +2 -1
- package/esm2022/lib/services/abp-format-error-handler.service.mjs +46 -0
- package/esm2022/lib/services/create-error-component.service.mjs +77 -0
- package/esm2022/lib/services/index.mjs +7 -1
- package/esm2022/lib/services/router-error-handler.service.mjs +43 -0
- package/esm2022/lib/services/status-code-error-handler.service.mjs +85 -0
- package/esm2022/lib/services/tenant-resolve-error-handler.service.mjs +30 -0
- package/esm2022/lib/services/unknown-status-code-error-handler.service.mjs +37 -0
- package/esm2022/lib/theme-shared.module.mjs +5 -4
- package/esm2022/lib/tokens/http-error.token.mjs +2 -1
- package/esm2022/lib/utils/error.utils.mjs +25 -0
- package/esm2022/lib/utils/index.mjs +2 -1
- package/esm2022/public-api.mjs +2 -1
- package/extensions/lib/models/actions.d.ts +3 -1
- package/extensions/lib/models/entity-actions.d.ts +2 -0
- package/fesm2022/abp-ng.theme.shared-extensions.mjs +10 -3
- package/fesm2022/abp-ng.theme.shared-extensions.mjs.map +1 -1
- package/fesm2022/abp-ng.theme.shared.mjs +704 -515
- package/fesm2022/abp-ng.theme.shared.mjs.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/internet-connection-status/internet-connection-status.component.d.ts +8 -0
- package/lib/constants/default-errors.d.ts +51 -0
- package/lib/handlers/error.handler.d.ts +11 -69
- package/lib/models/common.d.ts +7 -2
- package/lib/models/nav-item.d.ts +9 -0
- package/lib/providers/error-handlers.provider.d.ts +2 -0
- package/lib/providers/index.d.ts +1 -0
- package/lib/services/abp-format-error-handler.service.d.ts +13 -0
- package/lib/services/create-error-component.service.d.ts +20 -0
- package/lib/services/index.d.ts +6 -0
- package/lib/services/router-error-handler.service.d.ts +12 -0
- package/lib/services/status-code-error-handler.service.d.ts +21 -0
- package/lib/services/tenant-resolve-error-handler.service.d.ts +13 -0
- package/lib/services/unknown-status-code-error-handler.service.d.ts +16 -0
- package/lib/tokens/http-error.token.d.ts +2 -1
- package/lib/utils/error.utils.d.ts +8 -0
- package/lib/utils/index.d.ts +1 -0
- package/package.json +3 -3
- package/public-api.d.ts +1 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InternetConnectionService } from '@abp/ng.core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class InternetConnectionStatusComponent {
|
|
4
|
+
internetConnectionService: InternetConnectionService;
|
|
5
|
+
isOnline: import("@angular/core").Signal<boolean>;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InternetConnectionStatusComponent, never>;
|
|
7
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InternetConnectionStatusComponent, "abp-internet-status", never, {}, {}, never, never, true, never>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare const DEFAULT_ERROR_MESSAGES: {
|
|
2
|
+
defaultError: {
|
|
3
|
+
title: string;
|
|
4
|
+
details: string;
|
|
5
|
+
};
|
|
6
|
+
defaultError401: {
|
|
7
|
+
title: string;
|
|
8
|
+
details: string;
|
|
9
|
+
};
|
|
10
|
+
defaultError403: {
|
|
11
|
+
title: string;
|
|
12
|
+
details: string;
|
|
13
|
+
};
|
|
14
|
+
defaultError404: {
|
|
15
|
+
title: string;
|
|
16
|
+
details: string;
|
|
17
|
+
};
|
|
18
|
+
defaultError500: {
|
|
19
|
+
title: string;
|
|
20
|
+
details: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export declare const DEFAULT_ERROR_LOCALIZATIONS: {
|
|
24
|
+
defaultError: {
|
|
25
|
+
title: string;
|
|
26
|
+
details: string;
|
|
27
|
+
};
|
|
28
|
+
defaultError401: {
|
|
29
|
+
title: string;
|
|
30
|
+
details: string;
|
|
31
|
+
};
|
|
32
|
+
defaultError403: {
|
|
33
|
+
title: string;
|
|
34
|
+
details: string;
|
|
35
|
+
};
|
|
36
|
+
defaultError404: {
|
|
37
|
+
title: string;
|
|
38
|
+
details: string;
|
|
39
|
+
};
|
|
40
|
+
defaultError500: {
|
|
41
|
+
title: string;
|
|
42
|
+
details: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export declare const CUSTOM_HTTP_ERROR_HANDLER_PRIORITY: Readonly<{
|
|
46
|
+
veryLow: -99;
|
|
47
|
+
low: -9;
|
|
48
|
+
normal: 0;
|
|
49
|
+
high: 9;
|
|
50
|
+
veryHigh: 99;
|
|
51
|
+
}>;
|
|
@@ -1,84 +1,26 @@
|
|
|
1
|
-
import { HttpErrorReporterService, LocalizationParam, RouterEvents, SessionStateService } from '@abp/ng.core';
|
|
2
1
|
import { HttpErrorResponse } from '@angular/common/http';
|
|
3
|
-
import {
|
|
4
|
-
import { NavigationError } from '@angular/router';
|
|
2
|
+
import { Injector } from '@angular/core';
|
|
5
3
|
import { Observable } from 'rxjs';
|
|
6
|
-
import {
|
|
7
|
-
import { ErrorScreenErrorCodes, HttpErrorConfig } from '../models/common';
|
|
4
|
+
import { CustomHttpErrorHandlerService } from '../models/common';
|
|
8
5
|
import { Confirmation } from '../models/confirmation';
|
|
9
|
-
import { ConfirmationService } from '../services/confirmation.service';
|
|
10
6
|
import * as i0 from "@angular/core";
|
|
11
|
-
export declare const DEFAULT_ERROR_MESSAGES: {
|
|
12
|
-
defaultError: {
|
|
13
|
-
title: string;
|
|
14
|
-
details: string;
|
|
15
|
-
};
|
|
16
|
-
defaultError401: {
|
|
17
|
-
title: string;
|
|
18
|
-
details: string;
|
|
19
|
-
};
|
|
20
|
-
defaultError403: {
|
|
21
|
-
title: string;
|
|
22
|
-
details: string;
|
|
23
|
-
};
|
|
24
|
-
defaultError404: {
|
|
25
|
-
title: string;
|
|
26
|
-
details: string;
|
|
27
|
-
};
|
|
28
|
-
defaultError500: {
|
|
29
|
-
title: string;
|
|
30
|
-
details: string;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
export declare const DEFAULT_ERROR_LOCALIZATIONS: {
|
|
34
|
-
defaultError: {
|
|
35
|
-
title: string;
|
|
36
|
-
details: string;
|
|
37
|
-
};
|
|
38
|
-
defaultError401: {
|
|
39
|
-
title: string;
|
|
40
|
-
details: string;
|
|
41
|
-
};
|
|
42
|
-
defaultError403: {
|
|
43
|
-
title: string;
|
|
44
|
-
details: string;
|
|
45
|
-
};
|
|
46
|
-
defaultError404: {
|
|
47
|
-
title: string;
|
|
48
|
-
details: string;
|
|
49
|
-
};
|
|
50
|
-
defaultError500: {
|
|
51
|
-
title: string;
|
|
52
|
-
details: string;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
7
|
export declare class ErrorHandler {
|
|
56
8
|
protected injector: Injector;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
protected
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
protected httpErrorConfig: HttpErrorConfig;
|
|
65
|
-
protected sessionStateService: SessionStateService;
|
|
66
|
-
private authService;
|
|
9
|
+
private httpErrorReporter;
|
|
10
|
+
private confirmationService;
|
|
11
|
+
private routerErrorHandlerService;
|
|
12
|
+
protected httpErrorConfig: import("../models/common").HttpErrorConfig;
|
|
13
|
+
private customErrorHandlers;
|
|
14
|
+
private defaultHttpErrorHandler;
|
|
15
|
+
private httpErrorHandler;
|
|
67
16
|
constructor(injector: Injector);
|
|
68
17
|
protected listenToRouterError(): void;
|
|
69
|
-
protected listenToRouterDataResolved(): void;
|
|
70
18
|
protected listenToRestError(): void;
|
|
71
19
|
private executeErrorHandler;
|
|
20
|
+
protected sortHttpErrorHandlers(a: CustomHttpErrorHandlerService, b: CustomHttpErrorHandlerService): number;
|
|
72
21
|
private handleError;
|
|
73
|
-
protected
|
|
74
|
-
protected show404Page(): void;
|
|
75
|
-
protected showErrorWithRequestBody(body: any): Observable<Confirmation.Status>;
|
|
76
|
-
protected showError(message: LocalizationParam, title: LocalizationParam): Observable<Confirmation.Status>;
|
|
77
|
-
private navigateToLogin;
|
|
78
|
-
createErrorComponent(instance: Partial<HttpErrorWrapperComponent>): void;
|
|
79
|
-
canCreateCustomError(status: ErrorScreenErrorCodes): boolean;
|
|
22
|
+
protected showError(): Observable<Confirmation.Status>;
|
|
80
23
|
protected filterRestErrors: ({ status }: HttpErrorResponse) => boolean;
|
|
81
|
-
protected filterRouteErrors: (navigationError: NavigationError) => boolean;
|
|
82
24
|
static ɵfac: i0.ɵɵFactoryDeclaration<ErrorHandler, never>;
|
|
83
25
|
static ɵprov: i0.ɵɵInjectableDeclaration<ErrorHandler>;
|
|
84
26
|
}
|
package/lib/models/common.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpErrorResponse } from '@angular/common/http';
|
|
2
|
-
import {
|
|
2
|
+
import { Type } from '@angular/core';
|
|
3
3
|
import { Validation } from '@ngx-validate/core';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
import { ConfirmationIcons } from '../tokens/confirmation-icons.token';
|
|
@@ -17,5 +17,10 @@ export interface HttpErrorConfig {
|
|
|
17
17
|
hideCloseIcon?: boolean;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
export type HttpErrorHandler =
|
|
20
|
+
export type HttpErrorHandler<T = any> = (httpError: HttpErrorResponse) => Observable<T>;
|
|
21
21
|
export type LocaleDirection = 'ltr' | 'rtl';
|
|
22
|
+
export interface CustomHttpErrorHandlerService {
|
|
23
|
+
readonly priority: number;
|
|
24
|
+
canHandle(error: unknown): boolean;
|
|
25
|
+
execute(): any;
|
|
26
|
+
}
|
package/lib/models/nav-item.d.ts
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import { Injector, Type } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
+
export interface Badge {
|
|
4
|
+
count?: number | Observable<number>;
|
|
5
|
+
color?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
}
|
|
3
8
|
export declare class NavItem {
|
|
4
9
|
id?: string | number;
|
|
10
|
+
name?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
badge?: Badge;
|
|
5
13
|
component?: Type<any>;
|
|
6
14
|
html?: string;
|
|
7
15
|
action?: () => void;
|
|
8
16
|
order?: number;
|
|
9
17
|
requiredPolicy?: string;
|
|
10
18
|
visible?: NavBarPropPredicate<NavItem>;
|
|
19
|
+
icon?: string;
|
|
11
20
|
constructor(props: Partial<NavItem>);
|
|
12
21
|
}
|
|
13
22
|
export type NavBarPropPredicate<T> = (prop?: T, injector?: Injector) => boolean | Promise<boolean> | Observable<boolean>;
|
package/lib/providers/index.d.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CustomHttpErrorHandlerService } from '../models/common';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class AbpFormatErrorHandlerService implements CustomHttpErrorHandlerService {
|
|
4
|
+
readonly priority: 9;
|
|
5
|
+
private confirmationService;
|
|
6
|
+
private authService;
|
|
7
|
+
private error;
|
|
8
|
+
private navigateToLogin;
|
|
9
|
+
canHandle(error: unknown): boolean;
|
|
10
|
+
execute(): void;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AbpFormatErrorHandlerService, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AbpFormatErrorHandlerService>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ComponentFactoryResolver, ComponentRef, RendererFactory2 } from '@angular/core';
|
|
2
|
+
import { HttpErrorWrapperComponent } from '../components/http-error-wrapper/http-error-wrapper.component';
|
|
3
|
+
import { ErrorScreenErrorCodes } from '../models/common';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class CreateErrorComponentService {
|
|
6
|
+
protected rendererFactory: RendererFactory2;
|
|
7
|
+
protected cfRes: ComponentFactoryResolver;
|
|
8
|
+
private routerEvents;
|
|
9
|
+
private injector;
|
|
10
|
+
private httpErrorConfig;
|
|
11
|
+
componentRef: ComponentRef<HttpErrorWrapperComponent> | null;
|
|
12
|
+
private getErrorHostElement;
|
|
13
|
+
canCreateCustomError(status: ErrorScreenErrorCodes): boolean;
|
|
14
|
+
constructor();
|
|
15
|
+
protected listenToRouterDataResolved(): void;
|
|
16
|
+
private isCloseIconHidden;
|
|
17
|
+
execute(instance: Partial<HttpErrorWrapperComponent>): void;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CreateErrorComponentService, never>;
|
|
19
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CreateErrorComponentService>;
|
|
20
|
+
}
|
package/lib/services/index.d.ts
CHANGED
|
@@ -3,3 +3,9 @@ export * from './nav-items.service';
|
|
|
3
3
|
export * from './page-alert.service';
|
|
4
4
|
export * from './toaster.service';
|
|
5
5
|
export * from './user-menu.service';
|
|
6
|
+
export * from './create-error-component.service';
|
|
7
|
+
export * from './abp-format-error-handler.service';
|
|
8
|
+
export * from './tenant-resolve-error-handler.service';
|
|
9
|
+
export * from './status-code-error-handler.service';
|
|
10
|
+
export * from './unknown-status-code-error-handler.service';
|
|
11
|
+
export * from './router-error-handler.service';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NavigationError } from '@angular/router';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class RouterErrorHandlerService {
|
|
4
|
+
private readonly routerEvents;
|
|
5
|
+
private httpErrorConfig;
|
|
6
|
+
private createErrorComponentService;
|
|
7
|
+
listen(): void;
|
|
8
|
+
protected filterRouteErrors: (navigationError: NavigationError) => boolean;
|
|
9
|
+
show404Page(): void;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RouterErrorHandlerService, never>;
|
|
11
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<RouterErrorHandlerService>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Confirmation, CustomHttpErrorHandlerService } from '../models';
|
|
2
|
+
import { LocalizationParam } from '@abp/ng.core';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class StatusCodeErrorHandlerService implements CustomHttpErrorHandlerService {
|
|
6
|
+
private readonly confirmationService;
|
|
7
|
+
private readonly createErrorComponentService;
|
|
8
|
+
private readonly authService;
|
|
9
|
+
readonly priority: 0;
|
|
10
|
+
private status;
|
|
11
|
+
private readonly handledStatusCodes;
|
|
12
|
+
canHandle({ status }: {
|
|
13
|
+
status: any;
|
|
14
|
+
}): boolean;
|
|
15
|
+
execute(): void;
|
|
16
|
+
private navigateToLogin;
|
|
17
|
+
protected showConfirmation(message: LocalizationParam, title: LocalizationParam): Observable<Confirmation.Status>;
|
|
18
|
+
protected showPage(): void;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StatusCodeErrorHandlerService, never>;
|
|
20
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<StatusCodeErrorHandlerService>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CustomHttpErrorHandlerService } from '../models/common';
|
|
2
|
+
import { SessionStateService } from '@abp/ng.core';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class TenantResolveErrorHandlerService implements CustomHttpErrorHandlerService {
|
|
5
|
+
protected readonly sessionService: SessionStateService;
|
|
6
|
+
readonly priority: 9;
|
|
7
|
+
private authService;
|
|
8
|
+
private isTenantResolveError;
|
|
9
|
+
canHandle(error: unknown): boolean;
|
|
10
|
+
execute(): void;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TenantResolveErrorHandlerService, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TenantResolveErrorHandlerService>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CustomHttpErrorHandlerService } from '../models';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class UnknownStatusCodeErrorHandlerService implements CustomHttpErrorHandlerService {
|
|
4
|
+
readonly priority: 0;
|
|
5
|
+
private statusText;
|
|
6
|
+
private message;
|
|
7
|
+
private createErrorComponentService;
|
|
8
|
+
canHandle(error: {
|
|
9
|
+
status: number;
|
|
10
|
+
statusText: string;
|
|
11
|
+
message: string;
|
|
12
|
+
} | undefined): boolean;
|
|
13
|
+
execute(): void;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UnknownStatusCodeErrorHandlerService, never>;
|
|
15
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<UnknownStatusCodeErrorHandlerService>;
|
|
16
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import { HttpErrorConfig, HttpErrorHandler } from '../models/common';
|
|
2
|
+
import { CustomHttpErrorHandlerService, HttpErrorConfig, HttpErrorHandler } from '../models/common';
|
|
3
3
|
export declare function httpErrorConfigFactory(config?: HttpErrorConfig): HttpErrorConfig;
|
|
4
4
|
export declare const HTTP_ERROR_CONFIG: InjectionToken<HttpErrorConfig>;
|
|
5
5
|
export declare const HTTP_ERROR_HANDLER: InjectionToken<HttpErrorHandler>;
|
|
6
|
+
export declare const CUSTOM_ERROR_HANDLERS: InjectionToken<CustomHttpErrorHandlerService[]>;
|
package/lib/utils/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abp/ng.theme.shared",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.4.0-rc.1",
|
|
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.
|
|
10
|
+
"@abp/ng.core": "~7.4.0-rc.1",
|
|
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.
|
|
63
|
+
"@abp/ng.oauth": "7.4.0-rc.1"
|
|
64
64
|
}
|
|
65
65
|
}
|
package/public-api.d.ts
CHANGED