@pega/dx-component-builder-sdk 0.23.16 → 0.23.18

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 (154) hide show
  1. package/package.json +1 -1
  2. package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +3 -2
  3. package/src/tasks/create/templates/SDK-React/field/DateTime/demo.stories.tsx.mustache +8 -1
  4. package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +3 -9
  5. package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +7 -15
  6. package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +38 -37
  7. package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +3 -3
  8. package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/index.tsx.mustache +5 -3
  9. package/src/tasks/map/map.js +29 -8
  10. package/src/tasks/publish/index.js +3 -1
  11. package/src/tasks/publish-all/index.js +7 -5
  12. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/Operator/Operator.tsx +5 -3
  13. package/tests/assets/sdk-r/components/create/override-sdk/field/CancelAlert/CancelAlert.tsx +95 -78
  14. package/tests/assets/sdk-r/components/create/override-sdk/field/Checkbox/Checkbox.tsx +3 -1
  15. package/tests/assets/sdk-r/components/create/override-sdk/field/Currency/Currency.tsx +7 -15
  16. package/tests/assets/sdk-r/components/create/override-sdk/field/DateTime/config-ext.json +8 -8
  17. package/tests/assets/sdk-r/components/create/override-sdk/field/Decimal/Decimal.tsx +3 -9
  18. package/tests/assets/sdk-r/components/create/override-sdk/field/Decimal/config-ext.json +8 -8
  19. package/tests/assets/sdk-r/components/create/override-sdk/field/Dropdown/config-ext.json +8 -8
  20. package/tests/assets/sdk-r/components/create/override-sdk/field/Email/config-ext.json +8 -8
  21. package/tests/assets/sdk-r/components/create/override-sdk/field/Group/Group.tsx +2 -0
  22. package/tests/assets/sdk-r/components/create/override-sdk/field/Group/config-ext.json +7 -7
  23. package/tests/assets/sdk-r/components/create/override-sdk/field/Integer/config-ext.json +8 -8
  24. package/tests/assets/sdk-r/components/create/override-sdk/field/Percentage/Percentage.tsx +38 -36
  25. package/tests/assets/sdk-r/components/create/override-sdk/field/Percentage/config-ext.json +8 -8
  26. package/tests/assets/sdk-r/components/create/override-sdk/field/RadioButtons/config-ext.json +8 -8
  27. package/tests/assets/sdk-r/components/create/override-sdk/field/SemanticLink/config-ext.json +8 -8
  28. package/tests/assets/sdk-r/components/create/override-sdk/field/TextArea/config-ext.json +8 -8
  29. package/tests/assets/sdk-r/components/create/override-sdk/field/TextContent/config-ext.json +8 -8
  30. package/tests/assets/sdk-r/components/create/override-sdk/field/TextInput/config-ext.json +8 -8
  31. package/tests/assets/sdk-r/components/create/override-sdk/field/Time/config-ext.json +8 -8
  32. package/tests/assets/sdk-r/components/create/override-sdk/field/URL/config-ext.json +8 -8
  33. package/tests/assets/sdk-r/components/create/override-sdk/field/UserReference/config-ext.json +8 -8
  34. package/tests/assets/sdk-r/components/create/override-sdk/infra/Assignment/Assignment.tsx +21 -7
  35. package/tests/assets/sdk-r/components/create/override-sdk/infra/NavBar/NavBar.tsx +5 -3
  36. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseSummary/CaseSummary.tsx +43 -1
  37. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseSummary/config-ext.json +8 -8
  38. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseView/CaseView.tsx +1 -1
  39. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseView/config-ext.json +8 -8
  40. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +34 -1
  41. package/tests/assets/sdk-r/components/create/override-sdk/template/Confirmation/config-ext.json +11 -11
  42. package/tests/assets/sdk-r/components/create/override-sdk/template/DataReference/config-ext.json +9 -9
  43. package/tests/assets/sdk-r/components/create/override-sdk/template/DefaultForm/config-ext.json +8 -8
  44. package/tests/assets/sdk-r/components/create/override-sdk/template/DetailsSubTabs/config-ext.json +8 -8
  45. package/tests/assets/sdk-r/components/create/override-sdk/template/DetailsThreeColumn/config-ext.json +8 -8
  46. package/tests/assets/sdk-r/components/create/override-sdk/template/DetailsTwoColumn/config-ext.json +8 -8
  47. package/tests/assets/sdk-r/components/create/override-sdk/template/ListPage/config-ext.json +7 -7
  48. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/config-ext.json +8 -8
  49. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/utils.ts +3 -1
  50. package/tests/assets/sdk-r/components/create/override-sdk/template/NarrowWideDetails/config-ext.json +8 -8
  51. package/tests/assets/sdk-r/components/create/override-sdk/template/NarrowWideForm/config-ext.json +8 -8
  52. package/tests/assets/sdk-r/components/create/override-sdk/template/NarrowWidePage/config-ext.json +8 -8
  53. package/tests/assets/sdk-r/components/create/override-sdk/template/OneColumn/config-ext.json +8 -8
  54. package/tests/assets/sdk-r/components/create/override-sdk/template/OneColumnPage/config-ext.json +8 -8
  55. package/tests/assets/sdk-r/components/create/override-sdk/template/OneColumnTab/config-ext.json +8 -8
  56. package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTable/config-ext.json +8 -8
  57. package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +28 -12
  58. package/tests/assets/sdk-r/components/create/override-sdk/template/SubTabs/config-ext.json +8 -8
  59. package/tests/assets/sdk-r/components/create/override-sdk/template/TwoColumn/config-ext.json +8 -8
  60. package/tests/assets/sdk-r/components/create/override-sdk/template/TwoColumnPage/config-ext.json +8 -8
  61. package/tests/assets/sdk-r/components/create/override-sdk/template/TwoColumnTab/config-ext.json +8 -8
  62. package/tests/assets/sdk-r/components/create/override-sdk/template/WideNarrow/WideNarrow.tsx +1 -1
  63. package/tests/assets/sdk-r/components/create/override-sdk/template/WideNarrowDetails/config-ext.json +8 -8
  64. package/tests/assets/sdk-r/components/create/override-sdk/template/WideNarrowForm/config-ext.json +8 -8
  65. package/tests/assets/sdk-r/components/create/override-sdk/template/WideNarrowPage/config-ext.json +8 -8
  66. package/tests/assets/sdk-r/components/create/override-sdk/template/WssNavBar/WssNavBar.tsx +4 -1
  67. package/tests/assets/sdk-r/components/create/override-sdk/widget/AppAnnouncement/config-ext.json +8 -8
  68. package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/Attachment.tsx +17 -3
  69. package/tests/assets/sdk-r/components/create/override-sdk/widget/CaseHistory/config-ext.json +8 -8
  70. package/tests/assets/sdk-r/components/create/override-sdk/widget/FileUtility/config-ext.json +8 -8
  71. package/tests/assets/sdk-r/components/create/override-sdk/widget/Followers/config-ext.json +8 -8
  72. package/tests/assets/sdk-r/components/create/override-sdk/widget/QuickCreate/QuickCreate.tsx +52 -25
  73. package/tests/assets/sdk-r/components/create/override-sdk/widget/ToDo/config-ext.json +8 -8
  74. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/index.tsx +3 -2
  75. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +7 -15
  76. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/demo.stories.tsx +8 -1
  77. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +3 -9
  78. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +38 -37
  79. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/index.tsx +3 -3
  80. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/index.tsx +5 -3
  81. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/Operator/Operator.tsx +5 -3
  82. package/tests/assets/sdk-r/components/createAll/override-sdk/field/CancelAlert/CancelAlert.tsx +95 -78
  83. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Checkbox/Checkbox.tsx +3 -1
  84. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Currency/Currency.tsx +7 -15
  85. package/tests/assets/sdk-r/components/createAll/override-sdk/field/DateTime/config-ext.json +8 -8
  86. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Decimal/Decimal.tsx +3 -9
  87. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Decimal/config-ext.json +8 -8
  88. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Dropdown/config-ext.json +8 -8
  89. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Email/config-ext.json +8 -8
  90. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Group/Group.tsx +2 -0
  91. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Group/config-ext.json +7 -7
  92. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Integer/config-ext.json +8 -8
  93. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/Percentage.tsx +38 -36
  94. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/config-ext.json +8 -8
  95. package/tests/assets/sdk-r/components/createAll/override-sdk/field/RadioButtons/config-ext.json +8 -8
  96. package/tests/assets/sdk-r/components/createAll/override-sdk/field/SemanticLink/config-ext.json +8 -8
  97. package/tests/assets/sdk-r/components/createAll/override-sdk/field/TextArea/config-ext.json +8 -8
  98. package/tests/assets/sdk-r/components/createAll/override-sdk/field/TextContent/config-ext.json +8 -8
  99. package/tests/assets/sdk-r/components/createAll/override-sdk/field/TextInput/config-ext.json +8 -8
  100. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Time/config-ext.json +8 -8
  101. package/tests/assets/sdk-r/components/createAll/override-sdk/field/URL/config-ext.json +8 -8
  102. package/tests/assets/sdk-r/components/createAll/override-sdk/field/UserReference/config-ext.json +8 -8
  103. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Assignment/Assignment.tsx +21 -7
  104. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/NavBar/NavBar.tsx +5 -3
  105. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseSummary/CaseSummary.tsx +43 -1
  106. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseSummary/config-ext.json +8 -8
  107. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseView/CaseView.tsx +1 -1
  108. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseView/config-ext.json +8 -8
  109. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +34 -1
  110. package/tests/assets/sdk-r/components/createAll/override-sdk/template/Confirmation/config-ext.json +11 -11
  111. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DataReference/config-ext.json +9 -9
  112. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DefaultForm/config-ext.json +8 -8
  113. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DetailsSubTabs/config-ext.json +8 -8
  114. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DetailsThreeColumn/config-ext.json +8 -8
  115. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DetailsTwoColumn/config-ext.json +8 -8
  116. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListPage/config-ext.json +7 -7
  117. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/config-ext.json +8 -8
  118. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/utils.ts +3 -1
  119. package/tests/assets/sdk-r/components/createAll/override-sdk/template/NarrowWideDetails/config-ext.json +8 -8
  120. package/tests/assets/sdk-r/components/createAll/override-sdk/template/NarrowWideForm/config-ext.json +8 -8
  121. package/tests/assets/sdk-r/components/createAll/override-sdk/template/NarrowWidePage/config-ext.json +8 -8
  122. package/tests/assets/sdk-r/components/createAll/override-sdk/template/OneColumn/config-ext.json +8 -8
  123. package/tests/assets/sdk-r/components/createAll/override-sdk/template/OneColumnPage/config-ext.json +8 -8
  124. package/tests/assets/sdk-r/components/createAll/override-sdk/template/OneColumnTab/config-ext.json +8 -8
  125. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTable/config-ext.json +8 -8
  126. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +28 -12
  127. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SubTabs/config-ext.json +8 -8
  128. package/tests/assets/sdk-r/components/createAll/override-sdk/template/TwoColumn/config-ext.json +8 -8
  129. package/tests/assets/sdk-r/components/createAll/override-sdk/template/TwoColumnPage/config-ext.json +8 -8
  130. package/tests/assets/sdk-r/components/createAll/override-sdk/template/TwoColumnTab/config-ext.json +8 -8
  131. package/tests/assets/sdk-r/components/createAll/override-sdk/template/WideNarrow/WideNarrow.tsx +1 -1
  132. package/tests/assets/sdk-r/components/createAll/override-sdk/template/WideNarrowDetails/config-ext.json +8 -8
  133. package/tests/assets/sdk-r/components/createAll/override-sdk/template/WideNarrowForm/config-ext.json +8 -8
  134. package/tests/assets/sdk-r/components/createAll/override-sdk/template/WideNarrowPage/config-ext.json +8 -8
  135. package/tests/assets/sdk-r/components/createAll/override-sdk/template/WssNavBar/WssNavBar.tsx +4 -1
  136. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/AppAnnouncement/config-ext.json +8 -8
  137. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/Attachment.tsx +17 -3
  138. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/CaseHistory/config-ext.json +8 -8
  139. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/FileUtility/config-ext.json +8 -8
  140. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Followers/config-ext.json +8 -8
  141. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/QuickCreate/QuickCreate.tsx +52 -25
  142. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/ToDo/config-ext.json +8 -8
  143. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/PConnProps.d.ts +0 -46
  144. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/demo.stories.tsx +0 -54
  145. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/index.tsx +0 -73
  146. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/mock.ts +0 -15
  147. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/styles.ts +0 -15
  148. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/config.json +0 -83
  149. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/demo.stories.tsx +0 -59
  150. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx +0 -101
  151. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/mock.ts +0 -16
  152. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/styles.js +0 -7
  153. /package/src/tasks/create/templates/Constellation/field/Boolean/{demo.stories.jsx.mustache → demo.stories.tsx.mustache} +0 -0
  154. /package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyBoolean/{demo.stories.jsx → demo.stories.tsx} +0 -0
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable no-nested-ternary */
2
- import React, { PropsWithChildren, useEffect, useRef, useState } from 'react';
2
+ import React, { PropsWithChildren, useEffect, useLayoutEffect, useRef, useState } from 'react';
3
3
  import Table from '@material-ui/core/Table';
