@pega/dx-component-builder-sdk 0.1.28 → 0.1.29

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/dx-component-builder-sdk",
3
- "version": "0.1.28",
3
+ "version": "0.1.29",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "scripts": {
@@ -179,12 +179,13 @@ export const validateCompileAll = async (
179
179
  const type = "Template";
180
180
  const subtype = COMPONENT_SCHEMA.subtype.template[templateIdx].value;
181
181
  const prefixNoSpace = prefix.replace(/\s+/g, '');
182
+ let templateNameOriginal = COMPONENT_SCHEMA.subtype.template[templateIdx].name;
182
183
  let templateName = convertIntoPascalCase(COMPONENT_SCHEMA.subtype.template[templateIdx].name);
183
184
  let templateLabel = convertIntoPascalCase(COMPONENT_SCHEMA.subtype.template[templateIdx].name);
184
- if (templateName.indexOf("region") >= 0) {
185
- templateName = templateName.replace(" region", "");
186
- templateName = "TwoColumn".concat(templateName);
187
- templateLabel = "Two Column".concat(templateName);
185
+ if (templateNameOriginal.indexOf("region") >= 0) {
186
+ let templateNameBase = convertIntoPascalCase(templateNameOriginal.replace(" region", ""));
187
+ templateName = "TwoColumn".concat(templateNameBase);
188
+ templateLabel = "Two Column ".concat(templateNameBase);
188
189
  }
189
190
  const componentName = "".concat(prefixNoSpace).concat(templateName);
190
191
  const componentLabel = "".concat(prefix).concat(" ").concat(templateLabel);
@@ -211,10 +212,11 @@ export const validateCompileAll = async (
211
212
  const type = "Widget";
212
213
  const subtype = COMPONENT_SCHEMA.subtype.widget[widgetIdx].value;
213
214
  const prefixNoSpace = prefix.replace(/\s+/g, '');
215
+ let widgetNameOriginal = COMPONENT_SCHEMA.subtype.template[widgetIdx].name;
214
216
  let widgetName = convertIntoPascalCase(COMPONENT_SCHEMA.subtype.widget[widgetIdx].name).concat("Widget");
215
217
  let widgetLabel = convertIntoPascalCase(COMPONENT_SCHEMA.subtype.widget[widgetIdx].name).concat(" Widget");
216
- if (widgetName.indexOf("&") >= 0) {
217
- widgetName = widgetName.replace(" & ", "");
218
+ if (widgetNameOriginal.indexOf("&") >= 0) {
219
+ widgetName = convertIntoPascalCase(widgetNameOriginal.replace(" & ", ""));
218
220
  }
219
221
  const componentName = "".concat(prefixNoSpace).concat(widgetName);
220
222
  const componentLabel = "".concat(prefix).concat(" ").concat(widgetLabel);
@@ -100,7 +100,7 @@ export default async options => {
100
100
  {
101
101
  title: 'Clean up companion',
102
102
  task: async () => {
103
- removeCompanionConfigJson(componentKey);
103
+ await removeCompanionConfigJson(componentKey);
104
104
  }
105
105
  }
106
106
  ],
@@ -99,7 +99,7 @@ export default async options => {
99
99
  {
100
100
  title: 'Clean up companion',
101
101
  task: async () => {
102
- removeCompanionConfigJson(componentKey);
102
+ await removeCompanionConfigJson(componentKey);
103
103
  }
104
104
  }
105
105
  ],
@@ -23,7 +23,7 @@ const combinationTypes = ['PAGE', 'CASE'];
23
23
  const allowedSubtypes = [
24
24
  ...new Set([
25
25
  ...COMPONENT_SCHEMA.subtype.field.map(({ value }) => value),
26
- ...COMPONENT_SCHEMA.subtype.template,
26
+ ...COMPONENT_SCHEMA.subtype.template.map(({ value }) => value),
27
27
  ...COMPONENT_SCHEMA.subtype.widget.map(({ value }) => value)
28
28
  ])
29
29
  ];
@@ -32,7 +32,7 @@ const allowedSubtypes = [
32
32
  const allowedOverrideSubtypes = [
33
33
  ...new Set([
34
34
  ...COMPONENT_SCHEMA.subtype.field.map(({ value }) => value),
35
- ...COMPONENT_SCHEMA.subtype.template,
35
+ ...COMPONENT_SCHEMA.subtype.template.map(({ value }) => value),
36
36
  ...COMPONENT_SCHEMA.subtype.widget.map(({ value }) => value)
37
37
  ]), "ACTION", "DATA_CAPTURE", "SUMMARY", "CASEVIEW", "DATAVIEW", "LIST"
38
38
  ];