@pega/dx-component-builder-sdk 24.2.11 → 24.2.12

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 (234) hide show
  1. package/README.md +3 -3
  2. package/package.json +1 -1
  3. package/src/constants.js +39 -6
  4. package/src/tasks/create/templates/Constellation/field/Date/demo.stories.tsx.mustache +0 -16
  5. package/src/tasks/create/templates/Constellation/field/DateTime/demo.stories.tsx.mustache +0 -17
  6. package/src/tasks/create/templates/Constellation/field/Decimal/demo.stories.tsx.mustache +0 -1
  7. package/src/tasks/create/templates/Constellation/field/Decimal-Currency/demo.stories.tsx.mustache +0 -1
  8. package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/demo.stories.tsx.mustache +0 -1
  9. package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/mock.ts.mustache +1 -0
  10. package/src/tasks/create/templates/Constellation/field/Icon-Button-URL/demo.stories.tsx.mustache +9 -20
  11. package/src/tasks/create/templates/Constellation/field/Picklist/demo.stories.tsx.mustache +0 -1
  12. package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/demo.stories.tsx.mustache +0 -1
  13. package/src/tasks/create/templates/Constellation/field/Picklist-RadioButtons/demo.stories.tsx.mustache +0 -1
  14. package/src/tasks/create/templates/Constellation/field/Picklist-RadioButtons/index.tsx.mustache +3 -5
  15. package/src/tasks/create/templates/Constellation/field/Text/demo.stories.tsx.mustache +0 -1
  16. package/src/tasks/create/templates/Constellation/field/Text-Email/demo.stories.tsx.mustache +0 -1
  17. package/src/tasks/create/templates/Constellation/field/Text-Email/mock.ts.mustache +1 -0
  18. package/src/tasks/create/templates/Constellation/field/Text-Input/demo.stories.tsx.mustache +0 -1
  19. package/src/tasks/create/templates/Constellation/field/Text-Paragraph/demo.stories.tsx.mustache +0 -1
  20. package/src/tasks/create/templates/Constellation/field/Text-Phone/demo.stories.tsx.mustache +1 -2
  21. package/src/tasks/create/templates/Constellation/field/Text-URL/demo.stories.tsx.mustache +0 -1
  22. package/src/tasks/create/templates/Constellation/field/TimeOfDay/demo.stories.tsx.mustache +0 -1
  23. package/src/tasks/create/templates/Constellation/template/DETAILS/demo.stories.tsx.mustache +10 -0
  24. package/src/tasks/create/templates/Constellation/template/PAGE/demo.stories.tsx.mustache +1 -13
  25. package/src/tasks/create/templates/Constellation/widget/CASE/demo.stories.tsx.mustache +10 -32
  26. package/src/tasks/create/templates/Constellation/widget/CASE/index.tsx.mustache +2 -2
  27. package/src/tasks/create/templates/Constellation/widget/PAGE/demo.stories.tsx.mustache +10 -21
  28. package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/demo.stories.tsx.mustache +10 -22
  29. package/src/tasks/create/templates/SDK-Angular/field/Boolean/demo.stories.tsx.mustache +1 -1
  30. package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.spec.ts.mustache +1 -1
  31. package/src/tasks/create/templates/SDK-Angular/field/Date/demo.stories.tsx.mustache +1 -11
  32. package/src/tasks/create/templates/SDK-Angular/field/DateTime/demo.stories.tsx.mustache +1 -12
  33. package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.spec.ts.mustache +1 -1
  34. package/src/tasks/create/templates/SDK-Angular/field/Decimal/demo.stories.tsx.mustache +1 -1
  35. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/demo.stories.tsx.mustache +1 -15
  36. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.spec.ts.mustache +1 -1
  37. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/demo.stories.tsx.mustache +1 -1
  38. package/src/tasks/create/templates/SDK-Angular/field/Icon-Button-URL/demo.stories.tsx.mustache +10 -21
  39. package/src/tasks/create/templates/SDK-Angular/field/Integer/demo.stories.tsx.mustache +1 -1
  40. package/src/tasks/create/templates/SDK-Angular/field/Picklist/demo.stories.tsx.mustache +1 -1
  41. package/src/tasks/create/templates/SDK-Angular/field/Picklist-Autocomplete/demo.stories.tsx.mustache +1 -1
  42. package/src/tasks/create/templates/SDK-Angular/field/Picklist-RadioButtons/demo.stories.tsx.mustache +1 -1
  43. package/src/tasks/create/templates/SDK-Angular/field/Text/demo.stories.tsx.mustache +1 -1
  44. package/src/tasks/create/templates/SDK-Angular/field/Text-Email/demo.stories.tsx.mustache +1 -1
  45. package/src/tasks/create/templates/SDK-Angular/field/Text-Input/demo.stories.tsx.mustache +1 -1
  46. package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/demo.stories.tsx.mustache +1 -1
  47. package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/demo.stories.tsx.mustache +1 -1
  48. package/src/tasks/create/templates/SDK-Angular/field/Text-URL/demo.stories.tsx.mustache +1 -1
  49. package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/demo.stories.tsx.mustache +1 -1
  50. package/src/tasks/create/templates/SDK-Angular/template/DETAILS/demo.stories.tsx.mustache +1 -1
  51. package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/demo.stories.tsx.mustache +1 -1
  52. package/src/tasks/create/templates/SDK-Angular/template/FORM/demo.stories.tsx.mustache +9 -17
  53. package/src/tasks/create/templates/SDK-Angular/template/FORM/mock.ts.mustache +19 -1
  54. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/demo.stories.tsx.mustache +7 -16
  55. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/mock.ts.mustache +19 -1
  56. package/src/tasks/create/templates/SDK-Angular/template/PAGE/demo.stories.tsx.mustache +35 -47
  57. package/src/tasks/create/templates/SDK-Angular/widget/CASE/demo.stories.tsx.mustache +7 -17
  58. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/demo.stories.tsx.mustache +7 -10
  59. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/demo.stories.tsx.mustache +9 -17
  60. package/src/tasks/create/templates/SDK-React/field/Date/demo.stories.tsx.mustache +0 -21
  61. package/src/tasks/create/templates/SDK-React/field/Date/index.tsx.mustache +5 -1
  62. package/src/tasks/create/templates/SDK-React/field/DateTime/demo.stories.tsx.mustache +0 -21
  63. package/src/tasks/create/templates/SDK-React/field/DateTime/index.tsx.mustache +13 -5
  64. package/src/tasks/create/templates/SDK-React/field/Decimal/demo.stories.tsx.mustache +0 -14
  65. package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +6 -1
  66. package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/demo.stories.tsx.mustache +0 -14
  67. package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +6 -1
  68. package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/demo.stories.tsx.mustache +0 -14
  69. package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +5 -1
  70. package/src/tasks/create/templates/SDK-React/field/Icon-Button-URL/demo.stories.tsx.mustache +2 -6
  71. package/src/tasks/create/templates/SDK-React/field/Icon-Button-URL/index.tsx.mustache +1 -1
  72. package/src/tasks/create/templates/SDK-React/field/Integer/demo.stories.tsx.mustache +3 -0
  73. package/src/tasks/create/templates/SDK-React/field/Picklist/index.tsx.mustache +25 -20
  74. package/src/tasks/create/templates/SDK-React/field/Picklist-RadioButtons/index.tsx.mustache +1 -4
  75. package/src/tasks/create/templates/SDK-React/field/Text/demo.stories.tsx.mustache +3 -0
  76. package/src/tasks/create/templates/SDK-React/field/Text-Email/demo.stories.tsx.mustache +3 -0
  77. package/src/tasks/create/templates/SDK-React/field/Text-Input/demo.stories.tsx.mustache +3 -0
  78. package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/demo.stories.tsx.mustache +3 -0
  79. package/src/tasks/create/templates/SDK-React/field/Text-Phone/demo.stories.tsx.mustache +3 -0
  80. package/src/tasks/create/templates/SDK-React/field/Text-URL/demo.stories.tsx.mustache +3 -0
  81. package/src/tasks/create/templates/SDK-React/field/TimeOfDay/index.tsx.mustache +1 -1
  82. package/src/tasks/create/templates/SDK-React/template/DETAILS/demo.stories.tsx.mustache +8 -28
  83. package/src/tasks/create/templates/SDK-React/template/DETAILS/index.tsx.mustache +7 -2
  84. package/src/tasks/create/templates/SDK-React/template/DETAILS-region/demo.stories.tsx.mustache +8 -28
  85. package/src/tasks/create/templates/SDK-React/template/DETAILS-region/index.tsx.mustache +7 -2
  86. package/src/tasks/create/templates/SDK-React/template/FORM/demo.stories.tsx.mustache +10 -16
  87. package/src/tasks/create/templates/SDK-React/template/FORM-region/index.tsx.mustache +5 -5
  88. package/src/tasks/create/templates/SDK-React/widget/CASE/demo.stories.tsx.mustache +10 -20
  89. package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +2 -1
  90. package/src/tasks/create/templates/SDK-React/widget/PAGE/demo.stories.tsx.mustache +9 -19
  91. package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/demo.stories.tsx.mustache +10 -20
  92. package/tests/assets/sdk-a/components/create/custom-constellation/field/Pega_DXIL_MyTestText/demo.stories.tsx +0 -1
  93. package/tests/assets/sdk-a/components/create/custom-sdk/field/pega-dxil-my-test-text/demo.stories.tsx +1 -1
  94. package/tests/assets/sdk-a/components/create/override-sdk/field/user-reference/user-reference.component.html +2 -10
  95. package/tests/assets/sdk-a/components/create/override-sdk/field/user-reference/user-reference.component.ts +34 -12
  96. package/tests/assets/sdk-a/components/create/override-sdk/infra/view/view.component.ts +15 -1
  97. package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyCurrency/demo.stories.tsx +0 -1
  98. package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyDate/demo.stories.tsx +0 -16
  99. package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyDateTime/demo.stories.tsx +0 -17
  100. package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyDecimal/demo.stories.tsx +0 -1
  101. package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyEmail/demo.stories.tsx +0 -1
  102. package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyEmail/mock.ts +1 -0
  103. package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +9 -20
  104. package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyParagraph/demo.stories.tsx +0 -1
  105. package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyPercentage/demo.stories.tsx +0 -1
  106. package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyPercentage/mock.ts +1 -0
  107. package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyPhone/demo.stories.tsx +1 -2
  108. package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyPicklist/demo.stories.tsx +0 -1
  109. package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyRadioButtons/demo.stories.tsx +0 -1
  110. package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyRadioButtons/index.tsx +3 -5
  111. package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/demo.stories.tsx +0 -1
  112. package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyText/demo.stories.tsx +0 -1
  113. package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyTextInput/demo.stories.tsx +0 -1
  114. package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +0 -1
  115. package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyURL/demo.stories.tsx +0 -1
  116. package/tests/assets/sdk-a/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/demo.stories.tsx +10 -0
  117. package/tests/assets/sdk-a/components/createAll/custom-constellation/template/Pega_DXIL_MyPage/demo.stories.tsx +1 -13
  118. package/tests/assets/sdk-a/components/createAll/custom-constellation/widget/Pega_DXIL_MyCaseWidget/demo.stories.tsx +10 -32
  119. package/tests/assets/sdk-a/components/createAll/custom-constellation/widget/Pega_DXIL_MyCaseWidget/index.tsx +2 -2
  120. package/tests/assets/sdk-a/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +10 -22
  121. package/tests/assets/sdk-a/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageWidget/demo.stories.tsx +10 -21
  122. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-boolean/demo.stories.tsx +1 -1
  123. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-currency/demo.stories.tsx +1 -15
  124. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-date/demo.stories.tsx +1 -11
  125. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-date/pega-dxil-my-date.component.spec.ts +1 -1
  126. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-date-time/demo.stories.tsx +1 -12
  127. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-decimal/demo.stories.tsx +1 -1
  128. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-decimal/pega-dxil-my-decimal.component.spec.ts +1 -1
  129. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-email/demo.stories.tsx +1 -1
  130. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-icon-button-url/demo.stories.tsx +10 -21
  131. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-integer/demo.stories.tsx +1 -1
  132. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-paragraph/demo.stories.tsx +1 -1
  133. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-percentage/demo.stories.tsx +1 -1
  134. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-percentage/pega-dxil-my-percentage.component.spec.ts +1 -1
  135. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-phone/demo.stories.tsx +1 -1
  136. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-picklist/demo.stories.tsx +1 -1
  137. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-radiobuttons/demo.stories.tsx +1 -1
  138. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-searchbox/demo.stories.tsx +1 -1
  139. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-text/demo.stories.tsx +1 -1
  140. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-text-input/demo.stories.tsx +1 -1
  141. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-time-of-day/demo.stories.tsx +1 -1
  142. package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-url/demo.stories.tsx +1 -1
  143. package/tests/assets/sdk-a/components/createAll/custom-sdk/template/pega-dxil-my-details/demo.stories.tsx +1 -1
  144. package/tests/assets/sdk-a/components/createAll/custom-sdk/template/pega-dxil-my-form/demo.stories.tsx +9 -17
  145. package/tests/assets/sdk-a/components/createAll/custom-sdk/template/pega-dxil-my-form/mock.ts +19 -1
  146. package/tests/assets/sdk-a/components/createAll/custom-sdk/template/pega-dxil-my-page/demo.stories.tsx +35 -47
  147. package/tests/assets/sdk-a/components/createAll/custom-sdk/template/pega-dxil-my-two-column-details/demo.stories.tsx +1 -1
  148. package/tests/assets/sdk-a/components/createAll/custom-sdk/template/pega-dxil-my-two-column-form/demo.stories.tsx +7 -16
  149. package/tests/assets/sdk-a/components/createAll/custom-sdk/template/pega-dxil-my-two-column-form/mock.ts +19 -1
  150. package/tests/assets/sdk-a/components/createAll/custom-sdk/widget/pega-dxil-my-case-widget/demo.stories.tsx +7 -17
  151. package/tests/assets/sdk-a/components/createAll/custom-sdk/widget/pega-dxil-my-page-case-widget/demo.stories.tsx +9 -17
  152. package/tests/assets/sdk-a/components/createAll/custom-sdk/widget/pega-dxil-my-page-widget/demo.stories.tsx +7 -10
  153. package/tests/assets/sdk-a/components/createAll/override-sdk/field/user-reference/user-reference.component.html +2 -10
  154. package/tests/assets/sdk-a/components/createAll/override-sdk/field/user-reference/user-reference.component.ts +34 -12
  155. package/tests/assets/sdk-a/components/createAll/override-sdk/infra/view/view.component.ts +15 -1
  156. package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/demo.stories.tsx +3 -0
  157. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +2 -2
  158. package/tests/assets/sdk-r/components/create/override-sdk/field/Phone/Phone.tsx +5 -5
  159. package/tests/assets/sdk-r/components/create/override-sdk/infra/FlowContainer/FlowContainer.tsx +360 -0
  160. package/tests/assets/sdk-r/components/create/override-sdk/infra/FlowContainer/helpers.ts +138 -0
  161. package/tests/assets/sdk-r/components/create/override-sdk/infra/FlowContainer/index.tsx +1 -0
  162. package/tests/assets/sdk-r/components/create/override-sdk/infra/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +68 -0
  163. package/tests/assets/sdk-r/components/create/override-sdk/infra/ModalViewContainer/ListViewActionButtons/index.tsx +1 -0
  164. package/tests/assets/sdk-r/components/create/override-sdk/infra/ModalViewContainer/ModalViewContainer.tsx +345 -0
  165. package/tests/assets/sdk-r/components/create/override-sdk/infra/ModalViewContainer/index.tsx +1 -0
  166. package/tests/assets/sdk-r/components/create/override-sdk/infra/NavBar/NavBar.css +1 -0
  167. package/tests/assets/sdk-r/components/create/override-sdk/infra/Reference/Reference.tsx +52 -0
  168. package/tests/assets/sdk-r/components/create/override-sdk/infra/Reference/index.tsx +1 -0
  169. package/tests/assets/sdk-r/components/create/override-sdk/infra/Region/Region.tsx +17 -0
  170. package/tests/assets/sdk-r/components/create/override-sdk/infra/Region/index.tsx +1 -0
  171. package/tests/assets/sdk-r/components/create/override-sdk/infra/RootContainer/RootContainer.tsx +240 -0
  172. package/tests/assets/sdk-r/components/create/override-sdk/infra/RootContainer/index.tsx +1 -0
  173. package/tests/assets/sdk-r/components/create/override-sdk/infra/SimpleView/SimpleView.tsx +48 -0
  174. package/tests/assets/sdk-r/components/create/override-sdk/infra/SimpleView/helper.ts +125 -0
  175. package/tests/assets/sdk-r/components/create/override-sdk/infra/SimpleView/index.tsx +1 -0
  176. package/tests/assets/sdk-r/components/create/override-sdk/infra/ViewContainer/ViewContainer.tsx +201 -0
  177. package/tests/assets/sdk-r/components/create/override-sdk/infra/ViewContainer/index.tsx +1 -0
  178. package/tests/assets/sdk-r/components/create/override-sdk/template/DynamicTabs/DynamicTabs.tsx +80 -0
  179. package/tests/assets/sdk-r/components/create/override-sdk/template/DynamicTabs/config.json +36 -0
  180. package/tests/assets/sdk-r/components/create/override-sdk/template/DynamicTabs/index.tsx +1 -0
  181. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/ListView.tsx +29 -28
  182. package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +13 -5
  183. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyRadiobuttons/index.tsx +3 -5
  184. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyCaseWidget/index.tsx +2 -2
  185. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +6 -1
  186. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/demo.stories.tsx +3 -0
  187. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/index.tsx +5 -1
  188. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/demo.stories.tsx +3 -0
  189. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/index.tsx +13 -5
  190. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +6 -1
  191. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyEmail/demo.stories.tsx +3 -0
  192. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/index.tsx +1 -1
  193. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/demo.stories.tsx +3 -0
  194. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/demo.stories.tsx +3 -0
  195. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +5 -1
  196. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPhone/demo.stories.tsx +3 -0
  197. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPhone/index.tsx +5 -5
  198. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPicklist/index.tsx +25 -20
  199. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyRadiobuttons/index.tsx +1 -4
  200. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/demo.stories.tsx +3 -0
  201. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/demo.stories.tsx +3 -0
  202. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/index.tsx +1 -1
  203. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyURL/demo.stories.tsx +3 -0
  204. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/index.tsx +7 -2
  205. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/index.tsx +7 -2
  206. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +28 -13
  207. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/index.tsx +5 -5
  208. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/index.tsx +2 -1
  209. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +2 -2
  210. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Phone/Phone.tsx +5 -5
  211. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/FlowContainer/FlowContainer.tsx +360 -0
  212. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/FlowContainer/helpers.ts +138 -0
  213. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/FlowContainer/index.tsx +1 -0
  214. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +68 -0
  215. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/ModalViewContainer/ListViewActionButtons/index.tsx +1 -0
  216. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/ModalViewContainer/ModalViewContainer.tsx +345 -0
  217. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/ModalViewContainer/index.tsx +1 -0
  218. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/NavBar/NavBar.css +1 -0
  219. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Reference/Reference.tsx +52 -0
  220. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Reference/index.tsx +1 -0
  221. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Region/Region.tsx +17 -0
  222. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Region/index.tsx +1 -0
  223. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/RootContainer/RootContainer.tsx +240 -0
  224. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/RootContainer/index.tsx +1 -0
  225. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/SimpleView/SimpleView.tsx +48 -0
  226. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/SimpleView/helper.ts +125 -0
  227. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/SimpleView/index.tsx +1 -0
  228. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/ViewContainer/ViewContainer.tsx +201 -0
  229. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/ViewContainer/index.tsx +1 -0
  230. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DynamicTabs/DynamicTabs.tsx +80 -0
  231. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DynamicTabs/config.json +36 -0
  232. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DynamicTabs/index.tsx +1 -0
  233. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/ListView.tsx +29 -28
  234. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +13 -5