4
4
  import TableBody from '@material-ui/core/TableBody';
5
5
  import TableCell from '@material-ui/core/TableCell';
@@ -141,7 +141,6 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
141
141
  // Getting current context
142
142
  const context = getPConnect().getContextName();
143
143
  const resolvedList = getReferenceList(pConn);
144
- const pageReference = `${pConn.getPageReference()}${resolvedList}`;
145
144
  pConn.setReferenceList(resolvedList);
146
145
  const menuIconOverride$ = Utils.getImageSrc('trash', Utils.getSDKStaticConentUrl());
147
146
 
@@ -198,6 +197,20 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
198
197
  // Constellation DX Components.
199
198
  const fieldDefs = buildFieldsForTable(rawFields, resolvedFields, showDeleteButton);
200
199
 
200
+ useLayoutEffect(() => {
201
+ if (allowEditingInModal) {
202
+ getPConnect()
203
+ .getListActions()
204
+ .initDefaultPageInstructions(
205
+ getPConnect().getReferenceList(),
206
+ fieldDefs.filter(item => item.name).map(item => item.name)
207
+ );
208
+ } else {
209
+ // @ts-ignore - An argument for 'fields' was not provided
210
+ getPConnect().getListActions().initDefaultPageInstructions(getPConnect().getReferenceList());
211
+ }
212
+ }, []);
213
+
201
214
  const displayedColumns = fieldDefs.map(field => {
202
215
  return field.name ? field.name : field.cellRenderer;
203
216
  });
