@pega/dx-component-builder-sdk 25.1.16 → 26.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 (208) hide show
  1. package/package.json +1 -1
  2. package/pega-dx-component-builder-sdk-26.1.10.tgz +0 -0
  3. package/src/constants.js +4 -0
  4. package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/utils.ts.mustache +1 -1
  5. package/src/tasks/create/templates/Constellation/template/DETAILS/DetailsRender.tsx.mustache +1 -1
  6. package/src/tasks/create/templates/Constellation/template/DETAILS-region/DetailsRender.tsx.mustache +1 -1
  7. package/src/tasks/create/templates/Constellation/template/FORM/DetailsRender.tsx +1 -1
  8. package/src/tasks/create/templates/Constellation/template/FORM-region/DetailsRender.tsx +1 -1
  9. package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +22 -6
  10. package/src/tasks/create/templates/SDK-React/field/Date/demo.stories.tsx.mustache +8 -1
  11. package/src/tasks/create/templates/SDK-React/field/Date/index.tsx.mustache +22 -13
  12. package/src/tasks/create/templates/SDK-React/field/DateTime/demo.stories.tsx.mustache +9 -1
  13. package/src/tasks/create/templates/SDK-React/field/DateTime/index.tsx.mustache +23 -14
  14. package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +24 -8
  15. package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +24 -8
  16. package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +24 -10
  17. package/src/tasks/create/templates/SDK-React/field/Integer/index.tsx.mustache +26 -14
  18. package/src/tasks/create/templates/SDK-React/field/Picklist/index.tsx.mustache +34 -8
  19. package/src/tasks/create/templates/SDK-React/field/Picklist-Autocomplete/index.tsx.mustache +25 -9
  20. package/src/tasks/create/templates/SDK-React/field/Picklist-RadioButtons/index.tsx.mustache +21 -5
  21. package/src/tasks/create/templates/SDK-React/field/Text/index.tsx.mustache +25 -14
  22. package/src/tasks/create/templates/SDK-React/field/Text-Email/index.tsx.mustache +32 -21
  23. package/src/tasks/create/templates/SDK-React/field/Text-Input/index.tsx.mustache +25 -10
  24. package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/index.tsx.mustache +26 -14
  25. package/src/tasks/create/templates/SDK-React/field/Text-Phone/index.tsx.mustache +28 -10
  26. package/src/tasks/create/templates/SDK-React/field/Text-URL/index.tsx.mustache +26 -14
  27. package/src/tasks/create/templates/SDK-React/field/TimeOfDay/demo.stories.tsx.mustache +9 -1
  28. package/src/tasks/create/templates/SDK-React/field/TimeOfDay/index.tsx.mustache +22 -17
  29. package/src/tasks/create/templates/SDK-React/template/FORM/DefaultForm.css +82 -2
  30. package/src/tasks/create/templates/SDK-React/template/FORM/index.tsx.mustache +51 -11
  31. package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +19 -15
  32. package/src/tasks/create/templates/SDK-React/widget/PAGE/index.tsx.mustache +2 -167
  33. package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/index.tsx.mustache +72 -15
  34. package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx +25 -14
  35. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/AlertBanner/AlertBanner.css +46 -0
  36. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/AlertBanner/AlertBanner.tsx +37 -20
  37. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +14 -0
  38. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +57 -5
  39. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldGroup/FieldGroup.tsx +18 -11
  40. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldGroupList/FieldGroupList.tsx +1 -1
  41. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +19 -4
  42. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/Operator/Operator.tsx +125 -74
  43. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/RichTextEditor/RichTextEditor.tsx +184 -90
  44. package/tests/assets/sdk-r/components/create/override-sdk/field/AutoComplete/AutoComplete.tsx +372 -26
  45. package/tests/assets/sdk-r/components/create/override-sdk/field/Checkbox/Checkbox.tsx +22 -6
  46. package/tests/assets/sdk-r/components/create/override-sdk/field/Currency/Currency.tsx +22 -4
  47. package/tests/assets/sdk-r/components/create/override-sdk/field/Date/Date.tsx +35 -4
  48. package/tests/assets/sdk-r/components/create/override-sdk/field/DateTime/DateTime.tsx +35 -4
  49. package/tests/assets/sdk-r/components/create/override-sdk/field/Decimal/Decimal.tsx +22 -4
  50. package/tests/assets/sdk-r/components/create/override-sdk/field/Dropdown/Dropdown.tsx +48 -16
  51. package/tests/assets/sdk-r/components/create/override-sdk/field/Email/Email.tsx +21 -4
  52. package/tests/assets/sdk-r/components/create/override-sdk/field/Group/Group.tsx +28 -4
  53. package/tests/assets/sdk-r/components/create/override-sdk/field/Integer/Integer.tsx +21 -4
  54. package/tests/assets/sdk-r/components/create/override-sdk/field/Multiselect/Multiselect.tsx +42 -20
  55. package/tests/assets/sdk-r/components/create/override-sdk/field/Multiselect/utils.ts +5 -3
  56. package/tests/assets/sdk-r/components/create/override-sdk/field/ObjectReference/ObjectReference.tsx +554 -66
  57. package/tests/assets/sdk-r/components/create/override-sdk/field/ObjectReference/utils.ts +108 -20
  58. package/tests/assets/sdk-r/components/create/override-sdk/field/Percentage/Percentage.tsx +22 -4
  59. package/tests/assets/sdk-r/components/create/override-sdk/field/Phone/Phone.tsx +23 -4
  60. package/tests/assets/sdk-r/components/create/override-sdk/field/RadioButtons/RadioButtons.tsx +20 -4
  61. package/tests/assets/sdk-r/components/create/override-sdk/field/RichText/RichText.css +0 -79
  62. package/tests/assets/sdk-r/components/create/override-sdk/field/RichText/RichText.tsx +1 -1
  63. package/tests/assets/sdk-r/components/create/override-sdk/field/SelectableCard/SelectableCard.tsx +25 -10
  64. package/tests/assets/sdk-r/components/create/override-sdk/field/TextArea/TextArea.tsx +22 -4
  65. package/tests/assets/sdk-r/components/create/override-sdk/field/TextInput/TextInput.tsx +21 -4
  66. package/tests/assets/sdk-r/components/create/override-sdk/field/Time/Time.tsx +35 -4
  67. package/tests/assets/sdk-r/components/create/override-sdk/field/URL/URL.tsx +22 -4
  68. package/tests/assets/sdk-r/components/create/override-sdk/field/UserReference/UserReference.tsx +10 -6
  69. package/tests/assets/sdk-r/components/create/override-sdk/infra/Assignment/Assignment.tsx +36 -14
  70. package/tests/assets/sdk-r/components/create/override-sdk/infra/Assignment/useValidationBanner.ts +29 -0
  71. package/tests/assets/sdk-r/components/create/override-sdk/infra/DeferLoad/DeferLoad.tsx +31 -10
  72. package/tests/assets/sdk-r/components/create/override-sdk/infra/FlowContainer/FlowContainer.tsx +5 -6
  73. package/tests/assets/sdk-r/components/create/override-sdk/infra/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +1 -1
  74. package/tests/assets/sdk-r/components/create/override-sdk/infra/ModalViewContainer/DataViewActionButtons/DataViewActionButtons.tsx +138 -0
  75. package/tests/assets/sdk-r/components/create/override-sdk/infra/ModalViewContainer/ModalViewContainer.tsx +110 -64
  76. package/tests/assets/sdk-r/components/create/override-sdk/infra/MultiStep/MultiStep.css +63 -0
  77. package/tests/assets/sdk-r/components/create/override-sdk/infra/MultiStep/MultiStep.tsx +23 -52
  78. package/tests/assets/sdk-r/components/create/override-sdk/infra/NavBar/NavBar.tsx +8 -3
  79. package/tests/assets/sdk-r/components/create/override-sdk/infra/Reference/Reference.tsx +5 -0
  80. package/tests/assets/sdk-r/components/create/override-sdk/infra/RootContainer/RootContainer.tsx +4 -5
  81. package/tests/assets/sdk-r/components/create/override-sdk/infra/View/View.css +1 -0
  82. package/tests/assets/sdk-r/components/create/override-sdk/infra/View/View.tsx +10 -17
  83. package/tests/assets/sdk-r/components/create/override-sdk/infra/ViewContainer/ViewContainer.tsx +8 -10
  84. package/tests/assets/sdk-r/components/create/override-sdk/template/AppShell/AppShell.css +0 -4
  85. package/tests/assets/sdk-r/components/create/override-sdk/template/AppShell/AppShell.tsx +7 -1
  86. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseSummary/CaseSummary.tsx +9 -42
  87. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseView/CaseView.tsx +8 -2
  88. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +58 -3
  89. package/tests/assets/sdk-r/components/create/override-sdk/template/DataReference/DataReference.tsx +56 -33
  90. package/tests/assets/sdk-r/components/create/override-sdk/template/DataReference/SearchForm.tsx +3 -4
  91. package/tests/assets/sdk-r/components/create/override-sdk/template/DefaultForm/DefaultForm.css +71 -0
  92. package/tests/assets/sdk-r/components/create/override-sdk/template/DefaultForm/DefaultForm.tsx +45 -9
  93. package/tests/assets/sdk-r/components/create/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +10 -3
  94. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/ListView.tsx +139 -59
  95. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/hooks.ts +80 -13
  96. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/utils.ts +13 -3
  97. package/tests/assets/sdk-r/components/create/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +16 -1
  98. package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +167 -93
  99. package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableSelect/SimpleTableSelect.tsx +71 -56
  100. package/tests/assets/sdk-r/components/create/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +12 -7
  101. package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/Attachment.tsx +119 -26
  102. package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/AttachmentUtils.ts +1 -1
  103. package/tests/assets/sdk-r/components/create/override-sdk/widget/CaseHistory/CaseHistory.tsx +16 -12
  104. package/tests/assets/sdk-r/components/create/override-sdk/widget/FileUtility/FileUtility.tsx +40 -28
  105. package/tests/assets/sdk-r/components/create/override-sdk/widget/ToDo/ToDo.tsx +14 -6
  106. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/utils.ts +1 -1
  107. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/DetailsRender.tsx +1 -1
  108. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyForm/DetailsRender.tsx +1 -1
  109. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/DetailsRender.tsx +1 -1
  110. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnForm/DetailsRender.tsx +1 -1
  111. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/index.tsx +22 -6
  112. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +24 -8
  113. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/demo.stories.tsx +8 -1
  114. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/index.tsx +22 -13
  115. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/demo.stories.tsx +9 -1
  116. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/index.tsx +23 -14
  117. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +24 -8
  118. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyEmail/index.tsx +32 -21
  119. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/index.tsx +2 -2
  120. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/index.tsx +26 -14
  121. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/index.tsx +26 -14
  122. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +24 -10
  123. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPhone/index.tsx +25 -10
  124. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPicklist/index.tsx +34 -8
  125. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyRadiobuttons/index.tsx +21 -5
  126. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MySearchbox/index.tsx +22 -9
  127. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/index.tsx +25 -14
  128. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/index.tsx +25 -10
  129. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +9 -1
  130. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/index.tsx +22 -17
  131. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyURL/index.tsx +26 -14
  132. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/DefaultForm.css +82 -2
  133. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/index.tsx +45 -8
  134. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/index.tsx +19 -15
  135. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/index.tsx +66 -15
  136. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/index.tsx +2 -167
  137. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/AlertBanner/AlertBanner.css +46 -0
  138. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/AlertBanner/AlertBanner.tsx +37 -20
  139. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +14 -0
  140. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +57 -5
  141. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldGroup/FieldGroup.tsx +18 -11
  142. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldGroupList/FieldGroupList.tsx +1 -1
  143. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +19 -4
  144. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/Operator/Operator.tsx +125 -74
  145. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/RichTextEditor/RichTextEditor.tsx +184 -90
  146. package/tests/assets/sdk-r/components/createAll/override-sdk/field/AutoComplete/AutoComplete.tsx +372 -26
  147. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Checkbox/Checkbox.tsx +22 -6
  148. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Currency/Currency.tsx +22 -4
  149. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Date/Date.tsx +35 -4
  150. package/tests/assets/sdk-r/components/createAll/override-sdk/field/DateTime/DateTime.tsx +35 -4
  151. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Decimal/Decimal.tsx +22 -4
  152. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Dropdown/Dropdown.tsx +48 -16
  153. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Email/Email.tsx +21 -4
  154. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Group/Group.tsx +28 -4
  155. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Integer/Integer.tsx +21 -4
  156. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Multiselect/Multiselect.tsx +42 -20
  157. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Multiselect/utils.ts +5 -3
  158. package/tests/assets/sdk-r/components/createAll/override-sdk/field/ObjectReference/ObjectReference.tsx +554 -66
  159. package/tests/assets/sdk-r/components/createAll/override-sdk/field/ObjectReference/utils.ts +108 -20
  160. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/Percentage.tsx +22 -4
  161. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Phone/Phone.tsx +23 -4
  162. package/tests/assets/sdk-r/components/createAll/override-sdk/field/RadioButtons/RadioButtons.tsx +20 -4
  163. package/tests/assets/sdk-r/components/createAll/override-sdk/field/RichText/RichText.css +0 -79
  164. package/tests/assets/sdk-r/components/createAll/override-sdk/field/RichText/RichText.tsx +1 -1
  165. package/tests/assets/sdk-r/components/createAll/override-sdk/field/SelectableCard/SelectableCard.tsx +25 -10
  166. package/tests/assets/sdk-r/components/createAll/override-sdk/field/TextArea/TextArea.tsx +22 -4
  167. package/tests/assets/sdk-r/components/createAll/override-sdk/field/TextInput/TextInput.tsx +21 -4
  168. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Time/Time.tsx +35 -4
  169. package/tests/assets/sdk-r/components/createAll/override-sdk/field/URL/URL.tsx +22 -4
  170. package/tests/assets/sdk-r/components/createAll/override-sdk/field/UserReference/UserReference.tsx +10 -6
  171. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Assignment/Assignment.tsx +36 -14
  172. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Assignment/useValidationBanner.ts +29 -0
  173. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/DeferLoad/DeferLoad.tsx +31 -10
  174. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/FlowContainer/FlowContainer.tsx +5 -6
  175. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +1 -1
  176. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/ModalViewContainer/DataViewActionButtons/DataViewActionButtons.tsx +138 -0
  177. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/ModalViewContainer/ModalViewContainer.tsx +110 -64
  178. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/MultiStep/MultiStep.css +63 -0
  179. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/MultiStep/MultiStep.tsx +23 -52
  180. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/NavBar/NavBar.tsx +8 -3
  181. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Reference/Reference.tsx +5 -0
  182. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/RootContainer/RootContainer.tsx +4 -5
  183. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/View/View.css +1 -0
  184. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/View/View.tsx +10 -17
  185. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/ViewContainer/ViewContainer.tsx +8 -10
  186. package/tests/assets/sdk-r/components/createAll/override-sdk/template/AppShell/AppShell.css +0 -4
  187. package/tests/assets/sdk-r/components/createAll/override-sdk/template/AppShell/AppShell.tsx +7 -1
  188. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseSummary/CaseSummary.tsx +9 -42
  189. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseView/CaseView.tsx +8 -2
  190. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +58 -3
  191. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DataReference/DataReference.tsx +56 -33
  192. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DataReference/SearchForm.tsx +3 -4
  193. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DefaultForm/DefaultForm.css +71 -0
  194. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DefaultForm/DefaultForm.tsx +45 -9
  195. package/tests/assets/sdk-r/components/createAll/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +10 -3
  196. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/ListView.tsx +139 -59
  197. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/hooks.ts +80 -13
  198. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/utils.ts +13 -3
  199. package/tests/assets/sdk-r/components/createAll/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +16 -1
  200. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +167 -93
  201. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableSelect/SimpleTableSelect.tsx +71 -56
  202. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +12 -7
  203. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/Attachment.tsx +119 -26
  204. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/AttachmentUtils.ts +1 -1
  205. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/CaseHistory/CaseHistory.tsx +16 -12
  206. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/FileUtility/FileUtility.tsx +40 -28
  207. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/ToDo/ToDo.tsx +14 -6
  208. package/SECURITY.md +0 -10
