@veloceapps/sdk 8.0.0-166 → 8.0.0-168

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. package/esm2020/cms/components/element-renderer/element-renderer.component.mjs +3 -3
  2. package/esm2020/cms/modules/migrations/migrations.mjs +2 -2
  3. package/esm2020/cms/modules/migrations/services/migrations.service.mjs +6 -2
  4. package/esm2020/cms/modules/runtime/services/compilation.service.mjs +3 -3
  5. package/esm2020/cms/plugins/configuration.plugin.mjs +8 -4
  6. package/esm2020/cms/services/io-provider.service.mjs +10 -9
  7. package/esm2020/cms/services/templates.service.mjs +10 -9
  8. package/esm2020/cms/utils/path.utils.mjs +3 -3
  9. package/esm2020/core/modules/configuration/services/configuration-state.service.mjs +7 -8
  10. package/esm2020/core/services/flow-state.service.mjs +8 -6
  11. package/esm2020/core/services/product-images.service.mjs +2 -2
  12. package/esm2020/core/utils/line-item.utils.mjs +2 -2
  13. package/esm2020/src/components/doc-gen/doc-gen.component.mjs +13 -8
  14. package/esm2020/src/pages/remote/remote.component.mjs +8 -7
  15. package/esm2020/src/services/flow-dialog.service.mjs +2 -2
  16. package/fesm2015/veloceapps-sdk-cms.mjs +38 -26
  17. package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
  18. package/fesm2015/veloceapps-sdk-core.mjs +18 -14
  19. package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
  20. package/fesm2015/veloceapps-sdk.mjs +24 -19
  21. package/fesm2015/veloceapps-sdk.mjs.map +1 -1
  22. package/fesm2020/veloceapps-sdk-cms.mjs +34 -24
  23. package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
  24. package/fesm2020/veloceapps-sdk-core.mjs +15 -14
  25. package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
  26. package/fesm2020/veloceapps-sdk.mjs +20 -14
  27. package/fesm2020/veloceapps-sdk.mjs.map +1 -1
  28. package/package.json +1 -1
@@ -143,25 +143,30 @@ class DocGenComponent {
143
143
  if (!metaList) {
144
144
  return;
145
145
  }
146
- const meta = metaList?.[0] ?? metaList;
147
146
  const headerId = this.contextService.resolve().properties.Id ?? null;
148
- let script = meta.js;
149
- if (script) {
150
- const metadata = extractElementMetadata(script);
151
- script = extendElementMetadata(script, {
147
+ const patchedMetaList = metaList.map(component => {
148
+ if (!component.js) {
149
+ return component;
150
+ }
151
+ const metadata = extractElementMetadata(component.js);
152
+ const script = extendElementMetadata(component.js, {
152
153
  inputs: {
153
154
  ...metadata.inputs,
154
155
  Id: headerId ? `"${headerId}"` : null,
155
156
  },
156
157
  });
157
- }
158
+ return {
159
+ ...component,
160
+ js: script,
161
+ };
162
+ });
158
163
  const uiDef = {
159
164
  name: '',
160
165
  createdTimestamp: 0,
161
166
  primary: true,
162
167
  type: 'DEFAULT',
163
168
  version: 2,
164
- children: metaList.map(child => ({
169
+ children: patchedMetaList.map(child => ({
165
170
  children: [],
166
171
  template: child.html && btoaSafe(child.html),
167
172
  script: child.js && btoaSafe(child.js),
@@ -444,7 +449,7 @@ class FlowDialogService {
444
449
  }
445
450
  showReadonlyModeDialog() {
446
451
  const ctx = this.contextService.resolve();
447
- const objectName = ctx.mode ? ctx.mode[0].toUpperCase() + ctx.mode.substring(1).toLowerCase() : 'Object';
452
+ const objectName = ctx.mode ? ctx.mode[0]?.toUpperCase() + ctx.mode.substring(1).toLowerCase() : 'Object';
448
453
  return this.show({
449
454
  title: 'Error',
450
455
  description: `${objectName} Cannot be Saved`,
@@ -1674,7 +1679,7 @@ class RemoteComponent {
1674
1679
  let items = [lineItem];
1675
1680
  for (let i = 0; i < items.length; i++) {
1676
1681
  const item = items[i];
1677
- const children = options.get(item.id);
1682
+ const children = item && options.get(item.id);
1678
1683
  if (children) {
1679
1684
  item.lineItems = children;
1680
1685
  items = items.concat(children);
@@ -1747,7 +1752,7 @@ class RemoteComponent {
1747
1752
  if (rootOption) {
1748
1753
  const featureOptions = optionConfigurations[rootOption.featureName] ?? (optionConfigurations[rootOption.featureName] = []);
1749
1754
  const originOption = !rootOption.hasChildren
1750
- ? optionConfigurations[rootOption.featureName].find(({ optionId }) => optionId === rootOption.optionId)
1755
+ ? optionConfigurations[rootOption.featureName]?.find(({ optionId }) => optionId === rootOption.optionId)
1751
1756
  : undefined;
1752
1757
  const option = originOption ?? {};
1753
1758
  option.optionId = option.optionId ?? rootOption.optionId;
@@ -1800,8 +1805,9 @@ class RemoteComponent {
1800
1805
  }
1801
1806
  }
1802
1807
  for (const option of notBundleOptions) {
1803
- if (bundleOptionsByOptionId[option.configuredProductId]) {
1804
- bundleOptionsByOptionId[option.configuredProductId].hasChildren = true;
1808
+ const bundleOption = bundleOptionsByOptionId[option.configuredProductId];
1809
+ if (bundleOption) {
1810
+ bundleOption.hasChildren = true;
1805
1811
  }
1806
1812
  }
1807
1813
  }
@@ -1809,7 +1815,7 @@ class RemoteComponent {
1809
1815
  let items = lineItem.lineItems ?? [];
1810
1816
  for (let i = 0; i < items.length; i++) {
1811
1817
  const item = items[i];
1812
- if (item.lineItems) {
1818
+ if (item?.lineItems) {
1813
1819
  items = items.concat(item.lineItems.map(li => ({ ...li, parentLineItem: item })));
1814
1820
  }
1815
1821
  }
@@ -1875,7 +1881,7 @@ class RemoteComponent {
1875
1881
  .forEach(mapping => {
1876
1882
  const attribute = lineItem.attributes.find(a => a.name === mapping.name);
1877
1883
  if (attribute) {
1878
- new Set(mapping.properties[propertyName].split(',')).forEach(k => (result[k] = attribute.value));
1884
+ new Set(mapping.properties[propertyName]?.split(',')).forEach(k => (result[k] = attribute.value));
1879
1885
  }
1880
1886
  });
1881
1887
  return result;