@pega/dx-component-builder-sdk 0.242.8 → 0.242.10

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.
Files changed (69) hide show
  1. package/package.json +1 -1
  2. package/src/cli.js +6 -0
  3. package/src/constants.js +3 -0
  4. package/src/tasks/create/templates/Constellation/field/Decimal/index.tsx.mustache +3 -6
  5. package/src/tasks/create/templates/Constellation/field/Decimal-Currency/index.tsx.mustache +1 -3
  6. package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/index.tsx.mustache +2 -5
  7. package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/index.tsx.mustache +10 -52
  8. package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/utils.ts.mustache +1 -1
  9. package/src/tasks/create/templates/Constellation/template/DETAILS/Avatar.tsx.mustache +5 -7
  10. package/src/tasks/create/templates/Constellation/template/DETAILS-region/Avatar.tsx.mustache +5 -7
  11. package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/Avatar.tsx.mustache +5 -7
  12. package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.ts.mustache +3 -3
  13. package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.ts.mustache +3 -3
  14. package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.ts.mustache +3 -2
  15. package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.ts.mustache +4 -4
  16. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.ts.mustache +3 -3
  17. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/demo.stories.tsx.mustache +10 -0
  18. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.ts.mustache +2 -2
  19. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/demo.stories.tsx.mustache +10 -0
  20. package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.ts.mustache +1 -1
  21. package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.ts.mustache +3 -3
  22. package/src/tasks/create/templates/SDK-Angular/field/Picklist-Autocomplete/picklist-autocomplete.component.ts.mustache +3 -3
  23. package/src/tasks/create/templates/SDK-Angular/field/Picklist-RadioButtons/picklist-radio-buttons.component.ts.mustache +2 -2
  24. package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.ts.mustache +4 -2
  25. package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.ts.mustache +1 -1
  26. package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.ts.mustache +1 -1
  27. package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.ts.mustache +1 -1
  28. package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.ts.mustache +1 -1
  29. package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.ts.mustache +1 -1
  30. package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.ts.mustache +1 -1
  31. package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.ts.mustache +1 -1
  32. package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.ts.mustache +1 -1
  33. package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.ts.mustache +1 -1
  34. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.scss.mustache +1 -1
  35. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.ts.mustache +1 -1
  36. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/mock.ts.mustache +1 -1
  37. package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.ts.mustache +1 -1
  38. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.ts.mustache +1 -1
  39. package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +1 -1
  40. package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +1 -1
  41. package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +1 -1
  42. package/src/tasks/create/templates/SDK-React/template/FORM-region/demo.stories.tsx.mustache +21 -19
  43. package/src/tasks/index.js +1 -0
  44. package/src/tasks/map/map.js +2 -1
  45. package/src/tasks/quarantine/index.js +81 -0
  46. package/src/util.js +29 -1
  47. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +2 -2
  48. package/tests/assets/sdk-r/components/create/override-sdk/field/Phone/Phone.tsx +5 -5
  49. package/tests/assets/sdk-r/components/create/override-sdk/infra/NavBar/NavBar.css +0 -1
  50. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/ListView.tsx +28 -29
  51. package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +5 -10
  52. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyCurrency/index.tsx +1 -3
  53. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDecimal/index.tsx +3 -6
  54. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPercentage/index.tsx +2 -5
  55. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/index.tsx +10 -52
  56. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/utils.ts +1 -1
  57. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/Avatar.tsx +5 -7
  58. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +5 -7
  59. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +5 -7
  60. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +1 -1
  61. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +1 -1
  62. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +1 -1
  63. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPhone/index.tsx +5 -5
  64. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +8 -21
  65. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +2 -2
  66. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Phone/Phone.tsx +5 -5
  67. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/NavBar/NavBar.css +0 -1
  68. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/ListView.tsx +28 -29
  69. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +5 -10
@@ -129,7 +129,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
129
129
  }
130
130
  this.helperText = this.configProps$.helperText;
131
131
  this.placeholder = this.configProps$.placeholder || '';
132
- const currencyISOCode: any = this.configProps$?.currencyISOCode;
132
+ const currencyISOCode = this.configProps$?.currencyISOCode ?? '';
133
133
 
134
134
  const theSymbols = getCurrencyCharacters(currencyISOCode);
