@pega/dx-component-builder-sdk 0.23.3 → 0.23.5

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 (35) hide show
  1. package/package.json +1 -1
  2. package/src/tasks/create/templates/Constellation/field/Boolean/index.jsx.mustache +15 -3
  3. package/src/tasks/create/templates/Constellation/field/Date/index.jsx.mustache +19 -3
  4. package/src/tasks/create/templates/Constellation/field/DateTime/index.jsx.mustache +18 -3
  5. package/src/tasks/create/templates/Constellation/field/Decimal/index.jsx.mustache +18 -3
  6. package/src/tasks/create/templates/Constellation/field/Decimal-Currency/index.jsx.mustache +18 -3
  7. package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/index.jsx.mustache +19 -3
  8. package/src/tasks/create/templates/Constellation/field/Integer/index.jsx.mustache +20 -3
  9. package/src/tasks/create/templates/Constellation/field/Picklist/index.jsx.mustache +25 -3
  10. package/src/tasks/create/templates/Constellation/field/Text/index.jsx.mustache +3 -2
  11. package/src/tasks/create/templates/Constellation/field/Text-Email/index.jsx.mustache +19 -3
  12. package/src/tasks/create/templates/Constellation/field/Text-Input/index.jsx.mustache +15 -3
  13. package/src/tasks/create/templates/Constellation/field/Text-Paragraph/index.jsx.mustache +15 -3
  14. package/src/tasks/create/templates/Constellation/field/Text-Phone/index.jsx.mustache +18 -3
  15. package/src/tasks/create/templates/Constellation/field/Text-URL/index.jsx.mustache +18 -3
  16. package/src/tasks/create/templates/Constellation/field/TimeOfDay/index.jsx.mustache +20 -4
  17. package/tests/assets/components/SDK-React/create/custom-constellation/field/Pega_DXIL_MyTestText/index.jsx +3 -2
  18. package/tests/assets/components/SDK-React/createAll/custom-constellation/field/Pega_DXIL_MyBoolean/index.jsx +15 -3
  19. package/tests/assets/components/SDK-React/createAll/custom-constellation/field/Pega_DXIL_MyCurrency/index.jsx +18 -3
  20. package/tests/assets/components/SDK-React/createAll/custom-constellation/field/Pega_DXIL_MyDate/index.jsx +19 -3
  21. package/tests/assets/components/SDK-React/createAll/custom-constellation/field/Pega_DXIL_MyDateTime/index.jsx +18 -3
  22. package/tests/assets/components/SDK-React/createAll/custom-constellation/field/Pega_DXIL_MyDecimal/index.jsx +18 -3
  23. package/tests/assets/components/SDK-React/createAll/custom-constellation/field/Pega_DXIL_MyEmail/index.jsx +19 -3
  24. package/tests/assets/components/SDK-React/createAll/custom-constellation/field/Pega_DXIL_MyInteger/index.jsx +20 -3
  25. package/tests/assets/components/SDK-React/createAll/custom-constellation/field/Pega_DXIL_MyParagraph/index.jsx +15 -3
  26. package/tests/assets/components/SDK-React/createAll/custom-constellation/field/Pega_DXIL_MyPercentage/index.jsx +19 -3
  27. package/tests/assets/components/SDK-React/createAll/custom-constellation/field/Pega_DXIL_MyPhone/index.jsx +18 -3
  28. package/tests/assets/components/SDK-React/createAll/custom-constellation/field/Pega_DXIL_MyPicklist/index.jsx +25 -3
  29. package/tests/assets/components/SDK-React/createAll/custom-constellation/field/Pega_DXIL_MyText/index.jsx +3 -2
  30. package/tests/assets/components/SDK-React/createAll/custom-constellation/field/Pega_DXIL_MyTextInput/index.jsx +15 -3
  31. package/tests/assets/components/SDK-React/createAll/custom-constellation/field/Pega_DXIL_MyTimeOfDay/index.jsx +20 -4
  32. package/tests/assets/components/SDK-React/createAll/custom-constellation/field/Pega_DXIL_MyURL/index.jsx +18 -3
  33. package/tests/functional/localCreateBuildAllDeleteAllCustom.test.js +1 -1
  34. package/tests/functional/localCreatePublishAllDeleteAllCustom.test.js +1 -1
  35. package/tests/functional/localCreatePublishAllDeleteAllOverride.test.js +1 -1
@@ -79,12 +79,15 @@ const PegaDxilMyPhone = props => {
79
79
  additionalProps,
80
80
  variant,
81
81
  isTableFormatter,
82
- hasSuggestions
82
+ hasSuggestions,
83
+ fieldMetadata,
84
+ enableAdditionalInformation
83
85
  } = props;
84
86
  const { formatter } = props;
85
87
  const pConn = getPConnect();
