@mediusinc/mng-commons 3.0.0-rc.1 → 3.0.0-rc.11
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/README.md +8 -7
- package/assets/i18n/en.json +5 -1
- package/assets/i18n/sl.json +5 -1
- package/dev-scripts/version-info.js +13 -6
- package/esm2022/index.mjs +3 -1
- package/esm2022/lib/api/utils/object-serializer.util.mjs +11 -4
- package/esm2022/lib/components/action/action.component.mjs +18 -6
- package/esm2022/lib/components/action/editor/action-editor.component.mjs +83 -18
- package/esm2022/lib/components/action/models/action-execution.model.mjs +14 -37
- package/esm2022/lib/components/action/route/action-route.component.mjs +9 -2
- package/esm2022/lib/components/form/autocomplete/autocomplete.component.mjs +18 -5
- package/esm2022/lib/components/form/dropdown/dropdown.component.mjs +21 -8
- package/esm2022/lib/components/form/editor/form-editor.component.mjs +9 -8
- package/esm2022/lib/components/form/formly/fields/formly-field-action/formly-field-action.component.mjs +22 -4
- package/esm2022/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +43 -15
- package/esm2022/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +11 -4
- package/esm2022/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +8 -6
- package/esm2022/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +18 -9
- package/esm2022/lib/components/form/models/field-action-context.model.mjs +1 -1
- package/esm2022/lib/components/form/models/index.mjs +2 -1
- package/esm2022/lib/components/tableview/table/table.component.mjs +57 -55
- package/esm2022/lib/descriptors/action/action-button.descriptor.mjs +10 -2
- package/esm2022/lib/descriptors/action/action.descriptor.mjs +19 -8
- package/esm2022/lib/descriptors/editor/editor.descriptor.mjs +3 -3
- package/esm2022/lib/descriptors/editor/field.descriptor.mjs +13 -4
- package/esm2022/lib/descriptors/filter/filter.descriptor.mjs +7 -6
- package/esm2022/lib/descriptors/table/column.descriptor.mjs +3 -3
- package/esm2022/lib/descriptors/table/table.descriptor.mjs +35 -4
- package/esm2022/lib/descriptors/tableview/tableview.descriptor.mjs +3 -3
- package/esm2022/lib/error/error.handler.mjs +20 -0
- package/esm2022/lib/error/index.mjs +2 -0
- package/esm2022/lib/guards/index.mjs +2 -0
- package/esm2022/lib/guards/unsaved-changes.guard.mjs +4 -0
- package/esm2022/lib/models/action-editor.model.mjs +2 -0
- package/esm2022/lib/models/can-component-deactivate.model.mjs +2 -0
- package/esm2022/lib/models/config.model.mjs +1 -1
- package/esm2022/lib/models/error.model.mjs +44 -2
- package/esm2022/lib/models/index.mjs +4 -2
- package/esm2022/lib/models/log.model.mjs +10 -0
- package/esm2022/lib/models/version.model.mjs +1 -1
- package/esm2022/lib/pipes/json-path.pipe.mjs +3 -58
- package/esm2022/lib/provide-commons.mjs +22 -16
- package/esm2022/lib/router/route-builder.mjs +4 -4
- package/esm2022/lib/router/routes-builder.mjs +3 -3
- package/esm2022/lib/router/tableview-route-builder.mjs +4 -1
- package/esm2022/lib/security/authorization.service.mjs +5 -4
- package/esm2022/lib/security/authorization.util.mjs +3 -3
- package/esm2022/lib/services/action-error-mapper.service.mjs +20 -0
- package/esm2022/lib/services/action-executor.service.mjs +97 -57
- package/esm2022/lib/services/commons.service.mjs +16 -25
- package/esm2022/lib/services/configuration.service.mjs +56 -32
- package/esm2022/lib/services/index.mjs +4 -2
- package/esm2022/lib/services/internal/commons-init.service.mjs +49 -23
- package/esm2022/lib/services/log-publisher-console.service.mjs +40 -0
- package/esm2022/lib/services/logger.service.mjs +130 -0
- package/esm2022/lib/services/providers/index.mjs +1 -2
- package/esm2022/lib/services/router.service.mjs +106 -25
- package/esm2022/lib/services/tokens/index.mjs +2 -1
- package/esm2022/lib/services/tokens/log-publisher.token.mjs +3 -0
- package/esm2022/lib/services/version.service.mjs +7 -2
- package/esm2022/lib/utils/action-data-provider.util.mjs +7 -7
- package/esm2022/lib/utils/editor-formly.util.mjs +2 -1
- package/esm2022/lib/utils/error.util.mjs +247 -0
- package/esm2022/lib/utils/i18n.util.mjs +7 -9
- package/esm2022/lib/utils/index.mjs +2 -1
- package/esm2022/lib/utils/notification.util.mjs +3 -2
- package/esm2022/lib/utils/object.util.mjs +81 -5
- package/esm2022/lib/utils/route.util.mjs +3 -3
- package/esm2022/lib/utils/string.util.mjs +33 -2
- package/esm2022/lib/utils/tableview.util.mjs +3 -3
- package/esm2022/lib/utils/type.util.mjs +5 -5
- package/fesm2022/mediusinc-mng-commons.mjs +4338 -3480
- package/fesm2022/mediusinc-mng-commons.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/api/utils/object-serializer.util.d.ts +1 -0
- package/lib/components/action/action.component.d.ts +1 -0
- package/lib/components/action/editor/action-editor.component.d.ts +17 -6
- package/lib/components/action/models/action-execution.model.d.ts +6 -4
- package/lib/components/action/route/action-route.component.d.ts +4 -1
- package/lib/components/form/autocomplete/autocomplete.component.d.ts +1 -0
- package/lib/components/form/dropdown/dropdown.component.d.ts +1 -0
- package/lib/components/form/editor/form-editor.component.d.ts +1 -0
- package/lib/components/form/formly/fields/formly-field-action/formly-field-action.component.d.ts +3 -0
- package/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.d.ts +2 -0
- package/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +1 -0
- package/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +1 -0
- package/lib/components/form/models/field-action-context.model.d.ts +7 -0
- package/lib/components/form/models/index.d.ts +1 -0
- package/lib/components/tableview/table/table.component.d.ts +2 -0
- package/lib/descriptors/action/action-button.descriptor.d.ts +4 -1
- package/lib/descriptors/action/action.descriptor.d.ts +3 -0
- package/lib/descriptors/editor/field.descriptor.d.ts +10 -8
- package/lib/descriptors/table/column.descriptor.d.ts +1 -1
- package/lib/descriptors/table/table.descriptor.d.ts +26 -3
- package/lib/error/error.handler.d.ts +6 -0
- package/lib/error/index.d.ts +1 -0
- package/lib/guards/index.d.ts +1 -0
- package/lib/guards/unsaved-changes.guard.d.ts +3 -0
- package/lib/models/action-editor.model.d.ts +4 -0
- package/lib/models/can-component-deactivate.model.d.ts +4 -0
- package/lib/models/config.model.d.ts +2 -1
- package/lib/models/error.model.d.ts +44 -8
- package/lib/models/index.d.ts +3 -1
- package/lib/models/log.model.d.ts +40 -0
- package/lib/models/version.model.d.ts +1 -1
- package/lib/security/authorization.service.d.ts +1 -0
- package/lib/services/action-error-mapper.service.d.ts +18 -0
- package/lib/services/action-executor.service.d.ts +12 -6
- package/lib/services/commons.service.d.ts +9 -14
- package/lib/services/configuration.service.d.ts +13 -5
- package/lib/services/index.d.ts +3 -1
- package/lib/services/internal/commons-init.service.d.ts +8 -8
- package/lib/services/log-publisher-console.service.d.ts +4 -0
- package/lib/services/logger.service.d.ts +33 -0
- package/lib/services/providers/index.d.ts +0 -1
- package/lib/services/router.service.d.ts +17 -2
- package/lib/services/tokens/index.d.ts +1 -0
- package/lib/services/tokens/log-publisher.token.d.ts +3 -0
- package/lib/services/version.service.d.ts +1 -0
- package/lib/utils/error.util.d.ts +116 -0
- package/lib/utils/i18n.util.d.ts +3 -3
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/notification.util.d.ts +2 -2
- package/lib/utils/object.util.d.ts +7 -4
- package/lib/utils/string.util.d.ts +5 -0
- package/package.json +4 -1
- package/scss/common/theme/designer/_components.scss +1 -1
- package/scss/mng-overrides/_theme_dialog.scss +7 -0
- package/scss/mng-overrides/_theme_tableview.scss +15 -0
- package/esm2022/lib/models/error-internal.model.mjs +0 -27
- package/esm2022/lib/services/error-mapper.service.mjs +0 -14
- package/esm2022/lib/services/providers/config-service.provider.mjs +0 -31
- package/lib/models/error-internal.model.d.ts +0 -29
- package/lib/services/error-mapper.service.d.ts +0 -7
- package/lib/services/providers/config-service.provider.d.ts +0 -6
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IMngError } from '../models';
|
|
2
|
+
/**
|
|
3
|
+
* Service for transforming errors in action execution.
|
|
4
|
+
* Can be used to transform errors to Commons MngError interface for correct error message display.
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class MngActionErrorMapperService {
|
|
7
|
+
/**
|
|
8
|
+
* Can be used to enrich data from error and make it more "stable". Most use cases cover extracting message or message code of an
|
|
9
|
+
* error out of http response body/headers.
|
|
10
|
+
*
|
|
11
|
+
* @param error Original error (cause).
|
|
12
|
+
* @param mngError Commons mng error that wraps original error.
|
|
13
|
+
*/
|
|
14
|
+
abstract toMngError(error?: any, mngError?: IMngError): IMngError;
|
|
15
|
+
}
|
|
16
|
+
export declare class DefaultActionMngErrorMapperService extends MngActionErrorMapperService {
|
|
17
|
+
toMngError(error?: any, mngError?: IMngError): IMngError;
|
|
18
|
+
}
|
|
@@ -5,10 +5,10 @@ import { DialogService } from 'primeng/dynamicdialog';
|
|
|
5
5
|
import { ActionContext, ActionContextValidation, ActionInstance, ActionParameters } from '../components/action/models';
|
|
6
6
|
import { IDataProvider, IEditorDataProvider } from '../data-providers';
|
|
7
7
|
import { ActionDescriptor, ActionEditorDescriptor } from '../descriptors/action';
|
|
8
|
-
import {
|
|
8
|
+
import { IActionEditorComponent, IMngError } from '../models';
|
|
9
9
|
import { MngParametrizePipe } from '../pipes';
|
|
10
|
+
import { MngActionErrorMapperService } from './action-error-mapper.service';
|
|
10
11
|
import { MngCommonsService } from './commons.service';
|
|
11
|
-
import { MngErrorMapperService } from './error-mapper.service';
|
|
12
12
|
import { MngNavigationService } from './navigation.service';
|
|
13
13
|
import * as i0 from "@angular/core";
|
|
14
14
|
export declare class MngActionExecutorService {
|
|
@@ -21,10 +21,10 @@ export declare class MngActionExecutorService {
|
|
|
21
21
|
private errorMapper;
|
|
22
22
|
private parametrize;
|
|
23
23
|
private defaultEditorDialogComponent;
|
|
24
|
-
private readonly debugLog;
|
|
25
24
|
private readonly instancesBufferMax;
|
|
26
25
|
private readonly _instances;
|
|
27
|
-
|
|
26
|
+
private logger;
|
|
27
|
+
constructor(injector: Injector, router: Router, dialogService: DialogService, translate: TranslateService, mngCommons: MngCommonsService, navigationService: MngNavigationService, errorMapper: MngActionErrorMapperService, parametrize: MngParametrizePipe, defaultEditorDialogComponent: Type<any>);
|
|
28
28
|
get instances(): ActionInstance<any, any>[];
|
|
29
29
|
/**
|
|
30
30
|
* Prepares action context for usage in validation.
|
|
@@ -117,7 +117,12 @@ export declare class MngActionExecutorService {
|
|
|
117
117
|
* @param action Action descriptor.
|
|
118
118
|
* @param instance Action instance (if available).
|
|
119
119
|
*/
|
|
120
|
-
onActionEditorInit<T, S>(action: ActionDescriptor<T>, instance?: ActionInstance<T, S
|
|
120
|
+
onActionEditorInit<T, S>(action: ActionDescriptor<T>, instance?: ActionInstance<T, S>, componentRef?: IActionEditorComponent): ActionInstance<T, S>;
|
|
121
|
+
/**
|
|
122
|
+
* To be called when action editor cmp is being destroyed to correctly finish action.
|
|
123
|
+
* @param instance Action instance.
|
|
124
|
+
*/
|
|
125
|
+
onActionDestroy<T, S>(instance?: ActionInstance<T, S>): void;
|
|
121
126
|
/**
|
|
122
127
|
* To be called when action editor cmp is being destroyed to correctly finish action.
|
|
123
128
|
* @param instance Action instance.
|
|
@@ -153,10 +158,11 @@ export declare class MngActionExecutorService {
|
|
|
153
158
|
/**
|
|
154
159
|
* Transform error of any type to mng error by using error mapper that could be provided by final project.
|
|
155
160
|
* @param error error of any type.
|
|
161
|
+
* @param context Action context.
|
|
156
162
|
*
|
|
157
163
|
* @return mapped MngError.
|
|
158
164
|
*/
|
|
159
|
-
toMngActionError(error?: any):
|
|
165
|
+
toMngActionError(error?: any, context?: ActionContext<any, any>): IMngError;
|
|
160
166
|
/**
|
|
161
167
|
* Creates or gets existing action instance.
|
|
162
168
|
* @param instance Action instance.
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import { Title } from '@angular/platform-browser';
|
|
2
|
-
import { Router } from '@angular/router';
|
|
3
|
-
import { TranslateService } from '@ngx-translate/core';
|
|
4
|
-
import { FilterService, PrimeNGConfig } from 'primeng/api';
|
|
5
1
|
import { Observable } from 'rxjs';
|
|
6
|
-
import { IUser, MngMenuItem
|
|
2
|
+
import { IUser, MngMenuItem } from '../models';
|
|
7
3
|
import * as i0 from "@angular/core";
|
|
8
4
|
export declare class MngCommonsService {
|
|
9
|
-
private
|
|
10
|
-
private
|
|
11
|
-
private
|
|
12
|
-
private
|
|
13
|
-
private
|
|
14
|
-
private
|
|
15
|
-
private
|
|
5
|
+
private readonly logger;
|
|
6
|
+
private readonly router;
|
|
7
|
+
private readonly primengConfig;
|
|
8
|
+
private readonly translate;
|
|
9
|
+
private readonly titleService;
|
|
10
|
+
private readonly filterService;
|
|
11
|
+
private readonly moduleConfig;
|
|
12
|
+
private readonly localStorage;
|
|
16
13
|
private routerEventsSubscription?;
|
|
17
14
|
private translateLangChangeSubscription?;
|
|
18
15
|
private _menuMode;
|
|
@@ -33,7 +30,6 @@ export declare class MngCommonsService {
|
|
|
33
30
|
private userRolesSubject;
|
|
34
31
|
private languageSubject;
|
|
35
32
|
private dataLanguageSubject;
|
|
36
|
-
constructor(router: Router, primengConfig: PrimeNGConfig, translate: TranslateService, titleService: Title, filterService: FilterService, moduleConfig: MngModuleConfig, localStorage: Storage);
|
|
37
33
|
get appName(): string;
|
|
38
34
|
get appOwner(): string;
|
|
39
35
|
get appLogoLight(): string;
|
|
@@ -77,7 +73,6 @@ export declare class MngCommonsService {
|
|
|
77
73
|
get userRoles(): Array<string>;
|
|
78
74
|
set userRoles(roles: Array<string>);
|
|
79
75
|
get userRoles$(): Observable<string[]>;
|
|
80
|
-
get actionsDebugLog(): boolean;
|
|
81
76
|
get actionsDebugInstances(): boolean;
|
|
82
77
|
reset(): void;
|
|
83
78
|
menuChangeActiveKey(key: string): void;
|
|
@@ -1,23 +1,31 @@
|
|
|
1
1
|
import { HttpClient } from '@angular/common/http';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
+
import { IMngLoggerService, MngModuleConfig } from '../models';
|
|
3
4
|
export declare class MngConfigurationService {
|
|
4
|
-
private http;
|
|
5
5
|
private static _instance;
|
|
6
|
-
static init(httpClient: HttpClient): MngConfigurationService;
|
|
7
6
|
static get(): MngConfigurationService;
|
|
7
|
+
private logger?;
|
|
8
|
+
private http?;
|
|
9
|
+
private moduleConfig?;
|
|
8
10
|
private projectEnvironment?;
|
|
9
11
|
private jsonSources;
|
|
10
12
|
private objectSources;
|
|
11
13
|
private configuration;
|
|
12
14
|
private constructor();
|
|
15
|
+
init(httpClient: HttpClient, logger?: IMngLoggerService): this;
|
|
16
|
+
/**
|
|
17
|
+
* Add mng commons module config.
|
|
18
|
+
* @param config Module config.
|
|
19
|
+
*/
|
|
20
|
+
addModuleConfigSource(config?: MngModuleConfig): void;
|
|
13
21
|
/**
|
|
14
22
|
* Add project environment source.
|
|
15
|
-
* @param
|
|
23
|
+
* @param environment Environment.
|
|
16
24
|
*/
|
|
17
25
|
addEnvironmentSource(environment: any): void;
|
|
18
26
|
/**
|
|
19
27
|
* Adds new config source from JSON file loaded from HTTP.
|
|
20
|
-
* @param
|
|
28
|
+
* @param config Config for JSON file.
|
|
21
29
|
* @param loadImmediately Load is by default triggered on app initialization. If immediate load is required, pass true.
|
|
22
30
|
*/
|
|
23
31
|
addJsonSource(config?: {
|
|
@@ -47,7 +55,7 @@ export declare class MngConfigurationService {
|
|
|
47
55
|
* Get configuration value for key.
|
|
48
56
|
* @param key Configuration key.
|
|
49
57
|
*/
|
|
50
|
-
getConfigValue(key: string):
|
|
58
|
+
getConfigValue<T = any>(key: string): T | null;
|
|
51
59
|
/**
|
|
52
60
|
* Has configuration for key.
|
|
53
61
|
* @param key Configuration key.
|
package/lib/services/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export * from './action-executor.service';
|
|
2
|
+
export * from './action-error-mapper.service';
|
|
2
3
|
export * from './configuration.service';
|
|
3
4
|
export * from './commons.service';
|
|
4
|
-
export * from './error-mapper.service';
|
|
5
5
|
export * from './navigation.service';
|
|
6
6
|
export * from './router.service';
|
|
7
7
|
export * from './version.service';
|
|
8
8
|
export * from './view-container.component.service';
|
|
9
9
|
export * from './mng-localstorage-config.service';
|
|
10
|
+
export * from './log-publisher-console.service';
|
|
11
|
+
export * from './logger.service';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { TranslateService } from '@ngx-translate/core';
|
|
2
1
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { MngCommonsService, MngConfigurationService, MngRouterService } from '../';
|
|
4
2
|
import * as i0 from "@angular/core";
|
|
5
3
|
export declare class MngCommonsInitService {
|
|
6
|
-
private
|
|
7
|
-
private
|
|
8
|
-
private
|
|
9
|
-
private
|
|
4
|
+
private readonly httpClient;
|
|
5
|
+
private readonly logger;
|
|
6
|
+
private readonly logPublishers;
|
|
7
|
+
private readonly config;
|
|
8
|
+
private readonly mngCommons;
|
|
9
|
+
private readonly mngRouter;
|
|
10
|
+
private readonly moduleConfig;
|
|
10
11
|
private readonly commonsInitializers;
|
|
11
12
|
private isInitialized;
|
|
12
|
-
constructor(translate: TranslateService, configurationService: MngConfigurationService, mngCommons: MngCommonsService, mngRouter: MngRouterService, commonsInitializers: ReadonlyArray<() => Observable<unknown>>);
|
|
13
13
|
initialize(): Observable<void>;
|
|
14
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MngCommonsInitService,
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MngCommonsInitService, never>;
|
|
15
15
|
static ɵprov: i0.ɵɵInjectableDeclaration<MngCommonsInitService>;
|
|
16
16
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IMngLogPublisher, IMngLoggerService, LogLevelEnum, MngLogEntry } from '../models';
|
|
2
|
+
import { MngConfigurationService } from './configuration.service';
|
|
3
|
+
export declare class MngLoggerService implements IMngLoggerService {
|
|
4
|
+
private static _instance;
|
|
5
|
+
private static _isInit;
|
|
6
|
+
private static _configurationService?;
|
|
7
|
+
private static _publishers;
|
|
8
|
+
private static _entriesBuffer;
|
|
9
|
+
private static _categoryInstances;
|
|
10
|
+
private static _timestampFormat;
|
|
11
|
+
private category?;
|
|
12
|
+
private readonly defaultLogLevel;
|
|
13
|
+
private datePipe;
|
|
14
|
+
private constructor();
|
|
15
|
+
static get(): MngLoggerService;
|
|
16
|
+
static configure(config: {
|
|
17
|
+
timestampFormat?: string;
|
|
18
|
+
}): void;
|
|
19
|
+
static init(configurationService: MngConfigurationService, publishers: IMngLogPublisher[]): void;
|
|
20
|
+
private static _flushBuffer;
|
|
21
|
+
static create(category: string): MngLoggerService;
|
|
22
|
+
create(category: string): MngLoggerService;
|
|
23
|
+
private _processLog;
|
|
24
|
+
private _getTimestamps;
|
|
25
|
+
private _log;
|
|
26
|
+
trace(msgOrError: string | Error, ...data: any[]): void;
|
|
27
|
+
debug(msgOrError: string | Error, ...data: any[]): void;
|
|
28
|
+
log(msgOrError: string | Error, logLevel?: LogLevelEnum, category?: string | undefined, ...data: any[]): void;
|
|
29
|
+
logEntry<E extends Partial<MngLogEntry>>(logEntry: E): void;
|
|
30
|
+
info(msgOrError: string | Error, ...data: any[]): void;
|
|
31
|
+
warn(msgOrError: string | Error, ...data: any[]): void;
|
|
32
|
+
error(msgOrError: string | Error, ...data: any[]): void;
|
|
33
|
+
}
|
|
@@ -3,9 +3,10 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class MngRouterService {
|
|
5
5
|
private router;
|
|
6
|
+
private readonly logger;
|
|
7
|
+
private readonly routesLoadedPropKey;
|
|
6
8
|
private currentNavigationPath?;
|
|
7
|
-
private
|
|
8
|
-
private currentNavigationConfigLoaded?;
|
|
9
|
+
private currentNavigationModuleKeys;
|
|
9
10
|
private lazyLoadedRoutesConfig;
|
|
10
11
|
constructor(router: Router);
|
|
11
12
|
getRouteLoadedChildren(path: string | Array<string>): Routes | undefined;
|
|
@@ -15,6 +16,20 @@ export declare class MngRouterService {
|
|
|
15
16
|
private finishNavigation;
|
|
16
17
|
private markNavigationConfigLoad;
|
|
17
18
|
private getLoadedRoutesFromRoute;
|
|
19
|
+
/**
|
|
20
|
+
* Search for route config by module path by recursive scanning of router config tree.
|
|
21
|
+
* @param modulePath Path of module that is searched.
|
|
22
|
+
* @param routes Routes to be scanned. If not provided, it starts on root router config.
|
|
23
|
+
* @private
|
|
24
|
+
*/
|
|
25
|
+
private findRouteInRouteConfig;
|
|
26
|
+
/**
|
|
27
|
+
* Finds longest path match of source to match string. If match is '', it is considered as a match in Angular routing.
|
|
28
|
+
* @param source Source string from on which comparison is based.
|
|
29
|
+
* @param match Match string to which the source is matched to.
|
|
30
|
+
* @private
|
|
31
|
+
*/
|
|
32
|
+
private findLongestPathMatch;
|
|
18
33
|
private getOrCreateRouteForModule;
|
|
19
34
|
private getModulePathFromRouterLink;
|
|
20
35
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngRouterService, never>;
|
|
@@ -5,6 +5,7 @@ import * as i0 from "@angular/core";
|
|
|
5
5
|
export declare class MngVersionService {
|
|
6
6
|
private http;
|
|
7
7
|
private configurationService;
|
|
8
|
+
private readonly logger;
|
|
8
9
|
private cache;
|
|
9
10
|
constructor(http: HttpClient, configurationService: MngConfigurationService);
|
|
10
11
|
loadVersion(path: string, baseConfigKey?: string, jsonPath?: string): Observable<unknown>;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { HttpErrorResponse } from '@angular/common/http';
|
|
2
|
+
import { AMngErrorBase, LogLevelEnum, MngActionError } from '../models';
|
|
3
|
+
export declare class ErrorUtil {
|
|
4
|
+
/**
|
|
5
|
+
* Converts RxJS subscription error to MngError.
|
|
6
|
+
* @param error Error.
|
|
7
|
+
* @param name Optional name to write in mngError.
|
|
8
|
+
* @param details Optional details of error.
|
|
9
|
+
*/
|
|
10
|
+
static fromSubscribeError(error: any, name?: string, details?: any): AMngErrorBase;
|
|
11
|
+
/**
|
|
12
|
+
* Checks if error is Http error (Angular or Mng).
|
|
13
|
+
* @param error
|
|
14
|
+
*/
|
|
15
|
+
static isHttpErrorResponse(error: any): boolean | HttpErrorResponse | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Gets HttpErrorResponse from error (Angular or Mng).
|
|
18
|
+
* @param error Error.
|
|
19
|
+
*/
|
|
20
|
+
static getHttpErrorResponse(error: any): HttpErrorResponse | null;
|
|
21
|
+
/**
|
|
22
|
+
* Gets HttpErrorResponse status from error (Angular or Mng).
|
|
23
|
+
* @param error Error.
|
|
24
|
+
*/
|
|
25
|
+
static getHttpErrorResponseStatus(error: any): number | null;
|
|
26
|
+
/**
|
|
27
|
+
* Get error log level. All is error, except if error is http error with status >=400 and <500.
|
|
28
|
+
* @param error Error.
|
|
29
|
+
*/
|
|
30
|
+
static getErrorLogLevel(error: any): LogLevelEnum;
|
|
31
|
+
/**
|
|
32
|
+
* Get error name (prototype name or type from mng error if name is not provided).
|
|
33
|
+
* @param error Error.
|
|
34
|
+
*/
|
|
35
|
+
static getErrorName(error: any): string;
|
|
36
|
+
/**
|
|
37
|
+
* Writes http error to string with all headers and body.
|
|
38
|
+
* @param error Http response error.
|
|
39
|
+
* @param opts Options for hiding parts of error:
|
|
40
|
+
* - hideMessage Hides message of error (message include url, status and status text!).
|
|
41
|
+
* - hideHeaders Hides headers.
|
|
42
|
+
* - hideBody Hides JSON representation of body.
|
|
43
|
+
*/
|
|
44
|
+
static httpErrorResponseToString(error: HttpErrorResponse, opts?: HttpErrorResponseToStringOptions): string;
|
|
45
|
+
/**
|
|
46
|
+
* Error to string.
|
|
47
|
+
* @param error Error.
|
|
48
|
+
* @param opts Options for hiding parts of error:
|
|
49
|
+
* - hideMessage Hides message of error.
|
|
50
|
+
* - hideName Hides error name.
|
|
51
|
+
* - hideCause Hides cause of an error (if present, see @link(errorCauseToString) for other options).
|
|
52
|
+
* - hideStack Hides stack of an error (if present).
|
|
53
|
+
* - hideDetails Hides JSON detail's representation of error (if present).
|
|
54
|
+
* - hideLocation Hides location (URL) where error was thrown.
|
|
55
|
+
* - hideHttp Hides http error portion of error if http error response (see @link(httpErrorResponseToString) for other options).
|
|
56
|
+
*/
|
|
57
|
+
static errorToString(error: Error, opts?: ErrorToStringOptions): string;
|
|
58
|
+
/**
|
|
59
|
+
* Mng error to string.
|
|
60
|
+
* @param error Mng error.
|
|
61
|
+
* @param opts Options for hiding parts of error:
|
|
62
|
+
* - hideMessage Hides message of error.
|
|
63
|
+
* - hideName Hides error name.
|
|
64
|
+
* - hideCause Hides cause of an error (if present, see @link(errorCauseToString) for other options).
|
|
65
|
+
* - hideStack Hides stack of an error (if present).
|
|
66
|
+
* - hideDetails Hides JSON detail's representation of error (if present).
|
|
67
|
+
* - hideLocation Hides location (URL) where error was thrown.
|
|
68
|
+
* - hideHttp Hides http error portion of error if http error response (see @link(httpErrorResponseToString) for other options).
|
|
69
|
+
* - hideItems Hides all item information (http body, action context data).
|
|
70
|
+
* - hideActionData See @link(mngActionErrorContextToString) for additional info.
|
|
71
|
+
* - hideQueryParams See @link(mngActionErrorContextToString) for additional info.
|
|
72
|
+
*/
|
|
73
|
+
static mngErrorToString(error: AMngErrorBase, opts?: MngErrorToStringOptions): string;
|
|
74
|
+
/**
|
|
75
|
+
* Writes Mng action error info from context as string.
|
|
76
|
+
* @param error Mng action error.
|
|
77
|
+
* @param opts Options for hiding parts of error:
|
|
78
|
+
* - hideItems Hides all item related information (item, form item, submit item, ...).
|
|
79
|
+
* - hideActionData Hides action data.
|
|
80
|
+
* - hideQueryParams Hides query params.
|
|
81
|
+
*/
|
|
82
|
+
static mngActionErrorContextToString(error: MngActionError, opts?: MngActionErrorContextToStringOptions): string;
|
|
83
|
+
/**
|
|
84
|
+
* Writes cause of an error as string.
|
|
85
|
+
* @param error Error.
|
|
86
|
+
* @param opts Options for hiding parts of error:
|
|
87
|
+
* - causeOnErrorOnly Prints only if cause is instance of error.
|
|
88
|
+
* - causeAsJson Print error cause as a JSON (by default, if error only message and name will be printed).
|
|
89
|
+
*/
|
|
90
|
+
static errorCauseToString(error: Error, opts?: ErrorCauseToStringOptions): string;
|
|
91
|
+
}
|
|
92
|
+
export type ErrorToStringOptions = MngErrorToStringOptions;
|
|
93
|
+
export type MngErrorToStringOptions = ErrorToStringOptionsBase & HttpErrorResponseToStringOptions & MngActionErrorContextToStringOptions & ErrorCauseToStringOptions & {
|
|
94
|
+
hideDetails?: boolean;
|
|
95
|
+
hideLocation?: boolean;
|
|
96
|
+
};
|
|
97
|
+
export interface ErrorToStringOptionsBase {
|
|
98
|
+
hideName?: boolean;
|
|
99
|
+
hideStack?: boolean;
|
|
100
|
+
hideCause?: boolean;
|
|
101
|
+
hideHttp?: boolean;
|
|
102
|
+
}
|
|
103
|
+
export interface HttpErrorResponseToStringOptions {
|
|
104
|
+
hideMessage?: boolean;
|
|
105
|
+
hideHeaders?: boolean;
|
|
106
|
+
hideBody?: boolean;
|
|
107
|
+
}
|
|
108
|
+
export interface MngActionErrorContextToStringOptions {
|
|
109
|
+
hideItems?: boolean;
|
|
110
|
+
hideActionData?: boolean;
|
|
111
|
+
hideQueryParams?: boolean;
|
|
112
|
+
}
|
|
113
|
+
export interface ErrorCauseToStringOptions {
|
|
114
|
+
causeOnErrorOnly?: boolean;
|
|
115
|
+
causeAsJson?: boolean;
|
|
116
|
+
}
|
package/lib/utils/i18n.util.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { TranslateService } from '@ngx-translate/core';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { ModelDescriptor } from '../descriptors';
|
|
4
4
|
import { ActionDescriptor, ActionEditorDescriptor } from '../descriptors/action';
|
|
5
|
-
import {
|
|
5
|
+
import { IMngError } from '../models';
|
|
6
6
|
import { ClassType } from '../types';
|
|
7
7
|
import { I18nType } from '../types/i18n.type';
|
|
8
8
|
export declare namespace I18nUtils {
|
|
@@ -80,7 +80,7 @@ export declare namespace I18nUtils {
|
|
|
80
80
|
private static getKeysByPriority;
|
|
81
81
|
}
|
|
82
82
|
class Error {
|
|
83
|
-
static get(translate: TranslateService, error:
|
|
84
|
-
static getParams(error:
|
|
83
|
+
static get(translate: TranslateService, error: IMngError, params?: any): string | null;
|
|
84
|
+
static getParams(error: IMngError, params?: any): any;
|
|
85
85
|
}
|
|
86
86
|
}
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import { TranslateService } from '@ngx-translate/core';
|
|
|
2
2
|
import { Message } from 'primeng/api';
|
|
3
3
|
import { ActionDescriptor } from '../descriptors/action';
|
|
4
4
|
import { TableDescriptor } from '../descriptors/table';
|
|
5
|
-
import {
|
|
5
|
+
import { IMngError, IViewContainer } from '../models';
|
|
6
6
|
export declare class NotificationUtil {
|
|
7
7
|
static notification(viewContainer?: IViewContainer<any, any>, title?: string, message?: string, severity?: 'success' | 'warn' | 'error', icon?: string): Message;
|
|
8
8
|
static tableNotificationError(translate: TranslateService, table: TableDescriptor<any>, error: any, viewContainer?: IViewContainer<any, any>): Message;
|
|
9
9
|
static actionNotificationSuccess(translate: TranslateService, action: ActionDescriptor<any>, functionName: string, customTitleKey?: string, customMessageKey?: string, viewContainer?: IViewContainer<any, any>, item?: any): Message;
|
|
10
|
-
static actionNotificationError(translate: TranslateService, action: ActionDescriptor<any>, error:
|
|
10
|
+
static actionNotificationError(translate: TranslateService, action: ActionDescriptor<any>, error: IMngError, functionName: string, viewContainer?: IViewContainer<any, any>, item?: any, severity?: 'warn' | 'error'): Message;
|
|
11
11
|
static getFormEditorInfoMessage(translate: TranslateService, title: string, message: string, params?: any): Message;
|
|
12
12
|
static getFormEditorWarningMessage(translate: TranslateService, title: string, message: string): Message;
|
|
13
13
|
}
|
|
@@ -6,22 +6,25 @@ export interface DeepCopyOptions<P = object> extends DeepCopyPropsOptions {
|
|
|
6
6
|
objectPrototype?: ClassType<P>;
|
|
7
7
|
}
|
|
8
8
|
export declare class ObjectUtil {
|
|
9
|
-
static
|
|
9
|
+
static deepCopy<T = object, P = object>(obj: T, options: DeepCopyOptions<P> & {
|
|
10
10
|
mapGettersToProperties: true;
|
|
11
11
|
}): T | Record<string, any>;
|
|
12
|
-
static
|
|
12
|
+
static deepCopy<T = object, P = object>(obj: T, options: DeepCopyOptions<P> & {
|
|
13
13
|
objectPrototype: ClassType<P>;
|
|
14
14
|
} & {
|
|
15
15
|
mapGettersToProperties?: false;
|
|
16
16
|
}): P;
|
|
17
|
-
static
|
|
17
|
+
static deepCopy<T = object, P = object>(obj: T, options: DeepCopyOptions<P> & {
|
|
18
18
|
objectPrototype: ClassType<P>;
|
|
19
19
|
} & {
|
|
20
20
|
mapGettersToProperties: true;
|
|
21
21
|
}): P | Record<string, any>;
|
|
22
|
-
static
|
|
22
|
+
static deepCopy<T = object, P = object>(obj: T, options?: DeepCopyOptions<P>): T;
|
|
23
|
+
static deepMerge(target: Record<string, any>, source: Record<string, any>): Record<string, any>;
|
|
24
|
+
private static isObject;
|
|
23
25
|
private static handleProp;
|
|
24
26
|
static getProperties(obj: object): string[];
|
|
25
27
|
static getGetters(obj: any): string[];
|
|
28
|
+
static getPropertyByPath(value: any, path: string): any | undefined;
|
|
26
29
|
}
|
|
27
30
|
export {};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export declare class StringUtil {
|
|
2
2
|
static escapeHtml(value: string): any;
|
|
3
3
|
static escapeHtmlAny(value?: any): any;
|
|
4
|
+
/**
|
|
5
|
+
* Stringifies a value - primitives with toString, dates with dateUtil, objects with JSON.stringify.
|
|
6
|
+
* @param value Any value.
|
|
7
|
+
*/
|
|
8
|
+
static stringify(value: any): string;
|
|
4
9
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mediusinc/mng-commons",
|
|
3
|
-
"version": "3.0.0-rc.
|
|
3
|
+
"version": "3.0.0-rc.11",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/animations": "^16.0.0",
|
|
6
6
|
"@angular/common": "^16.0.0",
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
"reflect-metadata": "^0.1.13",
|
|
17
17
|
"tslib": "^2.5.0"
|
|
18
18
|
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"directory": "dist"
|
|
21
|
+
},
|
|
19
22
|
"sideEffects": false,
|
|
20
23
|
"module": "fesm2022/mediusinc-mng-commons.mjs",
|
|
21
24
|
"typings": "index.d.ts",
|
|
@@ -20,6 +20,13 @@
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.p-datatable {
|
|
23
|
+
.p-datatable-scrollable-table > .p-datatable-thead {
|
|
24
|
+
z-index: 2;
|
|
25
|
+
}
|
|
26
|
+
.p-datatable-loading-overlay {
|
|
27
|
+
z-index: 3;
|
|
28
|
+
}
|
|
29
|
+
|
|
23
30
|
.p-datatable-header {
|
|
24
31
|
text-align: left;
|
|
25
32
|
font-size: 1.5rem;
|
|
@@ -62,3 +69,11 @@
|
|
|
62
69
|
}
|
|
63
70
|
}
|
|
64
71
|
}
|
|
72
|
+
|
|
73
|
+
.mng-table-columns-multiselect {
|
|
74
|
+
width: 36px;
|
|
75
|
+
|
|
76
|
+
.p-multiselect-label-container {
|
|
77
|
+
width: 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export class MngErrorInternal {
|
|
2
|
-
constructor(message, name = 'Commons Internal Error', options) {
|
|
3
|
-
this.name = name;
|
|
4
|
-
this.message = message;
|
|
5
|
-
this.id = options?.id;
|
|
6
|
-
this.messageCode = options?.messageCode;
|
|
7
|
-
this.notification = options?.notification ?? this.generateNotification();
|
|
8
|
-
this.details = options?.details;
|
|
9
|
-
this.status = options?.status;
|
|
10
|
-
this.statusDescription = options?.statusDescription;
|
|
11
|
-
this.url = options?.url;
|
|
12
|
-
this.cause = options?.cause;
|
|
13
|
-
this.stack = options?.stack ?? (options?.cause ? options.cause.stack : new Error(message).stack);
|
|
14
|
-
}
|
|
15
|
-
consoleError() {
|
|
16
|
-
let cause = '';
|
|
17
|
-
if (this.cause) {
|
|
18
|
-
cause += `; Caused by ${this.cause.name}: ${this.cause.message}`;
|
|
19
|
-
}
|
|
20
|
-
console.error(`${this.name}: ${this.message}${cause}`, this);
|
|
21
|
-
return this;
|
|
22
|
-
}
|
|
23
|
-
generateNotification() {
|
|
24
|
-
return { severity: 'error', summary: this.name, detail: this.message, life: 10000 };
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3ItaW50ZXJuYWwubW9kZWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvbGliL21vZGVscy9lcnJvci1pbnRlcm5hbC5tb2RlbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFLQSxNQUFNLE9BQU8sZ0JBQWdCO0lBY3pCLFlBQ0ksT0FBZSxFQUNmLElBQUksR0FBRyx3QkFBd0IsRUFDL0IsT0FVQztRQUVELElBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDO1FBQ2pCLElBQUksQ0FBQyxPQUFPLEdBQUcsT0FBTyxDQUFDO1FBRXZCLElBQUksQ0FBQyxFQUFFLEdBQUcsT0FBTyxFQUFFLEVBQUUsQ0FBQztRQUN0QixJQUFJLENBQUMsV0FBVyxHQUFHLE9BQU8sRUFBRSxXQUFXLENBQUM7UUFDeEMsSUFBSSxDQUFDLFlBQVksR0FBRyxPQUFPLEVBQUUsWUFBWSxJQUFJLElBQUksQ0FBQyxvQkFBb0IsRUFBRSxDQUFDO1FBQ3pFLElBQUksQ0FBQyxPQUFPLEdBQUcsT0FBTyxFQUFFLE9BQU8sQ0FBQztRQUNoQyxJQUFJLENBQUMsTUFBTSxHQUFHLE9BQU8sRUFBRSxNQUFNLENBQUM7UUFDOUIsSUFBSSxDQUFDLGlCQUFpQixHQUFHLE9BQU8sRUFBRSxpQkFBaUIsQ0FBQzt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uICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICBwcml2YXRlIGdlbmVyYXRlTm90aWZpY2F0aW9uKCk6IE1lc3NhZ2Uge1xuICAgICAgICByZXR1cm4ge3NldmVyaXR5OiAnZXJyb3InLCBzdW1tYXJ5OiB0aGlzLm5hbWUsIGRldGFpbDogdGhpcy5tZXNzYWdlLCBsaWZlOiAxMDAwMH07XG4gICAgfVxufVxuIl19
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export class MngErrorMapperService {
|
|
2
|
-
}
|
|
3
|
-
export class DefaultMngErrorMapperService extends MngErrorMapperService {
|
|
4
|
-
toMngError(error, mngError) {
|
|
5
|
-
if (!mngError) {
|
|
6
|
-
mngError = {
|
|
7
|
-
name: error?.name ?? 'UnknownError',
|
|
8
|
-
message: error.message ?? 'Unknown error'
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
return mngError;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3ItbWFwcGVyLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvbGliL3NlcnZpY2VzL2Vycm9yLW1hcHBlci5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE1BQU0sT0FBZ0IscUJBQXFCO0NBRTFDO0FBRUQsTUFBTSxPQUFPLDRCQUE2QixTQUFRLHFCQUFxQjtJQUNuRSxVQUFVLENBQUMsS0FBVyxFQUFFLFFBQW1CO1FBQ3ZDLElBQUksQ0FBQyxRQUFRLEVBQUU7WUFDWCxRQUFRLEdBQUc7Z0JBQ1AsSUFBSSxFQUFFLEtBQUssRUFBRSxJQUFJLElBQUksY0FBYztnQkFDbkMsT0FBTyxFQUFFLEtBQUssQ0FBQyxPQUFPLElBQUksZUFBZTthQUM1QyxDQUFD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