@veloceapps/sdk 8.0.0-204 → 8.0.0-206

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.
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, InjectionToken, Optional, Inject, NgModule, inject, Directive, Input, LOCALE_ID, Pipe } from '@angular/core';
3
- import { UUID, ConfigurationContextMode, ConfigurationContext, UITemplateType, isDefined, ConfigurationProcessorTypes, EntityUtil, DEFAULT_CURRENCY_ISO_CODE, DEFAULT_CURRENCY_SYMBOL, validateDateFormat, DEFAULT_DATE_FORMAT, DEFAULT_DECIMALS_COUNT, getSupportedDateFormats, DEFAULT_DECIMAL_SEPARATOR, DEFAULT_THOUSANDS_SEPARATOR, DEFAULT_ACTION_CODE_LABELS, parseJsonSafely, ConfigurationMode, ConfigurationTranslatorUtils, ChargeGroupUtils, RuntimeModel, isNotLegacyUIDefinition, SalesforceIdUtils, DEFAULT_TIME_FORMAT, formatNumber } from '@veloceapps/core';
3
+ import { UUID, ConfigurationContextMode, ConfigurationContext, UITemplateType, QuoteDraft, isDefined, ConfigurationProcessorTypes, EntityUtil, DEFAULT_CURRENCY_ISO_CODE, DEFAULT_CURRENCY_SYMBOL, validateDateFormat, DEFAULT_DATE_FORMAT, DEFAULT_DECIMALS_COUNT, getSupportedDateFormats, DEFAULT_DECIMAL_SEPARATOR, DEFAULT_THOUSANDS_SEPARATOR, DEFAULT_ACTION_CODE_LABELS, parseJsonSafely, ConfigurationMode, ConfigurationTranslatorUtils, ChargeGroupUtils, RuntimeModel, isNotLegacyUIDefinition, SalesforceIdUtils, DEFAULT_TIME_FORMAT, formatNumber } from '@veloceapps/core';
4
4
  import * as i1 from '@veloceapps/api';
5
5
  import { ApiModule } from '@veloceapps/api';
6
6
  import { BehaviorSubject, switchMap, map as map$1, tap as tap$1, noop, catchError, throwError, of, forkJoin, zip, combineLatest, Subject, filter as filter$1, shareReplay as shareReplay$1, finalize, takeUntil, buffer, debounceTime, share, take as take$1, distinctUntilChanged } from 'rxjs';
@@ -344,13 +344,19 @@ class QuoteDraftService {
344
344
  }
345
345
  init(headerId, params) {
346
346
  const ctx = this.context.resolve();
347
- const accountId = this.context.mode === ConfigurationContextMode.ACCOUNT ? headerId : ctx.properties.AccountId;
348
- return zip(accountId ? this.accountApiService.getAssetsState(accountId, params) : of(null), this.quoteApiService.getQuoteState(headerId, params)).pipe(tap(([assets, quote]) => {
347
+ const isAccountMode = this.context.mode === ConfigurationContextMode.ACCOUNT;
348
+ const accountId = isAccountMode ? headerId : ctx.properties.AccountId;
349
+ return zip(accountId ? this.accountApiService.getAssetsState(accountId, params) : of(null), isAccountMode ? of(QuoteDraft.emptyQuote(ConfigurationContextMode.ACCOUNT)) : this.quoteApiService.getQuoteState(headerId, params)).pipe(tap(([assets, quote]) => {
349
350
  if (assets) {
350
351
  this.assetsSubj$.next(assets);
351
352
  }
352
353
  this.quoteSubj$.next(quote);
353
- this.context.update(quote.context);
354
+ if (assets && isAccountMode) {
355
+ this.context.update(assets.context);
356
+ }
357
+ else {
358
+ this.context.update(quote.context);
359
+ }
354
360
  }), map(() => noop()), take(1));
355
361
  }
356
362
  finalizeInit() {
@@ -2253,6 +2259,7 @@ class ConfigurationStateService {
2253
2259
  request.actions.forEach(action => {
2254
2260
  configurationRequest = this.executeActionScript(configurationRequest, action) ?? configurationRequest;
2255
2261
  });
2262
+ configurationRequest = ConfigurationTranslatorUtils.lightenConfigurationRequest(configurationRequest);
2256
2263
  return this.configurationService.configureRequest$(configurationRequest);
2257
2264
  }), map$1(() => {
2258
2265
  // Run selectors and apply them to the state