135
135
  this.currSym = theSymbols.theCurrencySymbol;
@@ -169,7 +169,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
169
169
 
170
170
  this.decimalPrecision = this.configProps$?.allowDecimals ? 2 : 0;
171
171
 
172
- this.componentReference = (this.pConn$.getStateProps() as any).value;
172
+ this.componentReference = this.pConn$.getStateProps().value;
173
173
 
174
174
  // trigger display of error message with field control
175
175
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -184,7 +184,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
184
184
 
185
185
  fieldOnBlur(event: any) {
186
186
  const actionsApi = this.pConn$?.getActionsApi();
187
- const propName = (this.pConn$?.getStateProps() as any).value;
187
+ const propName = this.pConn$?.getStateProps().value;
188
188
  let value = event?.target?.value;
189
189
  value = value?.substring(1);
190
190
  if (this.currSep === ',') {
@@ -33,6 +33,16 @@ const meta: Meta<{{COMPONENT_CLASS_NAME}}Component> = {
33
33
  },
34
34
  getStateProps: () => {
35
35
  return stateProps;
36
+ },
37
+ getActionsApi: () => {
38
+ return {
39
+ updateFieldValue: () => {
40
+ /* nothing */
41
+ },
42
+ triggerFieldChange: () => {
43
+ /* nothing */
44
+ }
45
+ };
36
46
  }
37
47
  } as any,
38
48
  formGroup$: new FormBuilder().group({})
@@ -157,7 +157,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
157
157
 
158
158
  this.decimalPrecision = this.configProps$?.decimalPrecision ?? 2;
159
159
 
160
- this.componentReference = (this.pConn$.getStateProps() as any).value;
160
+ this.componentReference = this.pConn$.getStateProps().value;
161
161
 
162
162
  // trigger display of error message with field control
163
163
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -175,7 +175,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
175
175
 
176
176
  fieldOnBlur(event: any) {
177
177
  const actionsApi = this.pConn$?.getActionsApi();
178
- const propName = (this.pConn$?.getStateProps() as any).value;
178
+ const propName = this.pConn$?.getStateProps()?.value;
179
179
  let value = event?.target?.value;
180
180
  value = value ? value.replace(/%/g, '') : '';
181
181
  if (this.currSep === ',') {
@@ -19,6 +19,16 @@ const meta: Meta<{{COMPONENT_CLASS_NAME}}Component> = {
19
19
  },
20
20
  getStateProps: () => {
21
21
  return stateProps;
22
+ },
23
+ getActionsApi: () => {
24
+ return {
25
+ updateFieldValue: () => {
26
+ /* nothing */
27
+ },
28
+ triggerFieldChange: () => {
29
+ /* nothing */
30
+ }
31
+ };
22
32
  }
23
33
  } as any,
24
34
  formGroup$: new FormBuilder().group({})
@@ -142,7 +142,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
142
142
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
143
143
  }
144
144
 
145
- this.componentReference = (this.pConn$.getStateProps() as any).value;
145
+ this.componentReference = this.pConn$.getStateProps().value;
146
146
 
147
147
  // trigger display of error message with field control
148
148
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -157,7 +157,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
157
157
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
158
158
  }
159
159
 
160
- this.componentReference = (this.pConn$.getStateProps() as any).value;
160
+ this.componentReference = this.pConn$.getStateProps().value;
161
161
 
162
162
  const optionsList = [...this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject())];
163
163
  optionsList?.unshift({ key: 'Select', value: this.pConn$.getLocalizedValue('Select...', '', '') });
@@ -166,7 +166,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
166
166
  this.value$ = 'Select';
167
167
  }
168
168
 
169
- const propName = (this.pConn$.getStateProps() as any).value;
169
+ const propName = this.pConn$.getStateProps().value;
170
170
  const className = this.pConn$.getCaseInfo().getClassName();
171
171
  const refName = propName?.slice(propName.lastIndexOf('.') + 1);
172
172
 
@@ -205,7 +205,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
205
205
  event.value = '';
206
206
  }
207
207
  const actionsApi = this.pConn$?.getActionsApi();
208
- const propName = (this.pConn$?.getStateProps() as any).value;
208
+ const propName = this.pConn$?.getStateProps().value;
209
209
  handleEvent(actionsApi, 'changeNblur', propName, event.value);
