@veloceapps/sdk 7.0.2-27 → 7.0.2-28

Sign up to get free protection for your applications and to get access to all the features.
@@ -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) {