@pega/custom-dx-components 8.8.20 → 23.1.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 (97) hide show
  1. package/.prettierrc.json +1 -7
  2. package/package.json +5 -5
  3. package/src/tasks/create/templates/Constellation/Field/Boolean/index.jsx.mustache +3 -3
  4. package/src/tasks/create/templates/Constellation/Field/Date/config.json.mustache +5 -1
  5. package/src/tasks/create/templates/Constellation/Field/Date/index.jsx.mustache +2 -1
  6. package/src/tasks/create/templates/Constellation/Field/DateTime/index.jsx.mustache +1 -1
  7. package/src/tasks/create/templates/Constellation/Field/Decimal/index.jsx.mustache +3 -3
  8. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.jsx.mustache +3 -3
  9. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.jsx.mustache +6 -5
  10. package/src/tasks/create/templates/Constellation/Field/Integer/index.jsx.mustache +4 -3
  11. package/src/tasks/create/templates/Constellation/Field/Picklist/index.jsx.mustache +2 -1
  12. package/src/tasks/create/templates/Constellation/Field/Text/index.jsx.mustache +5 -4
  13. package/src/tasks/create/templates/Constellation/Field/Text-Email/index.jsx.mustache +2 -1
  14. package/src/tasks/create/templates/Constellation/Field/Text-Input/index.jsx.mustache +1 -1
  15. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.jsx.mustache +1 -2
  16. package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.jsx.mustache +1 -1
  17. package/src/tasks/create/templates/Constellation/Field/Text-URL/index.jsx.mustache +1 -1
  18. package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/index.jsx.mustache +5 -4
  19. package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.jsx.mustache +3 -0
  20. package/src/tasks/create/templates/Constellation/Template/DETAILS/index.jsx.mustache +2 -2
  21. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.jsx.mustache +3 -0
  22. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.jsx.mustache +2 -2
  23. package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.jsx.mustache +5 -2
  24. package/src/tasks/create/templates/Constellation/Template/FORM/index.jsx.mustache +18 -12
  25. package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.jsx.mustache +5 -2
  26. package/src/tasks/create/templates/Constellation/Template/FORM-region/index.jsx.mustache +14 -11
  27. package/src/tasks/create/templates/Constellation/Widget/CASE/config.json.mustache +1 -1
  28. package/src/tasks/create/templates/Constellation/Widget/CASE/index.jsx.mustache +2 -2
  29. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Operator.jsx.mustache +2 -2
  30. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.jsx.mustache +2 -2
  31. package/src/tasks/create/templates/Launchpad/Widget/CASE/config.json.mustache +1 -1
  32. package/src/tasks/create/templates/Launchpad/Widget/CASE/index.jsx.mustache +2 -2
  33. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/Operator.jsx.mustache +2 -2
  34. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/index.jsx.mustache +2 -2
  35. package/src/tasks/create-all/index.js +105 -98
  36. package/src/tasks/delete/helper.js +32 -24
  37. package/src/tasks/delete-all/helper.js +15 -12
  38. package/src/tasks/init/template/jest.config.cjs +21 -0
  39. package/src/tasks/init/template/package.json.mustache +9 -4
  40. package/src/tasks/list/helper.js +14 -19
  41. package/tests/assets/components/create/Pega_DXIL_MyTestText/index.jsx +5 -4
  42. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/index.jsx +3 -3
  43. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/config.json +1 -1
  44. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/index.jsx +1 -1
  45. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/config.json +5 -1
  46. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/index.jsx +2 -1
  47. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/index.jsx +1 -1
  48. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/index.jsx +1 -1
  49. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.jsx +3 -0
  50. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/index.jsx +2 -1
  51. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/demo.stories.jsx +3 -0
  52. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/index.jsx +15 -9
  53. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/index.jsx +2 -1
  54. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/index.jsx +1 -2
  55. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/index.jsx +2 -1
  56. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/index.jsx +1 -1
  57. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.jsx +2 -1
  58. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/index.jsx +5 -4
  59. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/index.jsx +1 -1
  60. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/index.jsx +5 -4
  61. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.stories.jsx +3 -0
  62. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/demo.stories.jsx +3 -0
  63. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/index.jsx +12 -9
  64. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/index.jsx +1 -1
  65. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/index.jsx +3 -3
  66. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/config.json +1 -1
  67. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/index.jsx +1 -1
  68. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/config.json +5 -1
  69. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/index.jsx +2 -1
  70. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/index.jsx +1 -1
  71. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/index.jsx +1 -1
  72. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.stories.jsx +3 -0
  73. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/index.jsx +2 -1
  74. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/demo.stories.jsx +3 -0
  75. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/index.jsx +15 -9
  76. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/index.jsx +2 -1
  77. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/index.jsx +1 -2
  78. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/index.jsx +2 -1
  79. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/index.jsx +1 -1
  80. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.jsx +2 -1
  81. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/index.jsx +5 -4
  82. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/index.jsx +1 -1
  83. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/index.jsx +5 -4
  84. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/demo.stories.jsx +3 -0
  85. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/demo.stories.jsx +3 -0
  86. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/index.jsx +12 -9
  87. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/index.jsx +1 -1
  88. package/tests/functional/localCreateBuildAllDeleteAll.test.js +15 -6
  89. package/tests/functional/localCreateBuildDelete.test.js +1 -1
  90. package/tests/functional/localCreatePublishAllDeleteAll.test.js +15 -6
  91. package/tests/functional/localCreatePublishDelete.test.js +2 -1
  92. /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/config.json.mustache +0 -0
  93. /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/demo.stories.jsx.mustache +0 -0
  94. /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/mock.stories.js.mustache +0 -0
  95. /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/styles.js.mustache +0 -0
  96. /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/suggestions-handler.js +0 -0
  97. /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/time-of-day.js.mustache +0 -0
