@etsoo/appscript 1.4.81 → 1.4.83
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/lib/cjs/app/CoreApp.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { INotifier, NotificationAlign, NotificationCallProps, NotificationContent, NotificationReturn } from '@etsoo/notificationbase';
|
|
2
2
|
import { ApiDataError, IApi, IPData } from '@etsoo/restclient';
|
|
3
|
-
import { DataTypes, DateUtils, ErrorData, IActionResult, IStorage, ListType, ListType1 } from '@etsoo/shared';
|
|
3
|
+
import { DataTypes, DateUtils, ErrorData, ErrorType, IActionResult, IStorage, ListType, ListType1 } from '@etsoo/shared';
|
|
4
4
|
import { AddressRegion } from '../address/AddressRegion';
|
|
5
5
|
import { EntityStatus } from '../business/EntityStatus';
|
|
6
6
|
import { InitCallDto } from '../erp/dto/InitCallDto';
|
|
@@ -192,8 +192,9 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
192
192
|
/**
|
|
193
193
|
* Setup frontend logging
|
|
194
194
|
* @param action Custom action
|
|
195
|
+
* @param preventDefault Is prevent default action
|
|
195
196
|
*/
|
|
196
|
-
setupLogging(action?: (data: ErrorData) => void | Promise<void
|
|
197
|
+
setupLogging(action?: (data: ErrorData) => void | Promise<void>, preventDefault?: ((type: ErrorType) => boolean) | boolean): void;
|
|
197
198
|
/**
|
|
198
199
|
* Api init call
|
|
199
200
|
* @param data Data
|
package/lib/cjs/app/CoreApp.js
CHANGED
|
@@ -147,8 +147,7 @@ class CoreApp {
|
|
|
147
147
|
const { currentCulture, currentRegion } = settings;
|
|
148
148
|
// Load resources
|
|
149
149
|
Promise.all([loadCrypto(), this.changeCulture(currentCulture)]).then(([cj, _resources]) => {
|
|
150
|
-
|
|
151
|
-
CJ = cj;
|
|
150
|
+
CJ = cj.default;
|
|
152
151
|
this.changeRegion(currentRegion);
|
|
153
152
|
this.setup();
|
|
154
153
|
});
|
|
@@ -330,8 +329,9 @@ class CoreApp {
|
|
|
330
329
|
/**
|
|
331
330
|
* Setup frontend logging
|
|
332
331
|
* @param action Custom action
|
|
332
|
+
* @param preventDefault Is prevent default action
|
|
333
333
|
*/
|
|
334
|
-
setupLogging(action) {
|
|
334
|
+
setupLogging(action, preventDefault) {
|
|
335
335
|
action ?? (action = (data) => {
|
|
336
336
|
this.api.post('Auth/LogFrontendError', data, {
|
|
337
337
|
onError: (error) => {
|
|
@@ -342,7 +342,7 @@ class CoreApp {
|
|
|
342
342
|
}
|
|
343
343
|
});
|
|
344
344
|
});
|
|
345
|
-
shared_1.DomUtils.setupLogging(action);
|
|
345
|
+
shared_1.DomUtils.setupLogging(action, preventDefault);
|
|
346
346
|
}
|
|
347
347
|
/**
|
|
348
348
|
* Api init call
|
package/lib/mjs/app/CoreApp.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { INotifier, NotificationAlign, NotificationCallProps, NotificationContent, NotificationReturn } from '@etsoo/notificationbase';
|
|
2
2
|
import { ApiDataError, IApi, IPData } from '@etsoo/restclient';
|
|
3
|
-
import { DataTypes, DateUtils, ErrorData, IActionResult, IStorage, ListType, ListType1 } from '@etsoo/shared';
|
|
3
|
+
import { DataTypes, DateUtils, ErrorData, ErrorType, IActionResult, IStorage, ListType, ListType1 } from '@etsoo/shared';
|
|
4
4
|
import { AddressRegion } from '../address/AddressRegion';
|
|
5
5
|
import { EntityStatus } from '../business/EntityStatus';
|
|
6
6
|
import { InitCallDto } from '../erp/dto/InitCallDto';
|
|
@@ -192,8 +192,9 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
192
192
|
/**
|
|
193
193
|
* Setup frontend logging
|
|
194
194
|
* @param action Custom action
|
|
195
|
+
* @param preventDefault Is prevent default action
|
|
195
196
|
*/
|
|
196
|
-
setupLogging(action?: (data: ErrorData) => void | Promise<void
|
|
197
|
+
setupLogging(action?: (data: ErrorData) => void | Promise<void>, preventDefault?: ((type: ErrorType) => boolean) | boolean): void;
|
|
197
198
|
/**
|
|
198
199
|
* Api init call
|
|
199
200
|
* @param data Data
|
package/lib/mjs/app/CoreApp.js
CHANGED
|
@@ -144,8 +144,7 @@ export class CoreApp {
|
|
|
144
144
|
const { currentCulture, currentRegion } = settings;
|
|
145
145
|
// Load resources
|
|
146
146
|
Promise.all([loadCrypto(), this.changeCulture(currentCulture)]).then(([cj, _resources]) => {
|
|
147
|
-
|
|
148
|
-
CJ = cj;
|
|
147
|
+
CJ = cj.default;
|
|
149
148
|
this.changeRegion(currentRegion);
|
|
150
149
|
this.setup();
|
|
151
150
|
});
|
|
@@ -327,8 +326,9 @@ export class CoreApp {
|
|
|
327
326
|
/**
|
|
328
327
|
* Setup frontend logging
|
|
329
328
|
* @param action Custom action
|
|
329
|
+
* @param preventDefault Is prevent default action
|
|
330
330
|
*/
|
|
331
|
-
setupLogging(action) {
|
|
331
|
+
setupLogging(action, preventDefault) {
|
|
332
332
|
action ?? (action = (data) => {
|
|
333
333
|
this.api.post('Auth/LogFrontendError', data, {
|
|
334
334
|
onError: (error) => {
|
|
@@ -339,7 +339,7 @@ export class CoreApp {
|
|
|
339
339
|
}
|
|
340
340
|
});
|
|
341
341
|
});
|
|
342
|
-
DomUtils.setupLogging(action);
|
|
342
|
+
DomUtils.setupLogging(action, preventDefault);
|
|
343
343
|
}
|
|
344
344
|
/**
|
|
345
345
|
* Api init call
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/appscript",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.83",
|
|
4
4
|
"description": "Applications shared TypeScript framework",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"homepage": "https://github.com/ETSOO/AppScript#readme",
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@etsoo/notificationbase": "^1.1.41",
|
|
56
|
-
"@etsoo/restclient": "^1.1.
|
|
57
|
-
"@etsoo/shared": "^1.2.
|
|
56
|
+
"@etsoo/restclient": "^1.1.2",
|
|
57
|
+
"@etsoo/shared": "^1.2.34",
|
|
58
58
|
"crypto-js": "^4.2.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
package/src/app/CoreApp.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
DateUtils,
|
|
14
14
|
DomUtils,
|
|
15
15
|
ErrorData,
|
|
16
|
+
ErrorType,
|
|
16
17
|
IActionResult,
|
|
17
18
|
IStorage,
|
|
18
19
|
ListType,
|
|
@@ -298,8 +299,7 @@ export abstract class CoreApp<
|
|
|
298
299
|
// Load resources
|
|
299
300
|
Promise.all([loadCrypto(), this.changeCulture(currentCulture)]).then(
|
|
300
301
|
([cj, _resources]) => {
|
|
301
|
-
|
|
302
|
-
CJ = cj;
|
|
302
|
+
CJ = cj.default;
|
|
303
303
|
this.changeRegion(currentRegion);
|
|
304
304
|
this.setup();
|
|
305
305
|
}
|
|
@@ -523,8 +523,12 @@ export abstract class CoreApp<
|
|
|
523
523
|
/**
|
|
524
524
|
* Setup frontend logging
|
|
525
525
|
* @param action Custom action
|
|
526
|
+
* @param preventDefault Is prevent default action
|
|
526
527
|
*/
|
|
527
|
-
public setupLogging(
|
|
528
|
+
public setupLogging(
|
|
529
|
+
action?: (data: ErrorData) => void | Promise<void>,
|
|
530
|
+
preventDefault?: ((type: ErrorType) => boolean) | boolean
|
|
531
|
+
) {
|
|
528
532
|
action ??= (data) => {
|
|
529
533
|
this.api.post('Auth/LogFrontendError', data, {
|
|
530
534
|
onError: (error) => {
|
|
@@ -536,7 +540,7 @@ export abstract class CoreApp<
|
|
|
536
540
|
}
|
|
537
541
|
});
|
|
538
542
|
};
|
|
539
|
-
DomUtils.setupLogging(action);
|
|
543
|
+
DomUtils.setupLogging(action, preventDefault);
|
|
540
544
|
}
|
|
541
545
|
|
|
542
546
|
/**
|