@@ -288,11 +301,13 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
288
301
  pConn
289
302
  .getActionsApi()
290
303
  .openEmbeddedDataModal(defaultView, pConn, referenceListStr, referenceList.length, PCore.getConstants().RESOURCE_STATUS.CREATE);
291
- } else if (PCore.getPCoreVersion()?.includes('8.7')) {
292
- pConn.getListActions().insert({ classID: contextClass }, referenceList.length, pageReference);
293
304
  } else {
294
- pConn.getListActions().insert({ classID: contextClass }, referenceList.length, ''); // 3rd arg null until typedef marked correctly as optional
305
+ pConn.getListActions().insert({ classID: contextClass }, referenceList.length);
295
306
  }
307
+
308
+ getPConnect().clearErrorMessages({
309
+ property: (getPConnect().getStateProps() as any)?.referenceList?.substring(1)
310
+ } as any);
296
311
  };
297
312
 
298
313
  const editRecord = () => {
@@ -312,11 +327,11 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
312
327
 
313
328
  const deleteRecord = () => {
314
329
  setEditAnchorEl(null);
315
- if (PCore.getPCoreVersion()?.includes('8.7')) {
316
- pConn.getListActions().deleteEntry(selectedRowIndex.current, pageReference);
317
- } else {
318
- pConn.getListActions().deleteEntry(selectedRowIndex.current, ''); // 2nd arg empty string until typedef marked correctly as optional
319
- }
330
+ pConn.getListActions().deleteEntry(selectedRowIndex.current);
331
+ };
332
+
333
+ const deleteRecordFromInlineEditable = (index: number) => {
334
+ pConn.getListActions().deleteEntry(index);
320
335
  };
321
336
 
322
337
  function buildElementsForTable() {
@@ -616,7 +631,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
616
631
  className='psdk-utility-button'
617
632
  id='delete-button'
618
633
  aria-label='Delete Cell'
619
- onClick={() => deleteRecord()}
634
+ onClick={() => deleteRecordFromInlineEditable(index)}
620
635
  >
621
636
  <img className='psdk-utility-card-action-svg-icon' src={menuIconOverride$} />
622
637
  </button>
@@ -632,7 +647,8 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
632
647
  .slice(0)
633
648
  .map((row, index) => {
634
649
  return (
635
- <TableRow key={row[displayedColumns[0]]}>
650
+ // eslint-disable-next-line react/no-array-index-key
651
+ <TableRow key={index}>
636
652
  {displayedColumns.map(colKey => {
637
653
  return (
638
654
  <TableCell key={colKey} className={classes.tableCell}>
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "SubTabs",
3
- "name": "SubTabs",
4
- "label": "Sub tabs",
5
- "description": "Sub tabs view",
6
- "type": "Template",
7
- "subtype": "TAB",
8
- "properties": []
9
- }
2
+ "componentKey": "SubTabs",
3
+ "name": "SubTabs",
4
+ "label": "Sub tabs",
5
+ "description": "Sub tabs view",
6
+ "type": "Template",
7
+ "subtype": "TAB",
8
+ "properties": []
9
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "TwoColumn",
3
- "name": "TwoColumn",
4
- "label": "Two column",
5
- "description": "TwoColumn Template",
6
- "type": "Template",
7
- "subtype": "FORM",
8
- "properties": []
9
- }
2
+ "componentKey": "TwoColumn",
3
+ "name": "TwoColumn",
4
+ "label": "Two column",
5
+ "description": "TwoColumn Template",
6
+ "type": "Template",
7
+ "subtype": "FORM",
8
+ "properties": []
9
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "TwoColumnPage",
3
- "name": "TwoColumnPage",
4
- "label": "Two column",
5
- "description": "TwoColumn Page Template",
6
- "type": "Template",
7
- "subtype": "PAGE",
8
- "properties": []
9
- }
2
+ "componentKey": "TwoColumnPage",
3
+ "name": "TwoColumnPage",
4
+ "label": "Two column",
5
+ "description": "TwoColumn Page Template",
6
+ "type": "Template",
7
+ "subtype": "PAGE",
8
+ "properties": []
9
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "TwoColumnTab",
3
- "name": "TwoColumnTab",
4
- "label": "Two column",
5
- "description": "Two column",
6
- "type": "Template",
7
- "subtype": "TAB",
8
- "properties": []
9
- }
2
+ "componentKey": "TwoColumnTab",
3
+ "name": "TwoColumnTab",
4
+ "label": "Two column",
5
+ "description": "Two column",
6
+ "type": "Template",
7
+ "subtype": "TAB",
8
+ "properties": []
9
+ }
@@ -1,5 +1,5 @@
1
1
  import { PropsWithChildren, ReactElement } from 'react';
2
- import { PConnProps } from 'packages/react-sdk-components/src/types/PConnProps';
2
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
3
  import './WideNarrow.css';
4
4
 
5
5
  interface WideNarrowProps extends PConnProps {
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "WideNarrowDetails",
3
- "name": "WideNarrowDetails",
4
- "label": "Details (Wide-narrow)",
5
- "description": "Details (Wide-narrow) template",
6
- "type": "Template",
7
- "subtype": "DETAILS",
8
- "properties": []
9
- }
2
+ "componentKey": "WideNarrowDetails",
3
+ "name": "WideNarrowDetails",
4
+ "label": "Details (Wide-narrow)",
5
+ "description": "Details (Wide-narrow) template",
6
+ "type": "Template",
7
+ "subtype": "DETAILS",
8
+ "properties": []
9
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "WideNarrowForm",
3
- "name": "WideNarrowForm",
4
- "label": "Wide-narrow",
5
- "description": "WideNarrow Template",
6
- "type": "Template",
7
- "subtype": "FORM",
8
- "properties": []
9
- }
2
+ "componentKey": "WideNarrowForm",
3
+ "name": "WideNarrowForm",
4
+ "label": "Wide-narrow",
5
+ "description": "WideNarrow Template",
6
+ "type": "Template",
7
+ "subtype": "FORM",
8
+ "properties": []
9
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "WideNarrowPage",
3
- "name": "WideNarrowPage",
4
- "label": "Wide-narrow",
5
- "description": "Wide-narrow Page Template",
6
- "type": "Template",
7
- "subtype": "PAGE",
8
- "properties": []
9
- }
2
+ "componentKey": "WideNarrowPage",
3
+ "name": "WideNarrowPage",
4
+ "label": "Wide-narrow",
5
+ "description": "Wide-narrow Page Template",
6
+ "type": "Template",
7
+ "subtype": "PAGE",
8
+ "properties": []
9
+ }
@@ -54,6 +54,9 @@ export default function WssNavBar(props: WssNavBarProps) {
54
54
  const [anchorElNav, setAnchorElNav] = useState<null | HTMLElement>(null);
55
55
  const [anchorElUser, setAnchorElUser] = useState<null | HTMLElement>(null);
56
56
 
57
+ const localizedVal = PCore.getLocaleUtils().getLocaleValue;
58
+ const localeCategory = 'AppShell';
59
+
57
60
  const handleOpenNavMenu = (event: React.MouseEvent<HTMLElement>) => {
58
61
  setAnchorElNav(event.currentTarget);
59
62
  };
@@ -144,7 +147,7 @@ export default function WssNavBar(props: WssNavBarProps) {
144
147
  onClose={handleCloseUserMenu}
145
148
  >
146
149
  <MenuItem onClick={logout}>
147
- <Typography>Logout</Typography>
150
+ <Typography>{localizedVal('Log off', localeCategory)}</Typography>
148
151
  </MenuItem>
149
152
  </Menu>
150
153
  </Box>
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "AppAnnouncement",
3
- "name": "AppAnnouncement",
4
- "label": "App announcement",
5
- "description": "App announcement widget",
6
- "type": "Widget",
7
- "subtype": "PAGE",
8
- "properties": []
9
- }
2
+ "componentKey": "AppAnnouncement",
3
+ "name": "AppAnnouncement",
4
+ "label": "App announcement",
5
+ "description": "App announcement widget",
6
+ "type": "Widget",
7
+ "subtype": "PAGE",
8
+ "properties": []
9
+ }
@@ -1,11 +1,16 @@
1
1
  /* eslint-disable react/jsx-boolean-value */
2
2
  /* eslint-disable react/no-array-index-key */
3
+ /* eslint-disable no-nested-ternary */
3
4
  import { useState, useEffect, useCallback } from 'react';
4
5
  import { CircularProgress, IconButton, Menu, MenuItem, Button } from '@material-ui/core';
5
6
  import MoreVertIcon from '@material-ui/icons/MoreVert';
6
7
  import download from 'downloadjs';
7
8
 
8
- import { buildFilePropsFromResponse, getIconFromFileType, validateMaxSize } from '@pega/react-sdk-components/lib/components/helpers/attachmentHelpers';
9
+ import {
10
+ buildFilePropsFromResponse,
11
+ getIconFromFileType,
12
+ validateMaxSize
13
+ } from '@pega/react-sdk-components/lib/components/helpers/attachmentHelpers';
9
14
  import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
10
15
  import { isInfinity23OrHigher } from '@pega/react-sdk-components/lib/components/helpers/common-utils';
11
16
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
@@ -39,7 +44,10 @@ export default function Attachment(props: AttachmentProps) {
39
44
  [required, disabled] = [required, disabled].map(prop => prop === true || (typeof prop === 'string' && prop === 'true'));
40
45
  const pConn = getPConnect();
41
46
  const caseID = PCore.getStoreValue('.pyID', 'caseInfo.content', pConn.getContextName());
42
-
47
+ const localizedVal = PCore.getLocaleUtils().getLocaleValue;
48
+ const localeCategory = 'CosmosFields';
49
+ const uploadMultipleFilesLabel = localizedVal('file_upload_text_multiple', localeCategory);
50
+ const uploadSingleFileLabel = localizedVal('file_upload_text_one', localeCategory);
43
51
  let categoryName = '';
44
52
  if (value && value.pyCategoryName) {
45
53
  categoryName = value.pyCategoryName;
@@ -379,7 +387,13 @@ export default function Attachment(props: AttachmentProps) {
379
387
  onChange={onFileAdded}
380
388
  />
381
389
  <Button style={{ textTransform: 'none' }} variant='outlined' color='primary' component='span'>
382
- {allowMultiple === 'true' ? 'Upload files' : 'Upload a file'}
390
+ {allowMultiple === 'true'
391
+ ? uploadMultipleFilesLabel === 'file_upload_text_multiple'
392
+ ? 'Choose files'
393
+ : uploadMultipleFilesLabel
394
+ : uploadSingleFileLabel === 'file_upload_text_one'
395
+ ? 'Choose a file'
396
+ : uploadSingleFileLabel}
383
397
  </Button>
384
398
  </label>
385
399
  </div>
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "CaseHistory",
3
- "name": "CaseHistory",
4
- "label": "Case history",
5
- "description": "Case history widget",
6
- "type": "Widget",
7
- "subtype": "CASE",
8
- "properties": []
9
- }
2
+ "componentKey": "CaseHistory",
3
+ "name": "CaseHistory",
4
+ "label": "Case history",
5
+ "description": "Case history widget",
6
+ "type": "Widget",
7
+ "subtype": "CASE",
8
+ "properties": []
9
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "FileUtility",
3
- "name": "FileUtility",
4
- "label": "Attachments",
5
- "description": "Attachments",
6
- "type": "Widget",
7
- "subtype": "CASE",
8
- "properties": []
9
- }
2
+ "componentKey": "FileUtility",
3
+ "name": "FileUtility",
4
+ "label": "Attachments",
5
+ "description": "Attachments",
6
+ "type": "Widget",
7
+ "subtype": "CASE",
8
+ "properties": []
9
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "Followers",
3
- "name": "Followers",
4
- "label": "Followers",
5
- "description": "Followers",
6
- "type": "Widget",
7
- "subtype": "CASE",
8
- "properties": []
9
- }
2
+ "componentKey": "Followers",
3
+ "name": "Followers",
4
+ "label": "Followers",
5
+ "description": "Followers",
6
+ "type": "Widget",
7
+ "subtype": "CASE",
8
+ "properties": []
9
+ }
@@ -1,3 +1,4 @@
1
+ import { useEffect, useState } from 'react';
1
2
  import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
