@veloceapps/api 7.0.2-40 → 7.0.2-42

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.
@@ -3,7 +3,7 @@ import { HttpParams, HttpErrorResponse, HttpClientModule } from '@angular/common
3
3
  import * as i0 from '@angular/core';
4
4
  import { Injectable, NgModule } from '@angular/core';
5
5
  import * as i1 from '@veloceapps/core';
6
- import { ModelTranslatorUtils, ConfigurationContextMode, isLegacyDocumentTemplate, DocxTemplater, QuoteDraft, StringUtils, Expression, Operator, ProductModelsContainer, ModelUtils, EntityUtil, RuleGroupTypes, parseJsonSafely, BaseHttpService, XrayService } from '@veloceapps/core';
6
+ import { uiDefinitionFromDTO, isLegacyUIDefinition, ModelTranslatorUtils, ConfigurationContextMode, isLegacyDocumentTemplate, DocxTemplater, QuoteDraft, StringUtils, Expression, Operator, ProductModelsContainer, ModelUtils, EntityUtil, RuleGroupTypes, parseJsonSafely, BaseHttpService, XrayService } from '@veloceapps/core';
7
7
  import { throwError, of, zip, forkJoin, map as map$1, noop, catchError as catchError$1, switchMap as switchMap$1 } from 'rxjs';
8
8
  import { map, catchError, tap, switchMap, defaultIfEmpty } from 'rxjs/operators';
9
9
  import * as i2 from 'primeng/api';
@@ -366,11 +366,16 @@ class ConfigurationApiService {
366
366
  url: `${this.SERVICE_URL}/${productId}/model` + ((offeringId && `/${offeringId}`) || ''),
367
367
  })
368
368
  .pipe(map(runtimeData => {
369
- runtimeData.uiDefinitions = JSON.parse(runtimeData.uiDefinitionsSource);
370
- runtimeData.uiDefinitions.forEach(uiDefinition => {
371
- ModelTranslatorUtils.toLocalUIDefinition(uiDefinition);
372
- });
373
- return runtimeData;
369
+ return {
370
+ ...runtimeData,
371
+ uiDefinitions: runtimeData.uiDefinitions.map(dto => {
372
+ const uiDefinitionContainer = uiDefinitionFromDTO(dto);
373
+ if (isLegacyUIDefinition(uiDefinitionContainer.source)) {
374
+ ModelTranslatorUtils.toLocalUIDefinition(uiDefinitionContainer.source);
375
+ }
376
+ return uiDefinitionContainer;
377
+ }),
378
+ };
374
379
  }));
375
380
  }
376
381
  getRuntimeDataByModelId(modelId) {
@@ -1669,6 +1674,11 @@ class ProductModelApiService {
1669
1674
  return linkedModels;
1670
1675
  }));
1671
1676
  }
1677
+ /**
1678
+ *
1679
+ * @deprecated
1680
+ * Will be removed in next major release
1681
+ */
1672
1682
  load(id, version) {
1673
1683
  return forkJoin([this.getModel(id, version), this.getLinkedModels(id, version)]).pipe(map(([model, linkedModels]) => {
1674
1684
  const container = new ProductModelsContainer(model, linkedModels ?? []);