86
88
  const actions = pConn.getActionsApi();
87
89
  const propName = pConn.getStateProps().value;
90
+ const fieldDescription = fieldMetadata?.description;
88
91
  const hasValueChange = useRef(false);
89
92
 
90
93
  let callingCodesList = [];
@@ -216,6 +219,14 @@ const PegaDxilMyPhone = props => {
216
219
  }
217
220
  }}
218
221
  onResolveSuggestion={onResolveSuggestionHandler}
222
+ {...(enableAdditionalInformation && fieldDescription
223
+ ? {
224
+ additionalInfo: {
225
+ heading: label,
226
+ content: fieldDescription
227
+ }
228
+ }
229
+ : {})}
219
230
  />
220
231
  </StyledPegaDxilMyPhoneWrapper>
221
232
  );
@@ -238,7 +249,9 @@ PegaDxilMyPhone.defaultProps = {
238
249
  variant: 'inline',
239
250
  formatter: '',
240
251
  isTableFormatter: false,
241
- hasSuggestions: false
252
+ hasSuggestions: false,
253
+ fieldMetadata: {},
254
+ enableAdditionalInformation: false
242
255
  };
243
256
 
244
257
  PegaDxilMyPhone.propTypes = {
@@ -260,7 +273,9 @@ PegaDxilMyPhone.propTypes = {
260
273
  variant: PropTypes.string,
261
274
  formatter: PropTypes.string,
262
275
  isTableFormatter: PropTypes.bool,
263
- hasSuggestions: PropTypes.bool
276
+ hasSuggestions: PropTypes.bool,
277
+ fieldMetadata: PropTypes.objectOf(PropTypes.any),
278
+ enableAdditionalInformation: PropTypes.bool
264
279
  };
265
280
 
266
281
  export default PegaDxilMyPhone;
@@ -96,7 +96,9 @@ const PegaDxilMyPicklist = props => {
96
96
  variant,
97
97
  fieldMetadata,
98
98
  isTableFormatter,
99
- hasSuggestions
99
+ hasSuggestions,
100
+ enableAdditionalInformation,
101
+ additionalInfo
100
102
  } = props;
101
103
  const { formatter } = props;
102
104
  const pConnect = getPConnect();
@@ -105,6 +107,8 @@ const PegaDxilMyPicklist = props => {
105
107
  const className = pConnect.getCaseInfo().getClassName();
106
108
  const refName = propName?.slice(propName.lastIndexOf('.') + 1);
107
109
 
110
+ const fieldDescription = fieldMetadata?.description;
111
+
108
112
  let { readOnly, required, disabled } = props;
109
113
  [readOnly, required, disabled] = [readOnly, required, disabled].map(
110
114
  (prop) => prop === true || (typeof prop === 'string' && prop === 'true')
@@ -262,6 +266,12 @@ const PegaDxilMyPicklist = props => {
262
266
  suggestionsHandler(accepted, pConnect, setStatus);
263
267
  };
264
268
 
269
+ // In case of User Reference additionalInfo prop is directly passed down
270
+ const additionalInfoProp = additionalInfo || {
271
+ heading: label,
272
+ content: fieldDescription
273
+ };
274
+
265
275
  return (
266
276
  <StyledPegaDxilMyPicklistWrapper>
267
277
  <Select
@@ -290,6 +300,11 @@ const PegaDxilMyPicklist = props => {
290
300
  pConnect.getValidationApi().validate(event.target.value);
291
301
  }}
292
302
  onResolveSuggestion={onResolveSuggestionHandler}
303
+ {...(additionalInfo || (enableAdditionalInformation && fieldDescription)
304
+ ? {
305
+ additionalInfo: additionalInfoProp
306
+ }
307
+ : {})}
293
308
  >
294
309
  {items}
295
310
  </Select>
@@ -316,7 +331,9 @@ PegaDxilMyPicklist.defaultProps = {
316
331
  variant: 'inline',
317
332
  formatter: '',
318
333
  isTableFormatter: false,
319
- hasSuggestions: false
334
+ hasSuggestions: false,
335
+ enableAdditionalInformation: false,
336
+ additionalInfo: null
320
337
  };
321
338
 
322
339
  PegaDxilMyPicklist.propTypes = {
@@ -345,7 +362,12 @@ PegaDxilMyPicklist.propTypes = {
345
362
  variant: PropTypes.string,
346
363
  formatter: PropTypes.string,
347
364
  isTableFormatter: PropTypes.bool,
348
- hasSuggestions: PropTypes.bool
365
+ hasSuggestions: PropTypes.bool,
366
+ enableAdditionalInformation: PropTypes.bool,
367
+ additionalInfo: PropTypes.shape({
368
+ heading: PropTypes.string,
369
+ content: PropTypes.string
370
+ })
349
371
  };
350
372
 
351
373
  export default PegaDxilMyPicklist;
@@ -9,7 +9,7 @@ import StyledPegaDxilMyTextWrapper from './styles';
9
9
  // props passed in combination of props from property panel (config.json) and run time props from Constellation
10
10
  // any default values in config.pros should be set in defaultProps at bottom of this file
11
11
  const PegaDxilMyText = props => {
12
- const { getPConnect, value, placeholder, disabled, readOnly, required, label, testId } = props;
12
+ const { getPConnect, value, placeholder, disabled, readOnly, required, label, hideLabel, testId } = props;
13
13
 
14
14
  const pConn = getPConnect();
15
15
  const actions = pConn.getActionsApi();
@@ -22,10 +22,11 @@ const PegaDxilMyText = props => {
22
22
 
23
23
  return (
24
24
  <StyledPegaDxilMyTextWrapper>
25
- <Label>{label}</Label>
26
25
  <Input
27
26
  type='text'
28
27
  value={value}
28
+ label={label}
29
+ labelHidden={hideLabel}
29
30
  placeholder={placeholder}
30
31
  disabled={disabled}
31
32
  readOnly={readOnly}
@@ -73,13 +73,15 @@ const PegaDxilMyTextInput = props => {
73
73
  displayAsStatus,
74
74
  variant,
75
75
  hasSuggestions,
76
- isTableFormatter
76
+ isTableFormatter,
77
+ enableAdditionalInformation
77
78
  } = props;
78
79
  const { formatter } = props;
79
80
  const pConn = getPConnect();
80
81
  const actions = pConn.getActionsApi();
81
82
  const propName = pConn.getStateProps().value;
82
83
  const maxLength = fieldMetadata?.maxLength;
84
+ const fieldDescription = fieldMetadata?.description;
83
85
  const hasValueChange = useRef(false);
84
86
 
85
87
  let { value, readOnly, required, disabled } = props;
@@ -189,6 +191,14 @@ const PegaDxilMyTextInput = props => {
189
191
  }
190
192
  }}
191
193
  onResolveSuggestion={onResolveSuggestionHandler}
194
+ {...(enableAdditionalInformation && fieldDescription
195
+ ? {
196
+ additionalInfo: {
197
+ heading: label,
198
+ content: fieldDescription
199
+ }
200
+ }
201
+ : {})}
192
202
  />
193
203
  </StyledPegaDxilMyTextInputWrapper>
194
204
  );
@@ -211,7 +221,8 @@ PegaDxilMyTextInput.defaultProps = {
211
221
  variant: 'inline',
212
222
  formatter: '',
213
223
  isTableFormatter: false,
214
- hasSuggestions: false
224
+ hasSuggestions: false,
225
+ enableAdditionalInformation: false
215
226
  };
216
227
 
217
228
  PegaDxilMyTextInput.propTypes = {
@@ -233,7 +244,8 @@ PegaDxilMyTextInput.propTypes = {
233
244
  variant: PropTypes.string,
234
245
  formatter: PropTypes.string,
235
246
  isTableFormatter: PropTypes.bool,
236
- hasSuggestions: PropTypes.bool
247
+ hasSuggestions: PropTypes.bool,
248
+ enableAdditionalInformation: PropTypes.bool
237
249
  };
238
250
 
239
251
  export default PegaDxilMyTextInput;
@@ -31,13 +31,15 @@ const PegaDxilMyTimeOfDay = props => {
31
31
  additionalProps,
32
32
  displayMode,
33
33
  variant,
34
- hasSuggestions
34
+ hasSuggestions,
35
+ fieldMetadata,
36
+ enableAdditionalInformation
35
37
  } = props;
36
38
  let { formatter } = props;
37
39
  const pConn = getPConnect();
38
40
  const actions = pConn.getActionsApi();
39
41
  const propName = pConn.getStateProps().value;
40
-
42
+ const fieldDescription = fieldMetadata?.description;
41
43
 
42
44
  // BUG-547602: Temporary type coercion for 8.5 until DXAPIs are enhanced to pass original pxViewMetadata JSON, respecting boolean primitives
43
45
  let { readOnly, required, disabled } = props;
@@ -167,6 +169,14 @@ const PegaDxilMyTimeOfDay = props => {
167
169
  onChange={handleChange}
168
170
  onBlur={handleBlur}
169
171
  onResolveSuggestion={onResolveSuggestionHandler}
172
+ {...(enableAdditionalInformation && fieldDescription
173
+ ? {
174
+ additionalInfo: {
175
+ heading: label,
176
+ content: fieldDescription
177
+ }
178
+ }
179
+ : {})}
170
180
  />
171
181
  </StyledPegaDxilMyTimeOfDayWrapper>
172
182
  );
@@ -187,7 +197,10 @@ PegaDxilMyTimeOfDay.defaultProps = {
187
197
  additionalProps: {},
188
198
  displayMode: null,
189
199
  variant: "inline",
190
- formatter:"defaultTime"
200
+ formatter:"defaultTime",
201
+ hasSuggestions: false,
202
+ fieldMetadata: {},
203
+ enableAdditionalInformation: false
191
204
  };
192
205
 
193
206
  PegaDxilMyTimeOfDay.propTypes = {
@@ -207,7 +220,10 @@ PegaDxilMyTimeOfDay.propTypes = {
207
220
  additionalProps: PropTypes.objectOf(PropTypes.any),
208
221
  displayMode: PropTypes.string,
209
222
  variant: PropTypes.string,
210
- formatter : PropTypes.string
223
+ formatter : PropTypes.string,
224
+ hasSuggestions: PropTypes.bool,
225
+ fieldMetadata: PropTypes.objectOf(PropTypes.any),
226
+ enableAdditionalInformation: PropTypes.bool
211
227
  };
212
228
 
213
229
  export default PegaDxilMyTimeOfDay;
@@ -38,12 +38,15 @@ const PegaDxilMyUrl = props => {
38
38
  propUrlLabel,
39
39
  urlLabelSelection,
40
40
  tableDisplayAs,
41
- hasSuggestions
41
+ hasSuggestions,
42
+ fieldMetadata,
43
+ enableAdditionalInformation
42
44
  } = props;
43
45
  const { formatter } = props;
44
46
  const pConn = getPConnect();
45
47
  const actions = pConn.getActionsApi();
46
48
  const propName = pConn.getStateProps().value;
49
+ const fieldDescription = fieldMetadata?.description;
47
50
  const hasValueChange = useRef(false);
48
51
 
49
52
 
@@ -166,6 +169,14 @@ const PegaDxilMyUrl = props => {
166
169
  }}
167
170
  onFocus={actions.onFocus}
168
171
  onResolveSuggestion={onResolveSuggestionHandler}
172
+ {...(enableAdditionalInformation && fieldDescription
173
+ ? {
174
+ additionalInfo: {
175
+ heading: label,
176
+ content: fieldDescription
177
+ }
178
+ }
179
+ : {})}
169
180
  />
170
181
  </StyledPegaDxilMyUrlWrapper>
171
182
  );
@@ -196,7 +207,9 @@ PegaDxilMyUrl.defaultProps = {
196
207
  propUrlLabel: '',
197
208
  urlLabelSelection: 'constant',
198
209
  tableDisplayAs: 'link',
199
- hasSuggestions: false
210
+ hasSuggestions: false,
211
+ fieldMetadata: {},
212
+ enableAdditionalInformation: false
200
213
  };
201
214
 
202
215
  PegaDxilMyUrl.propTypes = {
@@ -226,7 +239,9 @@ PegaDxilMyUrl.propTypes = {
226
239
  propUrlLabel: PropTypes.string,
227
240
  urlLabelSelection: PropTypes.string,
228
241
  tableDisplayAs: PropTypes.string,
229
- hasSuggestions: PropTypes.bool
242
+ hasSuggestions: PropTypes.bool,
243
+ fieldMetadata: PropTypes.objectOf(PropTypes.any),
244
+ enableAdditionalInformation: PropTypes.bool
230
245
  };
231
246
 
232
247
  export default PegaDxilMyUrl;
@@ -189,7 +189,7 @@ describe('create buildAll and deleteAll local custom', () => {
189
189
  expect(stdout).toContain('Pega_DXIL_MyTestPage');
190
190
  expect(stdout).toContain('Pega_DXIL_MyTestDetails');
191
191
  // done();
192
- }, 100000);
192
+ }, 200000);
193
193
 
194
194
  it('npm run deleteAll Local custom', async () => {
195
195
  const script = `npm run deleteAll Local custom Y --prefix ../../..`;
@@ -244,7 +244,7 @@ describe('create publish and deleteAll local', () => {
244
244
  expect(isInMap).toBeTruthy();
245
245
 
246
246
  // done();
247
- }, 100000);
247
+ }, 200000);
248
248
 
249
249
  it('npm run deleteAll Local verify not in map custom', async () => {
250
250
  const script = `npm run deleteAll Local custom Y --prefix ../../..`;
@@ -300,7 +300,7 @@ describe('override publish and deleteAll local override', () => {
300
300
 
301
301
  expect(isInMap).toBeTruthy();
302
302
 
303
- }, 100000);
303
+ }, 200000);
304
304
 
305
305
  it('npm run deleteAll Local override verify removed from map', async () => {
306
306
  const script = `npm run deleteAll Local override Y --prefix ../../..`;