@pega/dx-component-builder-sdk 25.1.16 → 26.1.10
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/package.json +1 -1
- package/pega-dx-component-builder-sdk-26.1.10.tgz +0 -0
- package/src/constants.js +4 -0
- package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/utils.ts.mustache +1 -1
- package/src/tasks/create/templates/Constellation/template/DETAILS/DetailsRender.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/template/DETAILS-region/DetailsRender.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/template/FORM/DetailsRender.tsx +1 -1
- package/src/tasks/create/templates/Constellation/template/FORM-region/DetailsRender.tsx +1 -1
- package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +22 -6
- package/src/tasks/create/templates/SDK-React/field/Date/demo.stories.tsx.mustache +8 -1
- package/src/tasks/create/templates/SDK-React/field/Date/index.tsx.mustache +22 -13
- package/src/tasks/create/templates/SDK-React/field/DateTime/demo.stories.tsx.mustache +9 -1
- package/src/tasks/create/templates/SDK-React/field/DateTime/index.tsx.mustache +23 -14
- package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +24 -8
- package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +24 -8
- package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +24 -10
- package/src/tasks/create/templates/SDK-React/field/Integer/index.tsx.mustache +26 -14
- package/src/tasks/create/templates/SDK-React/field/Picklist/index.tsx.mustache +34 -8
- package/src/tasks/create/templates/SDK-React/field/Picklist-Autocomplete/index.tsx.mustache +25 -9
- package/src/tasks/create/templates/SDK-React/field/Picklist-RadioButtons/index.tsx.mustache +21 -5
- package/src/tasks/create/templates/SDK-React/field/Text/index.tsx.mustache +25 -14
- package/src/tasks/create/templates/SDK-React/field/Text-Email/index.tsx.mustache +32 -21
- package/src/tasks/create/templates/SDK-React/field/Text-Input/index.tsx.mustache +25 -10
- package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/index.tsx.mustache +26 -14
- package/src/tasks/create/templates/SDK-React/field/Text-Phone/index.tsx.mustache +28 -10
- package/src/tasks/create/templates/SDK-React/field/Text-URL/index.tsx.mustache +26 -14
- package/src/tasks/create/templates/SDK-React/field/TimeOfDay/demo.stories.tsx.mustache +9 -1
- package/src/tasks/create/templates/SDK-React/field/TimeOfDay/index.tsx.mustache +22 -17
- package/src/tasks/create/templates/SDK-React/template/FORM/DefaultForm.css +82 -2
- package/src/tasks/create/templates/SDK-React/template/FORM/index.tsx.mustache +51 -11
- package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +19 -15
- package/src/tasks/create/templates/SDK-React/widget/PAGE/index.tsx.mustache +2 -167
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/index.tsx.mustache +72 -15
- package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx +25 -14
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/AlertBanner/AlertBanner.css +46 -0
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/AlertBanner/AlertBanner.tsx +37 -20
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +14 -0
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +57 -5
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldGroup/FieldGroup.tsx +18 -11
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldGroupList/FieldGroupList.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +19 -4
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/Operator/Operator.tsx +125 -74
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/RichTextEditor/RichTextEditor.tsx +184 -90
- package/tests/assets/sdk-r/components/create/override-sdk/field/AutoComplete/AutoComplete.tsx +372 -26
- package/tests/assets/sdk-r/components/create/override-sdk/field/Checkbox/Checkbox.tsx +22 -6
- package/tests/assets/sdk-r/components/create/override-sdk/field/Currency/Currency.tsx +22 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/Date/Date.tsx +35 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/DateTime/DateTime.tsx +35 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/Decimal/Decimal.tsx +22 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/Dropdown/Dropdown.tsx +48 -16
- package/tests/assets/sdk-r/components/create/override-sdk/field/Email/Email.tsx +21 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/Group/Group.tsx +28 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/Integer/Integer.tsx +21 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/Multiselect/Multiselect.tsx +42 -20
- package/tests/assets/sdk-r/components/create/override-sdk/field/Multiselect/utils.ts +5 -3
- package/tests/assets/sdk-r/components/create/override-sdk/field/ObjectReference/ObjectReference.tsx +554 -66
- package/tests/assets/sdk-r/components/create/override-sdk/field/ObjectReference/utils.ts +108 -20
- package/tests/assets/sdk-r/components/create/override-sdk/field/Percentage/Percentage.tsx +22 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/Phone/Phone.tsx +23 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/RadioButtons/RadioButtons.tsx +20 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/RichText/RichText.css +0 -79
- package/tests/assets/sdk-r/components/create/override-sdk/field/RichText/RichText.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/field/SelectableCard/SelectableCard.tsx +25 -10
- package/tests/assets/sdk-r/components/create/override-sdk/field/TextArea/TextArea.tsx +22 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/TextInput/TextInput.tsx +21 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/Time/Time.tsx +35 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/URL/URL.tsx +22 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/UserReference/UserReference.tsx +10 -6
- package/tests/assets/sdk-r/components/create/override-sdk/infra/Assignment/Assignment.tsx +36 -14
- package/tests/assets/sdk-r/components/create/override-sdk/infra/Assignment/useValidationBanner.ts +29 -0
- package/tests/assets/sdk-r/components/create/override-sdk/infra/DeferLoad/DeferLoad.tsx +31 -10
- package/tests/assets/sdk-r/components/create/override-sdk/infra/FlowContainer/FlowContainer.tsx +5 -6
- package/tests/assets/sdk-r/components/create/override-sdk/infra/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/infra/ModalViewContainer/DataViewActionButtons/DataViewActionButtons.tsx +138 -0
- package/tests/assets/sdk-r/components/create/override-sdk/infra/ModalViewContainer/ModalViewContainer.tsx +110 -64
- package/tests/assets/sdk-r/components/create/override-sdk/infra/MultiStep/MultiStep.css +63 -0
- package/tests/assets/sdk-r/components/create/override-sdk/infra/MultiStep/MultiStep.tsx +23 -52
- package/tests/assets/sdk-r/components/create/override-sdk/infra/NavBar/NavBar.tsx +8 -3
- package/tests/assets/sdk-r/components/create/override-sdk/infra/Reference/Reference.tsx +5 -0
- package/tests/assets/sdk-r/components/create/override-sdk/infra/RootContainer/RootContainer.tsx +4 -5
- package/tests/assets/sdk-r/components/create/override-sdk/infra/View/View.css +1 -0
- package/tests/assets/sdk-r/components/create/override-sdk/infra/View/View.tsx +10 -17
- package/tests/assets/sdk-r/components/create/override-sdk/infra/ViewContainer/ViewContainer.tsx +8 -10
- package/tests/assets/sdk-r/components/create/override-sdk/template/AppShell/AppShell.css +0 -4
- package/tests/assets/sdk-r/components/create/override-sdk/template/AppShell/AppShell.tsx +7 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseSummary/CaseSummary.tsx +9 -42
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseView/CaseView.tsx +8 -2
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +58 -3
- package/tests/assets/sdk-r/components/create/override-sdk/template/DataReference/DataReference.tsx +56 -33
- package/tests/assets/sdk-r/components/create/override-sdk/template/DataReference/SearchForm.tsx +3 -4
- package/tests/assets/sdk-r/components/create/override-sdk/template/DefaultForm/DefaultForm.css +71 -0
- package/tests/assets/sdk-r/components/create/override-sdk/template/DefaultForm/DefaultForm.tsx +45 -9
- package/tests/assets/sdk-r/components/create/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +10 -3
- package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/ListView.tsx +139 -59
- package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/hooks.ts +80 -13
- package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/utils.ts +13 -3
- package/tests/assets/sdk-r/components/create/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +16 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +167 -93
- package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableSelect/SimpleTableSelect.tsx +71 -56
- package/tests/assets/sdk-r/components/create/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +12 -7
- package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/Attachment.tsx +119 -26
- package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/AttachmentUtils.ts +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/widget/CaseHistory/CaseHistory.tsx +16 -12
- package/tests/assets/sdk-r/components/create/override-sdk/widget/FileUtility/FileUtility.tsx +40 -28
- package/tests/assets/sdk-r/components/create/override-sdk/widget/ToDo/ToDo.tsx +14 -6
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/utils.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/DetailsRender.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyForm/DetailsRender.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/DetailsRender.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnForm/DetailsRender.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/index.tsx +22 -6
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +24 -8
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/demo.stories.tsx +8 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/index.tsx +22 -13
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/demo.stories.tsx +9 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/index.tsx +23 -14
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +24 -8
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyEmail/index.tsx +32 -21
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/index.tsx +2 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/index.tsx +26 -14
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/index.tsx +26 -14
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +24 -10
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPhone/index.tsx +25 -10
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPicklist/index.tsx +34 -8
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyRadiobuttons/index.tsx +21 -5
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MySearchbox/index.tsx +22 -9
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/index.tsx +25 -14
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/index.tsx +25 -10
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +9 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/index.tsx +22 -17
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyURL/index.tsx +26 -14
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/DefaultForm.css +82 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/index.tsx +45 -8
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/index.tsx +19 -15
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/index.tsx +66 -15
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/index.tsx +2 -167
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/AlertBanner/AlertBanner.css +46 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/AlertBanner/AlertBanner.tsx +37 -20
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +14 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +57 -5
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldGroup/FieldGroup.tsx +18 -11
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldGroupList/FieldGroupList.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +19 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/Operator/Operator.tsx +125 -74
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/RichTextEditor/RichTextEditor.tsx +184 -90
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/AutoComplete/AutoComplete.tsx +372 -26
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Checkbox/Checkbox.tsx +22 -6
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Currency/Currency.tsx +22 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Date/Date.tsx +35 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/DateTime/DateTime.tsx +35 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Decimal/Decimal.tsx +22 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Dropdown/Dropdown.tsx +48 -16
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Email/Email.tsx +21 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Group/Group.tsx +28 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Integer/Integer.tsx +21 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Multiselect/Multiselect.tsx +42 -20
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Multiselect/utils.ts +5 -3
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/ObjectReference/ObjectReference.tsx +554 -66
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/ObjectReference/utils.ts +108 -20
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/Percentage.tsx +22 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Phone/Phone.tsx +23 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/RadioButtons/RadioButtons.tsx +20 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/RichText/RichText.css +0 -79
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/RichText/RichText.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/SelectableCard/SelectableCard.tsx +25 -10
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/TextArea/TextArea.tsx +22 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/TextInput/TextInput.tsx +21 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Time/Time.tsx +35 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/URL/URL.tsx +22 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/UserReference/UserReference.tsx +10 -6
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Assignment/Assignment.tsx +36 -14
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Assignment/useValidationBanner.ts +29 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/DeferLoad/DeferLoad.tsx +31 -10
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/FlowContainer/FlowContainer.tsx +5 -6
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/ModalViewContainer/DataViewActionButtons/DataViewActionButtons.tsx +138 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/ModalViewContainer/ModalViewContainer.tsx +110 -64
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/MultiStep/MultiStep.css +63 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/MultiStep/MultiStep.tsx +23 -52
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/NavBar/NavBar.tsx +8 -3
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Reference/Reference.tsx +5 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/RootContainer/RootContainer.tsx +4 -5
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/View/View.css +1 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/View/View.tsx +10 -17
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/ViewContainer/ViewContainer.tsx +8 -10
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/AppShell/AppShell.css +0 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/AppShell/AppShell.tsx +7 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseSummary/CaseSummary.tsx +9 -42
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseView/CaseView.tsx +8 -2
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +58 -3
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DataReference/DataReference.tsx +56 -33
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DataReference/SearchForm.tsx +3 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DefaultForm/DefaultForm.css +71 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DefaultForm/DefaultForm.tsx +45 -9
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +10 -3
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/ListView.tsx +139 -59
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/hooks.ts +80 -13
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/utils.ts +13 -3
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +16 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +167 -93
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableSelect/SimpleTableSelect.tsx +71 -56
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +12 -7
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/Attachment.tsx +119 -26
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/AttachmentUtils.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/CaseHistory/CaseHistory.tsx +16 -12
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/FileUtility/FileUtility.tsx +40 -28
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/ToDo/ToDo.tsx +14 -6
- package/SECURITY.md +0 -10
|
@@ -4,10 +4,18 @@ import { TextField } from '@mui/material';
|
|
|
4
4
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
6
|
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
|
+
import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
|
|
8
|
+
import { getFieldSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
|
|
7
9
|
|
|
8
10
|
interface TextInputProps extends PConnFieldProps {
|
|
9
11
|
// If any, enter additional props that only exist on TextInput here
|
|
10
12
|
fieldMetadata?: any;
|
|
13
|
+
showFieldMessage?: boolean;
|
|
14
|
+
messageConfig?: {
|
|
15
|
+
content?: string;
|
|
16
|
+
visibility?: boolean;
|
|
17
|
+
};
|
|
18
|
+
variant?: string;
|
|
11
19
|
}
|
|
12
20
|
|
|
13
21
|
export default function TextInput(props: TextInputProps) {
|
|
@@ -21,7 +29,6 @@ export default function TextInput(props: TextInputProps) {
|
|
|
21
29
|
disabled,
|
|
22
30
|
value = '',
|
|
23
31
|
validatemessage,
|
|
24
|
-
status,
|
|
25
32
|
/* onChange, onBlur */
|
|
26
33
|
readOnly,
|
|
27
34
|
testId,
|
|
@@ -29,14 +36,23 @@ export default function TextInput(props: TextInputProps) {
|
|
|
29
36
|
helperText,
|
|
30
37
|
displayMode,
|
|
31
38
|
hideLabel,
|
|
32
|
-
placeholder
|
|
39
|
+
placeholder,
|
|
40
|
+
showFieldMessage,
|
|
41
|
+
messageConfig = {}
|
|
33
42
|
} = props;
|
|
34
43
|
|
|
35
44
|
const pConn = getPConnect();
|
|
36
45
|
const actions = pConn.getActionsApi();
|
|
37
46
|
const propName = (pConn.getStateProps() as any).value;
|
|
47
|
+
const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
|
|
48
|
+
const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
|
|
38
49
|
|
|
39
|
-
const
|
|
50
|
+
const status = useStatus({
|
|
51
|
+
showFieldMessage,
|
|
52
|
+
messageVisibility: messageConfig.visibility,
|
|
53
|
+
validatemessage,
|
|
54
|
+
readOnly
|
|
55
|
+
});
|
|
40
56
|
|
|
41
57
|
const [inputValue, setInputValue] = useState('');
|
|
42
58
|
const maxLength = fieldMetadata?.maxLength;
|
|
@@ -48,7 +64,7 @@ export default function TextInput(props: TextInputProps) {
|
|
|
48
64
|
}, [value]);
|
|
49
65
|
|
|
50
66
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
51
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
67
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} variant={props.variant} />;
|
|
52
68
|
}
|
|
53
69
|
|
|
54
70
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
@@ -87,6 +103,7 @@ export default function TextInput(props: TextInputProps) {
|
|
|
87
103
|
slotProps={{
|
|
88
104
|
input: { ...readOnlyProp, inputProps: { maxLength, ...testProps } }
|
|
89
105
|
}}
|
|
106
|
+
sx={getFieldSx(status)}
|
|
90
107
|
/>
|
|
91
108
|
);
|
|
92
109
|
}
|
|
@@ -5,9 +5,17 @@ import dayjs from 'dayjs';
|
|
|
5
5
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
6
6
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
7
7
|
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
|
+
import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
|
|
9
|
+
import { getFieldSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
|
|
8
10
|
|
|
9
11
|
interface TimeProps extends PConnFieldProps {
|
|
10
12
|
// If any, enter additional props that only exist on Time here
|
|
13
|
+
showFieldMessage?: boolean;
|
|
14
|
+
messageConfig?: {
|
|
15
|
+
content?: string;
|
|
16
|
+
visibility?: boolean;
|
|
17
|
+
};
|
|
18
|
+
variant?: string;
|
|
11
19
|
}
|
|
12
20
|
|
|
13
21
|
export default function Time(props: TimeProps) {
|
|
@@ -15,13 +23,35 @@ export default function Time(props: TimeProps) {
|
|
|
15
23
|
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
16
24
|
const TextInput = getComponentFromMap('TextInput');
|
|
17
25
|
|
|
18
|
-
const {
|
|
19
|
-
|
|
26
|
+
const {
|
|
27
|
+
getPConnect,
|
|
28
|
+
label,
|
|
29
|
+
required,
|
|
30
|
+
disabled,
|
|
31
|
+
value = '',
|
|
32
|
+
validatemessage,
|
|
33
|
+
readOnly,
|
|
34
|
+
helperText,
|
|
35
|
+
displayMode,
|
|
36
|
+
hideLabel,
|
|
37
|
+
testId,
|
|
38
|
+
showFieldMessage,
|
|
39
|
+
messageConfig = {}
|
|
40
|
+
} = props;
|
|
41
|
+
const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
|
|
42
|
+
const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
|
|
20
43
|
const pConn = getPConnect();
|
|
21
44
|
const actions = pConn.getActionsApi();
|
|
22
45
|
const propName = (pConn.getStateProps() as any).value;
|
|
46
|
+
|
|
47
|
+
const status = useStatus({
|
|
48
|
+
showFieldMessage,
|
|
49
|
+
messageVisibility: messageConfig.visibility,
|
|
50
|
+
validatemessage,
|
|
51
|
+
readOnly
|
|
52
|
+
});
|
|
23
53
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
24
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
54
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} variant={props.variant} />;
|
|
25
55
|
}
|
|
26
56
|
|
|
27
57
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
@@ -71,7 +101,8 @@ export default function Time(props: TimeProps) {
|
|
|
71
101
|
error: status === 'error',
|
|
72
102
|
helperText: helperTextToDisplay,
|
|
73
103
|
size: 'small',
|
|
74
|
-
InputProps: { ...testProps }
|
|
104
|
+
InputProps: { ...testProps },
|
|
105
|
+
sx: getFieldSx(status)
|
|
75
106
|
}
|
|
76
107
|
}}
|
|
77
108
|
/>
|
|
@@ -4,9 +4,17 @@ import { TextField } from '@mui/material';
|
|
|
4
4
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
6
|
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
|
+
import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
|
|
8
|
+
import { getFieldSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
|
|
7
9
|
|
|
8
10
|
interface URLComponentProps extends PConnFieldProps {
|
|
9
11
|
// If any, enter additional props that only exist on URLComponent here
|
|
12
|
+
showFieldMessage?: boolean;
|
|
13
|
+
messageConfig?: {
|
|
14
|
+
content?: string;
|
|
15
|
+
visibility?: boolean;
|
|
16
|
+
};
|
|
17
|
+
variant?: string;
|
|
10
18
|
}
|
|
11
19
|
|
|
12
20
|
// NOTE: that we had to change the name from URL to URLComponent
|
|
@@ -24,15 +32,17 @@ export default function URLComponent(props: URLComponentProps) {
|
|
|
24
32
|
disabled,
|
|
25
33
|
value = '',
|
|
26
34
|
validatemessage,
|
|
27
|
-
status,
|
|
28
35
|
readOnly,
|
|
29
36
|
testId,
|
|
30
37
|
helperText,
|
|
31
38
|
displayMode,
|
|
32
39
|
hideLabel,
|
|
33
|
-
placeholder
|
|
40
|
+
placeholder,
|
|
41
|
+
showFieldMessage,
|
|
42
|
+
messageConfig = {}
|
|
34
43
|
} = props;
|
|
35
|
-
const
|
|
44
|
+
const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
|
|
45
|
+
const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
|
|
36
46
|
|
|
37
47
|
const [inputValue, setInputValue] = useState('');
|
|
38
48
|
|
|
@@ -40,12 +50,19 @@ export default function URLComponent(props: URLComponentProps) {
|
|
|
40
50
|
const actions = pConn.getActionsApi();
|
|
41
51
|
const propName = (pConn.getStateProps() as any).value;
|
|
42
52
|
|
|
53
|
+
const status = useStatus({
|
|
54
|
+
showFieldMessage,
|
|
55
|
+
messageVisibility: messageConfig.visibility,
|
|
56
|
+
validatemessage,
|
|
57
|
+
readOnly
|
|
58
|
+
});
|
|
59
|
+
|
|
43
60
|
useEffect(() => {
|
|
44
61
|
setInputValue(value);
|
|
45
62
|
}, [value]);
|
|
46
63
|
|
|
47
64
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
48
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
65
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} variant={props.variant} />;
|
|
49
66
|
}
|
|
50
67
|
|
|
51
68
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
@@ -84,6 +101,7 @@ export default function URLComponent(props: URLComponentProps) {
|
|
|
84
101
|
slotProps={{
|
|
85
102
|
input: { inputProps: { ...testProps } }
|
|
86
103
|
}}
|
|
104
|
+
sx={getFieldSx(status)}
|
|
87
105
|
/>
|
|
88
106
|
);
|
|
89
107
|
}
|
package/tests/assets/sdk-r/components/create/override-sdk/field/UserReference/UserReference.tsx
CHANGED
|
@@ -68,11 +68,15 @@ const UserReference = (props: UserReferenceProps) => {
|
|
|
68
68
|
// if same user ref field is referred in view as editable & readonly formatted text
|
|
69
69
|
// referenced users won't be available, so get user details from dx api
|
|
70
70
|
const { getOperatorDetails } = PCore.getUserApi();
|
|
71
|
-
getOperatorDetails(userId)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
getOperatorDetails(userId)
|
|
72
|
+
.then((res: any) => {
|
|
73
|
+
if (res.data && res.data.pyOperatorInfo && res.data.pyOperatorInfo.pyUserName) {
|
|
74
|
+
setUserName(res.data.pyOperatorInfo.pyUserName);
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
.catch(e => {
|
|
78
|
+
console.error(e);
|
|
79
|
+
});
|
|
76
80
|
}
|
|
77
81
|
} else if (displayAs === DROPDOWN_LIST) {
|
|
78
82
|
const queryPayload = {
|
|
@@ -97,7 +101,7 @@ const UserReference = (props: UserReferenceProps) => {
|
|
|
97
101
|
let userReferenceComponent: any = null;
|
|
98
102
|
|
|
99
103
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
100
|
-
return <FieldValueList name={hideLabel ? '' : label} value={userName || ''} />;
|
|
104
|
+
return <FieldValueList name={hideLabel ? '' : label} value={userName || ''} variant={props.variant} />;
|
|
101
105
|
}
|
|
102
106
|
|
|
103
107
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
@@ -5,6 +5,8 @@ import CloseIcon from '@mui/icons-material/Close';
|
|
|
5
5
|
|
|
6
6
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
7
7
|
import { useFocusFirstField, useScrolltoTop } from '@pega/react-sdk-components/lib/hooks';
|
|
8
|
+
import AlertBanner from '@pega/react-sdk-components/lib/components/designSystemExtension/AlertBanner/AlertBanner';
|
|
9
|
+
import { useValidationBanner } from './useValidationBanner';
|
|
8
10
|
|
|
9
11
|
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
10
12
|
|
|
@@ -23,11 +25,12 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
|
|
|
23
25
|
const MultiStep = getComponentFromMap('MultiStep');
|
|
24
26
|
|
|
25
27
|
const { getPConnect, children, itemKey = '', isInModal = false, banners = [] } = props;
|
|
28
|
+
const validationMessages = useValidationBanner(itemKey);
|
|
26
29
|
const thePConn = getPConnect();
|
|
27
30
|
|
|
28
31
|
const [bHasNavigation, setHasNavigation] = useState(false);
|
|
29
32
|
const [actionButtons, setActionButtons] = useState([]);
|
|
30
|
-
const [
|
|
33
|
+
const [stepIndicator, setStepIndicator] = useState<'horizontal' | 'vertical' | 'vertical-start'>('horizontal');
|
|
31
34
|
const [arCurrentStepIndicies, setArCurrentStepIndicies] = useState<any[]>([]);
|
|
32
35
|
const [arNavigationSteps, setArNavigationSteps] = useState<any[]>([]);
|
|
33
36
|
|
|
@@ -88,8 +91,9 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
|
|
|
88
91
|
}
|
|
89
92
|
|
|
90
93
|
const scrollId = window.location.href.includes('embedded') ? '#pega-part-of-page' : '#portal';
|
|
94
|
+
const currentAssignmentViewName = getPConnect().getCaseInfo().getCurrentAssignmentViewName();
|
|
91
95
|
useScrolltoTop(scrollId, children);
|
|
92
|
-
useFocusFirstField('Assignment',
|
|
96
|
+
useFocusFirstField('Assignment', currentAssignmentViewName);
|
|
93
97
|
|
|
94
98
|
useEffect(() => {
|
|
95
99
|
if (children) {
|
|
@@ -124,9 +128,15 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
|
|
|
124
128
|
return;
|
|
125
129
|
}
|
|
126
130
|
|
|
127
|
-
// set
|
|
128
|
-
const
|
|
129
|
-
|
|
131
|
+
// set navigation mode
|
|
132
|
+
const navTemplate = navigation.template?.toLowerCase();
|
|
133
|
+
if (navTemplate === 'vertical') {
|
|
134
|
+
setStepIndicator('vertical');
|
|
135
|
+
} else if (navTemplate === 'vertical-left') {
|
|
136
|
+
setStepIndicator('vertical-start');
|
|
137
|
+
} else {
|
|
138
|
+
setStepIndicator('horizontal');
|
|
139
|
+
}
|
|
130
140
|
|
|
131
141
|
if (navigation.steps) {
|
|
132
142
|
const steps = JSON.parse(JSON.stringify(navigation.steps));
|
|
@@ -154,9 +164,14 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
|
|
|
154
164
|
}
|
|
155
165
|
|
|
156
166
|
function onSaveActionSuccess(data) {
|
|
157
|
-
actionsAPI
|
|
158
|
-
|
|
159
|
-
|
|
167
|
+
actionsAPI
|
|
168
|
+
.cancelAssignment(itemKey, false)
|
|
169
|
+
.then(() => {
|
|
170
|
+
PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_SAVED, data);
|
|
171
|
+
})
|
|
172
|
+
.catch(e => {
|
|
173
|
+
console.error(e);
|
|
174
|
+
});
|
|
160
175
|
}
|
|
161
176
|
|
|
162
177
|
function buttonPress(sAction: string, sButtonType: string) {
|
|
@@ -297,10 +312,12 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
|
|
|
297
312
|
refreshProps.forEach(prop => {
|
|
298
313
|
PCore.getRefreshManager().registerForRefresh(
|
|
299
314
|
'PROP_CHANGE',
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
315
|
+
matchedPath => {
|
|
316
|
+
thePConn.getActionsApi().refreshCaseView(caseKey, '', pageReference, {
|
|
317
|
+
...refreshOptions,
|
|
318
|
+
refreshFor: matchedPath || prop[0]
|
|
319
|
+
});
|
|
320
|
+
},
|
|
304
321
|
`${pageReference}.${prop[1]}`,
|
|
305
322
|
`${context}/${pageReference}`,
|
|
306
323
|
context
|
|
@@ -310,7 +327,12 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
|
|
|
310
327
|
|
|
311
328
|
return (
|
|
312
329
|
<div id='Assignment'>
|
|
313
|
-
{
|
|
330
|
+
{validationMessages.length > 0 && (
|
|
331
|
+
<div style={{ marginBottom: '1rem' }}>
|
|
332
|
+
<AlertBanner id={`validation-banner-${itemKey}`} variant='urgent' messages={validationMessages} />
|
|
333
|
+
</div>
|
|
334
|
+
)}
|
|
335
|
+
{banners && banners.length > 0 && <div style={{ marginBottom: '1rem' }}>{banners}</div>}
|
|
314
336
|
{bHasNavigation ? (
|
|
315
337
|
<>
|
|
316
338
|
<MultiStep
|
|
@@ -318,7 +340,7 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
|
|
|
318
340
|
itemKey={itemKey}
|
|
319
341
|
actionButtons={actionButtons}
|
|
320
342
|
onButtonPress={buttonPress}
|
|
321
|
-
|
|
343
|
+
stepIndicator={stepIndicator}
|
|
322
344
|
arCurrentStepIndicies={arCurrentStepIndicies}
|
|
323
345
|
arNavigationSteps={arNavigationSteps}
|
|
324
346
|
>
|
package/tests/assets/sdk-r/components/create/override-sdk/infra/Assignment/useValidationBanner.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
function formatError(error: any, localizedVal: Function): string {
|
|
4
|
+
if (typeof error === 'string') return localizedVal(error, 'Messages');
|
|
5
|
+
const label = error.label?.endsWith(':') ? error.label : `${error.label}:`;
|
|
6
|
+
return localizedVal(`${label} ${error.description}`, 'Messages');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Subscribes to the PCore store and returns formatted validation error messages
|
|
11
|
+
* for the given itemKey. Reacts to any ADD_MESSAGES / CLEAR_MESSAGES dispatch
|
|
12
|
+
* (blur, tab, submit, etc.) so the banner appears and clears in real time.
|
|
13
|
+
*/
|
|
14
|
+
export function useValidationBanner(itemKey: string): string[] {
|
|
15
|
+
const [messages, setMessages] = useState<string[]>([]);
|
|
16
|
+
|
|
17
|
+
const readMessages = useCallback(() => {
|
|
18
|
+
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
19
|
+
const errors: any[] = PCore.getMessageManager().getValidationErrorMessages(itemKey) || [];
|
|
20
|
+
setMessages(errors.map(error => formatError(error, localizedVal)));
|
|
21
|
+
}, [itemKey]);
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
readMessages();
|
|
25
|
+
return PCore.getStore().subscribe(readMessages);
|
|
26
|
+
}, [readMessages]);
|
|
27
|
+
|
|
28
|
+
return messages;
|
|
29
|
+
}
|
|
@@ -13,13 +13,13 @@ interface DeferLoadProps extends PConnProps {
|
|
|
13
13
|
isTab: boolean;
|
|
14
14
|
deferLoadId: string;
|
|
15
15
|
lastUpdateCaseTime: any;
|
|
16
|
+
template?: string;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
//
|
|
19
|
+
/**
|
|
20
|
+
* WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
|
|
21
|
+
* You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
|
|
22
|
+
*/
|
|
23
23
|
|
|
24
24
|
const useStyles = makeStyles(theme => ({
|
|
25
25
|
root: {
|
|
@@ -35,7 +35,7 @@ const useStyles = makeStyles(theme => ({
|
|
|
35
35
|
}));
|
|
36
36
|
|
|
37
37
|
export default function DeferLoad(props: DeferLoadProps) {
|
|
38
|
-
const { getPConnect, name, deferLoadId, isTab, lastUpdateCaseTime } = props;
|
|
38
|
+
const { getPConnect, name, deferLoadId, isTab, lastUpdateCaseTime, template } = props;
|
|
39
39
|
const [content, setContent] = useState<any>(null);
|
|
40
40
|
const [isLoading, setLoading] = useState(true);
|
|
41
41
|
const [currentLoadedAssignment, setCurrentLoadedAssignment] = useState('');
|
|
@@ -69,13 +69,13 @@ export default function DeferLoad(props: DeferLoadProps) {
|
|
|
69
69
|
|
|
70
70
|
const getViewOptions = () => ({
|
|
71
71
|
viewContext: resourceType,
|
|
72
|
-
pageClass: loadViewCaseID ? '' : (pConnect.getDataObject('') as any).pyPortal
|
|
72
|
+
pageClass: loadViewCaseID ? '' : (pConnect.getDataObject('') as any).pyPortal?.classID, // 2nd arg empty string until typedef allows optional
|
|
73
73
|
container: isContainerPreview ? 'preview' : undefined,
|
|
74
74
|
containerName: isContainerPreview ? 'preview' : undefined,
|
|
75
75
|
updateData: isContainerPreview
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
-
const onResponse = data => {
|
|
78
|
+
const onResponse = (data: any, isEditable = false) => {
|
|
79
79
|
setLoading(false);
|
|
80
80
|
if (deferLoadId) {
|
|
81
81
|
PCore.getDeferLoadManager().start(
|
|
@@ -92,11 +92,16 @@ export default function DeferLoad(props: DeferLoadProps) {
|
|
|
92
92
|
meta: data,
|
|
93
93
|
options: {
|
|
94
94
|
context: pConnect.getContextName(),
|
|
95
|
-
pageReference: pConnect.getPageReference()
|
|
95
|
+
pageReference: pConnect.getPageReference(),
|
|
96
|
+
target: pConnect.getTarget(),
|
|
97
|
+
hasForm: true,
|
|
98
|
+
viewName: (pConnect as any).viewName
|
|
96
99
|
}
|
|
97
100
|
};
|
|
98
101
|
const configObject = PCore.createPConnect(config);
|
|
99
|
-
|
|
102
|
+
if (!isEditable) {
|
|
103
|
+
configObject.getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
104
|
+
}
|
|
100
105
|
setContent(createElement(createPConnectComponent(), configObject));
|
|
101
106
|
if (deferLoadId) {
|
|
102
107
|
PCore.getDeferLoadManager().stop(deferLoadId, getPConnect().getContextName());
|
|
@@ -120,6 +125,9 @@ export default function DeferLoad(props: DeferLoadProps) {
|
|
|
120
125
|
})
|
|
121
126
|
.then(data => {
|
|
122
127
|
onResponse(data);
|
|
128
|
+
})
|
|
129
|
+
.catch(e => {
|
|
130
|
+
console.error(e);
|
|
123
131
|
});
|
|
124
132
|
} else {
|
|
125
133
|
console.error('Cannot load the defer loaded view without container information');
|
|
@@ -131,7 +139,20 @@ export default function DeferLoad(props: DeferLoadProps) {
|
|
|
131
139
|
.loadView(encodeURI(loadViewCaseID), name, getViewOptions())
|
|
132
140
|
.then(data => {
|
|
133
141
|
onResponse(data);
|
|
142
|
+
})
|
|
143
|
+
.catch(e => {
|
|
144
|
+
console.error(e);
|
|
134
145
|
});
|
|
146
|
+
} else if (template === 'HierarchicalForm') {
|
|
147
|
+
const root = {
|
|
148
|
+
config: {
|
|
149
|
+
context: pConnect.getPageReference(),
|
|
150
|
+
name,
|
|
151
|
+
type: 'view'
|
|
152
|
+
},
|
|
153
|
+
type: 'reference'
|
|
154
|
+
};
|
|
155
|
+
onResponse(root, true);
|
|
135
156
|
} else {
|
|
136
157
|
getPConnect()
|
|
137
158
|
.getActionsApi()
|
package/tests/assets/sdk-r/components/create/override-sdk/infra/FlowContainer/FlowContainer.tsx
CHANGED
|
@@ -22,11 +22,10 @@ interface FlowContainerProps extends PConnProps {
|
|
|
22
22
|
activeContainerItemID: string;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
//
|
|
25
|
+
/**
|
|
26
|
+
* WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
|
|
27
|
+
* You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
|
|
28
|
+
*/
|
|
30
29
|
|
|
31
30
|
const useStyles = makeStyles(theme => ({
|
|
32
31
|
root: {
|
|
@@ -199,7 +198,7 @@ export const FlowContainer = (props: FlowContainerProps) => {
|
|
|
199
198
|
}, [props]);
|
|
200
199
|
|
|
201
200
|
const caseId = thePConn.getCaseSummary().content.pyID;
|
|
202
|
-
const urgency = getPConnect().getCaseSummary().assignments ? getPConnect().getCaseSummary().assignments?.[0]
|
|
201
|
+
const urgency = getPConnect().getCaseSummary().assignments ? getPConnect().getCaseSummary().assignments?.[0]?.urgency : '';
|
|
203
202
|
const operatorInitials = Utils.getInitials(PCore.getEnvironmentInfo().getOperatorName() || '');
|
|
204
203
|
|
|
205
204
|
const displayPageMessages = () => {
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
3
|
+
import Button from '@mui/material/Button';
|
|
4
|
+
import { Grid2, Divider } from '@mui/material';
|
|
5
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
|
+
|
|
7
|
+
function getActionLabel(action: string, constants: { RESOURCE_STATUS: { UPDATE?: unknown; CREATE?: unknown; OPEN_FLOW_ACTION?: unknown } }) {
|
|
8
|
+
switch (action) {
|
|
9
|
+
case constants.RESOURCE_STATUS.UPDATE:
|
|
10
|
+
return 'Update';
|
|
11
|
+
case constants.RESOURCE_STATUS.CREATE:
|
|
12
|
+
return 'Submit';
|
|
13
|
+
case constants.RESOURCE_STATUS.OPEN_FLOW_ACTION:
|
|
14
|
+
return 'Submit';
|
|
15
|
+
default:
|
|
16
|
+
return 'Submit';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface DataViewActionButtonsProps extends PConnProps {
|
|
21
|
+
context: string;
|
|
22
|
+
classId: string;
|
|
23
|
+
dataObjectAction: string;
|
|
24
|
+
dataRecordKeys: string;
|
|
25
|
+
actionID: string;
|
|
26
|
+
closeActionsDialog: () => void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const useStyles = makeStyles(theme => ({
|
|
30
|
+
divider: {
|
|
31
|
+
marginTop: '10px',
|
|
32
|
+
marginBottom: '10px'
|
|
33
|
+
},
|
|
34
|
+
actionButtonsArea: {
|
|
35
|
+
padding: '8px 24px 20px 24px'
|
|
36
|
+
},
|
|
37
|
+
secondaryButton: {
|
|
38
|
+
backgroundColor: (theme as any).actionButtons.secondary.backgroundColor,
|
|
39
|
+
color: (theme as any).actionButtons.secondary.color
|
|
40
|
+
},
|
|
41
|
+
primaryButton: {
|
|
42
|
+
backgroundColor: (theme as any).actionButtons.primary.backgroundColor,
|
|
43
|
+
color: (theme as any).actionButtons.primary.color
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
46
|
+
|
|
47
|
+
export default function DataViewActionButtons(props: DataViewActionButtonsProps) {
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
49
|
+
const { getPConnect, context, classId, dataObjectAction, dataRecordKeys, actionID, closeActionsDialog } = props;
|
|
50
|
+
|
|
51
|
+
const classes = useStyles();
|
|
52
|
+
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
53
|
+
const localeCategory = 'Data Object';
|
|
54
|
+
const actionsAPI = getPConnect().getActionsApi();
|
|
55
|
+
const constants = PCore.getConstants();
|
|
56
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
57
|
+
|
|
58
|
+
const actionName = localizedVal(getActionLabel(constants.RESOURCE_STATUS[dataObjectAction], constants), localeCategory);
|
|
59
|
+
|
|
60
|
+
function handleCancel() {
|
|
61
|
+
actionsAPI.cancelDataObject(context);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function handleSubmitAction() {
|
|
65
|
+
setIsLoading(true);
|
|
66
|
+
if (constants.RESOURCE_STATUS[dataObjectAction] === constants.RESOURCE_STATUS.CREATE) {
|
|
67
|
+
actionsAPI
|
|
68
|
+
.createDataObject(context)
|
|
69
|
+
.then(data => {
|
|
70
|
+
PCore.getPubSubUtils().publish(constants.PUB_SUB_EVENTS.DATA_EVENTS.DATA_OBJECT_CREATED, {
|
|
71
|
+
classId,
|
|
72
|
+
data
|
|
73
|
+
});
|
|
74
|
+
})
|
|
75
|
+
.catch(() => {
|
|
76
|
+
// Error messages are handled by the infrastructure via httpMessages/pageMessages
|
|
77
|
+
})
|
|
78
|
+
.finally(() => {
|
|
79
|
+
setIsLoading(false);
|
|
80
|
+
});
|
|
81
|
+
} else if (constants.RESOURCE_STATUS[dataObjectAction] === constants.RESOURCE_STATUS.UPDATE) {
|
|
82
|
+
actionsAPI
|
|
83
|
+
.updateDataObject(context, JSON.parse(dataRecordKeys))
|
|
84
|
+
.then(() => {
|
|
85
|
+
PCore.getPubSubUtils().publish(constants.PUB_SUB_EVENTS.DATA_EVENTS.DATA_OBJECT_UPDATED, {
|
|
86
|
+
classId
|
|
87
|
+
});
|
|
88
|
+
})
|
|
89
|
+
.catch(() => {
|
|
90
|
+
// Error messages are handled by the infrastructure via httpMessages/pageMessages
|
|
91
|
+
})
|
|
92
|
+
.finally(() => {
|
|
93
|
+
setIsLoading(false);
|
|
94
|
+
});
|
|
95
|
+
} else if (constants.RESOURCE_STATUS[dataObjectAction] === constants.RESOURCE_STATUS.OPEN_FLOW_ACTION) {
|
|
96
|
+
actionsAPI
|
|
97
|
+
.submitDataObjectAction(context, JSON.parse(dataRecordKeys), actionID)
|
|
98
|
+
.then(() => {
|
|
99
|
+
PCore.getPubSubUtils().publish(constants.PUB_SUB_EVENTS.DATA_EVENTS.DATA_OBJECT_UPDATED, {
|
|
100
|
+
classId,
|
|
101
|
+
actionID
|
|
102
|
+
});
|
|
103
|
+
})
|
|
104
|
+
.catch(() => {
|
|
105
|
+
// Error messages are handled by the infrastructure via httpMessages/pageMessages
|
|
106
|
+
})
|
|
107
|
+
.finally(() => {
|
|
108
|
+
setIsLoading(false);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<div className={classes.actionButtonsArea}>
|
|
115
|
+
<Divider className={classes.divider} />
|
|
116
|
+
<Grid2 container spacing={4} justifyContent='space-between'>
|
|
117
|
+
<Grid2>
|
|
118
|
+
<Grid2 container spacing={1}>
|
|
119
|
+
<Grid2>
|
|
120
|
+
<Button className={classes.secondaryButton} color='secondary' variant='contained' disabled={isLoading} onClick={handleCancel}>
|
|
121
|
+
{localizedVal('Cancel', localeCategory)}
|
|
122
|
+
</Button>
|
|
123
|
+
</Grid2>
|
|
124
|
+
</Grid2>
|
|
125
|
+
</Grid2>
|
|
126
|
+
<Grid2>
|
|
127
|
+
<Grid2 container spacing={1}>
|
|
128
|
+
<Grid2>
|
|
129
|
+
<Button className={classes.primaryButton} color='primary' variant='contained' disabled={isLoading} onClick={handleSubmitAction}>
|
|
130
|
+
{actionName}
|
|
131
|
+
</Button>
|
|
132
|
+
</Grid2>
|
|
133
|
+
</Grid2>
|
|
134
|
+
</Grid2>
|
|
135
|
+
</Grid2>
|
|
136
|
+
</div>
|
|
137
|
+
);
|
|
138
|
+
}
|