@pega/custom-dx-components 23.1.13 → 24.1.11

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 (236) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/src/cli.js +1 -1
  4. package/src/constants.js +4 -0
  5. package/src/tasks/build-all/helper.js +6 -0
  6. package/src/tasks/build-comp/helper.js +8 -0
  7. package/src/tasks/bundle/builder/webpack.config.js +15 -1
  8. package/src/tasks/create/index.js +3 -0
  9. package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.tsx.mustache +3 -13
  10. package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +8 -5
  11. package/src/tasks/create/templates/Constellation/Field/Date/demo.stories.tsx.mustache +8 -19
  12. package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.tsx.mustache +7 -18
  13. package/src/tasks/create/templates/Constellation/Field/DateTime/mock.ts.mustache +1 -0
  14. package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.tsx.mustache +1 -7
  15. package/src/tasks/create/templates/Constellation/Field/Decimal/mock.ts.mustache +1 -0
  16. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.tsx.mustache +2 -9
  17. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/mock.ts.mustache +2 -0
  18. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.tsx.mustache +2 -6
  19. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/mock.ts.mustache +1 -0
  20. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/PConnProps.d.ts.mustache +46 -0
  21. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/config.json.mustache +64 -0
  22. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/demo.stories.tsx.mustache +104 -0
  23. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/index.tsx.mustache +218 -0
  24. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/mock.ts.mustache +5 -0
  25. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/styles.ts.mustache +8 -0
  26. package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.tsx.mustache +2 -6
  27. package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.tsx.mustache +2 -6
  28. package/src/tasks/create/templates/Constellation/Field/Picklist/mock.ts.mustache +1 -0
  29. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/demo.stories.tsx.mustache +2 -8
  30. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +11 -0
  31. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/utils.ts.mustache +3 -0
  32. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/demo.stories.tsx.mustache +1 -7
  33. package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.tsx.mustache +0 -3
  34. package/src/tasks/create/templates/Constellation/Field/Text/index.tsx.mustache +94 -4
  35. package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.tsx.mustache +1 -5
  36. package/src/tasks/create/templates/Constellation/Field/Text-Input/StatusWork.tsx +3 -9
  37. package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.tsx.mustache +1 -5
  38. package/src/tasks/create/templates/Constellation/Field/Text-Input/mock.ts.mustache +1 -0
  39. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.tsx.mustache +1 -5
  40. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/mock.ts.mustache +1 -0
  41. package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.tsx.mustache +2 -5
  42. package/src/tasks/create/templates/Constellation/Field/Text-Phone/mock.ts.mustache +1 -0
  43. package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.tsx.mustache +1 -5
  44. package/src/tasks/create/templates/Constellation/Field/Text-URL/mock.ts.mustache +1 -0
  45. package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.tsx.mustache +5 -15
  46. package/src/tasks/create/templates/Constellation/Template/DETAILS/Avatar.tsx.mustache +78 -0
  47. package/src/tasks/create/templates/Constellation/Template/DETAILS/DetailsRender.tsx.mustache +55 -0
  48. package/src/tasks/create/templates/Constellation/Template/DETAILS/HighlightRender.tsx.mustache +49 -0
  49. package/src/tasks/create/templates/Constellation/Template/DETAILS/Operator.tsx.mustache +218 -0
  50. package/src/tasks/create/templates/Constellation/Template/DETAILS/StatusWork.tsx.mustache +17 -19
  51. package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.tsx.mustache +79 -25
  52. package/src/tasks/create/templates/Constellation/Template/DETAILS/index.tsx.mustache +51 -40
  53. package/src/tasks/create/templates/Constellation/Template/DETAILS/mock.ts.mustache +78 -20
  54. package/src/tasks/create/templates/Constellation/Template/DETAILS/styles.ts.mustache +16 -0
  55. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Avatar.tsx.mustache +78 -0
  56. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/DetailsRender.tsx.mustache +55 -0
  57. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/HighlightRender.tsx.mustache +49 -0
  58. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Operator.tsx.mustache +218 -0
  59. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/StatusWork.tsx.mustache +17 -19
  60. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.tsx.mustache +96 -27
  61. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.tsx.mustache +42 -39
  62. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/mock.ts.mustache +68 -10
  63. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/styles.ts.mustache +15 -0
  64. package/src/tasks/create/templates/Constellation/Template/FORM/DetailsRender.tsx +59 -0
  65. package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.tsx.mustache +5 -3
  66. package/src/tasks/create/templates/Constellation/Template/FORM/index.tsx.mustache +31 -5
  67. package/src/tasks/create/templates/Constellation/Template/FORM-region/DetailsRender.tsx +59 -0
  68. package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.tsx.mustache +4 -2
  69. package/src/tasks/create/templates/Constellation/Template/FORM-region/index.tsx.mustache +29 -7
  70. package/src/tasks/create/templates/Constellation/Template/PAGE/GetNextWork.tsx.mustache +2 -1
  71. package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.tsx.mustache +4 -3
  72. package/src/tasks/create/templates/Constellation/Template/PAGE/localizations.json.mustache +4 -2
  73. package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.tsx.mustache +3 -2
  74. package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.tsx.mustache +91 -13
  75. package/src/tasks/create/templates/Constellation/Widget/PAGE/index.tsx.mustache +67 -5
  76. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.stories.tsx.mustache +5 -4
  77. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/PConnProps.d.ts.mustache +46 -0
  78. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/config.json.mustache +32 -0
  79. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/demo.stories.tsx.mustache +103 -0
  80. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/index.tsx.mustache +216 -0
  81. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/mock.ts.mustache +5 -0
  82. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/styles.ts.mustache +8 -0
  83. package/src/tasks/create/templates/Launchpad/Widget/PAGE/OneColumnPage.svg +36 -0
  84. package/src/tasks/create/templates/Launchpad/Widget/PAGE/PConnProps.d.ts.mustache +46 -0
  85. package/src/tasks/create/templates/Launchpad/Widget/PAGE/config.json.mustache +59 -0
  86. package/src/tasks/create/templates/Launchpad/Widget/PAGE/demo.stories.tsx.mustache +120 -0
  87. package/src/tasks/create/templates/Launchpad/Widget/PAGE/index.tsx.mustache +109 -0
  88. package/src/tasks/create/templates/Launchpad/Widget/PAGE/mock.ts.mustache +25 -0
  89. package/src/tasks/create/templates/Launchpad/Widget/PAGE/styles.ts.mustache +8 -0
  90. package/src/tasks/create-all/index.js +3 -0
  91. package/src/tasks/init/template/.storybook/preview.js +3 -0
  92. package/src/tasks/init/template/package.json.mustache +6 -6
  93. package/src/tasks/init/template/tsconfig.build.json +3 -1
  94. package/src/tasks/promote-webpack/webpack.config.js +26 -0
  95. package/src/tasks/revert-webpack/index.js +1 -5
  96. package/src/tasks/validator/index.js +7 -1
  97. package/src/util.js +72 -33
  98. package/tests/assets/components/create/Pega_DXIL_MyDetails.zip +0 -0
  99. package/tests/assets/components/create/Pega_DXIL_MyTestText/demo.stories.tsx +0 -3
  100. package/tests/assets/components/create/Pega_DXIL_MyTestText/index.tsx +94 -4
  101. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/demo.stories.tsx +3 -13
  102. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/index.tsx +8 -5
  103. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.stories.tsx +3 -2
  104. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/demo.stories.tsx +2 -9
  105. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/mock.ts +2 -0
  106. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/demo.stories.tsx +8 -19
  107. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/demo.stories.tsx +7 -18
  108. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/mock.ts +1 -0
  109. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/demo.stories.tsx +1 -7
  110. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/mock.ts +1 -0
  111. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/Avatar.tsx +78 -0
  112. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/DetailsRender.tsx +52 -0
  113. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/HighlightRender.tsx +46 -0
  114. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/Operator.tsx +215 -0
  115. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/StatusWork.tsx +17 -19
  116. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx +79 -25
  117. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/index.tsx +48 -37
  118. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/mock.ts +78 -20
  119. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/styles.ts +16 -0
  120. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails.zip +0 -0
  121. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/demo.stories.tsx +1 -5
  122. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/DetailsRender.tsx +59 -0
  123. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/demo.stories.tsx +5 -3
  124. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/index.tsx +28 -5
  125. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/PConnProps.d.ts +46 -0
  126. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/config.json +64 -0
  127. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +104 -0
  128. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/index.tsx +215 -0
  129. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/mock.ts +5 -0
  130. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/styles.ts +8 -0
  131. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/demo.stories.tsx +2 -6
  132. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/GetNextWork.tsx +2 -1
  133. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/demo.stories.tsx +4 -3
  134. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/localizations.json +4 -2
  135. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +5 -4
  136. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.stories.tsx +91 -13
  137. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +67 -5
  138. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/demo.stories.tsx +1 -5
  139. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/mock.ts +1 -0
  140. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/demo.stories.tsx +2 -6
  141. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/mock.ts +1 -0
  142. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/demo.stories.tsx +2 -5
  143. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/mock.ts +1 -0
  144. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/demo.stories.tsx +2 -6
  145. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/mock.ts +1 -0
  146. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyRadioButtons/demo.stories.tsx +1 -7
  147. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/demo.stories.tsx +2 -8
  148. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +11 -0
  149. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/utils.ts +3 -0
  150. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/demo.stories.tsx +0 -3
  151. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/index.tsx +94 -4
  152. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/StatusWork.tsx +3 -9
  153. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/demo.stories.tsx +1 -5
  154. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/mock.ts +1 -0
  155. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +5 -15
  156. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +78 -0
  157. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/DetailsRender.tsx +52 -0
  158. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +46 -0
  159. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/Operator.tsx +215 -0
  160. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +17 -19
  161. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +96 -27
  162. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/index.tsx +39 -36
  163. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/mock.ts +68 -10
  164. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/styles.ts +15 -0
  165. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/DetailsRender.tsx +59 -0
  166. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +4 -2
  167. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/index.tsx +23 -4
  168. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/demo.stories.tsx +1 -5
  169. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/mock.ts +1 -0
  170. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/demo.stories.tsx +3 -13
  171. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/index.tsx +8 -5
  172. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/demo.stories.tsx +2 -9
  173. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/mock.ts +2 -0
  174. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/demo.stories.tsx +8 -19
  175. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/demo.stories.tsx +7 -18
  176. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/mock.ts +1 -0
  177. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/demo.stories.tsx +1 -7
  178. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/mock.ts +1 -0
  179. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/Avatar.tsx +78 -0
  180. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/DetailsRender.tsx +52 -0
  181. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/HighlightRender.tsx +46 -0
  182. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/Operator.tsx +215 -0
  183. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/StatusWork.tsx +17 -19
  184. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.stories.tsx +79 -25
  185. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/index.tsx +48 -37
  186. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/mock.ts +78 -20
  187. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/styles.ts +16 -0
  188. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails.zip +0 -0
  189. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/demo.stories.tsx +1 -5
  190. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/DetailsRender.tsx +59 -0
  191. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/demo.stories.tsx +5 -3
  192. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/index.tsx +28 -5
  193. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/PConnProps.d.ts +46 -0
  194. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/config.json +32 -0
  195. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +103 -0
  196. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/index.tsx +213 -0
  197. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/mock.ts +5 -0
  198. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/styles.ts +8 -0
  199. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/demo.stories.tsx +2 -6
  200. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/GetNextWork.tsx +2 -1
  201. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/demo.stories.tsx +4 -3
  202. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/localizations.json +4 -2
  203. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/demo.stories.tsx +88 -9
  204. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/index.tsx +67 -5
  205. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/demo.stories.tsx +1 -5
  206. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/mock.ts +1 -0
  207. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/demo.stories.tsx +2 -6
  208. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/mock.ts +1 -0
  209. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/demo.stories.tsx +2 -5
  210. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/mock.ts +1 -0
  211. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/demo.stories.tsx +2 -6
  212. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/mock.ts +1 -0
  213. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyRadioButtons/demo.stories.tsx +1 -7
  214. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/demo.stories.tsx +2 -8
  215. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/index.tsx +11 -0
  216. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/utils.ts +3 -0
  217. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/demo.stories.tsx +0 -3
  218. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/index.tsx +94 -4
  219. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/StatusWork.tsx +3 -9
  220. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/demo.stories.tsx +1 -5
  221. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/mock.ts +1 -0
  222. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +5 -15
  223. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +78 -0
  224. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/DetailsRender.tsx +52 -0
  225. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +46 -0
  226. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/Operator.tsx +215 -0
  227. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +17 -19
  228. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +96 -27
  229. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/index.tsx +39 -36
  230. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/mock.ts +68 -10
  231. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/styles.ts +15 -0
  232. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/DetailsRender.tsx +59 -0
  233. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +4 -2
  234. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/index.tsx +23 -4
  235. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/demo.stories.tsx +1 -5
  236. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/mock.ts +1 -0
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "{{COMPONENT_KEY}}",
3
+ "label": "{{COMPONENT_LABEL}}",
4
+ "description": "{{DESCRIPTION}}",
5
+ "organization": "{{ORGANIZATION}}",
6
+ "version": "{{VERSION}}",
7
+ "library": "{{LIBRARY}}",
8
+ "allowedApplications": {{{ALLOWEDAPPS}}},
9
+ "componentKey": "{{COMPONENT_KEY}}",
10
+ "type": "{{TYPE}}",
11
+ "subtype": {{{SUB_TYPE}}},
12
+ "icon": "OneColumnPage.svg",
13
+ "properties": [
14
+ {
15
+ "name": "description",
16
+ "label": "Description",
17
+ "format": "TEXT",
18
+ "defaultValue": "We've launched a brand new experience to accelerate your workflow. Check out the guides to help you get the most of Cosmos."
19
+ },
20
+ {
21
+ "name": "whatsnewlink",
22
+ "label": "What's new link",
23
+ "format": "TEXT",
24
+ "defaultValue": "https://design.pega.com"
25
+ },
26
+ {
27
+ "name": "image",
28
+ "label": "Image link",
29
+ "format": "TEXT",
30
+ "defaultValue": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzOSAxMSI+PHRpdGxlPlBlZ2EgdGV4dC1vbmx5IGxvZ288L3RpdGxlPjxwYXRoIHN0eWxlPSJmaWxsLW9wYWNpdHk6IC4yNTsiIGZpbGw9IiNmZmYiIGQ9Ik03LjcyIDMuODJjMCAyLjI1LTEuNzggMy40MS00IDMuNDFoLTEuNnYzSDBWLjQyaDMuOTRjMi4zNiAwIDMuNzggMS4zOSAzLjc4IDMuNHptLTQtMS40N2gtMS42djNoMS43QTEuNDcgMS40NyAwIDAgMCA1LjUgMy44MmMwLS45MS0uNjUtMS40Ny0xLjc1LTEuNDd6bTcuNjggNS45MWg1LjN2Mkg5LjI5Vi40Mmg3LjM4djEuOTNoLTUuMjR2Mmg0LjI0djEuOWgtNC4yNHpNMjMuMTggMGE1IDUgMCAwIDEgMy41NyAxLjI4TDI1LjYzIDIuOGEzLjc4IDMuNzggMCAwIDAtMS4wNS0uNjNBNC4zMiA0LjMyIDAgMCAwIDIzLjMxIDIgMy4xNyAzLjE3IDAgMCAwIDIwIDUuMjdhMy4xNiAzLjE2IDAgMCAwIDEgMi4zOSAzLjA3IDMuMDcgMCAwIDAgMi4xNy44NCA0LjYgNC42IDAgMCAwIDIuMDktLjVWNi4xOWgtMi4yVjQuMzhoNC4yNXY0LjU2YTUuNDEgNS40MSAwIDAgMS00LjA4IDEuNTdBNS4zNSA1LjM1IDAgMCAxIDE5LjQzIDlhNS4wNSA1LjA1IDAgMCAxLTEuNTYtMy43NCA1LjIxIDUuMjEgMCAwIDEgMS41Ni0zLjc2QTUuMzEgNS4zMSAwIDAgMSAyMy4xOCAwem0xMS4yOS40Mmw0LjEzIDkuNzloLTIuMjVMMzUuNDggOGgtNC4wNmwtLjkgMi4xOGgtMi4yTDMyLjUxLjQyem0uMjUgNS43MkwzMy40NCAzbC0xLjI5IDMuMTR6bTMtNWEuNzEuNzEgMCAwIDEtLjc0Ljc1LjcxLjcxIDAgMCAxLS43My0uNzUuNzMuNzMgMCAwIDEgLjc1LS43Mi43Mi43MiAwIDAgMSAuNzUuNzF6TTM3IC41M2EuNTkuNTkgMCAwIDAtLjYuNi42MS42MSAwIDEgMCAxLjIxIDAgLjYuNiAwIDAgMC0uNjEtLjZ6bS0uMjQgMVYuNzFIMzdjLjEyIDAgLjE4LjA2LjI1LjA2YS4yMS4yMSAwIDAgMSAuMDcuMTguMTkuMTkgMCAwIDEtLjA3LjE4cy0uMDcuMDgtLjEzLjA4bC4yNi4zNmgtLjJMMzcgMS4yOGgtLjF2LjI5em0uMTMtLjQ0aC4yM2EuMjYuMjYgMCAwIDAgLjA3LS4wOWgtLjA2Yy0uMDUtLjE3LS4wNS0uMTctLjEzLS4xN2gtLjF6Ii8+PC9zdmc+"
31
+ },
32
+ {
33
+ "name": "datasource",
34
+ "label": "Data source for details",
35
+ "defaultValue": "@DATASOURCE D_pyAnnouncements.pxResults",
36
+ "format": "DATASOURCE",
37
+ "required": true,
38
+ "properties": [
39
+ {
40
+ "name": "name",
41
+ "label": "Label",
42
+ "defaultValue": "@P .pyLabel"
43
+ }
44
+ ]
45
+ },
46
+ {
47
+ "label": "Conditions",
48
+ "format": "GROUP",
49
+ "properties": [
50
+ {
51
+ "name": "visibility",
52
+ "label": "Visibility",
53
+ "format": "VISIBILITY"
54
+ }
55
+ ]
56
+ }
57
+ ],
58
+ "defaultConfig": {}
59
+ }
@@ -0,0 +1,120 @@
1
+
2
+ /* eslint-disable react/jsx-no-useless-fragment */
3
+ // @ts-nocheck
4
+ import type { Meta, StoryObj } from '@storybook/react';
5
+
6
+ import {{COMPONENT_CLASS_NAME}} from './index';
7
+
8
+
9
+ import configProps from './mock';
10
+
11
+ const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
12
+ title: '{{COMPONENT_CLASS_NAME}}',
13
+ component: {{COMPONENT_CLASS_NAME}},
14
+ excludeStories: /.*Data$/
15
+ };
16
+
17
+ export default meta;
18
+ type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
19
+
20
+ if (!window.PCore) {
21
+ window.PCore = {};
22
+ }
23
+
24
+ const worklistData = {
25
+ data: {
26
+ data: [
27
+ {
28
+ CaseName: 'Loan',
29
+ BusinessID: ' A-8002',
30
+ ProcessName: 'New',
31
+ TaskName: 'Details'
32
+ },
33
+ {
34
+ CaseName: 'Loan',
35
+ BusinessID: ' A-7001',
36
+ ProcessName: 'Open',
37
+ TaskName: 'Info'
38
+ },
39
+ {
40
+ CaseName: 'Loan',
41
+ BusinessID: ' A-9000',
42
+ ProcessName: 'Open',
43
+ TaskName: 'Amount'
44
+ }
45
+ ]
46
+ }
47
+
48
+ };
49
+
50
+ window.PCore.getDataApiUtils = () => {
51
+ return {
52
+ getData: () => {
53
+ return new Promise(resolve => {
54
+ resolve(worklistData);
55
+ });
56
+ },
57
+ getDataAsync: () => {
58
+ return new Promise(resolve => {
59
+ resolve(worklistData);
60
+ });
61
+ }
62
+ };
63
+ };
64
+
65
+
66
+
67
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
68
+
69
+ const props = {
70
+ ...configProps,
71
+ getPConnect: () => {
72
+ return {
73
+ getValue: value => {
74
+ return value;
75
+ },
76
+ getContextName: () => {
77
+ return 'app/primary_1';
78
+ },
79
+ getLocalizedValue: value => {
80
+ return value;
81
+ },
82
+ getActionsApi: () => {
83
+ return {
84
+ updateFieldValue: () => {
85
+ /* nothing */
86
+ },
87
+ triggerFieldChange: () => {
88
+ /* nothing */
89
+ }
90
+ };
91
+ },
92
+ ignoreSuggestion: () => {
93
+ /* nothing */
94
+ },
95
+ acceptSuggestion: () => {
96
+ /* nothing */
97
+ },
98
+ setInheritedProps: () => {
99
+ /* nothing */
100
+ },
101
+ resolveConfigProps: () => {
102
+ /* nothing */
103
+ }
104
+ };
105
+ }
106
+ };
107
+
108
+ return (
109
+ <>
110
+ <{{COMPONENT_CLASS_NAME}} {...props} {...args} />
111
+ </>
112
+ );
113
+ };
114
+
115
+ Base{{COMPONENT_CLASS_NAME}}.args = {
116
+ header: configProps.header,
117
+ description: configProps.description,
118
+ whatsnewlink: configProps.whatsnewlink,
119
+ datasource: configProps.datasource,
120
+ };
@@ -0,0 +1,109 @@
1
+ import { useEffect, useState } from 'react';
2
+ import { withConfiguration, Table } from '@pega/cosmos-react-core';
3
+ import { AppAnnouncement as PegaAppAnnouncement } from '@pega/cosmos-react-work';
4
+ import type { PConnFieldProps } from './PConnProps';
5
+
6
+ import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
7
+
8
+ // interface for props
9
+ interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
10
+ // If any, enter additional props that only exist on TextInput here
11
+ datasource: Array<any>;
12
+ header: string;
13
+ description: string;
14
+ whatsnewlink: string;
15
+ image: string;
16
+ }
17
+
18
+ // props passed in combination of props from property panel (config.json) and run time props from Constellation
19
+ // any default values in config.pros should be set in defaultProps at bottom of this file
20
+ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
21
+
22
+ const { header, description, datasource = [], whatsnewlink, image, getPConnect } = props;
23
+ const [worklist, setWorklist] = useState([]);
24
+ const [isLoading, setIsLoading] = useState(true);
25
+ const PConnect = getPConnect();
26
+ const dataViewName = 'MyWorkList';
27
+ const context = PConnect.getContextName();
28
+
29
+ let details = [];
30
+ // @ts-ignore
31
+ if (datasource && datasource.source) {
32
+ // @ts-ignore
33
+ details = datasource.source.map((item) => {
34
+ return item.name;
35
+ });
36
+ }
37
+
38
+ // setting up columns for the work list table
39
+ const columns = [
40
+ { renderer: 'caseType', label: PConnect.getLocalizedValue('Case type', '', '') },
41
+ { renderer: 'insKey', label: PConnect.getLocalizedValue('Key', '', '') },
42
+ { renderer: 'status', label: PConnect.getLocalizedValue('Status', '', '') },
43
+ { renderer: 'stage', label: PConnect.getLocalizedValue('Stage', '', '') }
44
+ ];
45
+
46
+ // going to get data for worklist to put into a table
47
+ // data comes from calling a PCore function to get
48
+ // get data from a data page and a PConnect function
49
+ // to get getContextName
50
+ useEffect(() => {
51
+
52
+ PCore.getDataApiUtils()
53
+ .getData(dataViewName, {}, context)
54
+ // @ts-ignore
55
+ .then((response: any) => {
56
+ setIsLoading(false);
57
+ if (response.data.data !== null) {
58
+ // table requires an index or will get setExtraStackFrame error
59
+ setWorklist(
60
+ response.data.data.map((entry: any, index: number) => {
61
+ // mapping the data into the column names
62
+ // MUST have an id/index or will get a setExtraStackFrame error
63
+ // put a key in the table
64
+ return {
65
+ caseType: entry.CaseName,
66
+ insKey: entry.BusinessID,
67
+ status: entry.ProcessName,
68
+ stage: entry.TaskName,
69
+ id: index
70
+ };
71
+ })
72
+ );
73
+ }
74
+ else {
75
+ setWorklist([]);
76
+ setIsLoading(false);
77
+ }
78
+
79
+ })
80
+ .catch((error: any) => {
81
+ setWorklist([]);
82
+ setIsLoading(false);
83
+ console.log(error);
84
+ });
85
+ }, [context]);
86
+
87
+ return (
88
+ <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
89
+ <PegaAppAnnouncement
90
+ heading={header}
91
+ description={description}
92
+ details={details}
93
+ whatsNewLink={whatsnewlink}
94
+ image={image.replace(/ /g, '+')}
95
+ />
96
+ <br />
97
+ <Table
98
+ title={PConnect.getLocalizedValue('Work list', '', '')}
99
+ columns={columns}
100
+ data={worklist}
101
+ loading={isLoading}
102
+ loadingMessage={PConnect.getLocalizedValue('Loading Work list', '', '')}
103
+ />
104
+ </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
105
+ );
106
+
107
+ }
108
+
109
+ export default withConfiguration({{COMPONENT_CLASS_NAME}});
@@ -0,0 +1,25 @@
1
+
2
+ // @ts-nocheck
3
+ const configProps = {
4
+ label: 'App announcement',
5
+ header: 'Announcements',
6
+ description: 'Welcome to MediaCo Application for testing SDK frameworks.',
7
+ whatsnewlink: 'https://design.pega.com',
8
+ image:
9
+ 'data:image/svg xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzOSAxMSI PHRpdGxlPlBlZ2EgdGV4dC1vbmx5IGxvZ288L3RpdGxlPjxwYXRoIHN0eWxlPSJmaWxsLW9wYWNpdHk6IC4yNTsiIGZpbGw9IiNmZmYiIGQ9Ik03LjcyIDMuODJjMCAyLjI1LTEuNzggMy40MS00IDMuNDFoLTEuNnYzSDBWLjQyaDMuOTRjMi4zNiAwIDMuNzggMS4zOSAzLjc4IDMuNHptLTQtMS40N2gtMS42djNoMS43QTEuNDcgMS40NyAwIDAgMCA1LjUgMy44MmMwLS45MS0uNjUtMS40Ny0xLjc1LTEuNDd6bTcuNjggNS45MWg1LjN2Mkg5LjI5Vi40Mmg3LjM4djEuOTNoLTUuMjR2Mmg0LjI0djEuOWgtNC4yNHpNMjMuMTggMGE1IDUgMCAwIDEgMy41NyAxLjI4TDI1LjYzIDIuOGEzLjc4IDMuNzggMCAwIDAtMS4wNS0uNjNBNC4zMiA0LjMyIDAgMCAwIDIzLjMxIDIgMy4xNyAzLjE3IDAgMCAwIDIwIDUuMjdhMy4xNiAzLjE2IDAgMCAwIDEgMi4zOSAzLjA3IDMuMDcgMCAwIDAgMi4xNy44NCA0LjYgNC42IDAgMCAwIDIuMDktLjVWNi4xOWgtMi4yVjQuMzhoNC4yNXY0LjU2YTUuNDEgNS40MSAwIDAgMS00LjA4IDEuNTdBNS4zNSA1LjM1IDAgMCAxIDE5LjQzIDlhNS4wNSA1LjA1IDAgMCAxLTEuNTYtMy43NCA1LjIxIDUuMjEgMCAwIDEgMS41Ni0zLjc2QTUuMzEgNS4zMSAwIDAgMSAyMy4xOCAwem0xMS4yOS40Mmw0LjEzIDkuNzloLTIuMjVMMzUuNDggOGgtNC4wNmwtLjkgMi4xOGgtMi4yTDMyLjUxLjQyem0uMjUgNS43MkwzMy40NCAzbC0xLjI5IDMuMTR6bTMtNWEuNzEuNzEgMCAwIDEtLjc0Ljc1LjcxLjcxIDAgMCAxLS43My0uNzUuNzMuNzMgMCAwIDEgLjc1LS43Mi43Mi43MiAwIDAgMSAuNzUuNzF6TTM3IC41M2EuNTkuNTkgMCAwIDAtLjYuNi42MS42MSAwIDEgMCAxLjIxIDAgLjYuNiAwIDAgMC0uNjEtLjZ6bS0uMjQgMVYuNzFIMzdjLjEyIDAgLjE4LjA2LjI1LjA2YS4yMS4yMSAwIDAgMSAuMDcuMTguMTkuMTkgMCAwIDEtLjA3LjE4cy0uMDcuMDgtLjEzLjA4bC4yNi4zNmgtLjJMMzcgMS4yOGgtLjF2LjI5em0uMTMtLjQ0aC4yM2EuMjYuMjYgMCAwIDAgLjA3LS4wOWgtLjA2Yy0uMDUtLjE3LS4wNS0uMTctLjEzLS4xN2gtLjF6Ii8 PC9zdmc ',
10
+ datasource: {
11
+ source: [
12
+ {
13
+ name: 'New React based UI rendering'
14
+ },
15
+ {
16
+ name: 'Support for followers and recents'
17
+ },
18
+ {
19
+ name: 'New authoring experience'
20
+ }
21
+ ],
22
+ fields: {}
23
+ }
24
+ };
25
+ export default configProps;
@@ -0,0 +1,8 @@
1
+ // individual style, comment out above, and uncomment here and add styles
2
+ import styled, { css } from 'styled-components';
3
+
4
+ export default styled.div(() => {
5
+ return css`
6
+ margin: 0px 0;
7
+ `;
8
+ });
@@ -82,6 +82,9 @@ export const compileMustacheTemplates = async (
82
82
  case 'Picklist-RadioButtons':
83
83
  mustacheSubType = 'Picklist';
84
84
  break;
85
+ case 'Icon-Button-URL':
86
+ mustacheSubType = 'Text-URL';
87
+ break;
85
88
  }
