@veloceapps/sdk 7.0.2-26 → 7.0.2-28
Sign up to get free protection for your applications and to get access to all the features.
- package/cms/vendor-map.d.ts +2 -1
- package/core/services/index.d.ts +1 -0
- package/core/services/runtime-settings.service.d.ts +18 -0
- package/esm2020/cms/components/element-tools-panel/element-tools-panel.component.mjs +3 -3
- package/esm2020/cms/vendor-map.mjs +3 -2
- package/esm2020/core/core.module.mjs +16 -4
- package/esm2020/core/services/index.mjs +2 -1
- package/esm2020/core/services/runtime-settings.service.mjs +62 -0
- package/esm2020/src/guards/context.guard.mjs +11 -8
- package/fesm2015/veloceapps-sdk-cms.mjs +5 -4
- package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
- package/fesm2015/veloceapps-sdk-core.mjs +72 -4
- package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2015/veloceapps-sdk.mjs +9 -6
- package/fesm2015/veloceapps-sdk.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-cms.mjs +4 -3
- package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-core.mjs +72 -4
- package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk.mjs +9 -6
- package/fesm2020/veloceapps-sdk.mjs.map +1 -1
- package/package.json +1 -1
- package/src/guards/context.guard.d.ts +3 -2
@@ -14,7 +14,7 @@ import * as i3$1 from 'primeng/button';
|
|
14
14
|
import { ButtonModule } from 'primeng/button';
|
15
15
|
import * as i1 from 'primeng/dynamicdialog';
|
16
16
|
import { UITemplateComponentType, UITemplateType, SalesforceIdUtils, ConfigurationContextMode, getSupportedDateFormats, EntityUtil, UUID } from '@veloceapps/core';
|
17
|
-
import { Subject, BehaviorSubject, tap, takeUntil, first, catchError, of, map, switchMap, filter, shareReplay, startWith, distinctUntilChanged, combineLatest, take, finalize, noop, from, throwError } from 'rxjs';
|
17
|
+
import { Subject, BehaviorSubject, tap, takeUntil, first, catchError, of, map, switchMap, filter, shareReplay, startWith, distinctUntilChanged, combineLatest, take, finalize, noop, forkJoin, from, throwError } from 'rxjs';
|
18
18
|
import * as i7 from 'primeng/overlaypanel';
|
19
19
|
import { OverlayPanel, OverlayPanelModule } from 'primeng/overlaypanel';
|
20
20
|
import * as i13 from 'primeng/splitbutton';
|
@@ -1367,10 +1367,11 @@ const getDefaultProperties = (params) => {
|
|
1367
1367
|
};
|
1368
1368
|
|
1369
1369
|
class ContextGuard {
|
1370
|
-
constructor(router, routerService, contextService) {
|
1370
|
+
constructor(router, routerService, contextService, runtimeSettingsService) {
|
1371
1371
|
this.router = router;
|
1372
1372
|
this.routerService = routerService;
|
1373
1373
|
this.contextService = contextService;
|
1374
|
+
this.runtimeSettingsService = runtimeSettingsService;
|
1374
1375
|
}
|
1375
1376
|
checkActivation(route) {
|
1376
1377
|
const { queryParams } = route;
|
@@ -1389,10 +1390,12 @@ class ContextGuard {
|
|
1389
1390
|
return of(true);
|
1390
1391
|
}
|
1391
1392
|
}
|
1392
|
-
// Initialize context
|
1393
|
-
return this.contextService.create(headerId, mode).pipe(tap((context) => {
|
1393
|
+
// Initialize context and runtime settings
|
1394
|
+
return forkJoin([this.contextService.create(headerId, mode), this.runtimeSettingsService.create()]).pipe(tap(([context]) => {
|
1394
1395
|
// Update context with queryParams
|
1395
1396
|
this.contextService.update(Object.assign(Object.assign({}, context), { properties: Object.assign(Object.assign(Object.assign({}, context.properties), (queryParams !== null && queryParams !== void 0 ? queryParams : {})), getDefaultProperties({ mode })) }));
|
1397
|
+
// Init currency settings
|
1398
|
+
this.runtimeSettingsService.initCurrency(context.properties['CurrencyIsoCode']);
|
1396
1399
|
}), map(() => true), catchError(e => {
|
1397
1400
|
const message = e instanceof HttpErrorResponse ? e.error.message : e;
|
1398
1401
|
return this.handleError(route, message);
|
@@ -1435,11 +1438,11 @@ class ContextGuard {
|
|
1435
1438
|
return from(this.router.navigate([parentUrl, '404'], { state: { message } })).pipe(map(() => false));
|
1436
1439
|
}
|
1437
1440
|
}
|
1438
|
-
ContextGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ContextGuard, deps: [{ token: i1$2.Router }, { token: FlowRouterService }, { token: i1$1.ContextService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1441
|
+
ContextGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ContextGuard, deps: [{ token: i1$2.Router }, { token: FlowRouterService }, { token: i1$1.ContextService }, { token: i1$1.RuntimeSettingsService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1439
1442
|
ContextGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ContextGuard });
|
1440
1443
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ContextGuard, decorators: [{
|
1441
1444
|
type: Injectable
|
1442
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }, { type: i1$1.ContextService }]; } });
|
1445
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }, { type: i1$1.ContextService }, { type: i1$1.RuntimeSettingsService }]; } });
|
1443
1446
|
|
1444
1447
|
class ProductUnloadGuard {
|
1445
1448
|
constructor(router, contextService, quoteDraftService, configurationService, flowDialogService) {
|