210
210
  if (this.configProps$?.onRecordChange) {
211
211
  this.configProps$.onRecordChange(event);
@@ -184,7 +184,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
184
184
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
185
185
  }
186
186
 
187
- this.componentReference = (this.pConn$.getStateProps() as any).value;
187
+ this.componentReference = this.pConn$.getStateProps().value;
188
188
  if (this.listType === 'associated') {
189
189
  this.options$ = this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject('')); // 1st arg empty string until typedef marked correctly
190
190
  }
@@ -220,7 +220,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
220
220
  let datasource = this.configProps$.datasource;
221
221
  let columns = this.configProps$.columns;
222
222
  // const { deferDatasource, datasourceMetadata } = this.configProps$;
223
- const { deferDatasource, datasourceMetadata }: any = this.pConn$.getConfigProps();
223
+ const { deferDatasource, datasourceMetadata } = this.pConn$.getConfigProps();
224
224
  // convert associated to datapage listtype and transform props
225
225
  // Process deferDatasource when datapage name is present. WHhen tableType is promptList / localList
226
226
  if (deferDatasource && datasourceMetadata?.datasource?.name) {
@@ -318,7 +318,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
318
318
 
319
319
  const value = key;
320
320
  const actionsApi = this.pConn$?.getActionsApi();
321
- const propName = (this.pConn$?.getStateProps() as any).value;
321
+ const propName = this.pConn$?.getStateProps().value;
322
322
  handleEvent(actionsApi, 'changeNblur', propName, value);
323
323
  if (this.configProps$?.onRecordChange) {
324
324
  el.value = value;
@@ -164,11 +164,11 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
164
164
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
165
165
  }
166
166
 
167
- this.componentReference = (this.pConn$.getStateProps() as any).value;
167
+ this.componentReference = this.pConn$.getStateProps().value;
168
168
 
169
169
  this.options$ = this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject());
170
170
 
171
- const propName = (this.pConn$.getStateProps() as any).value;
171
+ const propName = this.pConn$.getStateProps().value;
172
172
  const className = this.pConn$.getCaseInfo().getClassName();
173
173
  const refName = propName?.slice(propName.lastIndexOf('.') + 1);
174
174
 
@@ -100,11 +100,13 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
100
100
 
101
101
  // updateSelf
102
102
  updateSelf(): void {
103
- this.componentReference = (this.pConn$.getStateProps() as any).value;
103
+ this.componentReference = this.pConn$.getStateProps().value;
104
104
  // moved this from ngOnInit() and call this from there instead...
105
105
  this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as {{COMPONENT_CLASS_NAME}}Props;
106
106
 
107
- this.value$ = this.configProps$.value || '';
107
+ if (this.configProps$.value != undefined) {
108
+ this.value$ = this.configProps$.value;
109
+ }
108
110
  this.testId = this.configProps$.testId;
109
111
  this.label$ = this.configProps$.label;
110
112
  this.helperText = this.configProps$.helperText;
@@ -139,7 +139,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
139
139
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
140
140
  }
141
141
 
142
- this.componentReference = (this.pConn$.getStateProps() as any).value;
142
+ this.componentReference = this.pConn$.getStateProps().value;
143
143
 
144
144
  // trigger display of error message with field control
145
145
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -113,7 +113,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
113
113
  this.label$ = this.configProps$.label;
114
114
  this.displayMode$ = this.configProps$.displayMode;
115
115
 
116
- this.componentReference = (this.pConn$.getStateProps() as any).value;
116
+ this.componentReference = this.pConn$.getStateProps().value;
117
117
 
118
118
  if (this.configProps$.visibility != null) {
119
119
  this.bVisible$ = this.utils.getBooleanValue(this.configProps$.visibility);
@@ -140,7 +140,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
140
140
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
141
141
  }
142
142
 
143
- this.componentReference = (this.pConn$.getStateProps() as any).value;
143
+ this.componentReference = this.pConn$.getStateProps().value;
144
144
 
145
145
  // trigger display of error message with field control