86
89
  }
87
90
 
@@ -7,6 +7,9 @@ const preview = {
7
7
  color: /(background|color)$/i,
8
8
  date: /Date$/i
9
9
  }
10
+ },
11
+ docs: {
12
+ source: { type: 'code' }
10
13
  }
11
14
  }
12
15
  };
@@ -51,9 +51,9 @@
51
51
  "license": "Enter License",
52
52
  "sideEffects": false,
53
53
  "dependencies": {
54
- "@pega/cosmos-react-condition-builder": "^4.2.0",
55
- "@pega/cosmos-react-core": "^4.2.0",
56
- "@pega/cosmos-react-work": "^4.2.0",
54
+ "@pega/cosmos-react-condition-builder": "^6.0.3",
55
+ "@pega/cosmos-react-core": "^6.0.3",
56
+ "@pega/cosmos-react-work": "^6.0.3",
57
57
  "dayjs": "^1.11.10",
58
58
  "lodash.get": "^4.4.2",
59
59
  "polished": "^4.2.2",
@@ -61,7 +61,7 @@
61
61
  "react": "^17.0.2",
62
62
  "react-autosuggest": "^10.1.0",
63
63
  "react-dom": "^17.0.2",
64
- "react-is": "^18.2.0",
64
+ "react-is": "^17.0.2",
65
65
  "react-player": "^2.10.1",
66
66
  "react-redux": "^7.2.6",
67
67
  "styled-components": "^5.3.5",
@@ -69,8 +69,8 @@
69
69
  },
