@veloceapps/sdk 8.0.0-192 → 8.0.0-193

Sign up to get free protection for your applications and to get access to all the features.
@@ -100,17 +100,17 @@ class ContextService {
100
100
  return this.context.pipe(map(Boolean));
101
101
  }
102
102
  get mode() {
103
- return this.resolve().properties.mode;
103
+ return this.resolve().properties['#mode'];
104
104
  }
105
105
  get isEditMode$() {
106
106
  return this.resolve$().pipe(map(() => this.isEditMode));
107
107
  }
108
108
  get isEditMode() {
109
109
  const context = this.resolve();
110
- if (context.mode === ConfigurationContextMode.ACCOUNT) {
110
+ if (context.properties['#mode'] === ConfigurationContextMode.ACCOUNT) {
111
111
  return true;
112
112
  }
113
- if (context.mode === ConfigurationContextMode.QUOTE) {
113
+ if (context.properties['#mode'] === ConfigurationContextMode.QUOTE) {
114
114
  return context.properties.Status === 'Draft';
115
115
  }
116
116
  return false;
@@ -343,11 +343,9 @@ class QuoteDraftService {
343
343
  this.hasUnsavedChanges = false;
344
344
  }
345
345
  init(headerId, params) {
346
- const { mode } = this.context.resolve();
347
- const assets$ = mode === ConfigurationContextMode.ACCOUNT
348
- ? this.accountApiService.getAssetsState(headerId, params)
349
- : of(undefined);
350
- return zip(assets$, this.quoteApiService.getQuoteState(headerId, params)).pipe(tap(([assets, quote]) => {
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]) => {
351
349
  if (assets) {
352
350
  this.assetsSubj$.next(assets);
353
351
  }
@@ -443,7 +441,7 @@ class QuoteDraftService {
443
441
  return false;
444
442
  }
445
443
  markAsUpdated(quote) {
446
- if (quote?.context.properties.mode === ConfigurationContextMode.ACCOUNT) {
444
+ if (quote?.context.properties['#mode'] === ConfigurationContextMode.ACCOUNT) {
447
445
  this.hasUnsavedChanges = !!quote && !quote.currentState.every(li => li.actionCode === 'EXIST');
448
446
  }
449
447
  else {