2
3
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
3
4
  import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
@@ -25,38 +26,64 @@ export default function QuickCreate(props: QuickCreateProps) {
25
26
  });
26
27
  };
27
28
 
28
- const cases: any = [];
29
- const envInfo = PCore.getEnvironmentInfo();
30
- if (
31
- classFilter &&
32
- envInfo.environmentInfoObject &&
33
- envInfo.environmentInfoObject.pyCaseTypeList &&
34
- envInfo.environmentInfoObject.pyCaseTypeList.length > 0
35
- ) {
36
- classFilter.forEach(item => {
37
- let icon = Utils.getImageSrc('polaris-solid', Utils.getSDKStaticConentUrl());
38
- let label = '';
29
+ const [quickCreatecases, setCases] = useState([]);
30
+
31
+ /* If the classFilter is empty and has no entries - we will default to the default set of case types
32
+ It will usually come from the envInfo but for Launchpad, this is not populated - instead get the list of cases from the store */
33
+ useEffect(() => {
34
+ const cases: any = [];
35
+ const defaultCases: any = [];
36
+ const envInfo = PCore.getEnvironmentInfo();
37
+ if (envInfo?.environmentInfoObject?.pyCaseTypeList) {
39
38
  envInfo.environmentInfoObject.pyCaseTypeList.forEach(casetype => {
40
- if (casetype.pyWorkTypeImplementationClassName === item) {
41
- icon = casetype.pxIcon && Utils.getImageSrc(casetype?.pxIcon, Utils.getSDKStaticConentUrl());
42
- label = casetype.pyWorkTypeName ?? '';
39
+ if (casetype.pyWorkTypeName && casetype.pyWorkTypeImplementationClassName) {
40
+ defaultCases.push({
41
+ classname: casetype.pyWorkTypeImplementationClassName,
42
+ onClick: () => {
43
+ createCase(casetype.pyWorkTypeImplementationClassName);
44
+ },
45
+ ...(showCaseIcons && { icon: Utils.getImageSrc(casetype?.pxIcon, Utils.getSDKStaticConentUrl()) }),
46
+ label: casetype.pyWorkTypeName
47
+ });
48
+ }
49
+ });
50
+ } else {
51
+ const pConnectInAppContext = PCore.createPConnect({
52
+ options: { context: PCore.getConstants().APP.APP }
53
+ }).getPConnect();
54
+ const pyPortalInAppContext = pConnectInAppContext.getValue('pyPortal') as any;
55
+ pyPortalInAppContext?.pyCaseTypesAvailableToCreate?.forEach(casetype => {
56
+ if (casetype.pyClassName && casetype.pyLabel) {
57
+ defaultCases.push({
58
+ classname: casetype.pyClassName,
59
+ onClick: () => {
60
+ createCase(casetype.pyClassName);
61
+ },
62
+ ...(showCaseIcons && { icon: Utils.getImageSrc(casetype?.pxIcon, Utils.getSDKStaticConentUrl()) }),
63
+ label: casetype.pyLabel
64
+ });
43
65
  }
44
66
  });
45
- if (label !== '') {
46
- cases.push({
47
- label,
48
- onClick: () => {
49
- createCase(item);
50
- },
51
- ...(showCaseIcons && { icon })
67
+ }
68
+
69
+ /* If classFilter is not empty - filter from the list of defaultCases */
70
+ if (classFilter?.length > 0) {
71
+ classFilter.forEach(item => {
72
+ defaultCases.forEach(casetype => {
73
+ if (casetype.classname === item) {
74
+ cases.push(casetype);
75
+ }
52
76
  });
53
- }
54
- });
55
- }
77
+ });
78
+ setCases(cases);
79
+ } else {
80
+ setCases(defaultCases);
81
+ }
82
+ }, []);
56
83
 
57
84
  return (
58
85
  <div>
59
- <WssQuickCreate heading={heading} actions={cases} />
86
+ <WssQuickCreate heading={heading} actions={quickCreatecases} />
60
87
  </div>
61
88
  );
62
89
  }
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "Todo",
3
- "name": "Todo",
4
- "label": "Todo",
5
- "description": "My worklist widget",
6
- "type": "Widget",
7
- "subtype": "PAGE",
8
- "properties": []
9
- }
2
+ "componentKey": "Todo",
3
+ "name": "Todo",
4
+ "label": "Todo",
5
+ "description": "My worklist widget",
6
+ "type": "Widget",
7
+ "subtype": "PAGE",
8
+ "properties": []
9
+ }
@@ -1,5 +1,5 @@
1
1
  import { useState, useEffect } from 'react';
