@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,26 +143,28 @@ class DocGenComponent {
143
143
  throw new Error("Flow 'docGen' template is not defined.");
144
144
  }
145
145
  }), switchMap(() => this.getLocalMeta$()), switchMap(metaList => (metaList ? of(metaList) : this.getOrgMeta$())), map(metaList => {
146
- var _a, _b;
146
+ var _a;
147
147
  if (!metaList) {
148
148
  return;
149
149
  }
150
- const meta = (_a = metaList === null || metaList === void 0 ? void 0 : metaList[0]) !== null && _a !== void 0 ? _a : metaList;
151
- const headerId = (_b = this.contextService.resolve().properties.Id) !== null && _b !== void 0 ? _b : null;
152
- let script = meta.js;
153
- if (script) {
154
- const metadata = extractElementMetadata(script);
155
- script = extendElementMetadata(script, {
150
+ const headerId = (_a = this.contextService.resolve().properties.Id) !== null && _a !== void 0 ? _a : null;
151
+ const patchedMetaList = metaList.map(component => {
152
+ if (!component.js) {
153
+ return component;
154
+ }
155
+ const metadata = extractElementMetadata(component.js);
156
+ const script = extendElementMetadata(component.js, {
156
157
  inputs: Object.assign(Object.assign({}, metadata.inputs), { Id: headerId ? `"${headerId}"` : null }),
157
158
  });
158
- }
159
+ return Object.assign(Object.assign({}, component), { js: script });
160
+ });
159
161
  const uiDef = {
160
162
  name: '',
161
163
  createdTimestamp: 0,
162
164
  primary: true,
163
165
  type: 'DEFAULT',
164
166
  version: 2,
165
- children: metaList.map(child => ({
167
+ children: patchedMetaList.map(child => ({
166
168
  children: [],
167
169
  template: child.html && btoaSafe(child.html),
168
170
  script: child.js && btoaSafe(child.js),
@@ -637,8 +639,9 @@ class FlowDialogService {
637
639
  });
638
640
  }
639
641
  showReadonlyModeDialog() {
642
+ var _a;
640
643
  const ctx = this.contextService.resolve();
641
- const objectName = ctx.mode ? ctx.mode[0].toUpperCase() + ctx.mode.substring(1).toLowerCase() : 'Object';
644
+ const objectName = ctx.mode ? ((_a = ctx.mode[0]) === null || _a === void 0 ? void 0 : _a.toUpperCase()) + ctx.mode.substring(1).toLowerCase() : 'Object';
642
645
  return this.show({
643
646
  title: 'Error',
644
647
  description: `${objectName} Cannot be Saved`,
@@ -1698,7 +1701,7 @@ class RemoteComponent {
1698
1701
  let items = [lineItem];
1699
1702
  for (let i = 0; i < items.length; i++) {
1700
1703
  const item = items[i];
1701
- const children = options.get(item.id);
1704
+ const children = item && options.get(item.id);
1702
1705
  if (children) {
1703
1706
  item.lineItems = children;
1704
1707
  items = items.concat(children);
@@ -1770,17 +1773,17 @@ class RemoteComponent {
1770
1773
  const optionConfigurations = this.getOptionConfigurations(this.rpcMessage.product);
1771
1774
  const rootProductOptions = this.rpcMessage.options.filter(po => po.configuredProductId === lineItem.productId);
1772
1775
  childItems.forEach(lineItem => {
1773
- var _a, _b, _c;
1776
+ var _a, _b, _c, _d;
1774
1777
  const rootOption = rootProductOptions.find(po => po.optionalProductId === lineItem.productId);
1775
1778
  if (rootOption) {
1776
1779
  const featureOptions = (_a = optionConfigurations[rootOption.featureName]) !== null && _a !== void 0 ? _a : (optionConfigurations[rootOption.featureName] = []);
1777
1780
  const originOption = !rootOption.hasChildren
1778
- ? optionConfigurations[rootOption.featureName].find(({ optionId }) => optionId === rootOption.optionId)
1781
+ ? (_b = optionConfigurations[rootOption.featureName]) === null || _b === void 0 ? void 0 : _b.find(({ optionId }) => optionId === rootOption.optionId)
1779
1782
  : undefined;
1780
1783
  const option = originOption !== null && originOption !== void 0 ? originOption : {};
1781
- option.optionId = (_b = option.optionId) !== null && _b !== void 0 ? _b : rootOption.optionId;
1784
+ option.optionId = (_c = option.optionId) !== null && _c !== void 0 ? _c : rootOption.optionId;
1782
1785
  this.updateContentData(option, lineItem);
1783
- option.index = (_c = option.index) !== null && _c !== void 0 ? _c : featureOptions.length;
1786
+ option.index = (_d = option.index) !== null && _d !== void 0 ? _d : featureOptions.length;
1784
1787
  option.selected = true;
1785
1788
  if (!originOption) {
1786
1789
  featureOptions.push(option);
@@ -1827,8 +1830,9 @@ class RemoteComponent {
1827
1830
  }
1828
1831
  }
1829
1832
  for (const option of notBundleOptions) {
1830
- if (bundleOptionsByOptionId[option.configuredProductId]) {
1831
- bundleOptionsByOptionId[option.configuredProductId].hasChildren = true;
1833
+ const bundleOption = bundleOptionsByOptionId[option.configuredProductId];
1834
+ if (bundleOption) {
1835
+ bundleOption.hasChildren = true;
1832
1836
  }
1833
1837
  }
1834
1838
  }
@@ -1837,7 +1841,7 @@ class RemoteComponent {
1837
1841
  let items = (_a = lineItem.lineItems) !== null && _a !== void 0 ? _a : [];
1838
1842
  for (let i = 0; i < items.length; i++) {
1839
1843
  const item = items[i];
1840
- if (item.lineItems) {
1844
+ if (item === null || item === void 0 ? void 0 : item.lineItems) {
1841
1845
  items = items.concat(item.lineItems.map(li => (Object.assign(Object.assign({}, li), { parentLineItem: item }))));
1842
1846
  }
1843
1847
  }
@@ -1899,9 +1903,10 @@ class RemoteComponent {
1899
1903
  component.attributes
1900
1904
  .filter(a => a.properties && a.properties[propertyName])
1901
1905
  .forEach(mapping => {
1906
+ var _a;
1902
1907
  const attribute = lineItem.attributes.find(a => a.name === mapping.name);
1903
1908
  if (attribute) {
1904
- new Set(mapping.properties[propertyName].split(',')).forEach(k => (result[k] = attribute.value));
1909
+ new Set((_a = mapping.properties[propertyName]) === null || _a === void 0 ? void 0 : _a.split(',')).forEach(k => (result[k] = attribute.value));
1905
1910
  }
1906
1911
  });
1907
1912
  return result;