@pega/react-sdk-components 8.23.10 → 8.23.11-debug2

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 (262) hide show
  1. package/lib/bridge/Context/StoreContext.d.ts +3 -2
  2. package/lib/bridge/Context/StoreContext.d.ts.map +1 -1
  3. package/lib/bridge/Context/StoreContext.js +2 -3
  4. package/lib/bridge/Context/StoreContext.js.map +1 -1
  5. package/lib/bridge/helpers/sdk_component_map.d.ts +1 -0
  6. package/lib/bridge/helpers/sdk_component_map.d.ts.map +1 -1
  7. package/lib/bridge/helpers/sdk_component_map.js +22 -0
  8. package/lib/bridge/helpers/sdk_component_map.js.map +1 -1
  9. package/lib/bridge/react_pconnect.d.ts.map +1 -1
  10. package/lib/bridge/react_pconnect.js +2 -14
  11. package/lib/bridge/react_pconnect.js.map +1 -1
  12. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts +13 -0
  13. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts.map +1 -0
  14. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js +26 -0
  15. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js.map +1 -0
  16. package/lib/components/designSystemExtension/AlertBanner/index.d.ts +2 -0
  17. package/lib/components/designSystemExtension/AlertBanner/index.d.ts.map +1 -0
  18. package/lib/components/designSystemExtension/AlertBanner/index.js +2 -0
  19. package/lib/components/designSystemExtension/AlertBanner/index.js.map +1 -0
  20. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.d.ts.map +1 -1
  21. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js +1 -1
  22. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js.map +1 -1
  23. package/lib/components/designSystemExtension/Operator/Operator.d.ts.map +1 -1
  24. package/lib/components/designSystemExtension/Operator/Operator.js +12 -10
  25. package/lib/components/designSystemExtension/Operator/Operator.js.map +1 -1
  26. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js +2 -2
  27. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js.map +1 -1
  28. package/lib/components/field/CancelAlert/CancelAlert.d.ts.map +1 -1
  29. package/lib/components/field/CancelAlert/CancelAlert.js +9 -7
  30. package/lib/components/field/CancelAlert/CancelAlert.js.map +1 -1
  31. package/lib/components/field/Checkbox/Checkbox.d.ts.map +1 -1
  32. package/lib/components/field/Checkbox/Checkbox.js +3 -3
  33. package/lib/components/field/Checkbox/Checkbox.js.map +1 -1
  34. package/lib/components/field/Currency/currency-utils.d.ts +1 -1
  35. package/lib/components/field/Currency/currency-utils.d.ts.map +1 -1
  36. package/lib/components/field/Currency/currency-utils.js.map +1 -1
  37. package/lib/components/field/Date/Date.d.ts.map +1 -1
  38. package/lib/components/field/Date/Date.js +11 -5
  39. package/lib/components/field/Date/Date.js.map +1 -1
  40. package/lib/components/field/DateTime/DateTime.js +1 -1
  41. package/lib/components/field/DateTime/DateTime.js.map +1 -1
  42. package/lib/components/field/Decimal/Decimal.d.ts.map +1 -1
  43. package/lib/components/field/Decimal/Decimal.js +41 -8
  44. package/lib/components/field/Decimal/Decimal.js.map +1 -1
  45. package/lib/components/field/Dropdown/Dropdown.d.ts.map +1 -1
  46. package/lib/components/field/Dropdown/Dropdown.js +21 -7
  47. package/lib/components/field/Dropdown/Dropdown.js.map +1 -1
  48. package/lib/components/field/Phone/Phone.d.ts.map +1 -1
  49. package/lib/components/field/Phone/Phone.js +2 -1
  50. package/lib/components/field/Phone/Phone.js.map +1 -1
  51. package/lib/components/field/RadioButtons/RadioButtons.d.ts.map +1 -1
  52. package/lib/components/field/RadioButtons/RadioButtons.js +17 -4
  53. package/lib/components/field/RadioButtons/RadioButtons.js.map +1 -1
  54. package/lib/components/field/SemanticLink/utils.d.ts.map +1 -1
  55. package/lib/components/field/SemanticLink/utils.js.map +1 -1
  56. package/lib/components/field/TextInput/TextInput.d.ts.map +1 -1
  57. package/lib/components/field/TextInput/TextInput.js +20 -3
  58. package/lib/components/field/TextInput/TextInput.js.map +1 -1
  59. package/lib/components/field/Time/Time.d.ts.map +1 -1
  60. package/lib/components/field/Time/Time.js +6 -2
  61. package/lib/components/field/Time/Time.js.map +1 -1
  62. package/lib/components/field/URL/URL.d.ts.map +1 -1
  63. package/lib/components/field/URL/URL.js +6 -2
  64. package/lib/components/field/URL/URL.js.map +1 -1
  65. package/lib/components/field/UserReference/UserReference.d.ts.map +1 -1
  66. package/lib/components/field/UserReference/UserReference.js.map +1 -1
  67. package/lib/components/helpers/attachmentHelpers.d.ts +5 -5
  68. package/lib/components/helpers/attachmentHelpers.d.ts.map +1 -1
  69. package/lib/components/helpers/attachmentHelpers.js +2 -2
  70. package/lib/components/helpers/attachmentHelpers.js.map +1 -1
  71. package/lib/components/helpers/auth.d.ts.map +1 -1
  72. package/lib/components/helpers/auth.js +13 -3
  73. package/lib/components/helpers/auth.js.map +1 -1
  74. package/lib/components/helpers/authManager.d.ts.map +1 -1
  75. package/lib/components/helpers/authManager.js +15 -12
  76. package/lib/components/helpers/authManager.js.map +1 -1
  77. package/lib/components/helpers/case-utils.d.ts +20 -0
  78. package/lib/components/helpers/case-utils.d.ts.map +1 -0
  79. package/lib/components/helpers/case-utils.js +81 -0
  80. package/lib/components/helpers/case-utils.js.map +1 -0
  81. package/lib/components/helpers/common-utils.d.ts +2 -0
  82. package/lib/components/helpers/common-utils.d.ts.map +1 -0
  83. package/lib/components/helpers/common-utils.js +5 -0
  84. package/lib/components/helpers/common-utils.js.map +1 -0
  85. package/lib/components/helpers/config_access.d.ts.map +1 -1
  86. package/lib/components/helpers/config_access.js +75 -82
  87. package/lib/components/helpers/config_access.js.map +1 -1
  88. package/lib/components/helpers/data_page.d.ts.map +1 -1
  89. package/lib/components/helpers/data_page.js.map +1 -1
  90. package/lib/components/helpers/date-format-utils.d.ts.map +1 -1
  91. package/lib/components/helpers/date-format-utils.js +23 -14
  92. package/lib/components/helpers/date-format-utils.js.map +1 -1
  93. package/lib/components/helpers/event-utils.d.ts +1 -1
  94. package/lib/components/helpers/event-utils.d.ts.map +1 -1
  95. package/lib/components/helpers/event-utils.js.map +1 -1
  96. package/lib/components/helpers/field-group-utils.d.ts +15 -2
  97. package/lib/components/helpers/field-group-utils.d.ts.map +1 -1
  98. package/lib/components/helpers/field-group-utils.js +3 -3
  99. package/lib/components/helpers/field-group-utils.js.map +1 -1
  100. package/lib/components/helpers/formatters/Boolean.d.ts +3 -3
  101. package/lib/components/helpers/formatters/Boolean.d.ts.map +1 -1
  102. package/lib/components/helpers/formatters/Boolean.js.map +1 -1
  103. package/lib/components/helpers/formatters/Currency.d.ts.map +1 -1
  104. package/lib/components/helpers/formatters/Currency.js +4 -3
  105. package/lib/components/helpers/formatters/Currency.js.map +1 -1
  106. package/lib/components/helpers/formatters/CurrencyMap.d.ts +1132 -1399
  107. package/lib/components/helpers/formatters/CurrencyMap.d.ts.map +1 -1
  108. package/lib/components/helpers/formatters/CurrencyMap.js.map +1 -1
  109. package/lib/components/helpers/formatters/Date.d.ts.map +1 -1
  110. package/lib/components/helpers/formatters/Date.js +1 -1
  111. package/lib/components/helpers/formatters/Date.js.map +1 -1
  112. package/lib/components/helpers/formatters/common.d.ts +2 -2
  113. package/lib/components/helpers/formatters/common.d.ts.map +1 -1
  114. package/lib/components/helpers/formatters/common.js +4 -5
  115. package/lib/components/helpers/formatters/common.js.map +1 -1
  116. package/lib/components/helpers/formatters/index.d.ts +1 -1
  117. package/lib/components/helpers/formatters/index.d.ts.map +1 -1
  118. package/lib/components/helpers/formatters/index.js.map +1 -1
  119. package/lib/components/helpers/reactContextHelpers.d.ts +3 -2
  120. package/lib/components/helpers/reactContextHelpers.d.ts.map +1 -1
  121. package/lib/components/helpers/reactContextHelpers.js.map +1 -1
  122. package/lib/components/helpers/simpleTableHelpers.d.ts +2 -2
  123. package/lib/components/helpers/simpleTableHelpers.d.ts.map +1 -1
  124. package/lib/components/helpers/simpleTableHelpers.js +5 -2
  125. package/lib/components/helpers/simpleTableHelpers.js.map +1 -1
  126. package/lib/components/helpers/state-utils.d.ts +4 -0
  127. package/lib/components/helpers/state-utils.d.ts.map +1 -0
  128. package/lib/components/helpers/state-utils.js +36 -0
  129. package/lib/components/helpers/state-utils.js.map +1 -0
  130. package/lib/components/helpers/template-utils.d.ts.map +1 -1
  131. package/lib/components/helpers/template-utils.js +0 -1
  132. package/lib/components/helpers/template-utils.js.map +1 -1
  133. package/lib/components/helpers/utils.d.ts +1 -1
  134. package/lib/components/helpers/utils.d.ts.map +1 -1
  135. package/lib/components/helpers/utils.js +9 -3
  136. package/lib/components/helpers/utils.js.map +1 -1
  137. package/lib/components/helpers/versionHelpers.d.ts +0 -6
  138. package/lib/components/helpers/versionHelpers.d.ts.map +1 -1
  139. package/lib/components/helpers/versionHelpers.js +0 -6
  140. package/lib/components/helpers/versionHelpers.js.map +1 -1
  141. package/lib/components/infra/ActionButtons/ActionButtons.d.ts.map +1 -1
  142. package/lib/components/infra/ActionButtons/ActionButtons.js +4 -2
  143. package/lib/components/infra/ActionButtons/ActionButtons.js.map +1 -1
  144. package/lib/components/infra/Assignment/Assignment.d.ts +1 -0
  145. package/lib/components/infra/Assignment/Assignment.d.ts.map +1 -1
  146. package/lib/components/infra/Assignment/Assignment.js +27 -15
  147. package/lib/components/infra/Assignment/Assignment.js.map +1 -1
  148. package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts.map +1 -1
  149. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js +17 -9
  150. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js.map +1 -1
  151. package/lib/components/infra/Containers/FlowContainer/helpers.d.ts +12 -12
  152. package/lib/components/infra/Containers/FlowContainer/helpers.d.ts.map +1 -1
  153. package/lib/components/infra/Containers/FlowContainer/helpers.js +17 -16
  154. package/lib/components/infra/Containers/FlowContainer/helpers.js.map +1 -1
  155. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts.map +1 -1
  156. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js +17 -8
  157. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js.map +1 -1
  158. package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts.map +1 -1
  159. package/lib/components/infra/Containers/ViewContainer/ViewContainer.js +4 -2
  160. package/lib/components/infra/Containers/ViewContainer/ViewContainer.js.map +1 -1
  161. package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts.map +1 -1
  162. package/lib/components/infra/DashboardFilter/DashboardFilter.js.map +1 -1
  163. package/lib/components/infra/DashboardFilter/filterUtils.d.ts.map +1 -1
  164. package/lib/components/infra/DashboardFilter/filterUtils.js.map +1 -1
  165. package/lib/components/infra/DeferLoad/DeferLoad.d.ts.map +1 -1
  166. package/lib/components/infra/DeferLoad/DeferLoad.js.map +1 -1
  167. package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
  168. package/lib/components/infra/ErrorBoundary/ErrorBoundary.js +7 -4
  169. package/lib/components/infra/ErrorBoundary/ErrorBoundary.js.map +1 -1
  170. package/lib/components/infra/MultiStep/MultiStep.js +2 -2
  171. package/lib/components/infra/MultiStep/MultiStep.js.map +1 -1
  172. package/lib/components/infra/NavBar/NavBar.d.ts.map +1 -1
  173. package/lib/components/infra/NavBar/NavBar.js +6 -4
  174. package/lib/components/infra/NavBar/NavBar.js.map +1 -1
  175. package/lib/components/infra/RootContainer/RootContainer.d.ts.map +1 -1
  176. package/lib/components/infra/RootContainer/RootContainer.js +12 -15
  177. package/lib/components/infra/RootContainer/RootContainer.js.map +1 -1
  178. package/lib/components/infra/Stages/Stages.d.ts.map +1 -1
  179. package/lib/components/infra/Stages/Stages.js +2 -1
  180. package/lib/components/infra/Stages/Stages.js.map +1 -1
  181. package/lib/components/infra/View/View.d.ts +1 -1
  182. package/lib/components/infra/View/View.d.ts.map +1 -1
  183. package/lib/components/infra/View/View.js +6 -34
  184. package/lib/components/infra/View/View.js.map +1 -1
  185. package/lib/components/template/AppShell/AppShell.d.ts.map +1 -1
  186. package/lib/components/template/AppShell/AppShell.js +8 -8
  187. package/lib/components/template/AppShell/AppShell.js.map +1 -1
  188. package/lib/components/template/CaseView/CaseView.d.ts +1 -1
  189. package/lib/components/template/CaseView/CaseView.d.ts.map +1 -1
  190. package/lib/components/template/CaseView/CaseView.js +37 -28
  191. package/lib/components/template/CaseView/CaseView.js.map +1 -1
  192. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts +3 -1
  193. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts.map +1 -1
  194. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js +13 -8
  195. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js.map +1 -1
  196. package/lib/components/template/Confirmation/Confirmation.d.ts.map +1 -1
  197. package/lib/components/template/Confirmation/Confirmation.js.map +1 -1
  198. package/lib/components/template/DataReference/DataReference.d.ts.map +1 -1
  199. package/lib/components/template/DataReference/DataReference.js.map +1 -1
  200. package/lib/components/template/DefaultForm/DefaultForm.d.ts.map +1 -1
  201. package/lib/components/template/DefaultForm/DefaultForm.js +9 -5
  202. package/lib/components/template/DefaultForm/DefaultForm.js.map +1 -1
  203. package/lib/components/template/DefaultForm/utils/index.d.ts +3 -0
  204. package/lib/components/template/DefaultForm/utils/index.d.ts.map +1 -0
  205. package/lib/components/template/DefaultForm/utils/index.js +27 -0
  206. package/lib/components/template/DefaultForm/utils/index.js.map +1 -0
  207. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts.map +1 -1
  208. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js +1 -1
  209. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js.map +1 -1
  210. package/lib/components/template/ListView/DefaultViewMeta.d.ts +1 -90
  211. package/lib/components/template/ListView/DefaultViewMeta.d.ts.map +1 -1
  212. package/lib/components/template/ListView/DefaultViewMeta.js.map +1 -1
  213. package/lib/components/template/ListView/ListView.d.ts.map +1 -1
  214. package/lib/components/template/ListView/ListView.js +1 -1
  215. package/lib/components/template/ListView/ListView.js.map +1 -1
  216. package/lib/components/template/ListView/hooks.d.ts.map +1 -1
  217. package/lib/components/template/ListView/hooks.js +0 -1
  218. package/lib/components/template/ListView/hooks.js.map +1 -1
  219. package/lib/components/template/ListView/utils.d.ts +28 -16
  220. package/lib/components/template/ListView/utils.d.ts.map +1 -1
  221. package/lib/components/template/ListView/utils.js +1 -2
  222. package/lib/components/template/ListView/utils.js.map +1 -1
  223. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts.map +1 -1
  224. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.js.map +1 -1
  225. package/lib/components/template/PromotedFilters/PromotedFilters.d.ts.map +1 -1
  226. package/lib/components/template/PromotedFilters/PromotedFilters.js +2 -2
  227. package/lib/components/template/PromotedFilters/PromotedFilters.js.map +1 -1
  228. package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.d.ts.map +1 -1
  229. package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.js.map +1 -1
  230. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts.map +1 -1
  231. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js +3 -3
  232. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js.map +1 -1
  233. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts.map +1 -1
  234. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.js.map +1 -1
  235. package/lib/components/template/SubTabs/tabUtils.d.ts.map +1 -1
  236. package/lib/components/template/SubTabs/tabUtils.js.map +1 -1
  237. package/lib/components/template/WssNavBar/WssNavBar.js +2 -2
  238. package/lib/components/template/WssNavBar/WssNavBar.js.map +1 -1
  239. package/lib/components/widget/Attachment/Attachment.css +15 -3
  240. package/lib/components/widget/Attachment/Attachment.d.ts.map +1 -1
  241. package/lib/components/widget/Attachment/Attachment.js +29 -25
  242. package/lib/components/widget/Attachment/Attachment.js.map +1 -1
  243. package/lib/components/widget/CaseHistory/CaseHistory.js +3 -3
  244. package/lib/components/widget/CaseHistory/CaseHistory.js.map +1 -1
  245. package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts.map +1 -1
  246. package/lib/components/widget/FileUtility/FileUtility/FileUtility.js +17 -17
  247. package/lib/components/widget/FileUtility/FileUtility/FileUtility.js.map +1 -1
  248. package/lib/components/widget/QuickCreate/QuickCreate.d.ts.map +1 -1
  249. package/lib/components/widget/QuickCreate/QuickCreate.js +2 -2
  250. package/lib/components/widget/QuickCreate/QuickCreate.js.map +1 -1
  251. package/lib/components/widget/SummaryItem/SummaryItem.d.ts.map +1 -1
  252. package/lib/components/widget/SummaryItem/SummaryItem.js +2 -2
  253. package/lib/components/widget/SummaryItem/SummaryItem.js.map +1 -1
  254. package/lib/components/widget/ToDo/ToDo.d.ts.map +1 -1
  255. package/lib/components/widget/ToDo/ToDo.js +10 -6
  256. package/lib/components/widget/ToDo/ToDo.js.map +1 -1
  257. package/lib/components_map.d.ts +3 -3
  258. package/lib/components_map.d.ts.map +1 -1
  259. package/lib/components_map.js +819 -818
  260. package/lib/components_map.js.map +1 -1
  261. package/lib/doc/KeyReleaseUpdates.md +44 -9
  262. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"template-utils.js","sourceRoot":"","sources":["../../../src/components/helpers/template-utils.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAInE,MAAM,UAAU,YAAY,CAAC,QAAa;IACxC,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;IAC3C,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,IAAI,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE;QAC9C,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YACzC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,YAAY,KA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CAAC,SAAS,CAAC,YAAY;QAC3C,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAEjE,6DAA6D;IAC7D,MAAM,uBAAuB,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAE9D,yBAAyB;IACzB,IAAI,YAAY,KAAK,UAAU,IAAI,uBAAuB,IAAI,oBAAoB,EAAE,MAAM,EAAE;QAC1F,OAAO,oBAAoB,CAAC;KAC7B;IAED,kBAAkB;IAClB,IAAI,YAAY,KAAK,MAAM,EAAE;QAC3B,OAAO,SAAS,CAAC;KAClB;IAED,kFAAkF;IAClF,IAAI,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC,EAAE;QAC1C,OAAO,SAAS,CAAC;KAClB;IAED,oCAAoC;IACpC,iGAAiG;IACjG,+CAA+C;IAC/C,IAAI,YAAY,KAAK,UAAU,IAAI,YAAY,KAAK,MAAM,EAAE;QAC1D,OAAO,YAAY,CAAC;KACrB;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// This file is adapted from React DX components/template/utils.js\n\ndeclare const PCore: any;\n\nexport function getAllFields(pConnect: any) {\n const metadata = pConnect.getRawMetadata();\n let allFields = [];\n if (metadata.children && metadata.children.map) {\n allFields = metadata.children.map(fields => {\n const children = fields.children instanceof Array ? fields.children : [];\n return children.map(field => field.config);\n });\n }\n return allFields;\n}\n\nexport function filterForFieldValueList(fields: any) {\n return fields\n .filter(({ visibility }) => visibility !== false)\n .map(({ value, label }) => ({\n id: label.toLowerCase(),\n name: label,\n value\n }));\n}\n\n/**\n * Determine if the current view is the view of the case step/assignment.\n * @param {Function} pConnect PConnect object for the component\n */\nexport function getIsAssignmentView(pConnect) {\n // Get caseInfo content from the store which contains the view info about the current assignment/step\n // TODO To be replaced with pConnect.getCaseInfo().getCurrentAssignmentView when it's available\n const assignmentViewClass = pConnect.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_CLASSID);\n const assignmentViewName = pConnect.getValue(PCore.getConstants().CASE_INFO.ASSIGNMENTACTION_ID);\n\n const assignmentViewId = `${assignmentViewName}!${assignmentViewClass}`;\n\n // Get the info about the current view from pConnect\n const currentViewId = `${pConnect.getCurrentView()}!${pConnect.getCurrentClassID()}`;\n\n return assignmentViewId === currentViewId;\n}\n\n/**\n * A hook that gets the instructions content for a view.\n * @param {Function} pConnect PConnect object for the component\n * @param {string} [instructions=\"casestep\"] 'casestep', 'none', or the html content of a Rule-UI-Paragraph rule (processed via core's paragraph annotation handler)\n */\nexport function getInstructions(pConnect, instructions = 'casestep') {\n const caseStepInstructions =\n PCore.getConstants().CASE_INFO.INSTRUCTIONS &&\n pConnect.getValue(PCore.getConstants().CASE_INFO.INSTRUCTIONS);\n\n // Determine if this view is the current assignment/step view\n const isCurrentAssignmentView = getIsAssignmentView(pConnect);\n\n // Case step instructions\n if (instructions === 'casestep' && isCurrentAssignmentView && caseStepInstructions?.length) {\n return caseStepInstructions;\n }\n\n // No instructions\n if (instructions === 'none') {\n return undefined;\n }\n\n // If the annotation wasn't processed correctly, don't return any instruction text\n if (instructions?.startsWith('@PARAGRAPH')) {\n return undefined;\n }\n\n // Custom instructions from the view\n // The raw metadata for `instructions` will be something like '@PARAGRAPH .SomeParagraphRule' but\n // it is evaluated by core logic to the content\n if (instructions !== 'casestep' && instructions !== 'none') {\n return instructions;\n }\n return undefined;\n}\n"]}