2
- import { Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText } from '@material-ui/core';
2
+ import { Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel } from '@material-ui/core';
3
3
 
4
4
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
5
5
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
@@ -24,6 +24,7 @@ export default function PegaDxilMyBoolean(props: PegaDxilMyBooleanProps) {
24
24
 
25
25
  const {
26
26
  getPConnect,
27
+ label,
27
28
  value = false,
28
29
  readOnly,
29
30
  testId,
@@ -78,6 +79,7 @@ export default function PegaDxilMyBoolean(props: PegaDxilMyBooleanProps) {
78
79
  return (
79
80
  <StyledPegaDxilMyBooleanWrapper>
80
81
  <FormControl required={required} error={status === 'error'}>
82
+ {!hideLabel && <FormLabel component='legend'>{label}</FormLabel>}
81
83
  <FormGroup>
82
84
  <FormControlLabel
83
85
  control={theCheckbox}
@@ -94,4 +96,3 @@ export default function PegaDxilMyBoolean(props: PegaDxilMyBooleanProps) {
94
96
  </StyledPegaDxilMyBooleanWrapper>
95
97
  );
96
98
  }
97
-
@@ -1,11 +1,9 @@
1
- import { useState, useEffect } from 'react';
2
1
  import CurrencyTextField from '@unicef/material-ui-currency-textfield';
3
2
 
4
- import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
5
- import { format } from "@pega/react-sdk-components/lib/components/helpers/formatters";
6
3
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
7
4
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
-
5
+ import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
6
+ import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
9
7
  import { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils.js';
10
8
  import StyledPegaDxilMyCurrencyWrapper from './styles';
11
9
 
@@ -52,17 +50,11 @@ export default function PegaDxilMyCurrency(props: PegaDxilMyCurrencyProps) {
52
50
  'data-test-id': testId
53
51
  };
54
52
 
55
- const [theCurrSym, setCurrSym] = useState('$');
56
- const [theCurrDec, setCurrDec] = useState('.');
57
- const [theCurrSep, setCurrSep] = useState(',');
58
-
59
- useEffect(() => {
60
- // currencySymbols looks like this: { theCurrencySymbol: '$', theDecimalIndicator: '.', theSeparator: ',' }
61
- const theSymbols = getCurrencyCharacters(currencyISOCode);
62
- setCurrSym(theSymbols.theCurrencySymbol);
63
- setCurrDec(theSymbols.theDecimalIndicator);
64
- setCurrSep(theSymbols.theDigitGroupSeparator);
65
- }, [currencyISOCode]);
53
+ // currencySymbols looks like this: { theCurrencySymbol: '$', theDecimalIndicator: '.', theSeparator: ',' }
54
+ const theSymbols = getCurrencyCharacters(currencyISOCode);
55
+ const theCurrSym = theSymbols.theCurrencySymbol;
56
+ const theCurrDec = theSymbols.theDecimalIndicator;
57
+ const theCurrSep = theSymbols.theDigitGroupSeparator;
66
58
 
67
59
  const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
68
60
  const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);
@@ -15,7 +15,14 @@ window.PCore = {
15
15
  return 'en-GB';
16
16
  }
17
17
  };
18
- }
18
+ },
19
+ getLocaleUtils: (): any => {
20
+ return {
21
+ getLocaleValue: value => {
22
+ return value;
23
+ }
24
+ };
25
+ },
19
26
  };