146
146
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -162,7 +162,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
162
162
  fieldOnChange() {
163
163
  if (this.formGroup$.controls[this.controlName$].value) {
164
164
  const actionsApi = this.pConn$?.getActionsApi();
165
- const propName = (this.pConn$?.getStateProps() as any).value;
165
+ const propName = this.pConn$?.getStateProps().value;
166
166
  const value = this.formGroup$.controls[this.controlName$].value;
167
167
  const eventObj = {
168
168
  target: {
@@ -140,7 +140,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
140
140
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
141
141
  }
142
142
 
143
- this.componentReference = (this.pConn$.getStateProps() as any).value;
143
+ this.componentReference = this.pConn$.getStateProps().value;
144
144
 
145
145
  // trigger display of error message with field control
146
146
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -138,7 +138,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
138
138
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
139
139
  }
140
140
 
141
- this.componentReference = (this.pConn$.getStateProps() as any).value;
141
+ this.componentReference = this.pConn$.getStateProps().value;
142
142
 
143
143
  // trigger display of error message with field control
144
144
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -50,7 +50,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
50
50
  }
51
51
 
52
52
  updateSelf() {
53
- const rawMetaData: any = this.pConn$.resolveConfigProps((this.pConn$.getRawMetadata() as any).config);
53
+ const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
54
54
  this.showHighlightedData = rawMetaData?.showHighlightedData;
55
55
 
56
56
  if (this.showHighlightedData) {
@@ -57,7 +57,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
57
57
  }
58
58
 
59
59
  updateSelf() {
60
- const rawMetaData: any = this.pConn$.resolveConfigProps((this.pConn$.getRawMetadata() as any).config);
60
+ const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
61
61
  this.showHighlightedData = rawMetaData?.showHighlightedData;
62
62
 
63
63
  if (this.showHighlightedData) {
@@ -49,7 +49,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit {
49
49
  const propToUse: any = { ...this.pConn$.getInheritedProps() };
50
50
  this.showLabel = propToUse?.showLabel;
51
51
  this.label = propToUse?.label;
52
- const kids = this.pConn$.getChildren() as any[];
52
+ const kids = this.pConn$.getChildren();
53
53
  this.instructions = this.templateUtils.getInstructions(this.pConn$, configProps?.instructions);
54
54
 
55
55
  const numCols = configProps.NumCols ? configProps.NumCols : '1';
@@ -11,7 +11,7 @@
11
11
  .psdk-two-column-column {
12
12
  width: 50%;
13
13
  float: left;
14
- padding: 0rem 0rem;
14
+ padding: 0rem 1.5rem;
15
15
  height: 100%;
16
16
  }
17
17
 
@@ -29,6 +29,6 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnChanges {
29
29
  }
30
30
 
31
31
  updateSelf() {
32
- this.arChildren$ = this.pConn$.getChildren() as any[];
32
+ this.arChildren$ = this.pConn$.getChildren();
33
33
  }
34
34
  }
@@ -231,7 +231,7 @@ export const child2 = [
231
231
  readOnly: false,
232
232
  placeholder: 'Phone',
233
233
  value: '2015550123',
234
- label: '',
234
+ label: 'Phone Number',
235
235
  hasSuggestions: false
236
236
  };
237
237
  },
@@ -34,7 +34,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
34
34
  this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
35
35
 
36
36
  this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as {{COMPONENT_CLASS_NAME}}Props;
37
- this.arChildren$ = this.pConn$.getChildren() as any[];
37
+ this.arChildren$ = this.pConn$.getChildren();
38
38
 
39
39
  this.title$ = this.configProps$.title;
40
40
  const operator = this.configProps$.operator;
@@ -50,7 +50,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnChanges, OnD
50
50
  }
51
51
 
52
52
  updateSelf(): void {
53
- const configProps$ = this.pConn$.getConfigProps() as any;
53
+ const configProps$ = this.pConn$.getConfigProps();
54
54
  this.displayLabel = this.displayLabel?.toLowerCase();
55
55
  const label = configProps$?.label?.toLowerCase();
56
56
  if (label === 'create operator' || this.displayLabel === 'create operator') {
@@ -73,7 +73,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
73
73
  if (formatter === 'Currency') {
74
74
  formattedValue = format(value, formatter.toLowerCase(), theCurrencyOptions);
75
75
  } else {
76
- formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);
76
+ formattedValue = format(value, pConn.getComponentName()?.toLowerCase(), theCurrencyOptions);
77
77
  }
78
78
 
79
79
  if (displayMode === 'DISPLAY_ONLY') {
@@ -62,7 +62,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
62
62
  const theCurrSep = theSymbols.theDigitGroupSeparator;
63
63
 
64
64
  const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
65
- const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);
65
+ const formattedValue = format(value, pConn.getComponentName()?.toLowerCase(), theCurrencyOptions);
66
66
 
67
67
  let readOnlyProp = {}; // Note: empty if NOT ReadOnly
68
68
 
@@ -54,7 +54,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
54
54
  const helperTextToDisplay = validatemessage || helperText;
55
55
 
56
56
  const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
57
- const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);
57
+ const formattedValue = format(value, pConn.getComponentName()?.toLowerCase(), theCurrencyOptions);
58
58
 
59
59
  let readOnlyProp = {}; // Note: empty if NOT ReadOnly
60
60
 
@@ -23,7 +23,7 @@ export default meta;
23
23
  type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
24
24
 
25
25
  const renderField = resolvedProps => {
26
- const { displayMode, value = '', label = '', readOnly, onChange, onBlur, required, disabled, helperText, placeholder, validatemessage, status, testId } = resolvedProps;
26
+ const { displayMode, value = '', label = '', onChange, required, disabled, helperText, placeholder, validatemessage, status, testId } = resolvedProps;
27
27
 
28
28
  const helperTextToDisplay = validatemessage || helperText;
29
29
  let testProp = {};
@@ -33,7 +33,7 @@ const renderField = resolvedProps => {
33
33
  };
34
34
  const variant = displayMode === 'DISPLAY_ONLY' ? 'inline' : 'stacked';
35
35
  let val: any = '';
36
-
36
+
37
37
  {{! pick new delimiters for mustache }}
38
38
  {{=<% %>=}}
39
39
  if (label === 'Service Date')
@@ -72,24 +72,27 @@ const renderField = resolvedProps => {
72
72
  if (label === 'First Name' || label === 'Last Name' || label === 'Middle Name')
73
73
  val = <TextField value={value} fullWidth size='small' variant='outlined' style={{ fontSize: '14px' }} label={label} onChange={onChange} />;
74
74
 
75
+ const disableDropdown = true;
75
76
  if (label === 'Phone Number')
76
77
  val = (
77
78
  <MuiTelInput
78
- fullWidth
79
- variant='outlined'
80
- helperText={helperTextToDisplay}
81
- placeholder={placeholder ?? ''}
82
- size='small'
83
- defaultCountry='US'
84
- required={required}
85
- disabled={disabled}
86
- onChange={onChange}
87
- onBlur={!readOnly ? onBlur : undefined}
88
- error={status === 'error'}
89
- label={label}
90
- value={value}
91
- InputProps={{ ...testProp }}
92
- />
79
+ fullWidth
80
+ helperText={helperTextToDisplay}
81
+ placeholder={placeholder ?? ''}
82
+ size='small'
83
+ defaultCountry='US'
84
+ required={required}
85
+ disabled={disabled}
86
+ onChange={onChange}
87
+ error={status === 'error'}
88
+ label={label}
89
+ value={value}
90
+ InputProps={{
91
+ readOnly: true,
92
+ inputProps: { ...testProp }
93
+ }}
94
+ disableDropdown={disableDropdown}
95
+ />
93
96
  );
94
97
  <%={{ }}=%> {{! revert delimiters for mustache }}
95
98
 
@@ -170,8 +173,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
170
173
  hasSuggestions: false,
171
174
  onChange: val => {
172
175
  setPhone(val);
173
- },
174
- onBlur: () => {}
176
+ }
175
177
  },
176
178
  {
177
179
  readOnly: undefined,
@@ -9,6 +9,7 @@ export { default as mapAllComponents } from './map-all/index.js';
9
9
  export { default as publishComponent } from './publish/index.js';
10
10
  export { default as publishAllComponents } from './publish-all/index.js';
11
11
  export { default as renameComponent } from './rename/index.js';
12
+ export { default as quarantine } from './quarantine/index.js';
12
13
  export { default as listComponents } from './list/index.js';
13
14
  export { default as updateComponent } from './update/index.js';
14
15
  export { default as validate } from './validator/index.js';
@@ -43,7 +43,8 @@ export const getPrettierFormattedString = async (content) => {
43
43
 
44
44
  // format the contents
45
45
  if (options) {
46
- return prettier.format(content, options);
46
+ options.parser = 'babel';
47
+ return prettier.format(content, options);
47
48
  }
48
49
  else {
49
50
  return content;
@@ -0,0 +1,81 @@
1
+ import fs from 'fs';
2
+ import path, {join} from 'path';
3
+ import inquirer from 'inquirer';
4
+ import chalk from 'chalk';
5
+
6
+
7
+ import {
8
+ showVersion,
9
+ getFramework,
10
+ getJestFunctionalTestList } from '../../util.js';
11
+
12
+ import { JEST_TESTS_FUNCTIONAL_PATH } from '../../constants.js';
13
+
14
+
15
+ export const quarnUnquarnTests = async(answers) => {
16
+ switch (answers.QuarUnQuar) {
17
+ case "Quarantine" :
18
+ await quarantineTests(answers);
19
+ break;
20
+ case "Unquarantine" :
21
+ await unquarantineTests(answers);
22
+ break;
23
+ }
24
+ }
25
+
26
+
27
+
28
+ export const quarantineTests = async(answers) => {
29
+ const testList = await getJestFunctionalTestList("ALL");
30
+ const frameWork = await getFramework();
31
+ const SDK_PATH = frameWork === "SDK-Angular" ? "sdk-a" : "sdk-r";
32
+ const functionalPath = join(path.resolve(), JEST_TESTS_FUNCTIONAL_PATH, SDK_PATH);
33
+
34
+ // rename .test to .notest
35
+ for (const testName of testList) {
36
+ const quarantineName = testName.replace(".test", ".notest");
37
+ fs.renameSync(join(functionalPath, testName), join(functionalPath, quarantineName));
38
+ }
39
+
40
+ console.log(chalk.green(`All ${SDK_PATH} tests are quarantined.`));
41
+
42
+ }
43
+
44
+ export const unquarantineTests = async(answers) => {
45
+ const testList = await getJestFunctionalTestList("ALL");
46
+ const frameWork = await getFramework();
47
+ const SDK_PATH = frameWork === "SDK-Angular" ? "sdk-a" : "sdk-r";
48
+ const functionalPath = join(path.resolve(), JEST_TESTS_FUNCTIONAL_PATH, SDK_PATH);
49
+
50
+ // rename .test to .notest
51
+ for (const testName of testList) {
52
+ const restoreName = testName.replace(".notest", ".test");
53
+ fs.renameSync(join(functionalPath, testName), join(functionalPath, restoreName));
54
+ }
55
+
56
+ console.log(chalk.green(`All ${SDK_PATH} tests are unquarantined.`));
57
+
58
+ }
59
+
60
+
61
+ export default async options => {
62
+
63
+ await showVersion();
64
+
65
+ const quaranAnswers = await inquirer.prompt([
66
+
67
+ {
68
+ name: 'QuarUnQuar',
69
+ type: 'rawlist',
70
+ message: `Quarantine or UnQuarantine tests`,
71
+ choices: ["Quarantine", "Unquarantine"],
72
+ default: 'Quarantine'
73
+
74
+ }
75
+ ]);
76
+
77
+ // await showCurrentStatus();
78
+ await quarnUnquarnTests(quaranAnswers);
79
+
80
+
81
+ }
package/src/util.js CHANGED
@@ -40,7 +40,8 @@ import {
40
40
  COMPONENT_DIRECTORY_SUFFIX_SDK,
41
41
  DXCB_COMPONENT_DEFAULTS,
42
42
  SERVER_CONFIG,
43
- SERVER_REST_URL
43
+ SERVER_REST_URL,
44
+ JEST_TESTS_FUNCTIONAL_PATH
44
45
  } from './constants.js';
45
46
 
46
47
  export const DXCB_CONFIG_INTERNAL_JSON_FILENAME = 'src/dxcb.config.json';
@@ -765,6 +766,33 @@ export const showVersion = () => {
765
766
  console.log(chalk.redBright("DX Component Builder - SDK requires node v18 or greater, current version: " + process.version));
766
767
  process.exit(1);
767
768
  }
769
+ };
770
+
771
+ export const getJestFunctionalTestList = async(whichTests) => {
772
+ const frameWork = await getFramework();
773
+ const SDK_PATH = frameWork === "SDK-Angular" ? "sdk-a" : "sdk-r";
774
+ const functionalDir = join(path.resolve(), JEST_TESTS_FUNCTIONAL_PATH, SDK_PATH);
775
+ const libFilter = "localLib";
776
+
777
+ switch (whichTests) {
778
+ case "ALL" :
779
+ return fs
780
+ .readdirSync(functionalDir, { withFileTypes: true })
781
+ .filter(dirent => !dirent.isDirectory() )
782
+ .map(dirent => dirent.name);
783
+ case "Original":
784
+ return fs
785
+ .readdirSync(functionalDir, { withFileTypes: true })
786
+ .filter(dirent => !dirent.isDirectory() && !dirent.name.startsWith(libFilter))
787
+ .map(dirent => dirent.name);
788
+ case "Library" :
789
+ return fs
790
+ .readdirSync(functionalDir, { withFileTypes: true })
791
+ .filter(dirent => !dirent.isDirectory() && dirent.name.startsWith(libFilter))
792
+ .map(dirent => dirent.name);
793
+ }
794
+
795
+
768
796
  }
769
797
 
770
798
  export const getOOTBComponents = async () => {
@@ -51,7 +51,7 @@ export default function FieldValueList(props: FieldValueListProps) {
51
51
 
52
52
  function getGridItemLabel() {
53
53
  return (
54
- <Grid item xs={variant === 'stacked' ? 12 : 4} className={variant === 'stacked' ? classes.noPaddingBottom : ''}>
54
+ <Grid item xs={variant === 'stacked' ? 12 : 6} className={variant === 'stacked' ? classes.noPaddingBottom : ''}>
55
55
  <Typography variant='body2' component='span' className={`${classes.fieldLabel}`}>
56
56
  {name}
57
57
  </Typography>
@@ -63,7 +63,7 @@ export default function FieldValueList(props: FieldValueListProps) {
63
63
  const formattedValue = formatItemValue(value);
64
64
 
65
65
  return (
66
- <Grid item xs={variant === 'stacked' ? 12 : 8} className={variant === 'stacked' ? classes.noPaddingTop : ''}>
66
+ <Grid item xs={variant === 'stacked' ? 12 : 6} className={variant === 'stacked' ? classes.noPaddingTop : ''}>
67
67
  {isHtml ? (
68
68
  // eslint-disable-next-line react/no-danger
69
69
  <div dangerouslySetInnerHTML={{ __html: formattedValue }} />
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState } from 'react';
2
- import { MuiTelInput } from 'mui-tel-input';
2
+ import MuiPhoneNumber from 'material-ui-phone-number';
3
3
 
4
4
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
5
5
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
@@ -57,12 +57,12 @@ export default function Phone(props: PhoneProps) {
57
57
  const disableDropdown = true;
58
58
  return (
59
59
  <div>
60
- <MuiTelInput
60
+ <MuiPhoneNumber
61
61
  fullWidth
62
62
  helperText={helperTextToDisplay}
63
63
  placeholder={placeholder ?? ''}
64
64
  size='small'
65
- defaultCountry='US'
65
+ defaultCountry='us'
66
66
  required={required}
67
67
  disabled={disabled}
68
68
  onChange={onChange}
@@ -91,13 +91,13 @@ export default function Phone(props: PhoneProps) {
91
91
  };
92
92
 
93
93
  return (
94
- <MuiTelInput
94
+ <MuiPhoneNumber
95
95
  fullWidth
96
96
  variant='outlined'
97
97
  helperText={helperTextToDisplay}
98
98
  placeholder={placeholder ?? ''}
99
99
  size='small'
100
- defaultCountry='US'
100
+ defaultCountry='us'
101
101
  required={required}
102
102
  disabled={disabled}
103
103
  onChange={handleChange}
@@ -165,5 +165,4 @@
165
165
 
166
166
  .scrollable {
167
167
  overflow-y: scroll !important;
168
- min-height: 200px !important;
169
168
  }