70
70
  "devDependencies": {
71
71
  "@pega/configs": "^0.6.0",
72
- "@pega/custom-dx-components": "23.1.13",
73
- "@pega/pcore-pconnect-typedefs": "~2.1.1",
72
+ "@pega/custom-dx-components": "24.1.11",
73
+ "@pega/pcore-pconnect-typedefs": "~3.0.0",
74
74
  "@storybook/addon-actions": "^7.6.7",
75
75
  "@storybook/addon-essentials": "^7.6.7",
76
76
  "@storybook/addon-links": "^7.6.7",
@@ -5,7 +5,9 @@
5
5
  "./src/**/*.stories.ts",
6
6
  "./src/**/*.stories.tsx",
7
7
  "./src/**/*.stories.js",
8
- "./src/**/*.stories.jsx"
8
+ "./src/**/*.stories.jsx",
9
+ "./src/**/*.test.jsx",
10
+ "./src/**/*.test.tsx"
9
11
  ],
10
12
  "compilerOptions": {
11
13
  "noEmit": false,
@@ -345,6 +345,7 @@ module.exports = (
345
345
  resourceRegExp: /^\.\/locale$/,
346
346
  contextRegExp: /moment$/
347
347
  }),
348
+ /* cosmos 4.x and below */
348
349
  /* Ignore cosmos icons */
