@veloceapps/sdk 10.0.0-4 → 10.0.0-41

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. package/cms/modules/runtime/services/runtime.service.d.ts +3 -1
  2. package/cms/utils/index.d.ts +1 -0
  3. package/cms/utils/inject.d.ts +1 -0
  4. package/cms/utils/ui-definition.utils.d.ts +1 -0
  5. package/cms/vendor-map.d.ts +1 -0
  6. package/core/modules/configuration/services/configuration-state.service.d.ts +1 -0
  7. package/core/services/context.service.d.ts +3 -1
  8. package/core/services/flow-info.service.d.ts +4 -2
  9. package/core/services/quote-draft.service.d.ts +3 -1
  10. package/core/services/runtime-settings.service.d.ts +1 -1
  11. package/esm2020/cms/components/element-renderer/element-renderer.component.mjs +3 -2
  12. package/esm2020/cms/modules/runtime/services/runtime.service.mjs +3 -1
  13. package/esm2020/cms/utils/index.mjs +2 -1
  14. package/esm2020/cms/utils/inject.mjs +27 -0
  15. package/esm2020/cms/utils/ui-definition.utils.mjs +13 -1
  16. package/esm2020/cms/vendor-map.mjs +3 -1
  17. package/esm2020/core/modules/configuration/services/configuration-state.service.mjs +13 -4
  18. package/esm2020/core/modules/configuration/services/configuration.service.mjs +2 -2
  19. package/esm2020/core/services/context.service.mjs +15 -6
  20. package/esm2020/core/services/flow-info.service.mjs +19 -6
  21. package/esm2020/core/services/flow-state.service.mjs +19 -6
  22. package/esm2020/core/services/quote-draft.service.mjs +21 -9
  23. package/esm2020/core/services/runtime-settings.service.mjs +3 -3
  24. package/esm2020/src/guards/context.guard.mjs +4 -6
  25. package/esm2020/src/guards/flow.guard.mjs +5 -4
  26. package/fesm2015/veloceapps-sdk-cms.mjs +41 -2
  27. package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
  28. package/fesm2015/veloceapps-sdk-core.mjs +281 -230
  29. package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
  30. package/fesm2015/veloceapps-sdk.mjs +6 -7
  31. package/fesm2015/veloceapps-sdk.mjs.map +1 -1
  32. package/fesm2020/veloceapps-sdk-cms.mjs +40 -1
  33. package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
  34. package/fesm2020/veloceapps-sdk-core.mjs +278 -228
  35. package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
  36. package/fesm2020/veloceapps-sdk.mjs +6 -7
  37. package/fesm2020/veloceapps-sdk.mjs.map +1 -1
  38. package/package.json +1 -1
@@ -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, SdkCoreModule } from '@veloceapps/sdk/core';
12
+ import { FLOW_CUSTOMIZATION, ContextService, FlowStateService, FlowInfoService, QuoteDraftService, ConfigurationService, IntegrationState, RuntimeSettingsService, 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, forkJoin, throwError } from 'rxjs';
16
+ import { BehaviorSubject, Subject, filter, first, tap, takeUntil, catchError, of, map, switchMap, shareReplay, startWith, distinctUntilChanged, from, take, combineLatest, 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,11 +986,9 @@ class ContextGuard {
986
986
  return of(true);
987
987
  }
988
988
  }
989
- // Initialize context and runtime settings
990
- return forkJoin([this.contextService.create(headerId, mode), this.runtimeSettingsService.create()]).pipe(tap(([context]) => {
989
+ // Initialize runtime settings and context
990
+ return this.contextService.create(headerId, mode).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']);
994
992
  }), map(() => true), catchError(e => {
995
993
  const message = e instanceof HttpErrorResponse ? e.error.message : e;
996
994
  const errorDetails = isVeloceError(e.error) ? extractErrorDetails(e.error) : [];
@@ -1043,6 +1041,7 @@ const keepFlowInitialized = (route) => {
1043
1041
  const quoteDraft = inject(QuoteDraftService);
1044
1042
  const configurationService = inject(ConfigurationService);
1045
1043
  const integrationState = inject(IntegrationState);
1044
+ const runtimeSettingsService = inject(RuntimeSettingsService);
1046
1045
  const { flowId } = route.queryParams;
1047
1046
  const flow = flowInfoService.flow;
1048
1047
  if (flow && (flow === null || flow === void 0 ? void 0 : flow.id) === flowId) {
@@ -1058,7 +1057,7 @@ const keepFlowInitialized = (route) => {
1058
1057
  if (!flowId) {
1059
1058
  return true;
1060
1059
  }
1061
- return flowInfoService.init$(flowId, route.queryParams).pipe(map(() => true), catchError(e => {
1060
+ return runtimeSettingsService.create().pipe(switchMap(() => flowInfoService.init$(flowId, route.queryParams)), map(() => true), catchError(e => {
1062
1061
  const message = e instanceof HttpErrorResponse ? e.error.message : e;
1063
1062
  const errorDetails = isVeloceError(e.error) ? extractErrorDetails(e.error) : [];
1064
1063
  return routerService.showErrorPage$(message, errorDetails);