@@ -7,15 +7,7 @@ import ora from 'ora';
7
7
 
8
8
  import inquirer from 'inquirer';
9
9
 
10
- import {
11
- LIST_COMPONENT_SERVICE_REST_ENDPOINT,
12
- LP_LIST_COMPONENT_SERVICE_REST_ENDPOINT,
13
- TOKEN_PATH,
14
- COMPONENT_SCHEMA,
15
- TASKS_CONFIG_JSON_FILENAME,
16
- COMPONENTS_DIRECTORY_PATH,
17
- COMPONENTS_PATH
18
- } from '../../constants.js';
10
+ import { LIST_COMPONENT_SERVICE_REST_ENDPOINT, LP_LIST_COMPONENT_SERVICE_REST_ENDPOINT, TOKEN_PATH, COMPONENT_SCHEMA, TASKS_CONFIG_JSON_FILENAME, COMPONENTS_DIRECTORY_PATH, COMPONENTS_PATH } from '../../constants.js';
19
11
  import { constructCompleteUrl, getComponents, getPegaServerConfig, getHttpsAgent, sanitize } from '../../util.js';
20
12
 
21
13
  export const SOURCE_OF_COMPONENT_TYPES = {
@@ -23,6 +15,8 @@ export const SOURCE_OF_COMPONENT_TYPES = {
23
15
  LOCAL: 'Local'
24
16
  };
25
17
 
18
+
19
+
26
20
  export const getListComponentsQuestions = async (options) => {
27
21
  const defaultPegaServerConfig = await getPegaServerConfig();
28
22
 
@@ -49,7 +43,9 @@ export const getLaunchPadFilterQuestions = async () => {
49
43
  data = data && JSON.parse(data);
50
44
 
51
45
  if (!data[COMPONENTS_DIRECTORY_PATH]) {
52
- console.error(`${chalk.red.bold('ERROR')} Could not able find components directory path in config.json`);
46
+ console.error(
47
+ `${chalk.red.bold('ERROR')} Could not able find components directory path in config.json`
48
+ );
53
49
  process.exit(1);
54
50
  }
55
51
 
@@ -63,7 +59,7 @@ export const getLaunchPadFilterQuestions = async () => {
63
59
  name: 'organization',
64
60
  message: 'Enter component organization (required)',
65
61
  default: organization,
66
- validate: (value) => {
62
+ validate: value => {
67
63
  if (value) {
68
64
  return true;
69
65
  }
@@ -74,7 +70,7 @@ export const getLaunchPadFilterQuestions = async () => {
74
70
  name: 'library',
75
71
  message: 'Enter library name (required)',
76
72
  default: library,
77
- validate: (value) => {
73
+ validate: value => {
78
74
  if (value) {
79
75
  return true;
80
76
  }
@@ -82,7 +78,7 @@ export const getLaunchPadFilterQuestions = async () => {
82
78
  }
83
79
  }
84
80
  ];
85
- };
81
+ }
86
82
 
87
83
  export const listLocalComponents = async (sourceOfComponents) => {
88
84
  let localComponents = await getComponents();
@@ -173,6 +169,8 @@ export const getComponentsFromServer = async (library, organization) => {
173
169
  isLaunchpad ? LP_LIST_COMPONENT_SERVICE_REST_ENDPOINT : LIST_COMPONENT_SERVICE_REST_ENDPOINT
174
170
  );
175
171
 
172
+
173
+
176
174
  return new Promise((resolve, reject) => {
177
175
  try {
178
176
  fs.readFile(TOKEN_PATH, 'utf8', (err, data) => {
@@ -190,12 +188,9 @@ export const getComponentsFromServer = async (library, organization) => {
190
188
 
191
189
  fetchComponentsFromLaunchpad(url, headers)
192
190
  .then((response) => {
193
- response = response.filter(
194
- (component) =>
195
- (component.library === library || library === '*') && (component.organization === organization || organization === '*')
196
- );
197
- resolve(response);
198
- })
191
+ response = response.filter(component => (component.library === library || library === "*" ) && (component.organization === organization || organization === "*"));
192
+ resolve(response); }
193
+ )
199
194
  .catch((e) => reject(e));
200
195
  } else {
201
196
  headers.Authorization = `${tokenType} ${accessToken}`;
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import { Input, Label } from '@pega/cosmos-react-core';
2
+ import { Input } from '@pega/cosmos-react-core';
3
3
 
4
4
  import StyledPegaDxilMyTestTextWrapper from './styles';
5
5
 
@@ -9,7 +9,7 @@ import StyledPegaDxilMyTestTextWrapper 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 PegaDxilMyTestText = 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 PegaDxilMyTestText = props => {
22
22
 
23
23
  return (
24
24
  <StyledPegaDxilMyTestTextWrapper>
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}
@@ -43,7 +44,7 @@ PegaDxilMyTestText.defaultProps = {
43
44
  disabled: false,
44
45
  readOnly: false,
45
46
  required: false,
46
- testId: null
47
+ testId: ''
47
48
  };
48
49
 
49
50
  PegaDxilMyTestText.propTypes = {
@@ -65,7 +65,7 @@ const PegaDxilMyBoolean = props => {
65
65
  />
66
66
  );
67
67
 
68
- const parentTestId = testId ? `${testId}-parent` : testId;
68
+ const parentTestId = testId === '' ? `${testId}-parent` : testId;
69
69
 
70
70
  let displayComponent;
71
71
  if (displayMode) {
@@ -138,13 +138,13 @@ PegaDxilMyBoolean.defaultProps = {
138
138
  disabled: false,
139
139
  readOnly: false,
140
140
  required: false,
141
- testId: null,
141
+ testId: '',
142
142
  additionalProps: {},
143
143
  displayMode: null,
144
144
  variant: 'inline',
145
145
  displayValue: 'Yes/No',
146
146
  trueLabel: '',
147
- falseLabel: ''
147
+ falseLabel: '',
148
148
  };
149
149
 
150
150
  PegaDxilMyBoolean.propTypes = {
@@ -18,6 +18,6 @@
18
18
  }
19
19
  ],
20
20
  "defaultConfig": {
21
- "label": "@L $this.label"
21
+ "label": "@L My Case Widget"
22
22
  }
23
23
  }
@@ -248,7 +248,7 @@ PegaDxilMyCurrency.defaultProps = {
248
248
  allowDecimals: true,
249
249
  currencyISOCode: 'USD',
250
250
  isoCodeSelection: 'constant',
251
- testId: null,
251
+ testId: '',
252
252
  displayMode: null,
253
253
  additionalProps: {},
254
254
  variant: 'inline',
@@ -141,7 +141,11 @@
141
141
  },
142
142
  {
143
143
  "key": "DateTime-Long",
144
- "value": "Date Time"
144
+ "value": "Date (Long)"
145
+ },
146
+ {
147
+ "key": "DateTime-Short",
148
+ "value": "Date (Short)"
145
149
  },
146
150
  {
147
151
  "key": "DateTime-Since",
@@ -182,6 +182,7 @@ const PegaDxilMyDate = props => {
182
182
  </StyledPegaDxilMyDateWrapper>
183
183
  );
184
184
  } else {
185
+
185
186
  dateComponent = (
186
187
  <StyledPegaDxilMyDateWrapper>
187
188
  <DateInput
@@ -222,7 +223,7 @@ PegaDxilMyDate.defaultProps = {
222
223
  showWeekNumber: false,
223
224
  nextYearRange: "",
224
225
  previousYearRange: "",
225
- testId: null,
226
+ testId: "",
226
227
  showAsFormattedText: false,
227
228
  additionalProps: {},
228
229
  displayMode: null,
@@ -218,7 +218,7 @@ PegaDxilMyDateTime.defaultProps = {
218
218
  showWeekNumber: false,
219
219
  nextYearRange: "",
220
220
  previousYearRange: "",
221
- testId: null,
221
+ testId: "",
222
222
  additionalProps: {},
223
223
  displayMode: null,
224
224
  variant: "inline",
@@ -222,7 +222,7 @@ PegaDxilMyDecimal.defaultProps = {
222
222
  disabled: false,
223
223
  readOnly: false,
224
224
  required: false,
225
- testId: null,
225
+ testId: "",
226
226
  decimalPrecision: '',
227
227
  showGroupSeparators: false,
228
228
  displayMode: null,
@@ -88,6 +88,9 @@ export const basePegaDxilMyDetails = () => {
88
88
  getRawMetadata: () => {
89
89
  return pyReviewRaw;
90
90
  },
91
+ getContextName: () => {
92
+ return 'app/primary_1';
93
+ },
91
94
  getInheritedProps: () => {
92
95
  return pyReviewRaw.config.inheritedProps;
93
96
  },
@@ -76,6 +76,7 @@ const PegaDxilMyEmail = props => {
76
76
  const pConn = getPConnect();
77
77
  const actions = pConn.getActionsApi();
78
78
  const propName = pConn.getStateProps().value;
79
+
79
80
  const hasValueChange = useRef(false);
80
81
 
81
82
 
@@ -199,7 +200,7 @@ PegaDxilMyEmail.defaultProps = {
199
200
  disabled: false,
200
201
  readOnly: false,
201
202
  required: false,
202
- testId: null,
203
+ testId: '',
203
204
  displayMode: null,
204
205
  additionalProps: {},
205
206
  variant: 'inline',
@@ -133,6 +133,9 @@ export const basePegaDxilMyForm = () => {
133
133
  getChildren: () => {
134
134
  return pyReviewRaw.children;
135
135
  },
136
+ getInheritedProps: () => {
137
+ return pyReviewRaw.config.inheritedProps;
138
+ },
136
139
  createComponent: config => {
137
140
  // eslint-disable-next-line default-case
138
141
  switch (config.config.value) {
@@ -1,4 +1,4 @@
1
- import { Grid } from '@pega/cosmos-react-core';
1
+ import { Grid, FieldGroup } from '@pega/cosmos-react-core';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
4
  import StyledPegaDxilMyFormWrapper from './styles';
@@ -11,24 +11,30 @@ import StyledPegaDxilMyFormWrapper from './styles';
11
11
  export default function PegaDxilMyForm(props) {
12
12
 
13
13
 
14
- const { children, NumCols } = props;
14
+ const { children, NumCols, label, showLabel, getPConnect } = props;
15
+ const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
15
16
 
16
17
  const nCols = parseInt(NumCols, 10);
17
18
 
18
19
  // console.log(`Rendering ${getPConnect()?.getComponentName()} with ${template} with ${children?.length} Region(s)`);
19
20
 
21
+
22
+
20
23
  return (
21
24
  <StyledPegaDxilMyFormWrapper>
22
- <Grid container={{
23
- cols: `repeat(${nCols}, minmax(0, 1fr))`,
24
- gap: 2,
25
- wrap: `wrap`
26
- }}>
27
- {children}
28
- </Grid>
25
+ <FieldGroup name={propsToUse.showLabel ? propsToUse.label : ''}>
26
+ <Grid container={{
27
+ cols: `repeat(${nCols}, minmax(0, 1fr))`,
28
+ gap: 2,
29
+ wrap: `wrap`
30
+ }}>
31
+ {children}
32
+ </Grid>
33
+ </FieldGroup>
29
34
  </StyledPegaDxilMyFormWrapper>
30
35
  );
31
36
 
37
+
32
38
  }
33
39
 
34
40
  PegaDxilMyForm.defaultProps = {
@@ -46,6 +46,7 @@ const PegaDxilMyInteger = props => {
46
46
  const propName = pConn.getStateProps().value;
47
47
  const [integerValue, setIntegerValue] = useState(value?.toString());
48
48
  const sliderDefaultValue = !defaultValue && defaultValue !== 0 ? max : defaultValue;
49
+
49
50
  const hasValueChange = useRef(false);
50
51
 
51
52
 
@@ -272,7 +273,7 @@ PegaDxilMyInteger.defaultProps = {
272
273
  disabled: false,
273
274
  readOnly: false,
274
275
  required: false,
275
- testId: null,
276
+ testId: '',
276
277
  showGroupSeparators: false,
277
278
  displayMode: null,
278
279
  displayAs: 'input',
@@ -80,7 +80,6 @@ const PegaDxilMyParagraph = props => {
80
80
  const maxLength = fieldMetadata?.maxLength;
81
81
  const hasValueChange = useRef(false);
82
82
 
83
-
84
83
  // BUG-547602: Temporary type coercion for 8.5 until DXAPIs are enhanced to pass original pxViewMetadata JSON, respecting boolean primitives
85
84
  let { readOnly, required, disabled } = props;
86
85
  [readOnly, required, disabled] = [readOnly, required, disabled].map(
@@ -197,7 +196,7 @@ PegaDxilMyParagraph.defaultProps = {
197
196
  disabled: false,
198
197
  readOnly: false,
199
198
  required: false,
200
- testId: null,
199
+ testId: '',
201
200
  displayMode: null,
202
201
  fieldMetadata: {},
203
202
  additionalProps: {},
@@ -42,6 +42,7 @@ const PegaDxilMyPercentage = props => {
42
42
  const actions = pConn.getActionsApi();
43
43
  const propName = pConn.getStateProps().value;
44
44
  const [percentageValue, setPercentageValue] = useState(value?.toString());
45
+
45
46
  const hasValueChange = useRef(false);
46
47
 
47
48
  let { readOnly, required, disabled } = props;
@@ -237,7 +238,7 @@ PegaDxilMyPercentage.defaultProps = {
237
238
  disabled: false,
238
239
  readOnly: false,
239
240
  required: false,
240
- testId: null,
241
+ testId: '',
241
242
  decimalPrecision: '',
242
243
  showGroupSeparators: false,
243
244
  additionalProps: {},
@@ -232,7 +232,7 @@ PegaDxilMyPhone.defaultProps = {
232
232
  readOnly: false,
233
233
  required: false,
234
234
  showCountryCode: true,
235
- testId: null,
235
+ testId: '',
236
236
  displayMode: null,
237
237
  additionalProps: {},
238
238
  variant: 'inline',
@@ -262,6 +262,7 @@ const PegaDxilMyPicklist = props => {
262
262
  suggestionsHandler(accepted, pConnect, setStatus);
263
263
  };
264
264
 
265
+
265
266
  return (
266
267
  <StyledPegaDxilMyPicklistWrapper>
267
268
  <Select
@@ -305,7 +306,7 @@ PegaDxilMyPicklist.defaultProps = {
305
306
  disabled: false,
306
307
  readOnly: false,
307
308
  required: false,
308
- testId: null,
309
+ testId: '',
309
310
  helperText: '',
310
311
  datasource: [],
311
312
  listType: '',
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import { Input, Label } from '@pega/cosmos-react-core';
2
+ import { Input } from '@pega/cosmos-react-core';
3
3
 
4
4
  import StyledPegaDxilMyTextWrapper from './styles';
5
5
 
@@ -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}
@@ -43,7 +44,7 @@ PegaDxilMyText.defaultProps = {
43
44
  disabled: false,
44
45
  readOnly: false,
45
46
  required: false,
46
- testId: null
47
+ testId: ''
47
48
  };
48
49
 
49
50
  PegaDxilMyText.propTypes = {
@@ -204,7 +204,7 @@ PegaDxilMyTextInput.defaultProps = {
204
204
  disabled: false,
205
205
  readOnly: false,
206
206
  required: false,
207
- testId: null,
207
+ testId: '',
208
208
  fieldMetadata: {},
209
209
  additionalProps: {},
210
210
  displayMode: null,
@@ -38,7 +38,6 @@ const PegaDxilMyTimeOfDay = props => {
38
38
  const actions = pConn.getActionsApi();
39
39
  const propName = pConn.getStateProps().value;
40
40
 
41
-
42
41
  // BUG-547602: Temporary type coercion for 8.5 until DXAPIs are enhanced to pass original pxViewMetadata JSON, respecting boolean primitives
43
42
  let { readOnly, required, disabled } = props;
44
43
  [readOnly, required, disabled] = [readOnly, required, disabled].map(
@@ -183,11 +182,12 @@ PegaDxilMyTimeOfDay.defaultProps = {
183
182
  required: false,
184
183
  pickerInterval: "30",
185
184
  clockFormat: 0,
186
- testId: null,
185
+ testId: '',
187
186
  additionalProps: {},
188
187
  displayMode: null,
189
188
  variant: "inline",
190
- formatter:"defaultTime"
189
+ formatter:"defaultTime",
190
+ hasSuggestions: false
191
191
  };
192
192
 
193
193
  PegaDxilMyTimeOfDay.propTypes = {
@@ -207,7 +207,8 @@ PegaDxilMyTimeOfDay.propTypes = {
207
207
  additionalProps: PropTypes.objectOf(PropTypes.any),
208
208
  displayMode: PropTypes.string,
209
209
  variant: PropTypes.string,
210
- formatter : PropTypes.string
210
+ formatter : PropTypes.string,
211
+ hasSuggestions: PropTypes.bool
211
212
  };
212
213
 
213
214
  export default PegaDxilMyTimeOfDay;
@@ -88,6 +88,9 @@ export const basePegaDxilMyTwoColumnDetails = () => {
88
88
  getRawMetadata: () => {
89
89
  return pyReviewRaw;
90
90
  },
91
+ getContextName: () => {
92
+ return 'app/primary_1';
93
+ },
91
94
  getInheritedProps: () => {
92
95
  return pyReviewRaw.config.inheritedProps;
93
96
  },
@@ -138,6 +138,9 @@ export const basePegaDxilMyTwoColumnForm = () => {
138
138
  getChildren: () => {
139
139
  return pyReviewRaw.children;
140
140
  },
141
+ getInheritedProps: () => {
142
+ return pyReviewRaw.config.inheritedProps;
143
+ },
141
144
  createComponent: config => {
142
145
  // eslint-disable-next-line default-case
143
146
  switch (config.config.value) {
@@ -1,4 +1,4 @@
1
- import { Grid, Flex } from '@pega/cosmos-react-core';
1
+ import { Grid, Flex, FieldGroup } from '@pega/cosmos-react-core';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
4
  import StyledPegaDxilMyTwoColumnFormWrapper from './styles';
@@ -11,7 +11,8 @@ import StyledPegaDxilMyTwoColumnFormWrapper from './styles';
11
11
  export default function PegaDxilMyTwoColumnForm(props) {
12
12
 
13
13
 
14
- const { children } = props;
14
+ const { children, label, showLabel, getPConnect } = props;
15
+ const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
15
16
 
16
17
  const numRegions = children?.length;
17
18
  const gridRepeat = "repeat(".concat(numRegions).concat(", 1fr)");
@@ -24,13 +25,15 @@ export default function PegaDxilMyTwoColumnForm(props) {
24
25
 
25
26
  return (
26
27
  <StyledPegaDxilMyTwoColumnFormWrapper>
27
- <Grid container={gridContainer}>
28
- {children.map((child, i) => (
29
- <Flex container={flexContainer} key={`r-${i + 1}`}>
30
- {child}
31
- </Flex>
32
- ))}
33
- </Grid>
28
+ <FieldGroup name={propsToUse.showLabel ? propsToUse.label : ''}>
29
+ <Grid container={gridContainer}>
30
+ {children.map((child, i) => (
31
+ <Flex container={flexContainer} key={`r-${i + 1}`}>
32
+ {child}
33
+ </Flex>
34
+ ))}
35
+ </Grid>
36
+ </FieldGroup>
34
37
  </StyledPegaDxilMyTwoColumnFormWrapper>
35
38
  );
36
39
 
@@ -180,7 +180,7 @@ PegaDxilMyUrl.defaultProps = {
180
180
  disabled: false,
181
181
  readOnly: false,
182
182
  required: false,
183
- testId: null,
183
+ testId: '',
184
184
  displayMode: null,
185
185
  additionalProps: {},
186
186
  variant: 'inline',
@@ -65,7 +65,7 @@ const PegaDxilMyBoolean = props => {
65
65
  />
66
66
  );
67
67
 
68
- const parentTestId = testId ? `${testId}-parent` : testId;
68
+ const parentTestId = testId === '' ? `${testId}-parent` : testId;
69
69
 
70
70
  let displayComponent;
71
71
  if (displayMode) {
@@ -138,13 +138,13 @@ PegaDxilMyBoolean.defaultProps = {
138
138
  disabled: false,
139
139
  readOnly: false,
140
140
  required: false,
141
- testId: null,
141
+ testId: '',
142
142
  additionalProps: {},
143
143
  displayMode: null,
144
144
  variant: 'inline',
145
145
  displayValue: 'Yes/No',
146
146
  trueLabel: '',
147
- falseLabel: ''
147
+ falseLabel: '',
148
148
  };
149
149
 
150
150
  PegaDxilMyBoolean.propTypes = {
@@ -18,6 +18,6 @@
18
18
  }
19
19
  ],
20
20
  "defaultConfig": {
21
- "label": "@L $this.label"
21
+ "label": "@L My Case Widget"
22
22
  }
23
23
  }
@@ -248,7 +248,7 @@ PegaDxilMyCurrency.defaultProps = {
248
248
  allowDecimals: true,
249
249
  currencyISOCode: 'USD',
250
250
  isoCodeSelection: 'constant',
251
- testId: null,
251
+ testId: '',
252
252
  displayMode: null,
253
253
  additionalProps: {},
254
254
  variant: 'inline',
@@ -141,7 +141,11 @@
141
141
  },
142
142
  {
143
143
  "key": "DateTime-Long",
144
- "value": "Date Time"
144
+ "value": "Date (Long)"
145
+ },
146
+ {
147
+ "key": "DateTime-Short",
148
+ "value": "Date (Short)"
145
149
  },
146
150
  {
147
151
  "key": "DateTime-Since",
@@ -182,6 +182,7 @@ const PegaDxilMyDate = props => {
182
182
  </StyledPegaDxilMyDateWrapper>
183
183
  );
184
184
  } else {
185
+
185
186
  dateComponent = (
186
187
  <StyledPegaDxilMyDateWrapper>
187
188
  <DateInput
@@ -222,7 +223,7 @@ PegaDxilMyDate.defaultProps = {
222
223
  showWeekNumber: false,
223
224
  nextYearRange: "",
224
225
  previousYearRange: "",
225
- testId: null,
226
+ testId: "",
226
227
  showAsFormattedText: false,
227
228
  additionalProps: {},
228
229
  displayMode: null,
@@ -218,7 +218,7 @@ PegaDxilMyDateTime.defaultProps = {
218
218
  showWeekNumber: false,
219
219
  nextYearRange: "",
220
220
  previousYearRange: "",
221
- testId: null,
221
+ testId: "",
222
222
  additionalProps: {},
223
223
  displayMode: null,
224
224
  variant: "inline",
@@ -222,7 +222,7 @@ PegaDxilMyDecimal.defaultProps = {
222
222
  disabled: false,
223
223
  readOnly: false,
224
224
  required: false,
225
- testId: null,
225
+ testId: "",
226
226
  decimalPrecision: '',
227
227
  showGroupSeparators: false,
228
228
  displayMode: null,
@@ -88,6 +88,9 @@ export const basePegaDxilMyDetails = () => {
88
88
  getRawMetadata: () => {
89
89
  return pyReviewRaw;
90
90
  },
91
+ getContextName: () => {
92
+ return 'app/primary_1';
93
+ },
91
94
  getInheritedProps: () => {
92
95
  return pyReviewRaw.config.inheritedProps;
93
96
  },