349
350
  new webpack.IgnorePlugin({
350
351
  resourceRegExp: /^\.\/icons$/,
@@ -357,6 +358,31 @@ module.exports = (
357
358
  contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon$/
358
359
  }),
359
360
 
361
+ /* Ignore cosmos streamline-icons */
362
+ new webpack.IgnorePlugin({
363
+ resourceRegExp: /^\.\/streamline-icons$/,
364
+ contextRegExp: /@pega\/cosmos-react-core\/lib\/components\/Icon$/
365
+ }),
366
+
367
+ /* Ignore cosmos streamline-icons - windows */
368
+ new webpack.IgnorePlugin({
369
+ resourceRegExp: /^\.\/streamline-icons$/,
370
+ contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon$/
371
+ }),
372
+
373
+ /* cosmos 6.x and above */
374
+ /* Ignore cosmos icons */
375
+ new webpack.IgnorePlugin({
376
+ resourceRegExp: /^\.\/.*\/.*\.icon$/,
377
+ contextRegExp: /@pega\/cosmos-react-core\/lib\/components\/Icon$/
378
+ }),
379
+
380
+ /* Ignore cosmos icons - windows */
381
+ new webpack.IgnorePlugin({
382
+ resourceRegExp: /^\.\/.*\/.*\.icon$/,
383
+ contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon$/
384
+ }),
385
+
360
386
  new webpack.optimize.LimitChunkCountPlugin({
361
387
  maxChunks: 1
362
388
  }),
@@ -1,19 +1,15 @@
1
1
 
2
2
  import fs from 'fs';
3
3
  import path, { join } from 'path';
4
- import { URL, fileURLToPath } from 'url';
5
4
 
6
5
  import chalk from 'chalk';
7
- import { up } from 'inquirer/lib/utils/readline.js';
8
6
 
9
7
  import {
10
- convertIntoPascalCase,
11
8
  showVersion,
12
9
  updateUseWebPackPromotion
13
10
  } from '../../util.js';
14
11
  import {
15
- WEBPACK_CONFIG_JS_FILENAME,
16
- BUILDER_INDEX_FILE_PATH
12
+ WEBPACK_CONFIG_JS_FILENAME
17
13
  } from '../../constants.js';
18
14
 
19
15
 
@@ -350,7 +350,13 @@ export default async (option) => {
350
350
  }
351
351
 
352
352
  //const data = JSON.parse(fs.readFileSync(path.resolve(configFile), 'utf8'));
353
- const data = JSON.parse(configData);
353
+ let data;
354
+ try {
355
+ data = JSON.parse(configData);
356
+ }
357
+ catch (er) {
358
+ throw new Error(`Invalid schema json in config.json: ${er}`);
359
+ }
354
360
 
355
361
  const valid = validateSchema(data);
356
362
 
package/src/util.js CHANGED
@@ -33,12 +33,14 @@ export const checkPathAccess = async (path, options = {}, throwError = false) =>
33
33
  } catch (err) {
34
34
  if (throwError) {
35
35
  throw new Error(err);
36
- } else {
36
+ }
37
+ else {
37
38
  const message =
38
39
  errorMessage || `${chalk.red.bold('ERROR')} Could not able to access path - ${path}`;
39
40
  console.error(message);
40
41
  process.exit(1);
41
42
  }
43
+
42
44
  }
