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