1
+ {"version":3,"file":"template-utils.js","sourceRoot":"","sources":["../../../src/components/helpers/template-utils.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,YAAY,CAAC,QAAa;IACxC,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;IAC3C,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,IAAI,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE;QAC9C,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,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Y,GAAG,UAAU;IACjE,MAAM,oBAAoB,GACxB,KAAK,CAAC,YAAY,EAAE,CAAC,SAAS,CAAC,YAAY;QAC3C,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAEjE,6DAA6D;IAC7D,MAAM,uBAAuB,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAE9D,yBAAyB;IACzB,IAAI,YAAY,KAAK,UAAU,IAAI,uBAAuB,IAAI,oBAAoB,EAAE,MAAM,EAAE;QAC1F,OAAO,oBAAoB,CAAC;KAC7B;IAED,kBAAkB;IAClB,IAAI,YAAY,KAAK,MAAM,EAAE;QAC3B,OAAO,SAAS,CAAC;KAClB;IAED,kFAAkF;IAClF,IAAI,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC,EAAE;QAC1C,OAAO,SAAS,CAAC;KAClB;IAED,oCAAoC;IACpC,iGAAiG;IACjG,+CAA+C;IAC/C,IAAI,YAAY,KAAK,UAAU,IAAI,YAAY,KAAK,MAAM,EAAE;QAC1D,OAAO,YAAY,CAAC;KACrB;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// This file is adapted from React DX components/template/utils.js\nimport PCoreType from '@pega/pcore-pconnect-typedefs/types/pcore';\n\ndeclare const PCore: typeof PCoreType;\n\n\nexport function getAllFields(pConnect: any) {\n const metadata = pConnect.getRawMetadata();\n let allFields = [];\n if (metadata.children && metadata.children.map) {\n allFields = metadata.children.map(fields => {\n const children = fields.children instanceof Array ? fields.children : [];\n return children.map(field => field.config);\n });\n }\n return allFields;\n}\n\nexport function filterForFieldValueList(fields: any) {\n return fields\n .filter(({ visibility }) => visibility !== false)\n .map(({ value, label }) => ({\n id: label.toLowerCase(),\n name: label,\n value\n }));\n}\n\n/**\n * Determine if the current view is the view of the case step/assignment.\n * @param {Function} pConnect PConnect object for the component\n */\nexport function getIsAssignmentView(pConnect) {\n // Get caseInfo content from the store which contains the view info about the current assignment/step\n // TODO To be replaced with pConnect.getCaseInfo().getCurrentAssignmentView when it's available\n const assignmentViewClass = pConnect.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_CLASSID);\n const assignmentViewName = pConnect.getValue(PCore.getConstants().CASE_INFO.ASSIGNMENTACTION_ID);\n\n const assignmentViewId = `${assignmentViewName}!${assignmentViewClass}`;\n\n // Get the info about the current view from pConnect\n const currentViewId = `${pConnect.getCurrentView()}!${pConnect.getCurrentClassID()}`;\n\n return assignmentViewId === currentViewId;\n}\n\n/**\n * A hook that gets the instructions content for a view.\n * @param {Function} pConnect PConnect object for the component\n * @param {string} [instructions=\"casestep\"] 'casestep', 'none', or the html content of a Rule-UI-Paragraph rule (processed via core's paragraph annotation handler)\n */\nexport function getInstructions(pConnect, instructions = 'casestep') {\n const caseStepInstructions =\n PCore.getConstants().CASE_INFO.INSTRUCTIONS &&\n pConnect.getValue(PCore.getConstants().CASE_INFO.INSTRUCTIONS);\n\n // Determine if this view is the current assignment/step view\n const isCurrentAssignmentView = getIsAssignmentView(pConnect);\n\n // Case step instructions\n if (instructions === 'casestep' && isCurrentAssignmentView && caseStepInstructions?.length) {\n return caseStepInstructions;\n }\n\n // No instructions\n if (instructions === 'none') {\n return undefined;\n }\n\n // If the annotation wasn't processed correctly, don't return any instruction text\n if (instructions?.startsWith('@PARAGRAPH')) {\n return undefined;\n }\n\n // Custom instructions from the view\n // The raw metadata for `instructions` will be something like '@PARAGRAPH .SomeParagraphRule' but\n // it is evaluated by core logic to the content\n if (instructions !== 'casestep' && instructions !== 'none') {\n return instructions;\n }\n return undefined;\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  export declare class Utils {
2
2
  static lastControlID: number;
3
+ static getSDKStaticConentUrl(): string;
3
4
  static getUniqueControlID(): string;
4
5
  static getOptionList(configProps: any, dataObject: any): Array<any>;
5
6
  static getInitials(userName: string): string;
@@ -12,7 +13,6 @@ export declare class Utils {
12
13
  static getIconFromFileType(fileType: any): string;
13
14
  static getIconForAttachment(attachment: any): any;
14
15
  static getLastChar(text: any): any;
15
- static isEmptyObject(obj: Object): Boolean;
16
16
  static isObject(objValue: any): any;
17
17
  }
18
18
  export default Utils;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/utils.ts"],"names":[],"mappings":"AASA,qBAAa,KAAK;IAChB,MAAM,CAAC,aAAa,EAAE,MAAM,CAAK;IAEjC,MAAM,CAAC,kBAAkB,IAAI,MAAM;IAQnC,MAAM,CAAC,aAAa,CAAC,WAAW,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;IAwCnE,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAoB5C,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IAS3D,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAK7C,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO;IAiB7C,MAAM,CAAC,YAAY,CAAC,OAAO,KAAA,EAAE,UAAU,KAAA;IAuFvC,MAAM,CAAC,gBAAgB,CAAC,WAAW,KAAA,EAAE,UAAU,KAAA;IA4E/C,MAAM,CAAC,UAAU,CAAC,KAAK,KAAA,GAAG,GAAG;IAI7B,MAAM,CAAC,mBAAmB,CAAC,QAAQ,KAAA,GAAG,MAAM;IA2B5C,MAAM,CAAC,oBAAoB,CAAC,UAAU,KAAA;IAetC,MAAM,CAAC,WAAW,CAAC,IAAI,KAAA;IAIvB,MAAM,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI1C,MAAM,CAAC,QAAQ,CAAC,QAAQ,KAAA;CAGzB;AAED,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/utils.ts"],"names":[],"mappings":"AAUA,qBAAa,KAAK;IAChB,MAAM,CAAC,aAAa,EAAE,MAAM,CAAK;IAEjC,MAAM,CAAC,qBAAqB;IAW5B,MAAM,CAAC,kBAAkB,IAAI,MAAM;IAQnC,MAAM,CAAC,aAAa,CAAC,WAAW,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;IAwCnE,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAoB5C,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IAS3D,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAK7C,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO;IAiB7C,MAAM,CAAC,YAAY,CAAC,OAAO,KAAA,EAAE,UAAU,KAAA;IAuFvC,MAAM,CAAC,gBAAgB,CAAC,WAAW,KAAA,EAAE,UAAU,KAAA;IA4E/C,MAAM,CAAC,UAAU,CAAC,KAAK,KAAA,GAAG,GAAG;IAI7B,MAAM,CAAC,mBAAmB,CAAC,QAAQ,KAAA,GAAG,MAAM;IA2B5C,MAAM,CAAC,oBAAoB,CAAC,UAAU,KAAA;IAetC,MAAM,CAAC,WAAW,CAAC,IAAI,KAAA;IAIvB,MAAM,CAAC,QAAQ,CAAC,QAAQ,KAAA;CAGzB;AAED,eAAe,KAAK,CAAC"}
@@ -2,10 +2,19 @@ import dayjs from 'dayjs';
2
2
  import customParseFormat from 'dayjs/plugin/customParseFormat';
3
3
  import localizedFormat from 'dayjs/plugin/localizedFormat';
4
4
  import relativeTime from 'dayjs/plugin/relativeTime';
5
+ import { SdkConfigAccess } from './config_access';
5
6
  dayjs.extend(customParseFormat);
6
7
  dayjs.extend(localizedFormat);
7
8
  dayjs.extend(relativeTime);
8
9
  export class Utils {
10
+ static getSDKStaticConentUrl() {
11
+ const sdkConfigServer = SdkConfigAccess.getSdkConfigServer();
12
+ // NOTE: Needs a trailing slash! So add one if not provided
13
+ if (!sdkConfigServer.sdkContentServerUrl.endsWith('/')) {
14
+ sdkConfigServer.sdkContentServerUrl = `${sdkConfigServer.sdkContentServerUrl}/`;
15
+ }
16
+ return `${sdkConfigServer.sdkContentServerUrl}constellation/`;
17
+ }
9
18
  static getUniqueControlID() {
10
19
  const sPrefix = 'control-';
11
20
  this.lastControlID += 1;
@@ -293,9 +302,6 @@ export class Utils {
293
302
  static getLastChar(text) {
294
303
  return text.charAt(text.length - 1);
295
304
  }
296
- static isEmptyObject(obj) {
297
- return Object.keys(obj).length === 0;
298
- }
299
305
  static isObject(objValue) {
300
306
  return objValue && typeof objValue === 'object' && objValue.constructor === Object;
301
307
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/helpers/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,iBAAiB,MAAM,gCAAgC,CAAC;AAC/D,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,YAAY,MAAM,2BAA2B,CAAC;AAErD,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAChC,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;AAC9B,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAE3B,MAAM,OAAO,KAAK;IAGhB,MAAM,CAAC,kBAAkB;QACvB,MAAM,OAAO,GAAG,UAAU,CAAC;QAE3B,IAAI,CAAC,aAAa,IAAI,CAAC,CAAC;QAExB,OAAO,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC;IACjD,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,WAAgB,EAAE,UAAe;QACpD,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;QACtC,IAAI,QAAQ,GAAe,EAAE,CAAC;QAE9B,IAAI,QAAQ,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AC,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,GAAW;QAC9B,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;IACvC,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,QAAQ;QACtB,OAAO,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,WAAW,KAAK,MAAM,CAAC;IACrF,CAAC;;AAhUM;;;;WAAwB,CAAC;GAAC;AAmUnC,eAAe,KAAK,CAAC","sourcesContent":["import dayjs from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport localizedFormat from 'dayjs/plugin/localizedFormat';\nimport relativeTime from 'dayjs/plugin/relativeTime';\n\ndayjs.extend(customParseFormat);\ndayjs.extend(localizedFormat);\ndayjs.extend(relativeTime);\n\nexport class Utils {\n static lastControlID: number = 0;\n\n static getUniqueControlID(): string {\n const sPrefix = 'control-';\n\n this.lastControlID += 1;\n\n return sPrefix + this.lastControlID.toString();\n }\n\n static getOptionList(configProps: any, dataObject: any): Array<any> {\n const listType = configProps.listType;\n let arReturn: Array<any> = [];\n\n if (listType) {\n switch (listType.toLowerCase()) {\n case 'associated':\n // data source should be an array\n if (typeof configProps.datasource === 'object') {\n arReturn = configProps.datasource;\n }\n break;\n\n case 'datapage':\n // get data page\n // eslint-disable-next-line no-case-declarations\n const dataPage = configProps.datasource;\n if (dataObject[dataPage]) {\n // eslint-disable-next-line no-alert\n alert('need to handle data page');\n } else {\n let listSourceItems = configProps.listOutput;\n if (typeof dataPage === 'object' && !Array.isArray(listSourceItems)) {\n listSourceItems = dataPage.source ? dataPage.source : [];\n }\n (listSourceItems || []).forEach(item => {\n item.value = item.text ? item.text : item.value;\n });\n arReturn = listSourceItems || [];\n }\n break;\n\n default:\n break;\n }\n }\n\n return arReturn;\n }\n\n static getInitials(userName: string): string {\n let userInitials = userName;\n\n if (userName && userName !== '') {\n userInitials = userName.charAt(0);\n\n if (userName.lastIndexOf(' ') > 0) {\n const lastName = userName.substring(userName.lastIndexOf(' ') + 1);\n userInitials += lastName.charAt(0);\n } else if (userName.lastIndexOf('.') > 0) {\n const lastName = userName.substring(userName.lastIndexOf('.') + 1);\n userInitials += lastName.charAt(0);\n }\n } else {\n userInitials = '';\n }\n\n return userInitials.toUpperCase();\n }\n\n static getImageSrc(name: string, serverUrl: string): string {\n let iconName = name.replace('pi-', '').replace('pi ', '').trim();\n if (iconName === 'line-chart') {\n iconName = 'chart-line';\n }\n\n return this.getIconPath(serverUrl).concat(iconName).concat('.svg');\n }\n\n static getIconPath(serverUrl: string): string {\n // Directory in the constellation folder where the icons will be\n return serverUrl.concat('icons/');\n }\n\n static getBooleanValue(inValue: any): boolean {\n let bReturn = false;\n\n if (typeof inValue === 'string') {\n // Experiment with having \"\" be true, too (and \"on\")\n if (inValue.toLowerCase() === 'true' || inValue.toLowerCase() === 'on' || inValue === '') {\n bReturn = true;\n }\n } else {\n bReturn = inValue;\n }\n\n return bReturn;\n }\n\n // Note: Explored using formatters/format but that doesn't do the same as this function. So not possible to just invoke\n // format and do away with all the separate Pega possible dateFormats.\n static generateDate(dateVal, dateFormat) {\n let sReturnDate = dateVal;\n\n if (dateVal === null || dateVal === '') {\n return dateVal;\n }\n\n // VRS: Dont think we need the below line. Commenting out for now. (2020.05.20)\n // dateTimeVal = dateTimeVal.replace(\"GMT\", \"+0000\")\n // Anything else would require a specific String pattern be specified as an argument to the dayjs constructor\n\n // if date has a \".\", then of the format YYYMMDD[T]HHmmss[.]SSS Z, need to change to YYYYMMDD\n if (dateVal.indexOf('.') >= 0) {\n // VRS: Dont think we need the dateVal.replace(\"GMT\", \"+0000\"). Commenting out for now. (2020.05.20)\n // dateVal = dayjs(dateVal.replace(\"GMT\", \"+0000\"), \"YYYYMMDD[T]HHmmss[.]SSS Z\").format(\"YYYYMMDD\");\n // dateVal format appears to be YYYY-MM-DDThh:mm:ss.SSSZ (which is the default dayjs expected format)\n // Don't change the dateVal passed to dayjs (rather just set a default sReturnDate--if that is what we want to do)\n // (better might be just doing that in a default switch block)\n sReturnDate = dayjs(dateVal).format('YYYYMMDD');\n }\n\n switch (dateFormat) {\n case 'Date-Short':\n // 1/1/01\n sReturnDate = dayjs(dateVal).format('M/D/YY');\n break;\n case 'Date-Short-YYYY':\n // 1/1/2001\n sReturnDate = dayjs(dateVal).format('M/D/YYYY');\n break;\n case 'Date-Short-Custom':\n // 01/01/01\n sReturnDate = dayjs(dateVal).format('MM/DD/YY');\n break;\n case 'Date-Short-Custom-YYYY':\n // 01/01/2001\n sReturnDate = dayjs(dateVal).format('L');\n break;\n case 'Date-Medium':\n // Jan 1, 2001\n sReturnDate = dayjs(dateVal).format('ll');\n break;\n case 'Date-DayMonthYear-Custom':\n // 01-Jan-2001\n sReturnDate = dayjs(dateVal).format('DD-MMM-YYYY');\n break;\n case 'Date-Full':\n // Monday, January 1, 2001\n sReturnDate = dayjs(dateVal).format('dddd, MMMM D, YYYY');\n break;\n case 'DateTime-Frame':\n case 'DateTime-Frame-Short':\n case 'DateTime-Since':\n // 2 days, 5 hours ago\n sReturnDate = dayjs(dateVal).fromNow();\n break;\n case 'Date-Long':\n // January 1, 2001\n sReturnDate = dayjs(dateVal).format('MMMM D, YYYY');\n break;\n case 'Date-ISO-8601':\n // 2001/01/01 y/m/d\n sReturnDate = dayjs(dateVal).format('YYYY/MM/DD');\n break;\n case 'Date-Gregorian-1':\n // 01 January, 2001\n sReturnDate = dayjs(dateVal).format('DD MMMM, YYYY');\n break;\n case 'Date-Gregorian-2':\n // January 01, 2001\n sReturnDate = dayjs(dateVal).format('MMMM DD, YYYY');\n break;\n case 'Date-Gregorian-3':\n // 2001, January 01\n sReturnDate = dayjs(dateVal).format('YYYY, MMMM DD');\n break;\n case 'DateTime-Custom':\n break;\n default:\n break;\n }\n\n return sReturnDate;\n }\n\n // Note: Explored using formatters/format but that doesn't do the same as this function. So not possible to just invoke\n // format and do away with all the separate Pega possible dateFormats.\n static generateDateTime(dateTimeVal, dateFormat) {\n let sReturnDate = dateTimeVal;\n\n if (dateTimeVal === null || dateTimeVal === '') {\n return dateTimeVal;\n }\n\n // VRS: Dont think we need the below line. Commenting out for now. (2020.05.20)\n // dateTimeVal = dateTimeVal.replace(\"GMT\", \"+0000\")\n // dateTimeVal format appears to be YYYY-MM-DDThh:mm:ss.SSSZ (which is the default dayjs expected format)\n // Anything else would require a specific String pattern be specified as an argument to the dayjs constructor\n\n switch (dateFormat) {\n case 'DateTime-Short':\n // 1/1/01 1:00 AM\n sReturnDate = dayjs(dateTimeVal).format('M/D/YY h:mm A');\n break;\n case 'DateTime-Short-Custom':\n // 01/01/01 01:00 AM\n sReturnDate = dayjs(dateTimeVal).format('MM/DD/YY hh:mm A');\n break;\n case 'DateTime-Short-YYYY-Custom':\n // 01/01/2001 01:00 AM\n sReturnDate = dayjs(dateTimeVal).format('M/D/YYYY hh:mm A');\n break;\n case 'DateTime-Short-YYYY':\n // 1/1/2001 1:00 AM\n sReturnDate = dayjs(dateTimeVal).format('M/D/YYYY h:mm A');\n break;\n case 'DateTime-Medium':\n // Jan 1, 2001 1:00:00 AM\n sReturnDate = dayjs(dateTimeVal).format('MMM D, YYYY h:mm:ss A');\n break;\n case 'DateTime-Long':\n // January 1, 2001 1:00:00 AM\n sReturnDate = dayjs(dateTimeVal).format('MMMM D, YYYY h:mm:ss A');\n break;\n case 'DateTime-DayMonthYear-Custom':\n // 01-Jan-2001 1:00:00 AM\n sReturnDate = dayjs(dateTimeVal).format('DD-MMM-YYYY h:mm:ss A');\n break;\n case 'DateTime-Full':\n // Monday, January 1, 2001 1:00 AM EDT\n sReturnDate = dayjs(dateTimeVal).format('dddd, MMMM D, YYYY h:mm A z');\n break;\n case 'DateTime-Frame':\n case 'DateTime-Frame-Short':\n case 'DateTime-Since':\n // 2 days, 5 hours ago\n sReturnDate = dayjs(dateTimeVal).fromNow();\n break;\n case 'DateTime-ISO-8601':\n // 2001/01/01 1:00:00 AM y/m/d\n sReturnDate = dayjs(dateTimeVal).format('YYYY/MM/DD h:mm:ss A');\n break;\n case 'DateTime-Gregorian-1':\n // 01 January, 2001 1:00:00 AM\n sReturnDate = dayjs(dateTimeVal).format('DD MMMM, YYYY h:mm:ss A');\n break;\n case 'DateTime-Gregorian-2':\n // January 01, 2001 1:00:00 AM\n sReturnDate = dayjs(dateTimeVal).format('MMMM DD, YYYY h:mm:ss A');\n break;\n case 'DateTime-Gregorian-3':\n // 2001, January 01 1:00:00 AM\n sReturnDate = dayjs(dateTimeVal).format('YYYY, MMMM DD h:mm:ss A');\n break;\n case 'DateTime-Custom':\n break;\n default:\n break;\n }\n\n return sReturnDate;\n }\n\n static getSeconds(sTime): any {\n return dayjs(sTime).valueOf();\n }\n\n static getIconFromFileType(fileType): string {\n let icon = 'document-doc';\n if (!fileType) return icon;\n if (fileType.startsWith('audio')) {\n icon = 'audio';\n } else if (fileType.startsWith('video')) {\n icon = 'video';\n } else if (fileType.startsWith('image')) {\n icon = 'picture';\n } else if (fileType.includes('pdf')) {\n icon = 'document-pdf';\n } else {\n const [, subtype] = fileType.split('/');\n const foundMatch = sources => {\n return sources.some(key => subtype.includes(key));\n };\n\n if (foundMatch(['excel', 'spreadsheet'])) {\n icon = 'document-xls';\n } else if (foundMatch(['zip', 'compressed', 'gzip', 'rar', 'tar'])) {\n icon = 'document-compress';\n }\n }\n\n return icon;\n }\n\n static getIconForAttachment(attachment) {\n let icon;\n switch (attachment.type) {\n case 'FILE':\n icon = this.getIconFromFileType(attachment.mimeType);\n break;\n case 'URL':\n icon = 'chain';\n break;\n default:\n icon = 'document-doc';\n }\n return icon;\n }\n\n static getLastChar(text) {\n return text.charAt(text.length - 1);\n }\n\n static isEmptyObject(obj: Object): Boolean {\n return Object.keys(obj).length === 0;\n }\n\n static isObject(objValue) {\n return objValue && typeof objValue === 'object' && objValue.constructor === Object;\n }\n}\n\nexport default Utils;\n"]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AO,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,WAAW,KAAK,MAAM,CAAC;IACrF,CAAC;;AAvUM;;;;WAAwB,CAAC;GAAC;AA0UnC,eAAe,KAAK,CAAC","sourcesContent":["import dayjs from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport localizedFormat from 'dayjs/plugin/localizedFormat';\nimport relativeTime from 'dayjs/plugin/relativeTime';\nimport { SdkConfigAccess } from './config_access';\n\ndayjs.extend(customParseFormat);\ndayjs.extend(localizedFormat);\ndayjs.extend(relativeTime);\n\nexport class Utils {\n static lastControlID: number = 0;\n\n static getSDKStaticConentUrl() {\n const sdkConfigServer = SdkConfigAccess.getSdkConfigServer();\n\n // NOTE: Needs a trailing slash! So add one if not provided\n if (!sdkConfigServer.sdkContentServerUrl.endsWith('/')) {\n sdkConfigServer.sdkContentServerUrl = `${sdkConfigServer.sdkContentServerUrl}/`;\n }\n\n return `${sdkConfigServer.sdkContentServerUrl}constellation/`;\n }\n\n static getUniqueControlID(): string {\n const sPrefix = 'control-';\n\n this.lastControlID += 1;\n\n return sPrefix + this.lastControlID.toString();\n }\n\n static getOptionList(configProps: any, dataObject: any): Array<any> {\n const listType = configProps.listType;\n let arReturn: Array<any> = [];\n\n if (listType) {\n switch (listType.toLowerCase()) {\n case 'associated':\n // data source should be an array\n if (typeof configProps.datasource === 'object') {\n arReturn = configProps.datasource;\n }\n break;\n\n case 'datapage':\n // get data page\n // eslint-disable-next-line no-case-declarations\n const dataPage = configProps.datasource;\n if (dataObject[dataPage]) {\n // eslint-disable-next-line no-alert\n alert('need to handle data page');\n } else {\n let listSourceItems = configProps.listOutput;\n if (typeof dataPage === 'object' && !Array.isArray(listSourceItems)) {\n listSourceItems = dataPage.source ? dataPage.source : [];\n }\n (listSourceItems || []).forEach(item => {\n item.value = item.text ? item.text : item.value;\n });\n arReturn = listSourceItems || [];\n }\n break;\n\n default:\n break;\n }\n }\n\n return arReturn;\n }\n\n static getInitials(userName: string): string {\n let userInitials = userName;\n\n if (userName && userName !== '') {\n userInitials = userName.charAt(0);\n\n if (userName.lastIndexOf(' ') > 0) {\n const lastName = userName.substring(userName.lastIndexOf(' ') + 1);\n userInitials += lastName.charAt(0);\n } else if (userName.lastIndexOf('.') > 0) {\n const lastName = userName.substring(userName.lastIndexOf('.') + 1);\n userInitials += lastName.charAt(0);\n }\n } else {\n userInitials = '';\n }\n\n return userInitials.toUpperCase();\n }\n\n static getImageSrc(name: string, serverUrl: string): string {\n let iconName = name.replace('pi-', '').replace('pi ', '').trim();\n if (iconName === 'line-chart') {\n iconName = 'chart-line';\n }\n\n return this.getIconPath(serverUrl).concat(iconName).concat('.svg');\n }\n\n static getIconPath(serverUrl: string): string {\n // Directory in the constellation folder where the icons will be\n return serverUrl.concat('icons/');\n }\n\n static getBooleanValue(inValue: any): boolean {\n let bReturn = false;\n\n if (typeof inValue === 'string') {\n // Experiment with having \"\" be true, too (and \"on\")\n if (inValue.toLowerCase() === 'true' || inValue.toLowerCase() === 'on' || inValue === '') {\n bReturn = true;\n }\n } else {\n bReturn = inValue;\n }\n\n return bReturn;\n }\n\n // Note: Explored using formatters/format but that doesn't do the same as this function. So not possible to just invoke\n // format and do away with all the separate Pega possible dateFormats.\n static generateDate(dateVal, dateFormat) {\n let sReturnDate = dateVal;\n\n if (dateVal === null || dateVal === '') {\n return dateVal;\n }\n\n // VRS: Dont think we need the below line. Commenting out for now. (2020.05.20)\n // dateTimeVal = dateTimeVal.replace(\"GMT\", \"+0000\")\n // Anything else would require a specific String pattern be specified as an argument to the dayjs constructor\n\n // if date has a \".\", then of the format YYYMMDD[T]HHmmss[.]SSS Z, need to change to YYYYMMDD\n if (dateVal.indexOf('.') >= 0) {\n // VRS: Dont think we need the dateVal.replace(\"GMT\", \"+0000\"). Commenting out for now. (2020.05.20)\n // dateVal = dayjs(dateVal.replace(\"GMT\", \"+0000\"), \"YYYYMMDD[T]HHmmss[.]SSS Z\").format(\"YYYYMMDD\");\n // dateVal format appears to be YYYY-MM-DDThh:mm:ss.SSSZ (which is the default dayjs expected format)\n // Don't change the dateVal passed to dayjs (rather just set a default sReturnDate--if that is what we want to do)\n // (better might be just doing that in a default switch block)\n sReturnDate = dayjs(dateVal).format('YYYYMMDD');\n }\n\n switch (dateFormat) {\n case 'Date-Short':\n // 1/1/01\n sReturnDate = dayjs(dateVal).format('M/D/YY');\n break;\n case 'Date-Short-YYYY':\n // 1/1/2001\n sReturnDate = dayjs(dateVal).format('M/D/YYYY');\n break;\n case 'Date-Short-Custom':\n // 01/01/01\n sReturnDate = dayjs(dateVal).format('MM/DD/YY');\n break;\n case 'Date-Short-Custom-YYYY':\n // 01/01/2001\n sReturnDate = dayjs(dateVal).format('L');\n break;\n case 'Date-Medium':\n // Jan 1, 2001\n sReturnDate = dayjs(dateVal).format('ll');\n break;\n case 'Date-DayMonthYear-Custom':\n // 01-Jan-2001\n sReturnDate = dayjs(dateVal).format('DD-MMM-YYYY');\n break;\n case 'Date-Full':\n // Monday, January 1, 2001\n sReturnDate = dayjs(dateVal).format('dddd, MMMM D, YYYY');\n break;\n case 'DateTime-Frame':\n case 'DateTime-Frame-Short':\n case 'DateTime-Since':\n // 2 days, 5 hours ago\n sReturnDate = dayjs(dateVal).fromNow();\n break;\n case 'Date-Long':\n // January 1, 2001\n sReturnDate = dayjs(dateVal).format('MMMM D, YYYY');\n break;\n case 'Date-ISO-8601':\n // 2001/01/01 y/m/d\n sReturnDate = dayjs(dateVal).format('YYYY/MM/DD');\n break;\n case 'Date-Gregorian-1':\n // 01 January, 2001\n sReturnDate = dayjs(dateVal).format('DD MMMM, YYYY');\n break;\n case 'Date-Gregorian-2':\n // January 01, 2001\n sReturnDate = dayjs(dateVal).format('MMMM DD, YYYY');\n break;\n case 'Date-Gregorian-3':\n // 2001, January 01\n sReturnDate = dayjs(dateVal).format('YYYY, MMMM DD');\n break;\n case 'DateTime-Custom':\n break;\n default:\n break;\n }\n\n return sReturnDate;\n }\n\n // Note: Explored using formatters/format but that doesn't do the same as this function. So not possible to just invoke\n // format and do away with all the separate Pega possible dateFormats.\n static generateDateTime(dateTimeVal, dateFormat) {\n let sReturnDate = dateTimeVal;\n\n if (dateTimeVal === null || dateTimeVal === '') {\n return dateTimeVal;\n }\n\n // VRS: Dont think we need the below line. Commenting out for now. (2020.05.20)\n // dateTimeVal = dateTimeVal.replace(\"GMT\", \"+0000\")\n // dateTimeVal format appears to be YYYY-MM-DDThh:mm:ss.SSSZ (which is the default dayjs expected format)\n // Anything else would require a specific String pattern be specified as an argument to the dayjs constructor\n\n switch (dateFormat) {\n case 'DateTime-Short':\n // 1/1/01 1:00 AM\n sReturnDate = dayjs(dateTimeVal).format('M/D/YY h:mm A');\n break;\n case 'DateTime-Short-Custom':\n // 01/01/01 01:00 AM\n sReturnDate = dayjs(dateTimeVal).format('MM/DD/YY hh:mm A');\n break;\n case 'DateTime-Short-YYYY-Custom':\n // 01/01/2001 01:00 AM\n sReturnDate = dayjs(dateTimeVal).format('M/D/YYYY hh:mm A');\n break;\n case 'DateTime-Short-YYYY':\n // 1/1/2001 1:00 AM\n sReturnDate = dayjs(dateTimeVal).format('M/D/YYYY h:mm A');\n break;\n case 'DateTime-Medium':\n // Jan 1, 2001 1:00:00 AM\n sReturnDate = dayjs(dateTimeVal).format('MMM D, YYYY h:mm:ss A');\n break;\n case 'DateTime-Long':\n // January 1, 2001 1:00:00 AM\n sReturnDate = dayjs(dateTimeVal).format('MMMM D, YYYY h:mm:ss A');\n break;\n case 'DateTime-DayMonthYear-Custom':\n // 01-Jan-2001 1:00:00 AM\n sReturnDate = dayjs(dateTimeVal).format('DD-MMM-YYYY h:mm:ss A');\n break;\n case 'DateTime-Full':\n // Monday, January 1, 2001 1:00 AM EDT\n sReturnDate = dayjs(dateTimeVal).format('dddd, MMMM D, YYYY h:mm A z');\n break;\n case 'DateTime-Frame':\n case 'DateTime-Frame-Short':\n case 'DateTime-Since':\n // 2 days, 5 hours ago\n sReturnDate = dayjs(dateTimeVal).fromNow();\n break;\n case 'DateTime-ISO-8601':\n // 2001/01/01 1:00:00 AM y/m/d\n sReturnDate = dayjs(dateTimeVal).format('YYYY/MM/DD h:mm:ss A');\n break;\n case 'DateTime-Gregorian-1':\n // 01 January, 2001 1:00:00 AM\n sReturnDate = dayjs(dateTimeVal).format('DD MMMM, YYYY h:mm:ss A');\n break;\n case 'DateTime-Gregorian-2':\n // January 01, 2001 1:00:00 AM\n sReturnDate = dayjs(dateTimeVal).format('MMMM DD, YYYY h:mm:ss A');\n break;\n case 'DateTime-Gregorian-3':\n // 2001, January 01 1:00:00 AM\n sReturnDate = dayjs(dateTimeVal).format('YYYY, MMMM DD h:mm:ss A');\n break;\n case 'DateTime-Custom':\n break;\n default:\n break;\n }\n\n return sReturnDate;\n }\n\n static getSeconds(sTime): any {\n return dayjs(sTime).valueOf();\n }\n\n static getIconFromFileType(fileType): string {\n let icon = 'document-doc';\n if (!fileType) return icon;\n if (fileType.startsWith('audio')) {\n icon = 'audio';\n } else if (fileType.startsWith('video')) {\n icon = 'video';\n } else if (fileType.startsWith('image')) {\n icon = 'picture';\n } else if (fileType.includes('pdf')) {\n icon = 'document-pdf';\n } else {\n const [, subtype] = fileType.split('/');\n const foundMatch = sources => {\n return sources.some(key => subtype.includes(key));\n };\n\n if (foundMatch(['excel', 'spreadsheet'])) {\n icon = 'document-xls';\n } else if (foundMatch(['zip', 'compressed', 'gzip', 'rar', 'tar'])) {\n icon = 'document-compress';\n }\n }\n\n return icon;\n }\n\n static getIconForAttachment(attachment) {\n let icon;\n switch (attachment.type) {\n case 'FILE':\n icon = this.getIconFromFileType(attachment.mimeType);\n break;\n case 'URL':\n icon = 'chain';\n break;\n default:\n icon = 'document-doc';\n }\n return icon;\n }\n\n static getLastChar(text) {\n return text.charAt(text.length - 1);\n }\n\n static isObject(objValue) {\n return objValue && typeof objValue === 'object' && objValue.constructor === Object;\n }\n}\n\nexport default Utils;\n"]}
@@ -1,9 +1,3 @@
1
- /**
2
- * versionHelpers.ts
3
- *
4
- * Container helper functions that can identify which version of
5
- * PCore/PConnect is being run
6
- */
7
1
  export declare const sdkVersion = "8.7";
8
2
  export declare function compareSdkPCoreVersions(): void;
9
3
  //# sourceMappingURL=versionHelpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"versionHelpers.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/versionHelpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,UAAU,QAAQ,CAAC;AAEhC,wBAAgB,uBAAuB,SAOtC"}
1
+ {"version":3,"file":"versionHelpers.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/versionHelpers.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU,QAAQ,CAAC;AAEhC,wBAAgB,uBAAuB,SAOtC"}
@@ -1,9 +1,3 @@
1
- /**
2
- * versionHelpers.ts
3
- *
4
- * Container helper functions that can identify which version of
5
- * PCore/PConnect is being run
6
- */
7
1
  export const sdkVersion = "8.7";
8
2
  export function compareSdkPCoreVersions() {
9
3
  // const theConstellationVersion = PCore.getPCoreVersion();
@@ -1 +1 @@
1
- {"version":3,"file":"versionHelpers.js","sourceRoot":"","sources":["../../../src/components/helpers/versionHelpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC;AAEhC,MAAM,UAAU,uBAAuB;IAErC,2DAA2D;IAE3D,sCAAsC;IACtC,OAAO,CAAC,IAAI,CAAC,+BAA+B,KAAK,CAAC,eAAe,EAAE,4DAA4D,CAAC,CAAC;AAEnI,CAAC","sourcesContent":["/**\n * versionHelpers.ts\n *\n * Container helper functions that can identify which version of\n * PCore/PConnect is being run\n */\n\ndeclare const PCore;\n\nexport const sdkVersion = \"8.7\";\n\nexport function compareSdkPCoreVersions() {\n\n // const theConstellationVersion = PCore.getPCoreVersion();\n\n // eslint-disable-next-line no-console\n console.warn(`Using Constellation version ${PCore.getPCoreVersion()}. Ensure this is the same version as your Infinity server.`);\n\n}\n"]}
1
+ {"version":3,"file":"versionHelpers.js","sourceRoot":"","sources":["../../../src/components/helpers/versionHelpers.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC;AAEhC,MAAM,UAAU,uBAAuB;IAErC,2DAA2D;IAE3D,sCAAsC;IACtC,OAAO,CAAC,IAAI,CAAC,+BAA+B,KAAK,CAAC,eAAe,EAAE,4DAA4D,CAAC,CAAC;AAEnI,CAAC","sourcesContent":["/**\n * versionHelpers.ts\n *\n * Container helper functions that can identify which version of\n * PCore/PConnect is being run\n */\nimport PCoreType from '@pega/pcore-pconnect-typedefs/types/pcore';\n\ndeclare const PCore: typeof PCoreType;\n\n\nexport const sdkVersion = \"8.7\";\n\nexport function compareSdkPCoreVersions() {\n\n // const theConstellationVersion = PCore.getPCoreVersion();\n\n // eslint-disable-next-line no-console\n console.warn(`Using Constellation version ${PCore.getPCoreVersion()}. Ensure this is the same version as your Infinity server.`);\n\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionButtons.d.ts","sourceRoot":"","sources":["../../../../src/components/infra/ActionButtons/ActionButtons.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAmBnC,iBAAwB,aAAa,CAAC,KAAK,KAAA,eAoC1C;kBApCuB,aAAa;;;;;;;;;;;eAAb,aAAa"}
1
+ {"version":3,"file":"ActionButtons.d.ts","sourceRoot":"","sources":["../../../../src/components/infra/ActionButtons/ActionButtons.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAsBnC,iBAAwB,aAAa,CAAC,KAAK,KAAA,eAsC1C;kBAtCuB,aAAa;;;;;;;;;;;eAAb,aAAa"}
@@ -15,6 +15,8 @@ const useStyles = makeStyles(( /* theme */) => ({
15
15
  export default function ActionButtons(props) {
16
16
  const { arMainButtons, arSecondaryButtons, onButtonPress } = props;
17
17
  const classes = useStyles();
18
+ const localizedVal = PCore.getLocaleUtils().getLocaleValue;
19
+ const localeCategory = 'Assignment';
18
20
  function _onButtonPress(sAction, sButtonType) {
19
21
  onButtonPress(sAction, sButtonType);
20
22
  }
@@ -23,10 +25,10 @@ export default function ActionButtons(props) {
23
25
  React.createElement(Grid, { container: true, spacing: 4, justifyContent: "space-between" },
24
26
  React.createElement(Grid, { item: true },
25
27
  React.createElement(Grid, { container: true, spacing: 1 }, arSecondaryButtons.map((sButton) => (React.createElement(Grid, { item: true, key: sButton.name },
26
- React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => { _onButtonPress(sButton.jsAction, "secondary"); } }, sButton.name)))))),
28
+ React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => { _onButtonPress(sButton.jsAction, "secondary"); } }, localizedVal(sButton.name, localeCategory))))))),
27
29
  React.createElement(Grid, { item: true },
28
30
  React.createElement(Grid, { container: true, spacing: 1 }, arMainButtons.map((mButton) => (React.createElement(Grid, { item: true, key: mButton.name },
29
- React.createElement(Button, { variant: "contained", color: "primary", onClick: () => { _onButtonPress(mButton.jsAction, "primary"); } }, mButton.name)))))))));
31
+ React.createElement(Button, { variant: "contained", color: "primary", onClick: () => { _onButtonPress(mButton.jsAction, "primary"); } }, localizedVal(mButton.name, localeCategory))))))))));
30
32
  }
31
33
  ActionButtons.propTypes = {
32
34
  arMainButtons: PropTypes.array,
@@ -1 +1 @@
1
- {"version":3,"file":"ActionButtons.js","sourceRoot":"","sources":["../../../../src/components/infra/ActionButtons/ActionButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAIlD,MAAM,SAAS,GAAG,UAAU,CAAC,EAAC,W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AI,IAAC,IAAI,QAAC,GAAG,EAAE,OAAO,CAAC,IAAI;oBAC1B,oBAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,GAAG,EAAE,GAAG,cAAc,CAAC,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAA,CAAA,CAAC,IAAI,OAAO,CAAC,IAAI,CAAU,CAC9H,CACR,CAAC,CACD,CACF,CACF,CAEQ,CAElB,CAAA;AACH,CAAC;AAED,aAAa,CAAC,SAAS,GAAG;IACxB,aAAa,EAAE,SAAS,CAAC,KAAK;IAC9B,kBAAkB,EAAE,SAAS,CAAC,KAAK;IACnC,aAAa,EAAE,SAAS,CAAC,IAAI;IAC7B,8BAA8B;CAC/B,CAAC;AAEF,aAAa,CAAC,YAAY,GAAG;IAC3B,aAAa,EAAE,EAAE;IACjB,kBAAkB,EAAE,EAAE;IACtB,kBAAkB;CACnB,CAAC","sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { makeStyles } from '@material-ui/core/styles';\n\nimport Button from '@material-ui/core/Button';\nimport { Grid, Divider } from \"@material-ui/core\";\n\n\n\nconst useStyles = makeStyles((/* theme */) => ({\n button: {\n padding: \"0px 5px\",\n },\n divider: {\n marginTop: \"10px\",\n marginBottom: \"10px\"\n }\n}));\n\n\nexport default function ActionButtons(props) {\n const { arMainButtons, arSecondaryButtons, onButtonPress } = props;\n const classes = useStyles();\n\n function _onButtonPress(sAction: string, sButtonType: string) {\n\n onButtonPress(sAction, sButtonType);\n }\n\n return (\n <React.Fragment>\n <Divider className={classes.divider}/>\n <Grid container spacing={4} justifyContent=\"space-between\">\n <Grid item>\n <Grid container spacing={1}>\n {arSecondaryButtons.map((sButton) => (\n <Grid item key={sButton.name}>\n <Button variant=\"contained\" color=\"secondary\" onClick={() => { _onButtonPress(sButton.jsAction, \"secondary\")}} >{sButton.name}</Button>\n </Grid>\n ))}\n </Grid>\n </Grid>\n <Grid item>\n <Grid container spacing={1}>\n {arMainButtons.map((mButton) => (\n <Grid item key={mButton.name}>\n <Button variant=\"contained\" color=\"primary\" onClick={() => { _onButtonPress(mButton.jsAction, \"primary\")}} >{mButton.name}</Button>\n </Grid>\n ))}\n </Grid>\n </Grid>\n </Grid>\n\n </React.Fragment>\n\n )\n}\n\nActionButtons.propTypes = {\n arMainButtons: PropTypes.array,\n arSecondaryButtons: PropTypes.array,\n onButtonPress: PropTypes.func\n // buildName: PropTypes.string\n};\n\nActionButtons.defaultProps = {\n arMainButtons: [],\n arSecondaryButtons: []\n // buildName: null\n};\n"]}
1
+ {"version":3,"file":"ActionButtons.js","sourceRoot":"","sources":["../../../../src/components/infra/ActionButtons/ActionButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAOlD,MAAM,SAAS,GAAG,UAAU,CAAC,EAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IAC7C,MAAM,EAAE;QACN,OAAO,EAAE,SAAS;KACnB;IACD,OAAO,EAAE;QACP,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,MAAM;KACrB;CACF,CAAC,CAAC,CAAC;AAGJ,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK;IACzC,MAAM,EAAE,aAAa,EAAE,kBAAkB,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IACnE,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;IAC5B,MAAM,YAAY,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC,cAAc,CAAC;IAC3D,MAAM,cAAc,GAAG,YAAY,CAAC;IAEpC,SAAS,cAAc,CAAC,OAAe,EAAE,WAAmB;QAE1D,a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CAAC,SAAS,GAAG;IACxB,aAAa,EAAE,SAAS,CAAC,KAAK;IAC9B,kBAAkB,EAAE,SAAS,CAAC,KAAK;IACnC,aAAa,EAAE,SAAS,CAAC,IAAI;IAC7B,8BAA8B;CAC/B,CAAC;AAEF,aAAa,CAAC,YAAY,GAAG;IAC3B,aAAa,EAAE,EAAE;IACjB,kBAAkB,EAAE,EAAE;IACtB,kBAAkB;CACnB,CAAC","sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { makeStyles } from '@material-ui/core/styles';\n\nimport Button from '@material-ui/core/Button';\nimport { Grid, Divider } from \"@material-ui/core\";\n\nimport PCoreType from '@pega/pcore-pconnect-typedefs/types/pcore';\n\ndeclare const PCore: typeof PCoreType;\n\n\nconst useStyles = makeStyles((/* theme */) => ({\n button: {\n padding: \"0px 5px\",\n },\n divider: {\n marginTop: \"10px\",\n marginBottom: \"10px\"\n }\n}));\n\n\nexport default function ActionButtons(props) {\n const { arMainButtons, arSecondaryButtons, onButtonPress } = props;\n const classes = useStyles();\n const localizedVal = PCore.getLocaleUtils().getLocaleValue;\n const localeCategory = 'Assignment';\n\n function _onButtonPress(sAction: string, sButtonType: string) {\n\n onButtonPress(sAction, sButtonType);\n }\n\n return (\n <React.Fragment>\n <Divider className={classes.divider}/>\n <Grid container spacing={4} justifyContent=\"space-between\">\n <Grid item>\n <Grid container spacing={1}>\n {arSecondaryButtons.map((sButton) => (\n <Grid item key={sButton.name}>\n <Button variant=\"contained\" color=\"secondary\" onClick={() => { _onButtonPress(sButton.jsAction, \"secondary\")}} >{localizedVal(sButton.name, localeCategory)}</Button>\n </Grid>\n ))}\n </Grid>\n </Grid>\n <Grid item>\n <Grid container spacing={1}>\n {arMainButtons.map((mButton) => (\n <Grid item key={mButton.name}>\n <Button variant=\"contained\" color=\"primary\" onClick={() => { _onButtonPress(mButton.jsAction, \"primary\")}} >{localizedVal(mButton.name, localeCategory)}</Button>\n </Grid>\n ))}\n </Grid>\n </Grid>\n </Grid>\n\n </React.Fragment>\n\n )\n}\n\nActionButtons.propTypes = {\n arMainButtons: PropTypes.array,\n arSecondaryButtons: PropTypes.array,\n onButtonPress: PropTypes.func\n // buildName: PropTypes.string\n};\n\nActionButtons.defaultProps = {\n arMainButtons: [],\n arSecondaryButtons: []\n // buildName: null\n};\n"]}
@@ -7,6 +7,7 @@ declare namespace Assignment {
7
7
  getPConnect: PropTypes.Validator<(...args: any[]) => any>;
8
8
  itemKey: PropTypes.Requireable<string>;
9
9
  isInModal: PropTypes.Requireable<boolean>;
10
+ banners: PropTypes.Requireable<any>;
10
11
  };
11
12
  var defaultProps: {
12
13
  itemKey: null;
@@ -1 +1 @@
1
- {"version":3,"file":"Assignment.d.ts","sourceRoot":"","sources":["../../../../src/components/infra/Assignment/Assignment.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAUnC,iBAAwB,UAAU,CAAC,KAAK,KAAA,eA6QvC;kBA7QuB,UAAU;;;;;;;;;;;;eAAV,UAAU"}
1
+ {"version":3,"file":"Assignment.d.ts","sourceRoot":"","sources":["../../../../src/components/infra/Assignment/Assignment.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAanC,iBAAwB,UAAU,CAAC,KAAK,KAAA,eAsRvC;kBAtRuB,UAAU;;;;;;;;;;;;;eAAV,UAAU"}
@@ -6,7 +6,7 @@ import Snackbar from '@material-ui/core/Snackbar';
6
6
  import IconButton from '@material-ui/core/IconButton';
7
7
  import CloseIcon from '@material-ui/icons/Close';
8
8
  export default function Assignment(props) {
9
- const { getPConnect, children, itemKey, isInModal } = props;
9
+ const { getPConnect, children, itemKey, isInModal, banners } = props;
10
10
  const thePConn = getPConnect();
11
11
  const [bHasNavigation, setHasNavigation] = useState(false);
12
12
  const [actionButtons, setActionButtons] = useState({});
@@ -14,6 +14,9 @@ export default function Assignment(props) {
14
14
  const [arCurrentStepIndicies, setArCurrentStepIndicies] = useState([]);
15
15
  const [arNavigationSteps, setArNavigationSteps] = useState([]);
16
16
  const actionsAPI = thePConn.getActionsApi();
17
+ const localizedVal = PCore.getLocaleUtils().getLocaleValue;
18
+ const localeCategory = 'Assignment';
19
+ const localeReference = `${getPConnect().getCaseInfo().getClassName()}!CASE!${getPConnect().getCaseInfo().getName()}`.toUpperCase();
17
20
  // store off bound functions to above pointers
18
21
  const finishAssignment = actionsAPI.finishAssignment.bind(actionsAPI);
19
22
  const navigateToStep = actionsAPI.navigateToStep.bind(actionsAPI);
@@ -69,7 +72,13 @@ export default function Assignment(props) {
69
72
  else {
70
73
  setIsVertical(false);
71
74
  }
72
- setArNavigationSteps(JSON.parse(JSON.stringify(oCaseInfo.navigation.steps)));
75
+ const steps = JSON.parse(JSON.stringify(oCaseInfo?.navigation?.steps));
76
+ steps.forEach(step => {
77
+ if (step.name) {
78
+ step.name = PCore.getLocaleUtils().getLocaleValue(step.name, undefined, localeReference);
79
+ }
80
+ });
81
+ setArNavigationSteps(steps);
73
82
  setArCurrentStepIndicies(findCurrentIndicies(arNavigationSteps, arCurrentStepIndicies, 0));
74
83
  }
75
84
  }
@@ -101,7 +110,7 @@ export default function Assignment(props) {
101
110
  navigatePromise
102
111
  .then(() => { })
103
112
  .catch(() => {
104
- showToast(`Navigation failed!`);
113
+ showToast(`${localizedVal('Navigation failed!', localeCategory)}`);
105
114
  });
106
115
  break;
107
116
  }
@@ -117,7 +126,7 @@ export default function Assignment(props) {
117
126
  onSaveActionSuccess({ caseType, caseID, assignmentID });
118
127
  })
119
128
  .catch(() => {
120
- showToast('Save failed');
129
+ showToast(`${localizedVal('Save failed', localeCategory)}`);
121
130
  });
122
131
  break;
123
132
  }
@@ -136,7 +145,7 @@ export default function Assignment(props) {
136
145
  publish(PUB_SUB_EVENTS.EVENT_CANCEL, data);
137
146
  })
138
147
  .catch(() => {
139
- showToast(`Cancel failed!`);
148
+ showToast(`${localizedVal('Cancel failed!', localeCategory)}`);
140
149
  });
141
150
  }
142
151
  else {
@@ -146,7 +155,7 @@ export default function Assignment(props) {
146
155
  publish(PUB_SUB_EVENTS.EVENT_CANCEL, data);
147
156
  })
148
157
  .catch(() => {
149
- showToast(`Cancel failed!`);
158
+ showToast(`${localizedVal('Cancel failed!', localeCategory)}`);
150
159
  });
151
160
  }
152
161
  break;
@@ -163,7 +172,7 @@ export default function Assignment(props) {
163
172
  finishPromise
164
173
  .then(() => { })
165
174
  .catch(() => {
166
- showToast(`Submit failed!`);
175
+ showToast(`${localizedVal('Submit failed!', localeCategory)}`);
167
176
  });
168
177
  break;
169
178
  }
@@ -172,13 +181,15 @@ export default function Assignment(props) {
172
181
  }
173
182
  }