43
45
  };
44
46
 
@@ -49,7 +51,8 @@ export const getUseWebPackPromotion = async () => {
49
51
  try {
50
52
  // force to throw error and not console log
51
53
  await checkPathAccess(pegaConfigJsonPath, {}, true);
52
- } catch (ex) {
54
+ }
55
+ catch (ex) {
53
56
  // when can't find it, always be false, assume no webpack override.
54
57
  // This is IMPORTANT for init (npx install)
55
58
  return false;
@@ -72,9 +75,10 @@ export const getUseWebPackPromotion = async () => {
72
75
  }
73
76
 
74
77
  return data[USE_PROMOTED_WEB_PACK];
75
- };
76
78
 
77
- export const updateUseWebPackPromotion = async (useValue = false) => {
79
+ }
80
+
81
+ export const updateUseWebPackPromotion = async ( useValue = false ) => {
78
82
  const currentDirectory = process.cwd();
79
83
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
80
84
 
@@ -90,10 +94,11 @@ export const updateUseWebPackPromotion = async (useValue = false) => {
90
94
  process.exit(1);
91
95
  }
92
96
 
93
- data.usePromotedWebPack = useValue;
97
+ data["usePromotedWebPack"] = useValue;
94
98
 
95
99
  fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(data, null, 4), { encoding: 'utf8' });
96
- };
100
+
101
+ }
97
102
 
