@veloceapps/sdk 10.0.0-43 → 10.0.0-44

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.
@@ -9,11 +9,11 @@ import { ToastType, LoaderModule, LetDirectiveModule } from '@veloceapps/compone
9
9
  import * as i5 from '@veloceapps/sdk/cms';
10
10
  import { extractElementMetadata, extendElementMetadata, btoaSafe, PreviewModule, FlowAction, LauncherModule } from '@veloceapps/sdk/cms';
11
11
  import * as i2 from '@veloceapps/sdk/core';
12
- import { FLOW_CUSTOMIZATION, ContextService, FlowStateService, FlowInfoService, QuoteDraftService, ConfigurationService, IntegrationState, RuntimeSettingsService, SdkCoreModule } from '@veloceapps/sdk/core';
12
+ import { FLOW_CUSTOMIZATION, ContextService, FlowStateService, FlowInfoService, QuoteDraftService, ConfigurationService, IntegrationState, SdkCoreModule } from '@veloceapps/sdk/core';
13
13
  import * as i3 from 'primeng/button';
14
14
  import { ButtonModule } from 'primeng/button';
15
15
  import * as i1 from 'primeng/dynamicdialog';
16
- import { BehaviorSubject, Subject, filter, first, tap, takeUntil, catchError, of, map, switchMap, shareReplay, startWith, distinctUntilChanged, from, take, combineLatest, throwError } from 'rxjs';
16
+ import { BehaviorSubject, Subject, filter, first, tap, takeUntil, catchError, of, map, switchMap, shareReplay, startWith, distinctUntilChanged, from, take, combineLatest, forkJoin, throwError } from 'rxjs';
17
17
  import * as i1$2 from '@angular/router';
18
18
  import { NavigationEnd, NavigationStart, NavigationCancel, NavigationError, RouterModule } from '@angular/router';
19
19
  import { UITemplateType, SalesforceIdUtils, mapShoppingCartSettings, getMaxRenewalTermsValue, ConfigurationContextMode, isVeloceError, extractErrorDetails, UUID } from '@veloceapps/core';
@@ -986,9 +986,11 @@ class ContextGuard {
986
986
  return of(true);
987
987
  }
988
988
  }
989
- // Initialize runtime settings and context
990
- return this.contextService.create(headerId, mode).pipe(tap(context => {
989
+ // Initialize context and runtime settings
990
+ return forkJoin([this.contextService.create(headerId, mode), this.runtimeSettingsService.create()]).pipe(tap(([context]) => {
991
991
  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 })) }));
992
+ // Init currency settings
993
+ this.runtimeSettingsService.initCurrency(context.properties['CurrencyIsoCode']);
992
994
  }), map(() => true), catchError(e => {
993
995
  const message = e instanceof HttpErrorResponse ? e.error.message : e;
994
996
  const errorDetails = isVeloceError(e.error) ? extractErrorDetails(e.error) : [];
@@ -1041,7 +1043,6 @@ const keepFlowInitialized = (route) => {
1041
1043
  const quoteDraft = inject(QuoteDraftService);
1042
1044
  const configurationService = inject(ConfigurationService);
1043
1045
  const integrationState = inject(IntegrationState);
1044
- const runtimeSettingsService = inject(RuntimeSettingsService);
1045
1046
  const { flowId } = route.queryParams;
1046
1047
  const flow = flowInfoService.flow;
1047
1048
  if (flow && (flow === null || flow === void 0 ? void 0 : flow.id) === flowId) {
@@ -1057,7 +1058,7 @@ const keepFlowInitialized = (route) => {
1057
1058
  if (!flowId) {
1058
1059
  return true;
1059
1060
  }
1060
- return runtimeSettingsService.create().pipe(switchMap(() => flowInfoService.init$(flowId, route.queryParams)), map(() => true), catchError(e => {
1061
+ return flowInfoService.init$(flowId, route.queryParams).pipe(map(() => true), catchError(e => {
1061
1062
  const message = e instanceof HttpErrorResponse ? e.error.message : e;
1062
1063
  const errorDetails = isVeloceError(e.error) ? extractErrorDetails(e.error) : [];
1063
1064
  return routerService.showErrorPage$(message, errorDetails);