174
183
  }
175
- return (React.createElement("div", { id: 'Assignment' }, bHasNavigation ? (React.createElement(React.Fragment, null,
176
- React.createElement(MultiStep, { getPConnect: getPConnect, itemKey: itemKey, actionButtons: actionButtons, onButtonPress: buttonPress, bIsVertical: bIsVertical, arCurrentStepIndicies: arCurrentStepIndicies, arNavigationSteps: arNavigationSteps }, children),
177
- React.createElement(Snackbar, { open: showSnackbar, autoHideDuration: 3000, onClose: handleSnackbarClose, message: snackbarMessage, action: React.createElement(IconButton, { size: 'small', "aria-label": 'close', color: 'inherit', onClick: handleSnackbarClose },
178
- React.createElement(CloseIcon, { fontSize: 'small' })) }))) : (React.createElement(React.Fragment, null,
179
- React.createElement(AssignmentCard, { getPConnect: getPConnect, itemKey: itemKey, actionButtons: actionButtons, onButtonPress: buttonPress }, children),
180
- React.createElement(Snackbar, { open: showSnackbar, autoHideDuration: 3000, onClose: handleSnackbarClose, message: snackbarMessage, action: React.createElement(IconButton, { size: 'small', "aria-label": 'close', color: 'inherit', onClick: handleSnackbarClose },
181
- React.createElement(CloseIcon, { fontSize: 'small' })) })))));
184
+ return (React.createElement("div", { id: 'Assignment' },
185
+ banners,
186
+ bHasNavigation ? (React.createElement(React.Fragment, null,
187
+ React.createElement(MultiStep, { getPConnect: getPConnect, itemKey: itemKey, actionButtons: actionButtons, onButtonPress: buttonPress, bIsVertical: bIsVertical, arCurrentStepIndicies: arCurrentStepIndicies, arNavigationSteps: arNavigationSteps }, children),
188
+ React.createElement(Snackbar, { open: showSnackbar, autoHideDuration: 3000, onClose: handleSnackbarClose, message: snackbarMessage, action: React.createElement(IconButton, { size: 'small', "aria-label": 'close', color: 'inherit', onClick: handleSnackbarClose },
189
+ React.createElement(CloseIcon, { fontSize: 'small' })) }))) : (React.createElement(React.Fragment, null,
190
+ React.createElement(AssignmentCard, { getPConnect: getPConnect, itemKey: itemKey, actionButtons: actionButtons, onButtonPress: buttonPress }, children),
191
+ React.createElement(Snackbar, { open: showSnackbar, autoHideDuration: 3000, onClose: handleSnackbarClose, message: snackbarMessage, action: React.createElement(IconButton, { size: 'small', "aria-label": 'close', color: 'inherit', onClick: handleSnackbarClose },
192
+ React.createElement(CloseIcon, { fontSize: 'small' })) })))));
182
193
  }