98
103
  export const deleteLocalComponent = async componentKey => {
99
104
  const currentDirectory = process.cwd();
@@ -260,19 +265,20 @@ export const getComponentDefaults = async () => {
260
265
  export const getServerType = async () => {
261
266
  const defaultPegaServerConfig = await getPegaServerConfig();
262
267
  return defaultPegaServerConfig.serverType;
263
- };
268
+ }
264
269
 
265
- export const setServerType = async serverType => {
270
+ export const setServerType = async(serverType) => {
266
271
  const currentDirectory = process.cwd();
267
272
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
268
- const configData = await getPegaConfig();
269
- const serverConfig = configData['server-config'];
273
+ let configData = await getPegaConfig();
274
+ let serverConfig = configData['server-config'];
270
275
  serverConfig.serverType = serverType;
271
276
 
272
277
  // update file
273
278
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
274
279
  fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8' });
275
- };
280
+
281
+ }
276
282
 
277
283
  export const getComponentDirectoryPath = async componentKey => {
278
284
  const currentDirectory = process.cwd();
@@ -447,37 +453,55 @@ export const deleteInfinityServerComponent = async componentKey => {
447
453
  status = response.status;
448
454
  if (!response.ok) {
449
455
  if (status === 401) {
450
- throw new Error('Error occurred in authentication. Please regenerate using authenticate');
456
+ throw new Error(
457
+ 'Error occurred in authentication. Please regenerate using authenticate'
458
+ );
451
459
  // console.log(accessTokenUri, refreshToken);
452
460
  /* TODO - Handle refresh_token */
453
- } else if (status === 404) {
461
+ }
462
+ else if (status === 404){
454
463
  throw new Error('404: Server resource not found');
455
- } else if (status === 405) {
464
+ }
465
+ else if (status === 405){
456
466
  throw new Error('405: Server method not allowed');
457
- } else if (status === 408) {
467
+ }
468
+ else if (status === 408){
458
469
  throw new Error('408: Server timed out');
459
- } else if (response.status === 403) {
460
- throw new Error('Error forbidden: User does not have privileges to Publish.');
461
470
  }
471
+ else if (response.status === 403) {
472
+ throw new Error(
473
+ 'Error forbidden: User does not have privileges to Publish.'
474
+ );
475
+ }
476
+
477
+
462
478
  }
463
479
 
464
480
  try {
465
481
  const respData = await response.json();
466
- console.log(chalk.bold.green(`Success : ${respData.message}`));
482
+ console.log(
483
+ chalk.bold.green(`Success : ${respData.message}`)
484
+ );
467
485
 
468
486
  if (status === 500) {
469
487
  status = 999;
470
488
  throw new Error(respData.message);
471
489
  }
472
- } catch (err) {
490
+ }
491
+ catch (err) {
473
492
  if (status === 500) {
474
- throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
475
- } else if (status === 999) {
476
- throw new Error(err);
493
+ throw new Error(
494
+ `Error occurred in authentication. Please regenerate using authenticate`
495
+ );
496
+ }
497
+ else if (status === 999) {
498
+ throw new Error (err);
477
499
  }
478
500
  }
501
+
479
502
  }
480
503
  } catch (error) {
504
+
481
505
  throw new Error(error);
482
506
  }
483
507
  };