@@ -4,10 +4,18 @@ import { TextField } from '@mui/material';
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';
6
6
  import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
+ import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
8
+ import { getFieldSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
7
9
 
8
10
  interface TextInputProps extends PConnFieldProps {
9
11
  // If any, enter additional props that only exist on TextInput here
10
12
  fieldMetadata?: any;
13
+ showFieldMessage?: boolean;
14
+ messageConfig?: {
15
+ content?: string;
16
+ visibility?: boolean;
17
+ };
18
+ variant?: string;
11
19
  }
12
20
 
13
21
  export default function TextInput(props: TextInputProps) {
@@ -21,7 +29,6 @@ export default function TextInput(props: TextInputProps) {
21
29
  disabled,
22
30
  value = '',
23
31
  validatemessage,
24
- status,
25
32
  /* onChange, onBlur */
26
33
  readOnly,
27
34
  testId,
@@ -29,14 +36,23 @@ export default function TextInput(props: TextInputProps) {
29
36
  helperText,
30
37
  displayMode,
31
38
  hideLabel,
32
- placeholder
39
+ placeholder,
40
+ showFieldMessage,
41
+ messageConfig = {}
33
42
  } = props;
34
43
 
35
44
  const pConn = getPConnect();
36
45
  const actions = pConn.getActionsApi();
37
46
  const propName = (pConn.getStateProps() as any).value;
47
+ const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
48
+ const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
38
49
 
39
- const helperTextToDisplay = validatemessage || helperText;
50
+ const status = useStatus({
51
+ showFieldMessage,
52
+ messageVisibility: messageConfig.visibility,
53
+ validatemessage,
54
+ readOnly
55
+ });
40
56
 
41
57
  const [inputValue, setInputValue] = useState('');
42
58
  const maxLength = fieldMetadata?.maxLength;
@@ -48,7 +64,7 @@ export default function TextInput(props: TextInputProps) {
48
64
  }, [value]);
49
65
 
50
66
  if (displayMode === 'DISPLAY_ONLY') {
51
- return <FieldValueList name={hideLabel ? '' : label} value={value} />;
67
+ return <FieldValueList name={hideLabel ? '' : label} value={value} variant={props.variant} />;
52
68
  }
53
69
 
54
70
  if (displayMode === 'STACKED_LARGE_VAL') {
@@ -87,6 +103,7 @@ export default function TextInput(props: TextInputProps) {
87
103
  slotProps={{
88
104
  input: { ...readOnlyProp, inputProps: { maxLength, ...testProps } }
89
105
  }}
106
+ sx={getFieldSx(status)}
90
107
  />
91
108
  );
92
109
  }
@@ -5,9 +5,17 @@ import dayjs from 'dayjs';
5
5
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
6
6
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
7
7
  import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
+ import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
9
+ import { getFieldSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
8
10
 
9
11
  interface TimeProps extends PConnFieldProps {
10
12
  // If any, enter additional props that only exist on Time here
13
+ showFieldMessage?: boolean;
14
+ messageConfig?: {
15
+ content?: string;
16
+ visibility?: boolean;
17
+ };
18
+ variant?: string;
11
19
  }
12
20
 
13
21
  export default function Time(props: TimeProps) {
@@ -15,13 +23,35 @@ export default function Time(props: TimeProps) {
15
23
  const FieldValueList = getComponentFromMap('FieldValueList');
16
24
  const TextInput = getComponentFromMap('TextInput');
17
25
 
18
- const { getPConnect, label, required, disabled, value = '', validatemessage, status, readOnly, helperText, displayMode, hideLabel, testId } = props;
19
- const helperTextToDisplay = validatemessage || helperText;
26
+ const {
27
+ getPConnect,
28
+ label,
29
+ required,
30
+ disabled,
31
+ value = '',
32
+ validatemessage,
33
+ readOnly,
34
+ helperText,
35
+ displayMode,
36
+ hideLabel,
37
+ testId,
38
+ showFieldMessage,
39
+ messageConfig = {}
40
+ } = props;
41
+ const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
42
+ const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
20
43
  const pConn = getPConnect();
21
44
  const actions = pConn.getActionsApi();
22
45
  const propName = (pConn.getStateProps() as any).value;
46
+
47
+ const status = useStatus({
48
+ showFieldMessage,
49
+ messageVisibility: messageConfig.visibility,
50
+ validatemessage,
51
+ readOnly
52
+ });
23
53
  if (displayMode === 'DISPLAY_ONLY') {
24
- return <FieldValueList name={hideLabel ? '' : label} value={value} />;
54
+ return <FieldValueList name={hideLabel ? '' : label} value={value} variant={props.variant} />;
25
55
  }
26
56
 
27
57
  if (displayMode === 'STACKED_LARGE_VAL') {
@@ -71,7 +101,8 @@ export default function Time(props: TimeProps) {
71
101
  error: status === 'error',
72
102
  helperText: helperTextToDisplay,
73
103
  size: 'small',
74
- InputProps: { ...testProps }
104
+ InputProps: { ...testProps },
105
+ sx: getFieldSx(status)
75
106
  }
76
107
  }}
77
108
  />
@@ -4,9 +4,17 @@ import { TextField } from '@mui/material';
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';
6
6
  import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
+ import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
8
+ import { getFieldSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
7
9
 
8
10
  interface URLComponentProps extends PConnFieldProps {
9
11
  // If any, enter additional props that only exist on URLComponent here
12
+ showFieldMessage?: boolean;
13
+ messageConfig?: {
14
+ content?: string;
15
+ visibility?: boolean;
16
+ };
17
+ variant?: string;
10
18
  }
11
19
 
12
20
  // NOTE: that we had to change the name from URL to URLComponent
@@ -24,15 +32,17 @@ export default function URLComponent(props: URLComponentProps) {
24
32
  disabled,
25
33
  value = '',
26
34
  validatemessage,
27
- status,
28
35
  readOnly,
29
36
  testId,
30
37
  helperText,
31
38
  displayMode,
32
39
  hideLabel,
33
- placeholder
40
+ placeholder,
41
+ showFieldMessage,
42
+ messageConfig = {}
34
43
  } = props;
35
- const helperTextToDisplay = validatemessage || helperText;
44
+ const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
45
+ const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
36
46
 
37
47
  const [inputValue, setInputValue] = useState('');
38
48
 
@@ -40,12 +50,19 @@ export default function URLComponent(props: URLComponentProps) {
40
50
  const actions = pConn.getActionsApi();
41
51
  const propName = (pConn.getStateProps() as any).value;
42
52
 
53
+ const status = useStatus({
54
+ showFieldMessage,
55
+ messageVisibility: messageConfig.visibility,
56
+ validatemessage,
57
+ readOnly
58
+ });
59
+
43
60
  useEffect(() => {
44
61
  setInputValue(value);
45
62
  }, [value]);
46
63
 
47
64
  if (displayMode === 'DISPLAY_ONLY') {
48
- return <FieldValueList name={hideLabel ? '' : label} value={value} />;
65
+ return <FieldValueList name={hideLabel ? '' : label} value={value} variant={props.variant} />;
49
66
  }
50
67
 
51
68
  if (displayMode === 'STACKED_LARGE_VAL') {
@@ -84,6 +101,7 @@ export default function URLComponent(props: URLComponentProps) {
84
101
  slotProps={{
85
102
  input: { inputProps: { ...testProps } }
86
103
  }}
104
+ sx={getFieldSx(status)}
87
105
  />
88
106
  );
89
107
  }
@@ -68,11 +68,15 @@ const UserReference = (props: UserReferenceProps) => {
68
68
  // if same user ref field is referred in view as editable & readonly formatted text
69
69
  // referenced users won't be available, so get user details from dx api
70
70
  const { getOperatorDetails } = PCore.getUserApi();
71
- getOperatorDetails(userId).then((res: any) => {
72
- if (res.data && res.data.pyOperatorInfo && res.data.pyOperatorInfo.pyUserName) {
73
- setUserName(res.data.pyOperatorInfo.pyUserName);
74
- }
75
- });
71
+ getOperatorDetails(userId)
72
+ .then((res: any) => {
73
+ if (res.data && res.data.pyOperatorInfo && res.data.pyOperatorInfo.pyUserName) {
74
+ setUserName(res.data.pyOperatorInfo.pyUserName);
75
+ }
76
+ })
77
+ .catch(e => {
78
+ console.error(e);
79
+ });
76
80
  }
77
81
  } else if (displayAs === DROPDOWN_LIST) {
78
82
  const queryPayload = {
@@ -97,7 +101,7 @@ const UserReference = (props: UserReferenceProps) => {
97
101
  let userReferenceComponent: any = null;
98
102
 
99
103
  if (displayMode === 'DISPLAY_ONLY') {
100
- return <FieldValueList name={hideLabel ? '' : label} value={userName || ''} />;
104
+ return <FieldValueList name={hideLabel ? '' : label} value={userName || ''} variant={props.variant} />;
101
105
  }
102
106
 
103
107
  if (displayMode === 'STACKED_LARGE_VAL') {
@@ -5,6 +5,8 @@ import CloseIcon from '@mui/icons-material/Close';
5
5
 
6
6
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
7
7
  import { useFocusFirstField, useScrolltoTop } from '@pega/react-sdk-components/lib/hooks';
8
+ import AlertBanner from '@pega/react-sdk-components/lib/components/designSystemExtension/AlertBanner/AlertBanner';
9
+ import { useValidationBanner } from './useValidationBanner';
8
10
 
9
11
  import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
10
12
 
@@ -23,11 +25,12 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
23
25
  const MultiStep = getComponentFromMap('MultiStep');
24
26
 
25
27
  const { getPConnect, children, itemKey = '', isInModal = false, banners = [] } = props;
28
+ const validationMessages = useValidationBanner(itemKey);
26
29
  const thePConn = getPConnect();
27
30
 
28
31
  const [bHasNavigation, setHasNavigation] = useState(false);
29
32
  const [actionButtons, setActionButtons] = useState([]);
30
- const [bIsVertical, setIsVertical] = useState(false);
33
+ const [stepIndicator, setStepIndicator] = useState<'horizontal' | 'vertical' | 'vertical-start'>('horizontal');
31
34
  const [arCurrentStepIndicies, setArCurrentStepIndicies] = useState<any[]>([]);
32
35
  const [arNavigationSteps, setArNavigationSteps] = useState<any[]>([]);
33
36
 
@@ -88,8 +91,9 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
88
91
  }
89
92
 
90
93
  const scrollId = window.location.href.includes('embedded') ? '#pega-part-of-page' : '#portal';
94
+ const currentAssignmentViewName = getPConnect().getCaseInfo().getCurrentAssignmentViewName();
91
95
  useScrolltoTop(scrollId, children);
92
- useFocusFirstField('Assignment', children);
96
+ useFocusFirstField('Assignment', currentAssignmentViewName);
93
97
 
94
98
  useEffect(() => {
95
99
  if (children) {
@@ -124,9 +128,15 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
124
128
  return;
125
129
  }
126
130
 
127
- // set vertical navigation
128
- const isVerticalTemplate = navigation.template?.toLowerCase() === 'vertical';
129
- setIsVertical(isVerticalTemplate);
131
+ // set navigation mode
132
+ const navTemplate = navigation.template?.toLowerCase();
133
+ if (navTemplate === 'vertical') {
134
+ setStepIndicator('vertical');
135
+ } else if (navTemplate === 'vertical-left') {
136
+ setStepIndicator('vertical-start');
137
+ } else {
138
+ setStepIndicator('horizontal');
139
+ }
130
140
 
131
141
  if (navigation.steps) {
132
142
  const steps = JSON.parse(JSON.stringify(navigation.steps));
@@ -154,9 +164,14 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
154
164
  }
155
165
 
156
166
  function onSaveActionSuccess(data) {
157
- actionsAPI.cancelAssignment(itemKey, false).then(() => {
158
- PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_SAVED, data);
159
- });
167
+ actionsAPI
168
+ .cancelAssignment(itemKey, false)
169
+ .then(() => {
170
+ PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_SAVED, data);
171
+ })
172
+ .catch(e => {
173
+ console.error(e);
174
+ });
160
175
  }
161
176
 
162
177
  function buttonPress(sAction: string, sButtonType: string) {
@@ -297,10 +312,12 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
297
312
  refreshProps.forEach(prop => {
298
313
  PCore.getRefreshManager().registerForRefresh(
299
314
  'PROP_CHANGE',
300
- thePConn.getActionsApi().refreshCaseView.bind(thePConn.getActionsApi(), caseKey, '', pageReference, {
301
- ...refreshOptions,
302
- refreshFor: prop[0]
303
- }),
315
+ matchedPath => {
316
+ thePConn.getActionsApi().refreshCaseView(caseKey, '', pageReference, {
317
+ ...refreshOptions,
318
+ refreshFor: matchedPath || prop[0]
319
+ });
320
+ },
304
321
  `${pageReference}.${prop[1]}`,
305
322
  `${context}/${pageReference}`,
306
323
  context
@@ -310,7 +327,12 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
310
327
 
311
328
  return (
312
329
  <div id='Assignment'>
313
- {banners}
330
+ {validationMessages.length > 0 && (
331
+ <div style={{ marginBottom: '1rem' }}>
332
+ <AlertBanner id={`validation-banner-${itemKey}`} variant='urgent' messages={validationMessages} />
333
+ </div>
334
+ )}
335
+ {banners && banners.length > 0 && <div style={{ marginBottom: '1rem' }}>{banners}</div>}
314
336
  {bHasNavigation ? (
315
337
  <>
316
338
  <MultiStep
@@ -318,7 +340,7 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
318
340
  itemKey={itemKey}
319
341
  actionButtons={actionButtons}
320
342
  onButtonPress={buttonPress}
321
- bIsVertical={bIsVertical}
343
+ stepIndicator={stepIndicator}
322
344
  arCurrentStepIndicies={arCurrentStepIndicies}
323
345
  arNavigationSteps={arNavigationSteps}
324
346
  >
@@ -0,0 +1,29 @@
1
+ import { useState, useEffect, useCallback } from 'react';
2
+
3
+ function formatError(error: any, localizedVal: Function): string {
4
+ if (typeof error === 'string') return localizedVal(error, 'Messages');
5
+ const label = error.label?.endsWith(':') ? error.label : `${error.label}:`;
6
+ return localizedVal(`${label} ${error.description}`, 'Messages');
7
+ }
8
+
9
+ /**
10
+ * Subscribes to the PCore store and returns formatted validation error messages
11
+ * for the given itemKey. Reacts to any ADD_MESSAGES / CLEAR_MESSAGES dispatch
12
+ * (blur, tab, submit, etc.) so the banner appears and clears in real time.
13
+ */
14
+ export function useValidationBanner(itemKey: string): string[] {
15
+ const [messages, setMessages] = useState<string[]>([]);
16
+
17
+ const readMessages = useCallback(() => {
18
+ const localizedVal = PCore.getLocaleUtils().getLocaleValue;
19
+ const errors: any[] = PCore.getMessageManager().getValidationErrorMessages(itemKey) || [];
20
+ setMessages(errors.map(error => formatError(error, localizedVal)));
21
+ }, [itemKey]);
22
+
23
+ useEffect(() => {
24
+ readMessages();
25
+ return PCore.getStore().subscribe(readMessages);
26
+ }, [readMessages]);
27
+
28
+ return messages;
29
+ }
@@ -13,13 +13,13 @@ interface DeferLoadProps extends PConnProps {
13
13
  isTab: boolean;
14
14
  deferLoadId: string;
15
15
  lastUpdateCaseTime: any;
16
+ template?: string;
16
17
  }
17
18
 
18
- //
19
- // WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
20
- // Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
21
- // is totally at your own risk.
22
- //
19
+ /**
20
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
21
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
22
+ */
23
23
 
24
24
  const useStyles = makeStyles(theme => ({
25
25
  root: {
@@ -35,7 +35,7 @@ const useStyles = makeStyles(theme => ({
35
35
  }));
36
36
 
37
37
  export default function DeferLoad(props: DeferLoadProps) {
38
- const { getPConnect, name, deferLoadId, isTab, lastUpdateCaseTime } = props;
38
+ const { getPConnect, name, deferLoadId, isTab, lastUpdateCaseTime, template } = props;
39
39
  const [content, setContent] = useState<any>(null);
40
40
  const [isLoading, setLoading] = useState(true);
41
41
  const [currentLoadedAssignment, setCurrentLoadedAssignment] = useState('');
@@ -69,13 +69,13 @@ export default function DeferLoad(props: DeferLoadProps) {
69
69
 
70
70
  const getViewOptions = () => ({
71
71
  viewContext: resourceType,
72
- pageClass: loadViewCaseID ? '' : (pConnect.getDataObject('') as any).pyPortal.classID, // 2nd arg empty string until typedef allows optional
72
+ pageClass: loadViewCaseID ? '' : (pConnect.getDataObject('') as any).pyPortal?.classID, // 2nd arg empty string until typedef allows optional
73
73
  container: isContainerPreview ? 'preview' : undefined,
74
74
  containerName: isContainerPreview ? 'preview' : undefined,
75
75
  updateData: isContainerPreview
76
76
  });
77
77
 
78
- const onResponse = data => {
78
+ const onResponse = (data: any, isEditable = false) => {
79
79
  setLoading(false);
80
80
  if (deferLoadId) {
81
81
  PCore.getDeferLoadManager().start(
@@ -92,11 +92,16 @@ export default function DeferLoad(props: DeferLoadProps) {
92
92
  meta: data,
93
93
  options: {
94
94
  context: pConnect.getContextName(),
95
- pageReference: pConnect.getPageReference()
95
+ pageReference: pConnect.getPageReference(),
96
+ target: pConnect.getTarget(),
97
+ hasForm: true,
98
+ viewName: (pConnect as any).viewName
96
99
  }
97
100
  };
98
101
  const configObject = PCore.createPConnect(config);
99
- configObject.getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
102
+ if (!isEditable) {
103
+ configObject.getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
104
+ }
100
105
  setContent(createElement(createPConnectComponent(), configObject));
101
106
  if (deferLoadId) {
102
107
  PCore.getDeferLoadManager().stop(deferLoadId, getPConnect().getContextName());
@@ -120,6 +125,9 @@ export default function DeferLoad(props: DeferLoadProps) {
120
125
  })
121
126
  .then(data => {
122
127
  onResponse(data);
128
+ })
129
+ .catch(e => {
130
+ console.error(e);
123
131
  });
124
132
  } else {
125
133
  console.error('Cannot load the defer loaded view without container information');
@@ -131,7 +139,20 @@ export default function DeferLoad(props: DeferLoadProps) {
131
139
  .loadView(encodeURI(loadViewCaseID), name, getViewOptions())
132
140
  .then(data => {
133
141
  onResponse(data);
142
+ })
143
+ .catch(e => {
144
+ console.error(e);
134
145
  });
146
+ } else if (template === 'HierarchicalForm') {
147
+ const root = {
148
+ config: {
149
+ context: pConnect.getPageReference(),
150
+ name,
151
+ type: 'view'
152
+ },
153
+ type: 'reference'
154
+ };
155
+ onResponse(root, true);
135
156
  } else {
136
157
  getPConnect()
137
158
  .getActionsApi()
@@ -22,11 +22,10 @@ interface FlowContainerProps extends PConnProps {
22
22
  activeContainerItemID: string;
23
23
  }
24
24
 
25
- //
26
- // WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
27
- // Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
28
- // is totally at your own risk.
29
- //
25
+ /**
26
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
27
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
28
+ */
30
29
 
31
30
  const useStyles = makeStyles(theme => ({
32
31
  root: {
@@ -199,7 +198,7 @@ export const FlowContainer = (props: FlowContainerProps) => {
199
198
  }, [props]);
200
199
 
201
200
  const caseId = thePConn.getCaseSummary().content.pyID;
202
- const urgency = getPConnect().getCaseSummary().assignments ? getPConnect().getCaseSummary().assignments?.[0].urgency : '';
201
+ const urgency = getPConnect().getCaseSummary().assignments ? getPConnect().getCaseSummary().assignments?.[0]?.urgency : '';
203
202
  const operatorInitials = Utils.getInitials(PCore.getEnvironmentInfo().getOperatorName() || '');
204
203
 
205
204
  const displayPageMessages = () => {
@@ -27,7 +27,7 @@ const LeftAlignVerticalTabs: any = withStyles((/* theme */) => ({
27
27
  }
28
28
  }))((props: LeftAlignVerticalTabsProps) => (
29
29
  <div>
30
- <Tab {...props} />
30
+ <Tab style={{ textAlign: 'left' }} {...props} />
31
31
  <Divider />
32
32
  </div>
33
33
  ));
@@ -0,0 +1,138 @@
1
+ import { useState } from 'react';
2
+ import makeStyles from '@mui/styles/makeStyles';
3
+ import Button from '@mui/material/Button';
4
+ import { Grid2, Divider } from '@mui/material';
5
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
+
7
+ function getActionLabel(action: string, constants: { RESOURCE_STATUS: { UPDATE?: unknown; CREATE?: unknown; OPEN_FLOW_ACTION?: unknown } }) {
8
+ switch (action) {
9
+ case constants.RESOURCE_STATUS.UPDATE:
10
+ return 'Update';
11
+ case constants.RESOURCE_STATUS.CREATE:
12
+ return 'Submit';
13
+ case constants.RESOURCE_STATUS.OPEN_FLOW_ACTION:
14
+ return 'Submit';
15
+ default:
16
+ return 'Submit';
17
+ }
18
+ }
19
+
20
+ interface DataViewActionButtonsProps extends PConnProps {
21
+ context: string;
22
+ classId: string;
23
+ dataObjectAction: string;
24
+ dataRecordKeys: string;
25
+ actionID: string;
26
+ closeActionsDialog: () => void;
27
+ }
28
+
29
+ const useStyles = makeStyles(theme => ({
30
+ divider: {
31
+ marginTop: '10px',
32
+ marginBottom: '10px'
33
+ },
34
+ actionButtonsArea: {
35
+ padding: '8px 24px 20px 24px'
36
+ },
37
+ secondaryButton: {
38
+ backgroundColor: (theme as any).actionButtons.secondary.backgroundColor,
39
+ color: (theme as any).actionButtons.secondary.color
40
+ },
41
+ primaryButton: {
42
+ backgroundColor: (theme as any).actionButtons.primary.backgroundColor,
43
+ color: (theme as any).actionButtons.primary.color
44
+ }
45
+ }));
46
+
47
+ export default function DataViewActionButtons(props: DataViewActionButtonsProps) {
48
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
49
+ const { getPConnect, context, classId, dataObjectAction, dataRecordKeys, actionID, closeActionsDialog } = props;
50
+
51
+ const classes = useStyles();
52
+ const localizedVal = PCore.getLocaleUtils().getLocaleValue;
53
+ const localeCategory = 'Data Object';
54
+ const actionsAPI = getPConnect().getActionsApi();
55
+ const constants = PCore.getConstants();
56
+ const [isLoading, setIsLoading] = useState(false);
57
+
58
+ const actionName = localizedVal(getActionLabel(constants.RESOURCE_STATUS[dataObjectAction], constants), localeCategory);
59
+
60
+ function handleCancel() {
61
+ actionsAPI.cancelDataObject(context);
62
+ }
63
+
64
+ function handleSubmitAction() {
65
+ setIsLoading(true);
66
+ if (constants.RESOURCE_STATUS[dataObjectAction] === constants.RESOURCE_STATUS.CREATE) {
67
+ actionsAPI
68
+ .createDataObject(context)
69
+ .then(data => {
70
+ PCore.getPubSubUtils().publish(constants.PUB_SUB_EVENTS.DATA_EVENTS.DATA_OBJECT_CREATED, {
71
+ classId,
72
+ data
73
+ });
74
+ })
75
+ .catch(() => {
76
+ // Error messages are handled by the infrastructure via httpMessages/pageMessages
77
+ })
78
+ .finally(() => {
79
+ setIsLoading(false);
80
+ });
81
+ } else if (constants.RESOURCE_STATUS[dataObjectAction] === constants.RESOURCE_STATUS.UPDATE) {
82
+ actionsAPI
83
+ .updateDataObject(context, JSON.parse(dataRecordKeys))
84
+ .then(() => {
85
+ PCore.getPubSubUtils().publish(constants.PUB_SUB_EVENTS.DATA_EVENTS.DATA_OBJECT_UPDATED, {
86
+ classId
87
+ });
88
+ })
89
+ .catch(() => {
90
+ // Error messages are handled by the infrastructure via httpMessages/pageMessages
91
+ })
92
+ .finally(() => {
93
+ setIsLoading(false);
94
+ });
95
+ } else if (constants.RESOURCE_STATUS[dataObjectAction] === constants.RESOURCE_STATUS.OPEN_FLOW_ACTION) {
96
+ actionsAPI
97
+ .submitDataObjectAction(context, JSON.parse(dataRecordKeys), actionID)
98
+ .then(() => {
99
+ PCore.getPubSubUtils().publish(constants.PUB_SUB_EVENTS.DATA_EVENTS.DATA_OBJECT_UPDATED, {
100
+ classId,
101
+ actionID
102
+ });
103
+ })
104
+ .catch(() => {
105
+ // Error messages are handled by the infrastructure via httpMessages/pageMessages
106
+ })
107
+ .finally(() => {
108
+ setIsLoading(false);
109
+ });
110
+ }
111
+ }
112
+
113
+ return (
114
+ <div className={classes.actionButtonsArea}>
115
+ <Divider className={classes.divider} />
116
+ <Grid2 container spacing={4} justifyContent='space-between'>
117
+ <Grid2>
118
+ <Grid2 container spacing={1}>
119
+ <Grid2>
120
+ <Button className={classes.secondaryButton} color='secondary' variant='contained' disabled={isLoading} onClick={handleCancel}>
121
+ {localizedVal('Cancel', localeCategory)}
122
+ </Button>
123
+ </Grid2>
124
+ </Grid2>
125
+ </Grid2>
126
+ <Grid2>
127
+ <Grid2 container spacing={1}>
128
+ <Grid2>
129
+ <Button className={classes.primaryButton} color='primary' variant='contained' disabled={isLoading} onClick={handleSubmitAction}>
130
+ {actionName}
131
+ </Button>
132
+ </Grid2>
133
+ </Grid2>
134
+ </Grid2>
135
+ </Grid2>
136
+ </div>
137
+ );
138
+ }