20
27
 
21
28
  const meta: Meta<typeof PegaDxilMyDateTime> = {
@@ -1,4 +1,3 @@
1
- import { useState, useEffect } from 'react';
2
1
  import CurrencyTextField from '@unicef/material-ui-currency-textfield';
3
2
 
4
3
  import { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils.js';
@@ -49,14 +48,9 @@ export default function PegaDxilMyDecimal(props: PegaDxilMyDecimalProps) {
49
48
  const propName = (pConn.getStateProps() as any).value;
50
49
  const helperTextToDisplay = validatemessage || helperText;
51
50
 
52
- const [theCurrDec, setCurrDec] = useState('.');
53
- const [theCurrSep, setCurrSep] = useState(',');
54
-
55
- useEffect(() => {
56
- const theSymbols = getCurrencyCharacters(currencyISOCode);
57
- setCurrDec(theSymbols.theDecimalIndicator);
58
- setCurrSep(theSymbols.theDigitGroupSeparator);
59
- }, [currencyISOCode]);
51
+ const theSymbols = getCurrencyCharacters(currencyISOCode);
52
+ const theCurrDec = theSymbols.theDecimalIndicator;
53
+ const theCurrSep = theSymbols.theDigitGroupSeparator;
60
54
 
61
55
  const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
62
56
  const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);