@@ -509,6 +533,7 @@ export const deleteLaunchpadServerComponent = async componentKey => {
509
533
  componentName
510
534
  };
511
535
 
536
+
512
537
  const response = await fetch(deleteUrl, {
513
538
  method: 'DELETE',
514
539
  agent: new https.Agent({ rejectUnauthorized: false }),
@@ -519,33 +544,47 @@ export const deleteLaunchpadServerComponent = async componentKey => {
519
544
  status = response.status;
520
545
  if (!response.ok) {
521
546
  if (status === 401) {
522
- throw new Error('Error occurred in authentication. Please regenerate using authenticate');
547
+ throw new Error(
548
+ 'Error occurred in authentication. Please regenerate using authenticate'
549
+ );
523
550
  // console.log(accessTokenUri, refreshToken);
524
551
  /* TODO - Handle refresh_token */
525
- } else if (status === 404) {
552
+ }
553
+ else if (status === 404){
526
554
  throw new Error('404: Server resource not found');
527
- } else if (status === 405) {
555
+ }
556
+ else if (status === 405){
528
557
  throw new Error('405: Server method not allowed');
529
- } else if (status === 408) {
558
+ }
559
+ else if (status === 408){
530
560
  throw new Error('408: Server timed out');
531
- } else if (response.status === 403) {
532
- throw new Error('Error forbidden: User does not have privileges to Publish.');
561
+ }
562
+ else if (response.status === 403) {
563
+ throw new Error(
564
+ 'Error forbidden: User does not have privileges to Publish.'
565
+ );
533
566
  }
534
567
  }
535
568
 
536
569
  try {
537
570
  const respData = await response.text();
538
- console.log(chalk.bold.green(`Success : ${respData}`));
571
+ console.log(
572
+ chalk.bold.green(`Success : ${respData}`)
573
+ );
539
574
 
540
575
  if (status === 500) {
541
576
  status = 999;
542
577
  throw new Error(respData.message);
543
578
  }
544
- } catch (err) {
579
+ }
580
+ catch (err) {
545
581
  if (status === 500) {
546
- throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
547
- } else if (status === 999) {
548
- throw new Error(err);
582
+ throw new Error(
583
+ `Error occurred in authentication. Please regenerate using authenticate`
584
+ );
585
+ }
586
+ else if (status === 999) {
587
+ throw new Error (err);
549
588
  }
550
589
  }
551
590
  }