@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.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/cli.js +1 -1
- package/src/constants.js +4 -0
- package/src/tasks/build-all/helper.js +6 -0
- package/src/tasks/build-comp/helper.js +8 -0
- package/src/tasks/bundle/builder/webpack.config.js +15 -1
- package/src/tasks/create/index.js +3 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.tsx.mustache +3 -13
- package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +8 -5
- package/src/tasks/create/templates/Constellation/Field/Date/demo.stories.tsx.mustache +8 -19
- package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.tsx.mustache +7 -18
- package/src/tasks/create/templates/Constellation/Field/DateTime/mock.ts.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.tsx.mustache +1 -7
- package/src/tasks/create/templates/Constellation/Field/Decimal/mock.ts.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.tsx.mustache +2 -9
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/mock.ts.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.tsx.mustache +2 -6
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/mock.ts.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/PConnProps.d.ts.mustache +46 -0
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/config.json.mustache +64 -0
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/demo.stories.tsx.mustache +104 -0
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/index.tsx.mustache +218 -0
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/mock.ts.mustache +5 -0
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/styles.ts.mustache +8 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.tsx.mustache +2 -6
- package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.tsx.mustache +2 -6
- package/src/tasks/create/templates/Constellation/Field/Picklist/mock.ts.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/demo.stories.tsx.mustache +2 -8
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +11 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/utils.ts.mustache +3 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/demo.stories.tsx.mustache +1 -7
- package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.tsx.mustache +0 -3
- package/src/tasks/create/templates/Constellation/Field/Text/index.tsx.mustache +94 -4
- package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.tsx.mustache +1 -5
- package/src/tasks/create/templates/Constellation/Field/Text-Input/StatusWork.tsx +3 -9
- package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.tsx.mustache +1 -5
- package/src/tasks/create/templates/Constellation/Field/Text-Input/mock.ts.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.tsx.mustache +1 -5
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/mock.ts.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.tsx.mustache +2 -5
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/mock.ts.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.tsx.mustache +1 -5
- package/src/tasks/create/templates/Constellation/Field/Text-URL/mock.ts.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.tsx.mustache +5 -15
- package/src/tasks/create/templates/Constellation/Template/DETAILS/Avatar.tsx.mustache +78 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/DetailsRender.tsx.mustache +55 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/HighlightRender.tsx.mustache +49 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/Operator.tsx.mustache +218 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/StatusWork.tsx.mustache +17 -19
- package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.tsx.mustache +79 -25
- package/src/tasks/create/templates/Constellation/Template/DETAILS/index.tsx.mustache +51 -40
- package/src/tasks/create/templates/Constellation/Template/DETAILS/mock.ts.mustache +78 -20
- package/src/tasks/create/templates/Constellation/Template/DETAILS/styles.ts.mustache +16 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Avatar.tsx.mustache +78 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/DetailsRender.tsx.mustache +55 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/HighlightRender.tsx.mustache +49 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Operator.tsx.mustache +218 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/StatusWork.tsx.mustache +17 -19
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.tsx.mustache +96 -27
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.tsx.mustache +42 -39
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/mock.ts.mustache +68 -10
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/styles.ts.mustache +15 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/DetailsRender.tsx +59 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.tsx.mustache +5 -3
- package/src/tasks/create/templates/Constellation/Template/FORM/index.tsx.mustache +31 -5
- package/src/tasks/create/templates/Constellation/Template/FORM-region/DetailsRender.tsx +59 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.tsx.mustache +4 -2
- package/src/tasks/create/templates/Constellation/Template/FORM-region/index.tsx.mustache +29 -7
- package/src/tasks/create/templates/Constellation/Template/PAGE/GetNextWork.tsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.tsx.mustache +4 -3
- package/src/tasks/create/templates/Constellation/Template/PAGE/localizations.json.mustache +4 -2
- package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.tsx.mustache +3 -2
- package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.tsx.mustache +91 -13
- package/src/tasks/create/templates/Constellation/Widget/PAGE/index.tsx.mustache +67 -5
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.stories.tsx.mustache +5 -4
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/PConnProps.d.ts.mustache +46 -0
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/config.json.mustache +32 -0
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/demo.stories.tsx.mustache +103 -0
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/index.tsx.mustache +216 -0
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/mock.ts.mustache +5 -0
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/styles.ts.mustache +8 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/PConnProps.d.ts.mustache +46 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/config.json.mustache +59 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/demo.stories.tsx.mustache +120 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/index.tsx.mustache +109 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/mock.ts.mustache +25 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/styles.ts.mustache +8 -0
- package/src/tasks/create-all/index.js +3 -0
- package/src/tasks/init/template/.storybook/preview.js +3 -0
- package/src/tasks/init/template/package.json.mustache +6 -6
- package/src/tasks/init/template/tsconfig.build.json +3 -1
- package/src/tasks/promote-webpack/webpack.config.js +26 -0
- package/src/tasks/revert-webpack/index.js +1 -5
- package/src/tasks/validator/index.js +7 -1
- package/src/util.js +72 -33
- package/tests/assets/components/create/Pega_DXIL_MyDetails.zip +0 -0
- package/tests/assets/components/create/Pega_DXIL_MyTestText/demo.stories.tsx +0 -3
- package/tests/assets/components/create/Pega_DXIL_MyTestText/index.tsx +94 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/demo.stories.tsx +3 -13
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/index.tsx +8 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.stories.tsx +3 -2
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/demo.stories.tsx +2 -9
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/mock.ts +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/demo.stories.tsx +8 -19
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/demo.stories.tsx +7 -18
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/mock.ts +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/demo.stories.tsx +1 -7
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/mock.ts +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/Avatar.tsx +78 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/DetailsRender.tsx +52 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/HighlightRender.tsx +46 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/Operator.tsx +215 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/StatusWork.tsx +17 -19
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx +79 -25
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/index.tsx +48 -37
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/mock.ts +78 -20
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/styles.ts +16 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails.zip +0 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/demo.stories.tsx +1 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/DetailsRender.tsx +59 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/demo.stories.tsx +5 -3
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/index.tsx +28 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/PConnProps.d.ts +46 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/config.json +64 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +104 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/index.tsx +215 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/mock.ts +5 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/styles.ts +8 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/demo.stories.tsx +2 -6
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/GetNextWork.tsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/demo.stories.tsx +4 -3
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/localizations.json +4 -2
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +5 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.stories.tsx +91 -13
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +67 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/demo.stories.tsx +1 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/mock.ts +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/demo.stories.tsx +2 -6
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/mock.ts +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/demo.stories.tsx +2 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/mock.ts +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/demo.stories.tsx +2 -6
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/mock.ts +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyRadioButtons/demo.stories.tsx +1 -7
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/demo.stories.tsx +2 -8
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +11 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/utils.ts +3 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/demo.stories.tsx +0 -3
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/index.tsx +94 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/StatusWork.tsx +3 -9
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/demo.stories.tsx +1 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/mock.ts +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +5 -15
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +78 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/DetailsRender.tsx +52 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +46 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/Operator.tsx +215 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +17 -19
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +96 -27
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/index.tsx +39 -36
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/mock.ts +68 -10
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/styles.ts +15 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/DetailsRender.tsx +59 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +4 -2
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/index.tsx +23 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/demo.stories.tsx +1 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/mock.ts +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/demo.stories.tsx +3 -13
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/index.tsx +8 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/demo.stories.tsx +2 -9
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/mock.ts +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/demo.stories.tsx +8 -19
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/demo.stories.tsx +7 -18
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/mock.ts +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/demo.stories.tsx +1 -7
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/mock.ts +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/Avatar.tsx +78 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/DetailsRender.tsx +52 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/HighlightRender.tsx +46 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/Operator.tsx +215 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/StatusWork.tsx +17 -19
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.stories.tsx +79 -25
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/index.tsx +48 -37
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/mock.ts +78 -20
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/styles.ts +16 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails.zip +0 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/demo.stories.tsx +1 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/DetailsRender.tsx +59 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/demo.stories.tsx +5 -3
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/index.tsx +28 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/PConnProps.d.ts +46 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/config.json +32 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +103 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/index.tsx +213 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/mock.ts +5 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/styles.ts +8 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/demo.stories.tsx +2 -6
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/GetNextWork.tsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/demo.stories.tsx +4 -3
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/localizations.json +4 -2
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/demo.stories.tsx +88 -9
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/index.tsx +67 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/demo.stories.tsx +1 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/mock.ts +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/demo.stories.tsx +2 -6
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/mock.ts +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/demo.stories.tsx +2 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/mock.ts +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/demo.stories.tsx +2 -6
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/mock.ts +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyRadioButtons/demo.stories.tsx +1 -7
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/demo.stories.tsx +2 -8
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/index.tsx +11 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/utils.ts +3 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/demo.stories.tsx +0 -3
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/index.tsx +94 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/StatusWork.tsx +3 -9
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/demo.stories.tsx +1 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/mock.ts +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +5 -15
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +78 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/DetailsRender.tsx +52 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +46 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/Operator.tsx +215 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +17 -19
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +96 -27
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/index.tsx +39 -36
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/mock.ts +68 -10
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/styles.ts +15 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/DetailsRender.tsx +59 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +4 -2
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/index.tsx +23 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/demo.stories.tsx +1 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/mock.ts +1 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Icon,
|
|
4
|
+
Button,
|
|
5
|
+
withConfiguration,
|
|
6
|
+
registerIcon,
|
|
7
|
+
Table,
|
|
8
|
+
Label,
|
|
9
|
+
Link,
|
|
10
|
+
URLDisplay
|
|
11
|
+
} from '@pega/cosmos-react-core';
|
|
12
|
+
import type { PConnFieldProps } from './PConnProps';
|
|
13
|
+
|
|
14
|
+
// IMPORTANT
|
|
15
|
+
// To use Icons, need to individually import the icon file form @pega/cosmos-react-core (see path below)
|
|
16
|
+
// Icons filename is kabab case (file-name), where as the icon you import is camel case (fileName)
|
|
17
|
+
// Icons need to be registered (camel case), and then used (kabab case)
|
|
18
|
+
import * as listNumber from '@pega/cosmos-react-core/lib/components/Icon/icons/list-number.icon';
|
|
19
|
+
import * as arrowRight from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-right.icon';
|
|
20
|
+
import * as globe from '@pega/cosmos-react-core/lib/components/Icon/icons/globe.icon';
|
|
21
|
+
|
|
22
|
+
import StyledPegaDxilMyIconButtonUrlWrapper from './styles';
|
|
23
|
+
|
|
24
|
+
// interface for props
|
|
25
|
+
interface PegaDxilMyIconButtonUrlProps extends PConnFieldProps {
|
|
26
|
+
// If any, enter additional props that only exist on TextInput here
|
|
27
|
+
countryCode: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const textFormatter = (value: string) => {
|
|
31
|
+
const displayComponent = (
|
|
32
|
+
<URLDisplay target='_blank' value={value} displayText={value} variant='link' />
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
return displayComponent;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// *************
|
|
39
|
+
// This component is meant to be an example of usage (Icon, Button, Link, etc.) and NOT meant to be
|
|
40
|
+
// used "as is"
|
|
41
|
+
//
|
|
42
|
+
// In this example, Icon is shown on its own and inside a Button
|
|
43
|
+
// Though an Icon can have an "onClick" event is it recommended if you want to click on it,
|
|
44
|
+
// to put it in a Button (shown below), so you can have a tooltip and hover style or put it
|
|
45
|
+
// in a Link (shown below) as a URL.
|
|
46
|
+
//
|
|
47
|
+
// For the button, the click will get a list of states for a given country and display in a
|
|
48
|
+
// table below. The table display will toggle with the click of the button icon. Example shows
|
|
49
|
+
// how to handle click, retrieve data from PCore and display it.
|
|
50
|
+
//
|
|
51
|
+
// Globe icon is an icon placed in a Link element. The Link element to use an icon internally. (NOTE: In general
|
|
52
|
+
// the Link element shows the open icon to the left of the link text, but here we are using
|
|
53
|
+
// another icon, so with "icon" specified in the Link element, the open icon doesn't show)
|
|
54
|
+
// Link elements do not handle bad urls well, so we have a simple validator to prevent the Link element
|
|
55
|
+
// from getting most bad urls.
|
|
56
|
+
//
|
|
57
|
+
// NOTE: because icons have to be imported and registered, you can NOT put the icon name
|
|
58
|
+
// inside the config.json and let the user pick it, if it is not already part of your
|
|
59
|
+
// import and registration (can't be done on the fly)
|
|
60
|
+
// **************
|
|
61
|
+
|
|
62
|
+
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
63
|
+
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
64
|
+
function PegaDxilMyIconButtonUrl(props: PegaDxilMyIconButtonUrlProps) {
|
|
65
|
+
const { value, displayMode, countryCode = 'USA', getPConnect, testId } = props;
|
|
66
|
+
const [statelist, setStatelist] = useState([]);
|
|
67
|
+
const [showTable, setShowTable] = useState(false);
|
|
68
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
69
|
+
const [validUrl, setValidUrl] = useState('about:blank');
|
|
70
|
+
const PConnect = getPConnect();
|
|
71
|
+
const dataViewName = 'D_pyStateList';
|
|
72
|
+
const context = PConnect.getContextName();
|
|
73
|
+
|
|
74
|
+
// IMPORTANT: need to register icons used in camel case
|
|
75
|
+
registerIcon(listNumber, arrowRight, globe);
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
// setting up columns for the work list table
|
|
79
|
+
const columns = [
|
|
80
|
+
{ renderer: 'stateName', label: PConnect.getLocalizedValue('State name', '', '') },
|
|
81
|
+
{ renderer: 'stateCode', label: PConnect.getLocalizedValue('State code', '', '') }
|
|
82
|
+
];
|
|
83
|
+
|
|
84
|
+
// toggle showing table and getting table data
|
|
85
|
+
function showHideTable() {
|
|
86
|
+
setShowTable(prevShowTable => !prevShowTable);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// check if url is valid (simple)
|
|
90
|
+
function validateUrl(href: string) {
|
|
91
|
+
return /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(
|
|
92
|
+
href
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Testing to see if value entered is valid url, if not can't use it.
|
|
97
|
+
// Reason for this code is that you can NOT pass to Link component
|
|
98
|
+
// a bad url, or it will error out.
|
|
99
|
+
// For example: Since the value is the property field,
|
|
100
|
+
// it could be entered from another component and thus as it is
|
|
101
|
+
// entered (typed in), it won't be valid until it is all entered.
|
|
102
|
+
// NOTE: can't have a blank value for the url as the Link element will error out
|
|
103
|
+
// in App studio preview
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
if (validateUrl(value)) {
|
|
106
|
+
setValidUrl(value);
|
|
107
|
+
} else {
|
|
108
|
+
setValidUrl('about:blank');
|
|
109
|
+
}
|
|
110
|
+
}, [value]);
|
|
111
|
+
|
|
112
|
+
// going to get data for worklist to put into a table
|
|
113
|
+
// data comes from calling a PCore function to get
|
|
114
|
+
// get data from a data page and a PConnect function
|
|
115
|
+
// to get getContextName
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
const params = { pyCountry: countryCode };
|
|
118
|
+
|
|
119
|
+
// only retrieve table data if table is shown
|
|
120
|
+
if (showTable) {
|
|
121
|
+
PCore.getDataPageUtils()
|
|
122
|
+
.getDataAsync(dataViewName, context, params, null, null)
|
|
123
|
+
// @ts-ignore
|
|
124
|
+
.then((response: any) => {
|
|
125
|
+
setIsLoading(false);
|
|
126
|
+
// table requires an index or will get setExtraStackFrame error
|
|
127
|
+
if (response.data !== null) {
|
|
128
|
+
setStatelist(
|
|
129
|
+
response.data.map((entry: any, index: number) => {
|
|
130
|
+
// mapping the data into the column names
|
|
131
|
+
// MUST have an id/index or will get a setExtraStackFrame error
|
|
132
|
+
// put a key in the table
|
|
133
|
+
return {
|
|
134
|
+
stateName: entry.pyLabel,
|
|
135
|
+
stateCode: entry.pyStateCode,
|
|
136
|
+
id: index
|
|
137
|
+
};
|
|
138
|
+
})
|
|
139
|
+
);
|
|
140
|
+
} else {
|
|
141
|
+
setStatelist([]);
|
|
142
|
+
setIsLoading(false);
|
|
143
|
+
}
|
|
144
|
+
})
|
|
145
|
+
.catch((error: any) => {
|
|
146
|
+
setStatelist([]);
|
|
147
|
+
setIsLoading(false);
|
|
148
|
+
console.log(error);
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}, [context, countryCode, showTable]);
|
|
152
|
+
|
|
153
|
+
// when DISPLAY_ONLY, in this example we will just show the URL.
|
|
154
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
155
|
+
const displayComp = textFormatter(validUrl);
|
|
156
|
+
return (
|
|
157
|
+
<StyledPegaDxilMyIconButtonUrlWrapper> {displayComp} </StyledPegaDxilMyIconButtonUrlWrapper>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return (
|
|
162
|
+
<StyledPegaDxilMyIconButtonUrlWrapper>
|
|
163
|
+
<div style={{ display: 'flex' }} data-testid={testId}>
|
|
164
|
+
<Icon
|
|
165
|
+
style={{ height: '1.5rem', width: '1.5rem' }}
|
|
166
|
+
// icon name is kabab case
|
|
167
|
+
name='arrow-right'
|
|
168
|
+
role='img'
|
|
169
|
+
aria-label='arrow right'
|
|
170
|
+
/>
|
|
171
|
+
<Label style={{ margin: '0.1rem' }}>
|
|
172
|
+
{' '}
|
|
173
|
+
{PConnect.getLocalizedValue('State list for', '', '')}{' '}
|
|
174
|
+
{PConnect.getLocalizedValue(`${countryCode}`, '', '')}{' '}
|
|
175
|
+
</Label>
|
|
176
|
+
<Button
|
|
177
|
+
icon
|
|
178
|
+
label={PConnect.getLocalizedValue('Click to show/hide state list', '', '')}
|
|
179
|
+
variant='link'
|
|
180
|
+
compact={false}
|
|
181
|
+
onClick={showHideTable}
|
|
182
|
+
>
|
|
183
|
+
<Icon
|
|
184
|
+
style={{ height: '1.5rem', width: '1.5rem' }}
|
|
185
|
+
// icon name is kabab case
|
|
186
|
+
name='list-number'
|
|
187
|
+
role='img'
|
|
188
|
+
aria-label='numbered list'
|
|
189
|
+
/>
|
|
190
|
+
</Button>
|
|
191
|
+
<Link href={validUrl} variant='link' label={validUrl} icon>
|
|
192
|
+
<Icon
|
|
193
|
+
style={{ height: '1.5rem', width: '1.5rem' }}
|
|
194
|
+
// icon name is kabab case
|
|
195
|
+
name='globe'
|
|
196
|
+
role='img'
|
|
197
|
+
aria-label='open link'
|
|
198
|
+
/>
|
|
199
|
+
</Link>
|
|
200
|
+
</div>
|
|
201
|
+
{showTable && (
|
|
202
|
+
<Table
|
|
203
|
+
title={PConnect.getLocalizedValue('State list', '', '')}
|
|
204
|
+
columns={columns}
|
|
205
|
+
data={statelist}
|
|
206
|
+
loading={isLoading}
|
|
207
|
+
loadingMessage={PConnect.getLocalizedValue('Loading state list', '', '')}
|
|
208
|
+
/>
|
|
209
|
+
)}
|
|
210
|
+
</StyledPegaDxilMyIconButtonUrlWrapper>
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
export default withConfiguration(PegaDxilMyIconButtonUrl);
|
package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/demo.stories.tsx
CHANGED
|
@@ -19,14 +19,8 @@ export const BasePegaDxilMyInteger: Story = args => {
|
|
|
19
19
|
|
|
20
20
|
const props = {
|
|
21
21
|
value: configProps.value,
|
|
22
|
-
placeholder: configProps.placeholder,
|
|
23
|
-
label: configProps.label,
|
|
24
|
-
helperText: configProps.helperText,
|
|
25
|
-
showGroupSeparators: configProps.showGroupSeparators,
|
|
26
22
|
hasSuggestions: configProps.hasSuggestions,
|
|
27
|
-
testId: configProps.testId,
|
|
28
23
|
fieldMetadata,
|
|
29
|
-
validatemessage: '',
|
|
30
24
|
getPConnect: () => {
|
|
31
25
|
return {
|
|
32
26
|
getStateProps: () => {
|
|
@@ -56,6 +50,7 @@ export const BasePegaDxilMyInteger: Story = args => {
|
|
|
56
50
|
BasePegaDxilMyInteger.args = {
|
|
57
51
|
label: configProps.label,
|
|
58
52
|
helperText: configProps.helperText,
|
|
53
|
+
placeholder: configProps.placeholder,
|
|
59
54
|
showGroupSeparators: configProps.showGroupSeparators,
|
|
60
55
|
testId: configProps.testId,
|
|
61
56
|
readOnly: configProps.readOnly,
|
|
@@ -64,5 +59,6 @@ BasePegaDxilMyInteger.args = {
|
|
|
64
59
|
status: configProps.status,
|
|
65
60
|
hideLabel: configProps.hideLabel,
|
|
66
61
|
displayMode: configProps.displayMode,
|
|
62
|
+
variant: configProps.variant,
|
|
67
63
|
validatemessage: configProps.validatemessage
|
|
68
64
|
};
|
|
@@ -18,6 +18,7 @@ export default function GetNextWork(props: PegaDxilMyPageWorkProps) {
|
|
|
18
18
|
const toasterCtx = useToaster();
|
|
19
19
|
|
|
20
20
|
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
21
|
+
const localeCategory = 'Case';
|
|
21
22
|
|
|
22
23
|
const getNextWork = () => {
|
|
23
24
|
|
|
@@ -30,7 +31,7 @@ export default function GetNextWork(props: PegaDxilMyPageWorkProps) {
|
|
|
30
31
|
console.log(err);
|
|
31
32
|
if (err[0].status === 404) {
|
|
32
33
|
toasterCtx.push({
|
|
33
|
-
content: localizedVal('No task currently available')
|
|
34
|
+
content: localizedVal('No task currently available', localeCategory)
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
});
|
|
@@ -35,9 +35,7 @@ export const BasePegaDxilMyPage: Story = args => {
|
|
|
35
35
|
|
|
36
36
|
const props = {
|
|
37
37
|
useConfigurableLayout: false,
|
|
38
|
-
enableGetNextWork: pyHome1Raw.config.enableGetNextWork,
|
|
39
38
|
icon: pyHome1Raw.config.icon,
|
|
40
|
-
title: 'Page Template',
|
|
41
39
|
|
|
42
40
|
getPConnect: () => {
|
|
43
41
|
return {
|
|
@@ -108,4 +106,7 @@ export const BasePegaDxilMyPage: Story = args => {
|
|
|
108
106
|
);
|
|
109
107
|
};
|
|
110
108
|
|
|
111
|
-
BasePegaDxilMyPage.args = {
|
|
109
|
+
BasePegaDxilMyPage.args = {
|
|
110
|
+
title: 'Page Template',
|
|
111
|
+
enableGetNextWork: pyHome1Raw.config.enableGetNextWork,
|
|
112
|
+
};
|
package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx
CHANGED
|
@@ -41,13 +41,10 @@ export const BasePegaDxilMyPageCaseWidget: Story = args => {
|
|
|
41
41
|
|
|
42
42
|
const props = {
|
|
43
43
|
label: configProps.label,
|
|
44
|
-
createLabel: configProps.createLabel,
|
|
45
|
-
updateLabel: configProps.updateLabel,
|
|
46
44
|
createOperator: configProps.createOperator,
|
|
47
45
|
updateOperator: configProps.updateOperator,
|
|
48
46
|
createDateTime: configProps.createDateTime,
|
|
49
47
|
updateDateTime: configProps.updateDateTime,
|
|
50
|
-
hideLabel: configProps.hideLabel,
|
|
51
48
|
|
|
52
49
|
getPConnect: () => {
|
|
53
50
|
return {
|
|
@@ -72,4 +69,8 @@ return (
|
|
|
72
69
|
);
|
|
73
70
|
};
|
|
74
71
|
|
|
75
|
-
BasePegaDxilMyPageCaseWidget.args = {
|
|
72
|
+
BasePegaDxilMyPageCaseWidget.args = {
|
|
73
|
+
createLabel: configProps.createLabel,
|
|
74
|
+
updateLabel: configProps.updateLabel,
|
|
75
|
+
hideLabel: configProps.hideLabel
|
|
76
|
+
};
|
package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.stories.tsx
CHANGED
|
@@ -17,25 +17,103 @@ const meta: Meta<typeof PegaDxilMyPageWidget> = {
|
|
|
17
17
|
export default meta;
|
|
18
18
|
type Story = StoryObj<typeof PegaDxilMyPageWidget>;
|
|
19
19
|
|
|
20
|
+
if (!window.PCore) {
|
|
21
|
+
window.PCore = {};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const worklistData = {
|
|
25
|
+
data: {
|
|
26
|
+
data: [
|
|
27
|
+
{
|
|
28
|
+
pxProcessName: 'Loan',
|
|
29
|
+
pxRefObjectInsName: ' A-8002',
|
|
30
|
+
pyAssignmentStatus: 'New',
|
|
31
|
+
pxTaskLabel: 'Details'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
pxProcessName: 'Loan',
|
|
35
|
+
pxRefObjectInsName: ' A-7001',
|
|
36
|
+
pyAssignmentStatus: 'Open',
|
|
37
|
+
pxTaskLabel: 'Info'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
pxProcessName: 'Loan',
|
|
41
|
+
pxRefObjectInsName: ' A-9000',
|
|
42
|
+
pyAssignmentStatus: 'Open',
|
|
43
|
+
pxTaskLabel: 'Amount'
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
window.PCore.getDataApiUtils = () => {
|
|
50
|
+
return {
|
|
51
|
+
getData: () => {
|
|
52
|
+
return new Promise(resolve => {
|
|
53
|
+
resolve(worklistData);
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
getDataAsync: () => {
|
|
57
|
+
return new Promise(resolve => {
|
|
58
|
+
resolve(worklistData);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
20
66
|
export const BasePegaDxilMyPageWidget: Story = args => {
|
|
21
67
|
|
|
22
68
|
const props = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
69
|
+
...configProps,
|
|
70
|
+
getPConnect: () => {
|
|
71
|
+
return {
|
|
72
|
+
getValue: value => {
|
|
73
|
+
return value;
|
|
74
|
+
},
|
|
75
|
+
getContextName: () => {
|
|
76
|
+
return 'app/primary_1';
|
|
77
|
+
},
|
|
78
|
+
getLocalizedValue: value => {
|
|
79
|
+
return value;
|
|
80
|
+
},
|
|
81
|
+
getActionsApi: () => {
|
|
82
|
+
return {
|
|
83
|
+
updateFieldValue: () => {
|
|
84
|
+
/* nothing */
|
|
85
|
+
},
|
|
86
|
+
triggerFieldChange: () => {
|
|
87
|
+
/* nothing */
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
ignoreSuggestion: () => {
|
|
92
|
+
/* nothing */
|
|
93
|
+
},
|
|
94
|
+
acceptSuggestion: () => {
|
|
95
|
+
/* nothing */
|
|
96
|
+
},
|
|
97
|
+
setInheritedProps: () => {
|
|
98
|
+
/* nothing */
|
|
99
|
+
},
|
|
100
|
+
resolveConfigProps: () => {
|
|
101
|
+
/* nothing */
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
};
|
|
30
106
|
|
|
31
|
-
return (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
107
|
+
return (
|
|
108
|
+
<>
|
|
109
|
+
<PegaDxilMyPageWidget {...props} {...args} />
|
|
110
|
+
</>
|
|
111
|
+
);
|
|
36
112
|
};
|
|
37
113
|
|
|
38
114
|
BasePegaDxilMyPageWidget.args = {
|
|
39
115
|
header: configProps.header,
|
|
40
|
-
description: configProps.description
|
|
116
|
+
description: configProps.description,
|
|
117
|
+
whatsnewlink: configProps.whatsnewlink,
|
|
118
|
+
datasource: configProps.datasource,
|
|
41
119
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { withConfiguration, Table } from '@pega/cosmos-react-core';
|
|
2
3
|
import { AppAnnouncement as PegaAppAnnouncement } from '@pega/cosmos-react-work';
|
|
3
4
|
import type { PConnFieldProps } from './PConnProps';
|
|
4
5
|
|
|
@@ -14,14 +15,17 @@ interface PegaDxilMyPageWidgetProps extends PConnFieldProps {
|
|
|
14
15
|
image: string;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
// Duplicated runtime code from Constellation Design System Component
|
|
19
|
-
|
|
20
18
|
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
21
19
|
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
22
20
|
function PegaDxilMyPageWidget(props: PegaDxilMyPageWidgetProps) {
|
|
23
21
|
|
|
24
|
-
const { header, description, datasource = [], whatsnewlink, image } = props;
|
|
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 = 'D_pyMyWorkList';
|
|
27
|
+
const context = PConnect.getContextName();
|
|
28
|
+
|
|
25
29
|
let details = [];
|
|
26
30
|
// @ts-ignore
|
|
27
31
|
if (datasource && datasource.source) {
|
|
@@ -30,6 +34,56 @@ function PegaDxilMyPageWidget(props: PegaDxilMyPageWidgetProps) {
|
|
|
30
34
|
return item.name;
|
|
31
35
|
});
|
|
32
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.pxProcessName,
|
|
66
|
+
insKey: entry.pxRefObjectInsName,
|
|
67
|
+
status: entry.pyAssignmentStatus,
|
|
68
|
+
stage: entry.pxTaskLabel,
|
|
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
|
+
|
|
33
87
|
return (
|
|
34
88
|
<StyledPegaDxilMyPageWidgetWrapper>
|
|
35
89
|
<PegaAppAnnouncement
|
|
@@ -39,6 +93,14 @@ function PegaDxilMyPageWidget(props: PegaDxilMyPageWidgetProps) {
|
|
|
39
93
|
whatsNewLink={whatsnewlink}
|
|
40
94
|
image={image.replace(/ /g, '+')}
|
|
41
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
|
+
/>
|
|
42
104
|
</StyledPegaDxilMyPageWidgetWrapper>
|
|
43
105
|
);
|
|
44
106
|
|
package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/demo.stories.tsx
CHANGED
|
@@ -20,13 +20,8 @@ export const BasePegaDxilMyParagraph: Story = args => {
|
|
|
20
20
|
|
|
21
21
|
const props = {
|
|
22
22
|
value: configProps.value,
|
|
23
|
-
placeholder: configProps.placeholder,
|
|
24
|
-
label: configProps.label,
|
|
25
|
-
helperText: configProps.helperText,
|
|
26
|
-
testId: configProps.testId,
|
|
27
23
|
hasSuggestions: configProps.hasSuggestions,
|
|
28
24
|
fieldMetadata,
|
|
29
|
-
validatemessage: '',
|
|
30
25
|
getPConnect: () => {
|
|
31
26
|
return {
|
|
32
27
|
getStateProps: () => {
|
|
@@ -64,5 +59,6 @@ BasePegaDxilMyParagraph.args = {
|
|
|
64
59
|
status: configProps.status,
|
|
65
60
|
hideLabel: configProps.hideLabel,
|
|
66
61
|
displayMode: configProps.displayMode,
|
|
62
|
+
variant: configProps.variant,
|
|
67
63
|
validatemessage: configProps.validatemessage
|
|
68
64
|
};
|
package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/demo.stories.tsx
CHANGED
|
@@ -20,14 +20,8 @@ export const BasePegaDxilMyPercentage: Story = args => {
|
|
|
20
20
|
|
|
21
21
|
const props = {
|
|
22
22
|
value: configProps.value,
|
|
23
|
-
placeholder: configProps.placeholder,
|
|
24
|
-
label: configProps.label,
|
|
25
|
-
helperText: configProps.helperText,
|
|
26
|
-
showGroupSeparators: configProps.showGroupSeparators,
|
|
27
23
|
hasSuggestions: configProps.hasSuggestions,
|
|
28
|
-
testId: configProps.testId,
|
|
29
24
|
fieldMetadata,
|
|
30
|
-
validatemessage: '',
|
|
31
25
|
getPConnect: () => {
|
|
32
26
|
return {
|
|
33
27
|
getStateProps: () => {
|
|
@@ -57,6 +51,7 @@ export const BasePegaDxilMyPercentage: Story = args => {
|
|
|
57
51
|
BasePegaDxilMyPercentage.args = {
|
|
58
52
|
label: configProps.label,
|
|
59
53
|
helperText: configProps.helperText,
|
|
54
|
+
placeholder: configProps.placeholder,
|
|
60
55
|
showGroupSeparators: configProps.showGroupSeparators,
|
|
61
56
|
testId: configProps.testId,
|
|
62
57
|
readOnly: configProps.readOnly,
|
|
@@ -65,5 +60,6 @@ BasePegaDxilMyPercentage.args = {
|
|
|
65
60
|
status: configProps.status,
|
|
66
61
|
hideLabel: configProps.hideLabel,
|
|
67
62
|
displayMode: configProps.displayMode,
|
|
63
|
+
variant: configProps.variant,
|
|
68
64
|
validatemessage: configProps.validatemessage
|
|
69
65
|
};
|
|
@@ -19,12 +19,7 @@ export const BasePegaDxilMyPhone: Story = args => {
|
|
|
19
19
|
|
|
20
20
|
const props = {
|
|
21
21
|
value: configProps.value,
|
|
22
|
-
placeholder: configProps.placeholder,
|
|
23
|
-
label: configProps.label,
|
|
24
|
-
testId: configProps.testId,
|
|
25
22
|
hasSuggestions: configProps.hasSuggestions,
|
|
26
|
-
datasource: configProps.datasource,
|
|
27
|
-
validatemessage: '',
|
|
28
23
|
getPConnect: () => {
|
|
29
24
|
return {
|
|
30
25
|
getStateProps: () => {
|
|
@@ -52,6 +47,7 @@ export const BasePegaDxilMyPhone: Story = args => {
|
|
|
52
47
|
};
|
|
53
48
|
|
|
54
49
|
BasePegaDxilMyPhone.args = {
|
|
50
|
+
datasource: configProps.datasource,
|
|
55
51
|
label: configProps.label,
|
|
56
52
|
helperText: configProps.helperText,
|
|
57
53
|
placeholder: configProps.placeholder,
|
|
@@ -62,5 +58,6 @@ BasePegaDxilMyPhone.args = {
|
|
|
62
58
|
status: configProps.status,
|
|
63
59
|
hideLabel: configProps.hideLabel,
|
|
64
60
|
displayMode: configProps.displayMode,
|
|
61
|
+
variant: configProps.variant,
|
|
65
62
|
validatemessage: configProps.validatemessage
|
|
66
63
|
};
|