183
194
  // From WC SDK
184
195
  // const aHtml = html`
@@ -207,7 +218,8 @@ Assignment.propTypes = {
207
218
  children: PropTypes.node.isRequired,
208
219
  getPConnect: PropTypes.func.isRequired,
209
220
  itemKey: PropTypes.string,
210
- isInModal: PropTypes.bool
221
+ isInModal: PropTypes.bool,
222
+ banners: PropTypes.any
211
223
  // actionButtons: PropTypes.object
212
224
  // buildName: PropTypes.string
213
225
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Assignment.js","sourceRoot":"","sources":["../../../../src/components/infra/Assignment/Assignment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAClD,OAAO,UAAU,MAAM,8BAA8B,CAAC;AACtD,OAAO,SAAS,MAAM,0BAA0B,CAAC;AAIjD,MAAM,CAAC,OAAO,UAAU,UAAU,C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mB,EAC5B,OAAO,EAAE,eAAe,EACxB,MAAM,EACJ,oBAAC,UAAU,IACT,IAAI,EAAC,OAAO,gBACD,OAAO,EAClB,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,mBAAmB;gBAE5B,oBAAC,SAAS,IAAC,QAAQ,EAAC,OAAO,GAAG,CACnB,GAEf,CACa,CAClB,CACG,CACP,CAAC;AACJ,CAAC;AAED,cAAc;AACd,sBAAsB;AACtB,yBAAyB;AACzB,UAAU;AACV,iCAAiC;AACjC,wGAAwG;AACxG,8FAA8F;AAC9F,gGAAgG;AAChG,uDAAuD;AACvD,sEAAsE;AACtE,8BAA8B;AAC9B,8BAA8B;AAC9B,cAAc;AACd,QAAQ;AACR,UAAU;AACV,YAAY;AACZ,iHAAiH;AACjH,gGAAgG;AAChG,yEAAyE;AACzE,uCAAuC;AACvC,kCAAkC;AAClC,eAAe;AACf,KAAK;AAEL,UAAU,CAAC,SAAS,GAAG;IACrB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,WAAW,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACtC,OAAO,EAAE,SAAS,CAAC,MAAM;IACzB,SAAS,EAAE,SAAS,CAAC,IAAI;IACzB,kCAAkC;IAClC,8BAA8B;CAC/B,CAAC;AAEF,UAAU,CAAC,YAAY,GAAG;IACxB,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,KAAK;IAChB,kBAAkB;CACnB,CAAC","sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\n\nimport AssignmentCard from '../AssignmentCard';\nimport MultiStep from '../MultiStep';\nimport Snackbar from '@material-ui/core/Snackbar';\nimport IconButton from '@material-ui/core/IconButton';\nimport CloseIcon from '@material-ui/icons/Close';\n\ndeclare const PCore: any;\n\nexport default function Assignment(props) {\n const { getPConnect, children, itemKey, isInModal } = props;\n const thePConn = getPConnect();\n\n const [bHasNavigation, setHasNavigation] = useState(false);\n const [actionButtons, setActionButtons] = useState({});\n const [bIsVertical, setIsVertical] = useState(false);\n const [arCurrentStepIndicies, setArCurrentStepIndicies] = useState<Array<any>>([]);\n const [arNavigationSteps, setArNavigationSteps] = useState<Array<any>>([]);\n\n const actionsAPI = thePConn.getActionsApi();\n\n // store off bound functions to above pointers\n const finishAssignment = actionsAPI.finishAssignment.bind(actionsAPI);\n const navigateToStep = actionsAPI.navigateToStep.bind(actionsAPI);\n const cancelAssignment = actionsAPI.cancelAssignment.bind(actionsAPI);\n const saveAssignment = actionsAPI.saveAssignment?.bind(actionsAPI);\n const cancelCreateStageAssignment = actionsAPI.cancelCreateStageAssignment.bind(actionsAPI);\n // const showPage = actionsAPI.showPage.bind(actionsAPI);\n\n const [showSnackbar, setShowSnackbar] = useState(false);\n const [snackbarMessage, setSnackbarMessage] = useState('');\n\n function findCurrentIndicies(\n arStepperSteps: Array<any>,\n arIndicies: Array<number>,\n depth: number\n ): Array<number> {\n let count = 0;\n arStepperSteps.forEach(step => {\n if (step.visited_status === 'current') {\n arIndicies[depth] = count;\n\n // add in\n step['step_status'] = '';\n } else if (step.visited_status === 'success') {\n count += 1;\n step.step_status = 'completed';\n } else {\n count += 1;\n step.step_status = '';\n }\n\n if (step.steps) {\n arIndicies = findCurrentIndicies(step.steps, arIndicies, depth + 1);\n }\n });\n\n return arIndicies;\n }\n\n useEffect(() => {\n if (children && children.length > 0) {\n // debugger;\n\n const oWorkItem = children[0].props.getPConnect();\n const oWorkData = oWorkItem.getDataObject();\n const oData = thePConn.getDataObject();\n\n if (oWorkData?.caseInfo && oWorkData.caseInfo.assignments !== null) {\n const oCaseInfo = oData.caseInfo;\n\n if (oCaseInfo && oCaseInfo.actionButtons) {\n setActionButtons(oCaseInfo.actionButtons);\n }\n\n if (oCaseInfo?.navigation /* was oCaseInfo.navigation != null */) {\n setHasNavigation(true);\n\n if (\n oCaseInfo.navigation.template &&\n oCaseInfo.navigation.template.toLowerCase() === 'standard'\n ) {\n setHasNavigation(false);\n } else if (\n oCaseInfo.navigation.template &&\n oCaseInfo.navigation.template.toLowerCase() === 'vertical'\n ) {\n setIsVertical(true);\n } else {\n setIsVertical(false);\n }\n\n setArNavigationSteps(JSON.parse(JSON.stringify(oCaseInfo.navigation.steps)));\n setArCurrentStepIndicies(\n findCurrentIndicies(arNavigationSteps, arCurrentStepIndicies, 0)\n );\n }\n }\n }\n }, [children]);\n\n function showToast(message: string) {\n const theMessage = `Assignment: ${message}`;\n // eslint-disable-next-line no-console\n console.error(theMessage);\n setSnackbarMessage(message);\n setShowSnackbar(true);\n }\n\n function handleSnackbarClose(event: React.SyntheticEvent | React.MouseEvent, reason?: string) {\n if (reason === 'clickaway') {\n return;\n }\n setShowSnackbar(false);\n }\n\n function onSaveActionSuccess(data) {\n actionsAPI.cancelAssignment(itemKey).then(() => {\n PCore.getPubSubUtils().publish(\n PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_SAVED,\n data\n );\n });\n }\n\n function buttonPress(sAction: string, sButtonType: string) {\n if (sButtonType === 'secondary') {\n switch (sAction) {\n case 'navigateToStep': {\n const navigatePromise = navigateToStep('previous', itemKey);\n\n navigatePromise\n .then(() => {})\n .catch(() => {\n showToast(`Navigation failed!`);\n });\n\n break;\n }\n\n case 'saveAssignment': {\n const caseID = thePConn.getCaseInfo().getKey();\n const assignmentID = thePConn.getCaseInfo().getAssignmentID();\n const savePromise = saveAssignment(itemKey);\n\n savePromise\n .then(() => {\n const caseType = thePConn\n .getCaseInfo()\n .c11nEnv.getValue(PCore.getConstants().CASE_INFO.CASE_TYPE_ID);\n onSaveActionSuccess({ caseType, caseID, assignmentID });\n })\n .catch(() => {\n showToast('Save failed');\n });\n\n break;\n }\n\n case 'cancelAssignment': {\n // check if create stage (modal)\n const { PUB_SUB_EVENTS } = PCore.getConstants();\n const { publish } = PCore.getPubSubUtils();\n const isAssignmentInCreateStage = thePConn.getCaseInfo().isAssignmentInCreateStage();\n const isLocalAction =\n thePConn.getCaseInfo().isLocalAction() ||\n (PCore.getConstants().CASE_INFO.IS_LOCAL_ACTION &&\n getPConnect().getValue(PCore.getConstants().CASE_INFO.IS_LOCAL_ACTION));\n if (isAssignmentInCreateStage && isInModal && !isLocalAction) {\n const cancelPromise = cancelCreateStageAssignment(itemKey);\n\n cancelPromise\n .then(data => {\n publish(PUB_SUB_EVENTS.EVENT_CANCEL, data);\n })\n .catch(() => {\n showToast(`Cancel failed!`);\n });\n } else {\n const cancelPromise = cancelAssignment(itemKey);\n\n cancelPromise\n .then(data => {\n publish(PUB_SUB_EVENTS.EVENT_CANCEL, data);\n })\n .catch(() => {\n showToast(`Cancel failed!`);\n });\n }\n break;\n }\n\n default:\n break;\n }\n } else if (sButtonType === 'primary') {\n // eslint-disable-next-line sonarjs/no-small-switch\n switch (sAction) {\n case 'finishAssignment': {\n const finishPromise = finishAssignment(itemKey);\n\n finishPromise\n .then(() => {})\n .catch(() => {\n showToast(`Submit failed!`);\n });\n\n break;\n }\n\n default:\n break;\n }\n }\n }\n\n return (\n <div id='Assignment'>\n {bHasNavigation ? (\n <React.Fragment>\n <MultiStep\n getPConnect={getPConnect}\n itemKey={itemKey}\n actionButtons={actionButtons}\n onButtonPress={buttonPress}\n bIsVertical={bIsVertical}\n arCurrentStepIndicies={arCurrentStepIndicies}\n arNavigationSteps={arNavigationSteps}\n >\n {children}\n </MultiStep>\n <Snackbar\n open={showSnackbar}\n autoHideDuration={3000}\n onClose={handleSnackbarClose}\n message={snackbarMessage}\n action={\n <IconButton\n size='small'\n aria-label='close'\n color='inherit'\n onClick={handleSnackbarClose}\n >\n <CloseIcon fontSize='small' />\n </IconButton>\n }\n />\n </React.Fragment>\n ) : (\n <React.Fragment>\n <AssignmentCard\n getPConnect={getPConnect}\n itemKey={itemKey}\n actionButtons={actionButtons}\n onButtonPress={buttonPress}\n >\n {children}\n </AssignmentCard>\n <Snackbar\n open={showSnackbar}\n autoHideDuration={3000}\n onClose={handleSnackbarClose}\n message={snackbarMessage}\n action={\n <IconButton\n size='small'\n aria-label='close'\n color='inherit'\n onClick={handleSnackbarClose}\n >\n <CloseIcon fontSize='small' />\n </IconButton>\n }\n />\n </React.Fragment>\n )}\n </div>\n );\n}\n\n// From WC SDK\n// const aHtml = html`\n// ${this.bHasNavigation?\n// html`\n// <div class=\"psdk-stepper\">\n// <multi-step-component .pConn=${this.pConn} .arChildren=${this.arChildren} itemKey=${this.itemKey}\n// .arMainButtons=${this.arMainButtons} .arSecondaryButtons=${this.arSecondaryButtons}\n// .bIsVertical=${this.bIsVertical} .arCurrentStepIndicies=${this.arCurrentStepIndicies}\n// .arNavigationSteps=${this.arNavigationSteps}\n// @MultiStepActionButtonClick=\"${this._onActionButtonClick}\">\n// </multi-step-component>\n// <lit-toast></lit-toast>\n// </div>`\n// :\n// html`\n// <div>\n// <assignment-card-component .pConn=${this.pConn} .arChildren=${this.arChildren} itemKey=${this.itemKey}\n// .arMainButtons=${this.arMainButtons} .arSecondaryButtons=${this.arSecondaryButtons}\n// @AssignmentActionButtonClick=\"${this._onActionButtonClick}\">\n// </assignment-card-component>\n// <lit-toast></lit-toast>\n// </div>`}\n// `;\n\nAssignment.propTypes = {\n children: PropTypes.node.isRequired,\n getPConnect: PropTypes.func.isRequired,\n itemKey: PropTypes.string,\n isInModal: PropTypes.bool\n // actionButtons: PropTypes.object\n // buildName: PropTypes.string\n};\n\nAssignment.defaultProps = {\n itemKey: null,\n isInModal: false\n // buildName: null\n};\n"]}
1
+ {"version":3,"file":"Assignment.js","sourceRoot":"","sources":["../../../../src/components/infra/Assignment/Assignment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAClD,OAAO,UAAU,MAAM,8BAA8B,CAAC;AAC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AsE;AACtE,8BAA8B;AAC9B,8BAA8B;AAC9B,cAAc;AACd,QAAQ;AACR,UAAU;AACV,YAAY;AACZ,iHAAiH;AACjH,gGAAgG;AAChG,yEAAyE;AACzE,uCAAuC;AACvC,kCAAkC;AAClC,eAAe;AACf,KAAK;AAEL,UAAU,CAAC,SAAS,GAAG;IACrB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,WAAW,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACtC,OAAO,EAAE,SAAS,CAAC,MAAM;IACzB,SAAS,EAAE,SAAS,CAAC,IAAI;IACzB,OAAO,EAAE,SAAS,CAAC,GAAG;IACtB,kCAAkC;IAClC,8BAA8B;CAC/B,CAAC;AAEF,UAAU,CAAC,YAAY,GAAG;IACxB,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,KAAK;IAChB,kBAAkB;CACnB,CAAC","sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\n\nimport AssignmentCard from '../AssignmentCard';\nimport MultiStep from '../MultiStep';\nimport Snackbar from '@material-ui/core/Snackbar';\nimport IconButton from '@material-ui/core/IconButton';\nimport CloseIcon from '@material-ui/icons/Close';\n\nimport PCoreType from '@pega/pcore-pconnect-typedefs/types/pcore';\n\ndeclare const PCore: typeof PCoreType;\n\n\nexport default function Assignment(props) {\n const { getPConnect, children, itemKey, isInModal, banners } = props;\n const thePConn = getPConnect();\n\n const [bHasNavigation, setHasNavigation] = useState(false);\n const [actionButtons, setActionButtons] = useState({});\n const [bIsVertical, setIsVertical] = useState(false);\n const [arCurrentStepIndicies, setArCurrentStepIndicies] = useState<Array<any>>([]);\n const [arNavigationSteps, setArNavigationSteps] = useState<Array<any>>([]);\n\n const actionsAPI = thePConn.getActionsApi();\n const localizedVal = PCore.getLocaleUtils().getLocaleValue;\n const localeCategory = 'Assignment';\n const localeReference = `${getPConnect().getCaseInfo().getClassName()}!CASE!${getPConnect().getCaseInfo().getName()}`.toUpperCase();\n\n // store off bound functions to above pointers\n const finishAssignment = actionsAPI.finishAssignment.bind(actionsAPI);\n const navigateToStep = actionsAPI.navigateToStep.bind(actionsAPI);\n const cancelAssignment = actionsAPI.cancelAssignment.bind(actionsAPI);\n const saveAssignment = actionsAPI.saveAssignment?.bind(actionsAPI);\n const cancelCreateStageAssignment = actionsAPI.cancelCreateStageAssignment.bind(actionsAPI);\n // const showPage = actionsAPI.showPage.bind(actionsAPI);\n\n const [showSnackbar, setShowSnackbar] = useState(false);\n const [snackbarMessage, setSnackbarMessage] = useState('');\n\n function findCurrentIndicies(\n arStepperSteps: Array<any>,\n arIndicies: Array<number>,\n depth: number\n ): Array<number> {\n let count = 0;\n arStepperSteps.forEach(step => {\n if (step.visited_status === 'current') {\n arIndicies[depth] = count;\n\n // add in\n step['step_status'] = '';\n } else if (step.visited_status === 'success') {\n count += 1;\n step.step_status = 'completed';\n } else {\n count += 1;\n step.step_status = '';\n }\n\n if (step.steps) {\n arIndicies = findCurrentIndicies(step.steps, arIndicies, depth + 1);\n }\n });\n\n return arIndicies;\n }\n\n useEffect(() => {\n if (children && children.length > 0) {\n // debugger;\n\n const oWorkItem = children[0].props.getPConnect();\n const oWorkData = oWorkItem.getDataObject();\n const oData = thePConn.getDataObject();\n\n if (oWorkData?.caseInfo && oWorkData.caseInfo.assignments !== null) {\n const oCaseInfo = oData.caseInfo;\n\n if (oCaseInfo && oCaseInfo.actionButtons) {\n setActionButtons(oCaseInfo.actionButtons);\n }\n\n if (oCaseInfo?.navigation /* was oCaseInfo.navigation != null */) {\n setHasNavigation(true);\n\n if (\n oCaseInfo.navigation.template &&\n oCaseInfo.navigation.template.toLowerCase() === 'standard'\n ) {\n setHasNavigation(false);\n } else if (\n oCaseInfo.navigation.template &&\n oCaseInfo.navigation.template.toLowerCase() === 'vertical'\n ) {\n setIsVertical(true);\n } else {\n setIsVertical(false);\n }\n const steps = JSON.parse(JSON.stringify(oCaseInfo?.navigation?.steps));\n steps.forEach(step => {\n if (step.name) {\n step.name = PCore.getLocaleUtils().getLocaleValue(step.name, undefined, localeReference);\n }\n });\n setArNavigationSteps(steps);\n setArCurrentStepIndicies(\n findCurrentIndicies(arNavigationSteps, arCurrentStepIndicies, 0)\n );\n }\n }\n }\n }, [children]);\n\n function showToast(message: string) {\n const theMessage = `Assignment: ${message}`;\n // eslint-disable-next-line no-console\n console.error(theMessage);\n setSnackbarMessage(message);\n setShowSnackbar(true);\n }\n\n function handleSnackbarClose(event: React.SyntheticEvent | React.MouseEvent, reason?: string) {\n if (reason === 'clickaway') {\n return;\n }\n setShowSnackbar(false);\n }\n\n function onSaveActionSuccess(data) {\n actionsAPI.cancelAssignment(itemKey).then(() => {\n PCore.getPubSubUtils().publish(\n PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_SAVED,\n data\n );\n });\n }\n\n function buttonPress(sAction: string, sButtonType: string) {\n if (sButtonType === 'secondary') {\n switch (sAction) {\n case 'navigateToStep': {\n const navigatePromise = navigateToStep('previous', itemKey);\n\n navigatePromise\n .then(() => {})\n .catch(() => {\n showToast(`${localizedVal('Navigation failed!', localeCategory)}`);\n });\n\n break;\n }\n\n case 'saveAssignment': {\n const caseID = thePConn.getCaseInfo().getKey();\n const assignmentID = thePConn.getCaseInfo().getAssignmentID();\n const savePromise = saveAssignment(itemKey);\n\n savePromise\n .then(() => {\n const caseType = thePConn\n .getCaseInfo()\n .c11nEnv.getValue(PCore.getConstants().CASE_INFO.CASE_TYPE_ID);\n onSaveActionSuccess({ caseType, caseID, assignmentID });\n })\n .catch(() => {\n showToast(`${localizedVal('Save failed', localeCategory)}`);\n });\n\n break;\n }\n\n case 'cancelAssignment': {\n // check if create stage (modal)\n const { PUB_SUB_EVENTS } = PCore.getConstants();\n const { publish } = PCore.getPubSubUtils();\n const isAssignmentInCreateStage = thePConn.getCaseInfo().isAssignmentInCreateStage();\n const isLocalAction =\n thePConn.getCaseInfo().isLocalAction() ||\n (PCore.getConstants().CASE_INFO.IS_LOCAL_ACTION &&\n getPConnect().getValue(PCore.getConstants().CASE_INFO.IS_LOCAL_ACTION));\n if (isAssignmentInCreateStage && isInModal && !isLocalAction) {\n const cancelPromise = cancelCreateStageAssignment(itemKey);\n\n cancelPromise\n .then(data => {\n publish(PUB_SUB_EVENTS.EVENT_CANCEL, data);\n })\n .catch(() => {\n showToast(`${localizedVal('Cancel failed!', localeCategory)}`);\n });\n } else {\n const cancelPromise = cancelAssignment(itemKey);\n\n cancelPromise\n .then(data => {\n publish(PUB_SUB_EVENTS.EVENT_CANCEL, data);\n })\n .catch(() => {\n showToast(`${localizedVal('Cancel failed!', localeCategory)}`);\n });\n }\n break;\n }\n\n default:\n break;\n }\n } else if (sButtonType === 'primary') {\n // eslint-disable-next-line sonarjs/no-small-switch\n switch (sAction) {\n case 'finishAssignment': {\n const finishPromise = finishAssignment(itemKey);\n\n finishPromise\n .then(() => {})\n .catch(() => {\n showToast(`${localizedVal('Submit failed!', localeCategory)}`);\n });\n\n break;\n }\n\n default:\n break;\n }\n }\n }\n\n return (\n <div id='Assignment'>\n {banners}\n {bHasNavigation ? (\n <React.Fragment>\n <MultiStep\n getPConnect={getPConnect}\n itemKey={itemKey}\n actionButtons={actionButtons}\n onButtonPress={buttonPress}\n bIsVertical={bIsVertical}\n arCurrentStepIndicies={arCurrentStepIndicies}\n arNavigationSteps={arNavigationSteps}\n >\n {children}\n </MultiStep>\n <Snackbar\n open={showSnackbar}\n autoHideDuration={3000}\n onClose={handleSnackbarClose}\n message={snackbarMessage}\n action={\n <IconButton\n size='small'\n aria-label='close'\n color='inherit'\n onClick={handleSnackbarClose}\n >\n <CloseIcon fontSize='small' />\n </IconButton>\n }\n />\n </React.Fragment>\n ) : (\n <React.Fragment>\n <AssignmentCard\n getPConnect={getPConnect}\n itemKey={itemKey}\n actionButtons={actionButtons}\n onButtonPress={buttonPress}\n >\n {children}\n </AssignmentCard>\n <Snackbar\n open={showSnackbar}\n autoHideDuration={3000}\n onClose={handleSnackbarClose}\n message={snackbarMessage}\n action={\n <IconButton\n size='small'\n aria-label='close'\n color='inherit'\n onClick={handleSnackbarClose}\n >\n <CloseIcon fontSize='small' />\n </IconButton>\n }\n />\n </React.Fragment>\n )}\n </div>\n );\n}\n\n// From WC SDK\n// const aHtml = html`\n// ${this.bHasNavigation?\n// html`\n// <div class=\"psdk-stepper\">\n// <multi-step-component .pConn=${this.pConn} .arChildren=${this.arChildren} itemKey=${this.itemKey}\n// .arMainButtons=${this.arMainButtons} .arSecondaryButtons=${this.arSecondaryButtons}\n// .bIsVertical=${this.bIsVertical} .arCurrentStepIndicies=${this.arCurrentStepIndicies}\n// .arNavigationSteps=${this.arNavigationSteps}\n// @MultiStepActionButtonClick=\"${this._onActionButtonClick}\">\n// </multi-step-component>\n// <lit-toast></lit-toast>\n// </div>`\n// :\n// html`\n// <div>\n// <assignment-card-component .pConn=${this.pConn} .arChildren=${this.arChildren} itemKey=${this.itemKey}\n// .arMainButtons=${this.arMainButtons} .arSecondaryButtons=${this.arSecondaryButtons}\n// @AssignmentActionButtonClick=\"${this._onActionButtonClick}\">\n// </assignment-card-component>\n// <lit-toast></lit-toast>\n// </div>`}\n// `;\n\nAssignment.propTypes = {\n children: PropTypes.node.isRequired,\n getPConnect: PropTypes.func.isRequired,\n itemKey: PropTypes.string,\n isInModal: PropTypes.bool,\n banners: PropTypes.any\n // actionButtons: PropTypes.object\n // buildName: PropTypes.string\n};\n\nAssignment.defaultProps = {\n itemKey: null,\n isInModal: false\n // buildName: null\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FlowContainer.d.ts","sourceRoot":"","sources":["../../../../../src/components/infra/Containers/FlowContainer/FlowContainer.tsx"],"names":[],"mappings":";AAGA,OAAO,SAAS,MAAM,YAAY,CAAC;AA6CnC,iBAAwB,aAAa,CAAC,KAAK,KAAA,eAua1C;kBAvauB,aAAa;;;;;;;;;;;;;;;;;;eAAb,aAAa"}
1
+ {"version":3,"file":"FlowContainer.d.ts","sourceRoot":"","sources":["../../../../../src/components/infra/Containers/FlowContainer/FlowContainer.tsx"],"names":[],"mappings":";AAGA,OAAO,SAAS,MAAM,YAAY,CAAC;AAgDnC,iBAAwB,aAAa,CAAC,KAAK,KAAA,eAib1C;kBAjbuB,aAAa;;;;;;;;;;;;;;;;;;eAAb,aAAa"}
@@ -6,13 +6,14 @@ import { makeStyles } from '@material-ui/core/styles';
6
6
  import { Card, CardHeader, Avatar, Typography } from '@material-ui/core';
7
7
  import { Utils } from '../../../helpers/utils';
8
8
  import { Alert } from '@material-ui/lab';
9
- import Assignment from '../../Assignment';
10
- import ToDo from '../../../widget/ToDo';
11
9
  import createPConnectComponent from '../../../../bridge/react_pconnect';
12
10
  import StoreContext from '../../../../bridge/Context/StoreContext';
13
11
  import DayjsUtils from '@date-io/dayjs';
14
12
  import { MuiPickersUtilsProvider } from '@material-ui/pickers';
15
13
  import { addContainerItem, getToDoAssignments, showBanner } from './helpers';
14
+ import { isEmptyObject } from '../../../helpers/common-utils';
15
+ // Need to get correct implementation from component map for Assignment and ToDo
16
+ import { getComponentFromMap } from '../../../../bridge/helpers/sdk_component_map';
16
17
  //
17
18
  // WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
18
19
  // Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
@@ -39,6 +40,9 @@ const useStyles = makeStyles(theme => ({
39
40
  }
40
41
  }));
41
42
  export default function FlowContainer(props) {
43
+ // Get the proper implementation (local or Pega-provided) for these components that are emitted below
44
+ const Assignment = getComponentFromMap("Assignment");
45
+ const ToDo = getComponentFromMap("Todo"); // NOTE: ConstellationJS Engine uses "Todo" and not "ToDo"!!!
42
46
  const pCoreConstants = PCore.getConstants();
43
47
  const { TODO } = pCoreConstants;
44
48
  const todo_headerText = 'To do';
@@ -63,6 +67,10 @@ export default function FlowContainer(props) {
63
67
  const [containerName, setContainerName] = useState('');
64
68
  const [buildName, setBuildName] = useState('');
65
69
  const [bShowConfirm, setShowConfirm] = useState(false);
70
+ const localizedVal = PCore.getLocaleUtils().getLocaleValue;
71
+ const localeCategory = 'Messages';
72
+ const caseInfo = getPConnect().getCaseInfo();
73
+ const localeReference = `${caseInfo?.getClassName()}!CASE!${caseInfo.getName()}`.toUpperCase();
66
74
  const classes = useStyles();
67
75
  function initContainer() {
68
76
  const ourPConn = getPConnect();
@@ -133,7 +141,7 @@ export default function FlowContainer(props) {
133
141
  const oWorkData = oWorkItem.getDataObject();
134
142
  if (bLoadChildren && oWorkData) {
135
143
  // debugger;
136
- setContainerName(oWorkData.caseInfo.assignments?.[0].name);
144
+ setContainerName(localizedVal(oWorkData.caseInfo.assignments?.[0].name, undefined, localeReference));
137
145
  }
138
146
  // debugger;
139
147
  setBuildName(getBuildName());
@@ -248,17 +256,17 @@ export default function FlowContainer(props) {
248
256
  }
249
257
  }
250
258
  // if have caseMessage show message and end
251
- const theCaseMessages = thePConn.getValue('caseMessages');
259
+ const theCaseMessages = localizedVal(thePConn.getValue('caseMessages'), localeCategory);
252
260
  if (theCaseMessages || !hasAssignments()) {
253
261
  // Temp fix for 8.7 change: confirmationNote no longer coming through in caseMessages$.
254
262
  // So, if we get here and caseMessages$ is empty, use default value in DX API response
255
- setCaseMessages(theCaseMessages || 'Thank you! The next step in this case has been routed appropriately.');
263
+ setCaseMessages(theCaseMessages || localizedVal('Thank you! The next step in this case has been routed appropriately.', localeCategory));
256
264
  setHasCaseMessages(true);
257
265
  setShowConfirm(true);
258
266
  // publish this "assignmentFinished" for mashup, need to get approved as a standard
259
267
  PCore.getPubSubUtils().publish('assignmentFinished');
260
268
  // debugger;
261
- setCheckSvg(Utils.getImageSrc('check', PCore.getAssetLoader().getStaticServerUrl()));
269
+ setCheckSvg(Utils.getImageSrc('check', Utils.getSDKStaticConentUrl()));
262
270
  }
263
271
  else {
264
272
  // debugger;
@@ -283,7 +291,7 @@ export default function FlowContainer(props) {
283
291
  currentItems[key] &&
284
292
  currentItems[key].view &&
285
293
  type === 'single' &&
286
- !Utils.isEmptyObject(currentItems[key].view)) {
294
+ !isEmptyObject(currentItems[key].view)) {
287
295
  const currentItem = currentItems[key];
288
296
  const rootView = currentItem.view;
289
297
  const { context } = rootView.config;
@@ -313,7 +321,7 @@ export default function FlowContainer(props) {
313
321
  // check if have oWorkData, there are times due to timing of state change, when this
314
322
  // may not be available
315
323
  if (oWorkData) {
316
- setContainerName(getActiveViewLabel() || oWorkData.caseInfo.assignments?.[0].name);
324
+ setContainerName(localizedVal(getActiveViewLabel() || oWorkData.caseInfo.assignments?.[0].name, undefined, localeReference));
317
325
  }
318
326
  }
319
327
  }
@@ -340,7 +348,7 @@ export default function FlowContainer(props) {
340
348
  instructionText !== '' ? (React.createElement(Typography, { variant: 'caption' }, instructionText)) : null,
341
349
  React.createElement(MuiPickersUtilsProvider, { utils: DayjsUtils },
342
350
  React.createElement(Assignment, { getPConnect: getPConnect, itemKey: itemKey }, arNewChildrenAsReact))))) : (React.createElement("div", null,
343
- React.createElement(ToDo, { getPConnect: getPConnect, caseInfoID: todo_caseInfoID, datasource: todo_datasource, showTodoList: todo_showTodoList, headerText: todo_headerText, type: TODO, context: todo_context, itemKey: itemKey })))),
351
+ React.createElement(ToDo, { key: Math.random(), getPConnect: getPConnect, caseInfoID: todo_caseInfoID, datasource: todo_datasource, showTodoList: todo_showTodoList, headerText: todo_headerText, type: TODO, context: todo_context, itemKey: itemKey })))),
344
352
  bHasCaseMessages && (React.createElement("div", { className: classes.alert },
345
353
  React.createElement(Alert, { severity: 'success' }, caseMessages))),
346
354
  bShowConfirm && bShowBanner && React.createElement("div", null, arNewChildrenAsReact)));