@veloceapps/sdk 9.0.0-4 → 9.0.0-6
Sign up to get free protection for your applications and to get access to all the features.
@@ -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
|
348
|
-
|
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
|
-
|
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() {
|