@@ -0,0 +1,360 @@
1
+ /* eslint-disable no-nested-ternary */
2
+
3
+ import { useState, useEffect, useContext } from 'react';
4
+ import makeStyles from '@mui/styles/makeStyles';
5
+ import { Alert, Card, CardHeader, Avatar, Typography } from '@mui/material';
6
+
7
+ import StoreContext from '@pega/react-sdk-components/lib/bridge/Context/StoreContext';
8
+ import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
9
+ import { isContainerInitialized } from '@pega/react-sdk-components/lib/components/helpers';
10
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
11
+ import { withSimpleViewContainerRenderer } from '../SimpleView/SimpleView';
12
+
13
+ import { addContainerItem, getToDoAssignments, showBanner, hasContainerItems } from './helpers';
14
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
15
+ import { LocalizationProvider } from '@mui/x-date-pickers';
16
+ import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
17
+
18
+ interface FlowContainerProps extends PConnProps {
19
+ // If any, enter additional props that only exist on this component
20
+ pageMessages: any[];
21
+ rootViewElement: React.ReactNode;
22
+ getPConnectOfActiveContainerItem: Function;
23
+ assignmentNames: string[];
24
+ activeContainerItemID: string;
25
+ }
26
+
27
+ //
28
+ // WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
29
+ // Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
30
+ // is totally at your own risk.
31
+ //
32
+
33
+ const useStyles = makeStyles(theme => ({
34
+ root: {
35
+ paddingRight: theme.spacing(2),
36
+ paddingLeft: theme.spacing(2),
37
+ paddingTop: theme.spacing(1.5),
38
+ paddingBottom: theme.spacing(1.5),
39
+ marginRight: theme.spacing(1),
40
+ marginLeft: theme.spacing(1),
41
+ marginTop: theme.spacing(1),
42
+ marginBottom: theme.spacing(1)
43
+ },
44
+ alert: {
45
+ marginRight: theme.spacing(1),
46
+ marginLeft: theme.spacing(1)
47
+ },
48
+ avatar: {
49
+ backgroundColor: theme.palette.primary.light,
50
+ color: theme.palette.getContrastText(theme.palette.primary.light)
51
+ }
52
+ }));
53
+
54
+ export const FlowContainer = (props: FlowContainerProps) => {
55
+ // Get the proper implementation (local or Pega-provided) for these components that are emitted below
56
+ const Assignment = getComponentFromMap('Assignment');
57
+ const ToDo = getComponentFromMap('Todo'); // NOTE: ConstellationJS Engine uses "Todo" and not "ToDo"!!!
58
+ const AlertBanner = getComponentFromMap('AlertBanner');
59
+
60
+ const pCoreConstants = PCore.getConstants();
61
+ const PCoreVersion = PCore.getPCoreVersion();
62
+ const { TODO } = pCoreConstants;
63
+ const todo_headerText = 'To do';
64
+
65
+ const {
66
+ getPConnect: getPConnectOfFlowContainer,
67
+ pageMessages,
68
+ rootViewElement,
69
+ getPConnectOfActiveContainerItem,
70
+ assignmentNames,
71
+ activeContainerItemID: itemKey
72
+ } = props;
73
+
74
+ const { displayOnlyFA } = useContext<any>(StoreContext);
75
+ const pConnectOfFlowContainer = getPConnectOfFlowContainer();
76
+ const isInitialized = isContainerInitialized(pConnectOfFlowContainer);
77
+ const hasItems = isInitialized && hasContainerItems(pConnectOfFlowContainer);
78
+ const getPConnect = getPConnectOfActiveContainerItem || getPConnectOfFlowContainer;
79
+ const thePConn = getPConnect();
80
+ const containerName = assignmentNames && assignmentNames.length > 0 ? assignmentNames[0] : '';
81
+ // const [init, setInit] = useState(true);
82
+ // const [fcState, setFCState] = useState({ hasError: false });
83
+
84
+ const [todo_showTodo, setShowTodo] = useState(false);
85
+ const [todo_caseInfoID, setCaseInfoID] = useState('');
86
+ const [todo_showTodoList, setShowTodoList] = useState(false);
87
+ const [todo_datasource, setTodoDatasource] = useState({});
88
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
89
+ const [todo_context, setTodoContext] = useState('');
90
+
91
+ const [caseMessages, setCaseMessages] = useState('');
92
+ const [bHasCaseMessages, setHasCaseMessages] = useState(false);
93
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
94
+ const [checkSvg, setCheckSvg] = useState('');
95
+
96
+ const [buildName, setBuildName] = useState('');
97
+ const [bShowConfirm, setShowConfirm] = useState(false);
98
+ const localizedVal = PCore.getLocaleUtils().getLocaleValue;
99
+ const localeCategory = 'Messages';
100
+
101
+ const key = `${thePConn.getCaseInfo().getClassName()}!CASE!${thePConn.getCaseInfo().getName()}`.toUpperCase();
102
+ const classes = useStyles();
103
+
104
+ function getBuildName(): string {
105
+ const ourPConn = getPConnect();
106
+
107
+ // let { getPConnect, name } = this.pConn$.pConn;
108
+ const context = ourPConn.getContextName();
109
+ let viewContainerName = ourPConn.getContainerName();
110
+
111
+ if (!viewContainerName) viewContainerName = '';
112
+ return `${context.toUpperCase()}/${viewContainerName.toUpperCase()}`;
113
+ }
114
+
115
+ function getTodoVisibility() {
116
+ const caseViewMode = getPConnect().getValue('context_data.caseViewMode', ''); // 2nd arg empty string until typedefs properly allow optional
117
+ if (caseViewMode && caseViewMode === 'review') {
118
+ return true;
119
+ }
120
+ // eslint-disable-next-line sonarjs/prefer-single-boolean-return
121
+ if (caseViewMode && caseViewMode === 'perform') {
122
+ return false;
123
+ }
124
+
125
+ return true;
126
+ }
127
+
128
+ function initComponent() {
129
+ const ourPConn = getPConnect();
130
+
131
+ // debugging/investigation help
132
+ // console.log(`${ourPConn.getComponentName()}: children update for main draw`);
133
+
134
+ // const oData = ourPConn.getDataObject();
135
+
136
+ // const activeActionLabel = "";
137
+ // const child0_getPConnect = arNewChildren[0].getPConnect();
138
+
139
+ // this.templateName$ = this.configProps$["template"];
140
+
141
+ // debugger;
142
+ setShowTodo(getTodoVisibility());
143
+
144
+ ourPConn.isBoundToState();
145
+
146
+ // debugger;
147
+ setBuildName(getBuildName());
148
+ }
149
+
150
+ useEffect(() => {
151
+ // from WC SDK connectedCallback (mount)
152
+ initComponent();
153
+ }, []);
154
+
155
+ useEffect(() => {
156
+ // @ts-ignore - Property 'getMetadata' is private and only accessible within class 'C11nEnv'
157
+ if (isInitialized && pConnectOfFlowContainer.getMetadata().children && !hasItems) {
158
+ // ensuring not to add container items, if container already has items
159
+ // because during multi doc mode, we will have container items already in store
160
+ addContainerItem(pConnectOfFlowContainer);
161
+ }
162
+ }, [isInitialized, hasItems]);
163
+
164
+ function isCaseWideLocalAction() {
165
+ const ourPConn = getPConnect();
166
+
167
+ const actionID = ourPConn.getValue(pCoreConstants.CASE_INFO.ACTIVE_ACTION_ID, ''); // 2nd arg empty string until typedefs properly allow optional
168
+ const caseActions = ourPConn.getValue(pCoreConstants.CASE_INFO.AVAILABLEACTIONS, ''); // 2nd arg empty string until typedefs properly allow optional
169
+ let bCaseWideAction = false;
170
+ if (caseActions && actionID) {
171
+ const actionObj = caseActions.find(caseAction => caseAction.ID === actionID);
172
+ if (actionObj) {
173
+ bCaseWideAction = actionObj.type === 'Case';
174
+ }
175
+ }
176
+ return bCaseWideAction;
177
+ }
178
+
179
+ function hasChildCaseAssignments() {
180
+ const ourPConn = getPConnect();
181
+
182
+ const childCases = ourPConn.getValue(pCoreConstants.CASE_INFO.CHILD_ASSIGNMENTS, ''); // 2nd arg empty string until typedefs properly allow optional
183
+ // const allAssignments = [];
184
+ // eslint-disable-next-line sonarjs/prefer-single-boolean-return
185
+ if (childCases && childCases.length > 0) {
186
+ return true;
187
+ }
188
+ return false;
189
+ }
190
+
191
+ function hasAssignments() {
192
+ const ourPConn = getPConnect();
193
+
194
+ let bHasAssignments = false;
195
+ const assignmentsList: any[] = ourPConn.getValue(pCoreConstants.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS, ''); // 2nd arg empty string until typedefs properly allow optional
196
+ const isEmbedded = window.location.href.includes('embedded');
197
+ let bAssignmentsForThisOperator = false;
198
+ // 8.7 includes assignments in Assignments List that may be assigned to
199
+ // a different operator. So, see if there are any assignments for
200
+ // the current operator
201
+ if (PCoreVersion?.includes('8.7') || isEmbedded) {
202
+ const thisOperator = PCore.getEnvironmentInfo().getOperatorIdentifier();
203
+ for (const assignment of assignmentsList) {
204
+ if (assignment.assigneeInfo.ID === thisOperator) {
205
+ bAssignmentsForThisOperator = true;
206
+ }
207
+ }
208
+ } else {
209
+ bAssignmentsForThisOperator = true;
210
+ }
211
+ // Bail out if there isn't an assignmentsList
212
+ if (!assignmentsList) {
213
+ return bHasAssignments;
214
+ }
215
+
216
+ const bHasChildCaseAssignments = hasChildCaseAssignments();
217
+
218
+ if (bAssignmentsForThisOperator || bHasChildCaseAssignments || isCaseWideLocalAction()) {
219
+ bHasAssignments = true;
220
+ }
221
+
222
+ return bHasAssignments;
223
+ }
224
+
225
+ // From SDK-WC updateSelf - so do this in useEffect that's run only when the props change...
226
+ useEffect(() => {
227
+ setBuildName(getBuildName());
228
+
229
+ // routingInfo was added as component prop in populateAdditionalProps
230
+ // let routingInfo = this.getComponentProp("routingInfo");
231
+
232
+ let loadingInfo: any;
233
+ try {
234
+ loadingInfo = thePConn.getLoadingStatus(''); // 1st arg empty string until typedefs properly allow optional
235
+ } catch (ex) {
236
+ // eslint-disable-next-line no-console
237
+ console.error(`${thePConn.getComponentName()}: loadingInfo catch block`);
238
+ }
239
+
240
+ // let configProps = this.thePConn.resolveConfigProps(this.thePConn.getConfigProps());
241
+
242
+ if (!loadingInfo) {
243
+ // turn off spinner
244
+ // this.psService.sendMessage(false);
245
+ }
246
+
247
+ const caseViewMode = thePConn.getValue('context_data.caseViewMode', ''); // 2nd arg empty string until typedefs properly allow optional
248
+ const { CASE_INFO: CASE_CONSTS } = pCoreConstants;
249
+ if (caseViewMode && caseViewMode === 'review') {
250
+ setTimeout(() => {
251
+ // updated for 8.7 - 30-Mar-2022
252
+ const todoAssignments = getToDoAssignments(thePConn);
253
+ if (todoAssignments && todoAssignments.length > 0) {
254
+ setCaseInfoID(thePConn.getValue(CASE_CONSTS.CASE_INFO_ID, '')); // 2nd arg empty string until typedefs properly allow optional
255
+ setTodoDatasource({ source: todoAssignments });
256
+ }
257
+ setShowTodo(true);
258
+ setShowTodoList(false);
259
+ }, 100);
260
+ } else if (caseViewMode && caseViewMode === 'perform') {
261
+ // perform
262
+ // debugger;
263
+ setShowTodo(false);
264
+ }
265
+
266
+ // if have caseMessage show message and end
267
+ const theCaseMessages = localizedVal(thePConn.getValue('caseMessages', ''), localeCategory); // 2nd arg empty string until typedefs properly allow optional
268
+
269
+ // caseMessages's behavior has changed in 24.2, and hence it doesn't let Optional Action work.
270
+ // Changing the below condition for now. Was: (theCaseMessages || !hasAssignments())
271
+ if (!hasAssignments()) {
272
+ // Temp fix for 8.7 change: confirmationNote no longer coming through in caseMessages$.
273
+ // So, if we get here and caseMessages$ is empty, use default value in DX API response
274
+ setCaseMessages(theCaseMessages || localizedVal('Thank you! The next step in this case has been routed appropriately.', localeCategory));
275
+ setHasCaseMessages(true);
276
+ setShowConfirm(true);
277
+
278
+ // publish this "assignmentFinished" for mashup, need to get approved as a standard
279
+ // @ts-ignore - second parameter “payload” for publish method should be optional
280
+ PCore.getPubSubUtils().publish('assignmentFinished');
281
+
282
+ // debugger;
283
+ setCheckSvg(Utils.getImageSrc('check', Utils.getSDKStaticConentUrl()));
284
+ } else {
285
+ // debugger;
286
+ setHasCaseMessages(false);
287
+ setShowConfirm(false);
288
+ }
289
+ }, [props]);
290
+
291
+ const caseId = thePConn.getCaseSummary().content.pyID;
292
+ const urgency = getPConnect().getCaseSummary().assignments ? getPConnect().getCaseSummary().assignments?.[0].urgency : '';
293
+ const operatorInitials = Utils.getInitials(PCore.getEnvironmentInfo().getOperatorName());
294
+
295
+ const bShowBanner = showBanner(getPConnect);
296
+
297
+ const displayPageMessages = () => {
298
+ let hasBanner = false;
299
+ const messages = pageMessages ? pageMessages.map(msg => localizedVal(msg.message, 'Messages')) : pageMessages;
300
+ hasBanner = messages && messages.length > 0;
301
+ return hasBanner && <AlertBanner id='flowContainerBanner' variant='urgent' messages={messages} />;
302
+ };
303
+
304
+ return (
305
+ <div style={{ textAlign: 'left' }} id={buildName} className='psdk-flow-container-top'>
306
+ {!bShowConfirm &&
307
+ (!todo_showTodo ? (
308
+ !displayOnlyFA ? (
309
+ <Card className={`${classes.root} psdk-root`}>
310
+ <CardHeader
311
+ id='assignment-header'
312
+ title={<Typography variant='h6'>{localizedVal(containerName, undefined, key)}</Typography>}
313
+ subheader={`${localizedVal('Task in', 'Todo')} ${caseId} \u2022 ${localizedVal('Priority', 'Todo')} ${urgency}`}
314
+ avatar={<Avatar className={`${classes.avatar} psdk-avatar`}>{operatorInitials}</Avatar>}
315
+ />
316
+ {displayPageMessages()}
317
+ <LocalizationProvider dateAdapter={AdapterDayjs}>
318
+ <Assignment getPConnect={getPConnect} itemKey={itemKey}>
319
+ {rootViewElement}
320
+ </Assignment>
321
+ </LocalizationProvider>
322
+ </Card>
323
+ ) : (
324
+ <Card className={`${classes.root} psdk-root`}>
325
+ <Typography variant='h6'>{localizedVal(containerName, undefined, key)}</Typography>
326
+ {displayPageMessages()}
327
+ <LocalizationProvider dateAdapter={AdapterDayjs}>
328
+ <Assignment getPConnect={getPConnect} itemKey={itemKey}>
329
+ {rootViewElement}
330
+ </Assignment>
331
+ </LocalizationProvider>
332
+ </Card>
333
+ )
334
+ ) : (
335
+ <div>
336
+ <ToDo
337
+ key={Math.random()}
338
+ getPConnect={getPConnect}
339
+ caseInfoID={todo_caseInfoID}
340
+ datasource={todo_datasource}
341
+ showTodoList={todo_showTodoList}
342
+ headerText={todo_headerText}
343
+ type={TODO}
344
+ context={todo_context}
345
+ itemKey={itemKey}
346
+ isConfirm
347
+ />
348
+ </div>
349
+ ))}
350
+ {bHasCaseMessages && (
351
+ <div className={`${classes.alert} psdk-alert`}>
352
+ <Alert severity='success'>{caseMessages}</Alert>
353
+ </div>
354
+ )}
355
+ {bShowConfirm && bShowBanner && <div>{rootViewElement}</div>}
356
+ </div>
357
+ );
358
+ };
359
+
360
+ export default withSimpleViewContainerRenderer(FlowContainer);
@@ -0,0 +1,138 @@
1
+ // Moved PCore.getConstants() into each function in which it's used until we can
2
+ // make sure that this code isn't run until PCore is defined (after onPCoreReady)
3
+ // const { CASE_INFO } = PCore.getConstants();
4
+
5
+ export const addContainerItem = pConnect => {
6
+ const containerManager = pConnect.getContainerManager();
7
+ const contextName = pConnect.getContextName(); // here we will get parent context name, as flow container is child of view container
8
+ const caseViewMode = pConnect.getValue('context_data.caseViewMode');
9
+
10
+ let key;
11
+ let flowName;
12
+
13
+ if (caseViewMode !== 'review') {
14
+ const target = contextName.substring(0, contextName.lastIndexOf('_'));
15
+ const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(target);
16
+ const containerItemData = PCore.getContainerUtils().getContainerItemData(target, activeContainerItemID);
17
+
18
+ if (containerItemData) {
19
+ ({ key, flowName } = containerItemData);
20
+ }
21
+ }
22
+
23
+ containerManager.addContainerItem({
24
+ semanticURL: '',
25
+ key,
26
+ flowName,
27
+ caseViewMode: 'perform',
28
+ resourceType: 'ASSIGNMENT',
29
+ data: pConnect.getDataObject(contextName)
30
+ });
31
+ };
32
+
33
+ export const hasContainerItems = pConnect => {
34
+ const contextName = pConnect.getContextName();
35
+ const containerName = pConnect.getContainerName();
36
+ return PCore.getContainerUtils().hasContainerItems(`${contextName}/${containerName}`);
37
+ };
38
+
39
+ export const getActiveCaseActionName = pConnect => {
40
+ const { CASE_INFO } = PCore.getConstants();
41
+ const caseActions = pConnect.getValue(CASE_INFO.CASE_INFO_ACTIONS);
42
+ const activeActionID = pConnect.getValue(CASE_INFO.ACTIVE_ACTION_ID);
43
+ const activeAction = caseActions.find(action => action.ID === activeActionID);
44
+ return activeAction?.name || '';
45
+ };
46
+
47
+ export const getFirstCaseActionName = pConnect => {
48
+ const { CASE_INFO } = PCore.getConstants();
49
+ const caseActions = pConnect.getValue(CASE_INFO.CASE_INFO_ACTIONS);
50
+ return caseActions[0]?.name || '';
51
+ };
52
+
53
+ export const hasNotificationMessages = pConnect => {
54
+ return !!pConnect.getValue('caseMessages');
55
+ };
56
+
57
+ export const isCaseWideLocalAction = pConnect => {
58
+ const { CASE_INFO } = PCore.getConstants();
59
+ const actionID = pConnect.getValue(CASE_INFO.ACTIVE_ACTION_ID);
60
+ const caseActions = pConnect.getValue(CASE_INFO.CASE_INFO_ACTIONS);
61
+ if (caseActions && actionID) {
62
+ const activeAction = caseActions.find(caseAction => caseAction.ID === actionID);
63
+ return activeAction?.type === 'Case';
64
+ }
65
+ return false;
66
+ };
67
+
68
+ export const getChildCaseAssignments = pConnect => {
69
+ const { CASE_INFO } = PCore.getConstants();
70
+ const childCases = pConnect.getValue(CASE_INFO.CHILD_ASSIGNMENTS);
71
+ let allAssignments = [];
72
+ if (childCases && childCases.length > 0) {
73
+ childCases.forEach(({ assignments, Name }) => {
74
+ if (assignments) {
75
+ const childCaseAssignments = assignments.map(assignment => ({
76
+ ...assignment,
77
+ caseName: Name
78
+ }));
79
+ allAssignments = allAssignments.concat(childCaseAssignments);
80
+ }
81
+ });
82
+ }
83
+ return allAssignments;
84
+ };
85
+
86
+ export const hasAssignments = pConnect => {
87
+ const { CASE_INFO } = PCore.getConstants();
88
+ const assignments = pConnect.getValue(CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS);
89
+ const childCasesAssignments = getChildCaseAssignments(pConnect);
90
+
91
+ // eslint-disable-next-line sonarjs/prefer-single-boolean-return
92
+ if (assignments || childCasesAssignments || isCaseWideLocalAction(pConnect)) {
93
+ return true;
94
+ }
95
+ return false;
96
+ };
97
+
98
+ export const showBanner = getPConnect => {
99
+ const pConnect = getPConnect();
100
+ return hasNotificationMessages(pConnect) || !hasAssignments(pConnect);
101
+ };
102
+
103
+ export const showTodo = pConnect => {
104
+ const caseViewMode = pConnect.getValue('context_data.caseViewMode');
105
+ return caseViewMode !== 'perform';
106
+ };
107
+
108
+ export const isRenderWithToDoWrapper = (getPConnect, options) => {
109
+ const pConnect = getPConnect();
110
+ const { showWithToDo } = options;
111
+ return showWithToDo && (!isCaseWideLocalAction(pConnect) || showTodo(pConnect));
112
+ };
113
+
114
+ export const getToDoAssignments = pConnect => {
115
+ const { CASE_INFO } = PCore.getConstants();
116
+ const caseActions = pConnect.getValue(CASE_INFO.CASE_INFO_ACTIONS);
117
+ const assignmentLabel = pConnect.getValue(CASE_INFO.ASSIGNMENT_LABEL);
118
+ const assignments = pConnect.getValue(CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS) || [];
119
+ const childCasesAssignments = getChildCaseAssignments(pConnect) || [];
120
+ let childCasesAssignmentsCopy = JSON.parse(JSON.stringify(childCasesAssignments));
121
+
122
+ childCasesAssignmentsCopy = childCasesAssignmentsCopy.map(assignment => {
123
+ assignment.isChild = true;
124
+ return assignment;
125
+ });
126
+
127
+ const todoAssignments = [...assignments, ...childCasesAssignmentsCopy];
128
+ let todoAssignmentsCopy = JSON.parse(JSON.stringify(todoAssignments));
129
+
130
+ if (caseActions && !showTodo(pConnect)) {
131
+ todoAssignmentsCopy = todoAssignmentsCopy.map(assignment => {
132
+ assignment.name = getActiveCaseActionName(pConnect) || assignmentLabel;
133
+ return assignment;
134
+ });
135
+ }
136
+
137
+ return todoAssignmentsCopy;
138
+ };
@@ -0,0 +1 @@
1
+ export { default } from './FlowContainer';
@@ -0,0 +1,68 @@
1
+ import { useState } from 'react';
2
+ import Button from '@mui/material/Button';
3
+ import makeStyles from '@mui/styles/makeStyles';
4
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
+
6
+ const useStyles = makeStyles((/* theme */) => ({
7
+ button: {
8
+ width: '50%',
9
+ margin: '4px'
10
+ },
11
+ div: {
12
+ display: 'flex',
13
+ margin: '8px'
14
+ }
15
+ }));
16
+
17
+ interface ListViewActionButtonsProps extends PConnProps {
18
+ // If any, enter additional props that only exist on this component
19
+ context: string;
20
+ closeActionsDialog: Function;
21
+ }
22
+
23
+ function ListViewActionButtons(props: ListViewActionButtonsProps) {
24
+ const { getPConnect, context, closeActionsDialog } = props;
25
+ const classes = useStyles();
26
+ const localizedVal = PCore.getLocaleUtils().getLocaleValue;
27
+ const localeCategory = 'Data Object';
28
+ const [isDisabled, setIsDisabled] = useState(false);
29
+
30
+ return (
31
+ <div className={classes.div}>
32
+ <Button
33
+ className={classes.button}
34
+ variant='contained'
35
+ color='secondary'
36
+ onClick={() => {
37
+ getPConnect().getActionsApi().cancelDataObject(context);
38
+ }}
39
+ >
40
+ {localizedVal('Cancel', localeCategory)}
41
+ </Button>
42
+ <Button
43
+ className={classes.button}
44
+ variant='contained'
45
+ color='primary'
46
+ disabled={isDisabled}
47
+ onClick={() => {
48
+ setIsDisabled(true);
49
+ getPConnect()
50
+ .getActionsApi()
51
+ .submitEmbeddedDataModal(context)
52
+ .then(() => {
53
+ setIsDisabled(false);
54
+ closeActionsDialog();
55
+ })
56
+ .catch(err => {
57
+ // eslint-disable-next-line no-console
58
+ console.log(err);
59
+ });
60
+ }}
61
+ >
62
+ {localizedVal('Submit', localeCategory)}
63
+ </Button>
64
+ </div>
65
+ );
66
+ }
67
+
68
+ export default ListViewActionButtons;
@@ -0,0 +1 @@
1
+ export { default } from './ListViewActionButtons';