@pega/dx-component-builder-sdk 0.242.15 → 0.242.16
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 +0 -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-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/createAll/custom-constellation/field/Pega_DXIL_MyRadioButtons/index.tsx +3 -5
- 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/createAll/custom-sdk/template/Pega_DXIL_MyDetails/index.tsx
CHANGED
|
@@ -9,6 +9,8 @@ import StyledPegaDxilMyDetailsWrapper from './styles';
|
|
|
9
9
|
|
|
10
10
|
interface PegaDxilMyDetailsProps extends PConnProps {
|
|
11
11
|
// If any, enter additional props that only exist on this component
|
|
12
|
+
label: string;
|
|
13
|
+
showLabel: boolean;
|
|
12
14
|
showHighlightedData: boolean;
|
|
13
15
|
}
|
|
14
16
|
// Duplicated runtime code from React SDK
|
|
@@ -17,8 +19,11 @@ export default function PegaDxilMyDetails(props: PegaDxilMyDetailsProps) {
|
|
|
17
19
|
// Get emitted components from map (so we can get any override that may exist)
|
|
18
20
|
const FieldGroup = getComponentFromMap('FieldGroup');
|
|
19
21
|
|
|
20
|
-
const { getPConnect, showHighlightedData } = props;
|
|
22
|
+
const { label, showLabel, getPConnect, showHighlightedData } = props;
|
|
21
23
|
|
|
24
|
+
// Get the inherited props from the parent to determine label settings
|
|
25
|
+
const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
|
|
26
|
+
|
|
22
27
|
// Set display mode prop and re-create the children so this part of the dom tree renders
|
|
23
28
|
// in a readonly (display) mode instead of a editable
|
|
24
29
|
getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
@@ -50,7 +55,7 @@ export default function PegaDxilMyDetails(props: PegaDxilMyDetailsProps) {
|
|
|
50
55
|
|
|
51
56
|
return (
|
|
52
57
|
<StyledPegaDxilMyDetailsWrapper>
|
|
53
|
-
<FieldGroup>
|
|
58
|
+
<FieldGroup name={propsToUse.showLabel ? propsToUse.label : ''}>
|
|
54
59
|
{showHighlightedData && highlightedDataArr.length > 0 && (
|
|
55
60
|
<Grid container spacing={1} style={{ padding: '0 0 1em' }}>
|
|
56
61
|
{highlightedDataArr.map((child, i) => (
|
|
@@ -9,6 +9,8 @@ import StyledPegaDxilMyTwoColumnDetailsWrapper from './styles';
|
|
|
9
9
|
|
|
10
10
|
interface PegaDxilMyTwoColumnDetailsProps extends PConnProps {
|
|
11
11
|
// If any, enter additional props that only exist on this component
|
|
12
|
+
showLabel: boolean;
|
|
13
|
+
label: string;
|
|
12
14
|
showHighlightedData: boolean;
|
|
13
15
|
}
|
|
14
16
|
// Duplicated runtime code from React SDK
|
|
@@ -17,7 +19,10 @@ export default function PegaDxilMyTwoColumnDetails(props: PegaDxilMyTwoColumnDet
|
|
|
17
19
|
// Get emitted components from map (so we can get any override that may exist)
|
|
18
20
|
const FieldGroup = getComponentFromMap('FieldGroup');
|
|
19
21
|
|
|
20
|
-
const { getPConnect, showHighlightedData = false } = props;
|
|
22
|
+
const { label, showLabel = true, getPConnect, showHighlightedData = false } = props;
|
|
23
|
+
|
|
24
|
+
// Get the inherited props from the parent to determine label settings
|
|
25
|
+
const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
|
|
21
26
|
|
|
22
27
|
// Set display mode prop and re-create the children so this part of the dom tree renders
|
|
23
28
|
// in a readonly (display) mode instead of a editable
|
|
@@ -50,7 +55,7 @@ export default function PegaDxilMyTwoColumnDetails(props: PegaDxilMyTwoColumnDet
|
|
|
50
55
|
|
|
51
56
|
return (
|
|
52
57
|
<StyledPegaDxilMyTwoColumnDetailsWrapper>
|
|
53
|
-
<FieldGroup>
|
|
58
|
+
<FieldGroup name={propsToUse.showLabel ? propsToUse.label : ''}>
|
|
54
59
|
{showHighlightedData && highlightedDataArr.length > 0 && (
|
|
55
60
|
<Grid container spacing={1} style={{ padding: '0 0 1em' }}>
|
|
56
61
|
{highlightedDataArr.map((child, i) => (
|
|
@@ -2,7 +2,7 @@ import { useState } from 'react';
|
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
|
|
4
4
|
import { TextField } from '@mui/material';
|
|
5
|
-
import
|
|
5
|
+
import { MuiTelInput } from 'mui-tel-input';
|
|
6
6
|
import { DatePicker, LocalizationProvider } from '@mui/x-date-pickers';
|
|
7
7
|
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
|
8
8
|
import dayjs from 'dayjs';
|
|
@@ -23,11 +23,17 @@ export default meta;
|
|
|
23
23
|
type Story = StoryObj<typeof PegaDxilMyTwoColumnForm>;
|
|
24
24
|
|
|
25
25
|
const renderField = resolvedProps => {
|
|
26
|
-
const { displayMode, value = '', label = '', onChange } = resolvedProps;
|
|
26
|
+
const { displayMode, value = '', label = '', onChange, required, disabled, helperText, placeholder, validatemessage, status, testId } = resolvedProps;
|
|
27
27
|
|
|
28
|
+
const helperTextToDisplay = validatemessage || helperText;
|
|
29
|
+
let testProp = {};
|
|
30
|
+
|
|
31
|
+
testProp = {
|
|
32
|
+
'data-test-id': testId
|
|
33
|
+
};
|
|
28
34
|
const variant = displayMode === 'DISPLAY_ONLY' ? 'inline' : 'stacked';
|
|
29
35
|
let val: any = '';
|
|
30
|
-
|
|
36
|
+
|
|
31
37
|
if (label === 'Service Date')
|
|
32
38
|
val = (
|
|
33
39
|
<LocalizationProvider dateAdapter={AdapterDayjs}>
|
|
@@ -64,18 +70,27 @@ const renderField = resolvedProps => {
|
|
|
64
70
|
if (label === 'First Name' || label === 'Last Name' || label === 'Middle Name')
|
|
65
71
|
val = <TextField value={value} fullWidth size='small' variant='outlined' style={{ fontSize: '14px' }} label={label} onChange={onChange} />;
|
|
66
72
|
|
|
73
|
+
const disableDropdown = true;
|
|
67
74
|
if (label === 'Phone Number')
|
|
68
75
|
val = (
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
<MuiTelInput
|
|
77
|
+
fullWidth
|
|
78
|
+
helperText={helperTextToDisplay}
|
|
79
|
+
placeholder={placeholder ?? ''}
|
|
80
|
+
size='small'
|
|
81
|
+
defaultCountry='US'
|
|
82
|
+
required={required}
|
|
83
|
+
disabled={disabled}
|
|
84
|
+
onChange={onChange}
|
|
85
|
+
error={status === 'error'}
|
|
86
|
+
label={label}
|
|
87
|
+
value={value}
|
|
88
|
+
InputProps={{
|
|
89
|
+
readOnly: true,
|
|
90
|
+
inputProps: { ...testProp }
|
|
91
|
+
}}
|
|
92
|
+
disableDropdown={disableDropdown}
|
|
93
|
+
/>
|
|
79
94
|
);
|
|
80
95
|
|
|
81
96
|
if (variant === 'inline') {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
-
import { Grid } from '@mui/material';
|
|
2
|
+
import { Grid, GridSize } from '@mui/material';
|
|
3
3
|
import makeStyles from '@mui/styles/makeStyles';
|
|
4
4
|
|
|
5
5
|
import StyledPegaDxilMyTwoColumnFormWrapper from './styles';
|
|
@@ -35,8 +35,8 @@ export default function PegaDxilMyTwoColumnForm(props: PropsWithChildren<PegaDxi
|
|
|
35
35
|
// Calculate the size
|
|
36
36
|
// Default to assume the 2 columns are evenly split. However, override if templateCol
|
|
37
37
|
// (example value: "1fr 1fr")
|
|
38
|
-
let aSize = 6;
|
|
39
|
-
let bSize = 6;
|
|
38
|
+
let aSize: GridSize = 6;
|
|
39
|
+
let bSize: GridSize = 6;
|
|
40
40
|
|
|
41
41
|
const colAArray = templateCol
|
|
42
42
|
.replaceAll(/[a-z]+/g, '')
|
|
@@ -44,8 +44,8 @@ export default function PegaDxilMyTwoColumnForm(props: PropsWithChildren<PegaDxi
|
|
|
44
44
|
.map(itm => Number(itm));
|
|
45
45
|
const totalCols = colAArray.reduce((v, itm) => itm + v, 0);
|
|
46
46
|
const ratio = 12 / totalCols;
|
|
47
|
-
aSize = (ratio * colAArray[0]) as
|
|
48
|
-
bSize = (ratio * colAArray[1]) as
|
|
47
|
+
aSize = (ratio * colAArray[0]) as GridSize;
|
|
48
|
+
bSize = (ratio * colAArray[1]) as GridSize;
|
|
49
49
|
|
|
50
50
|
return (
|
|
51
51
|
<StyledPegaDxilMyTwoColumnFormWrapper>
|
package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/index.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { Theme } from '@mui/material/styles';
|
|
2
3
|
import withStyles from '@mui/styles/withStyles';
|
|
3
4
|
import createStyles from '@mui/styles/createStyles';
|
|
4
5
|
import Table from '@mui/material/Table';
|
|
@@ -18,7 +19,7 @@ interface PegaDxilMyCaseWidgetProps extends PConnProps {
|
|
|
18
19
|
// If any, enter additional props that only exist on this component
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
const StyledTableCell = withStyles((myTheme) =>
|
|
22
|
+
const StyledTableCell = withStyles((myTheme: Theme) =>
|
|
22
23
|
createStyles({
|
|
23
24
|
head: {
|
|
24
25
|
borderWidth: '1px',
|
|
@@ -51,7 +51,7 @@ export default function FieldValueList(props: FieldValueListProps) {
|
|
|
51
51
|
|
|
52
52
|
function getGridItemLabel() {
|
|
53
53
|
return (
|
|
54
|
-
<Grid item xs={variant === 'stacked' ? 12 :
|
|
54
|
+
<Grid item xs={variant === 'stacked' ? 12 : 4} className={variant === 'stacked' ? classes.noPaddingBottom : ''}>
|
|
55
55
|
<Typography variant='body2' component='span' className={`${classes.fieldLabel}`}>
|
|
56
56
|
{name}
|
|
57
57
|
</Typography>
|
|
@@ -63,7 +63,7 @@ export default function FieldValueList(props: FieldValueListProps) {
|
|
|
63
63
|
const formattedValue = formatItemValue(value);
|
|
64
64
|
|
|
65
65
|
return (
|
|
66
|
-
<Grid item xs={variant === 'stacked' ? 12 :
|
|
66
|
+
<Grid item xs={variant === 'stacked' ? 12 : 8} className={variant === 'stacked' ? classes.noPaddingTop : ''}>
|
|
67
67
|
{isHtml ? (
|
|
68
68
|
// eslint-disable-next-line react/no-danger
|
|
69
69
|
<div dangerouslySetInnerHTML={{ __html: formattedValue }} />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { MuiTelInput } from 'mui-tel-input';
|
|
3
3
|
|
|
4
4
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
5
5
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
@@ -57,12 +57,12 @@ export default function Phone(props: PhoneProps) {
|
|
|
57
57
|
const disableDropdown = true;
|
|
58
58
|
return (
|
|
59
59
|
<div>
|
|
60
|
-
<
|
|
60
|
+
<MuiTelInput
|
|
61
61
|
fullWidth
|
|
62
62
|
helperText={helperTextToDisplay}
|
|
63
63
|
placeholder={placeholder ?? ''}
|
|
64
64
|
size='small'
|
|
65
|
-
defaultCountry='
|
|
65
|
+
defaultCountry='US'
|
|
66
66
|
required={required}
|
|
67
67
|
disabled={disabled}
|
|
68
68
|
onChange={onChange}
|
|
@@ -91,13 +91,13 @@ export default function Phone(props: PhoneProps) {
|
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
return (
|
|
94
|
-
<
|
|
94
|
+
<MuiTelInput
|
|
95
95
|
fullWidth
|
|
96
96
|
variant='outlined'
|
|
97
97
|
helperText={helperTextToDisplay}
|
|
98
98
|
placeholder={placeholder ?? ''}
|
|
99
99
|
size='small'
|
|
100
|
-
defaultCountry='
|
|
100
|
+
defaultCountry='US'
|
|
101
101
|
required={required}
|
|
102
102
|
disabled={disabled}
|
|
103
103
|
onChange={handleChange}
|
package/tests/assets/sdk-r/components/createAll/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);
|