@pega/react-sdk-overrides 0.25.3 → 0.25.5
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/lib/designSystemExtension/Banner/Banner.tsx +5 -2
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +29 -26
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.css +6 -13
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +12 -1
- package/lib/field/Group/Group.tsx +3 -1
- package/lib/field/Location/Location.css +4 -0
- package/lib/field/Location/Location.tsx +2 -0
- package/lib/field/RadioButtons/RadioButtons.tsx +1 -1
- package/lib/field/RichText/RichText.css +79 -0
- package/lib/field/RichText/RichText.tsx +2 -0
- package/lib/field/SelectableCard/SelectableCard.tsx +3 -3
- package/lib/field/UserReference/UserReference.tsx +1 -1
- package/lib/helpers/simpleTableHelpers.ts +1 -1
- package/lib/infra/Assignment/Assignment.tsx +31 -24
- package/lib/infra/MultiStep/MultiStep.css +44 -64
- package/lib/infra/MultiStep/MultiStep.tsx +25 -51
- package/lib/infra/View/View.tsx +2 -1
- package/lib/template/AppShell/AppShell.tsx +5 -7
- package/lib/template/CaseSummary/CaseSummary.tsx +5 -78
- package/lib/template/CaseView/CaseView.tsx +20 -15
- package/lib/template/DefaultPage/DefaultPage.tsx +108 -0
- package/lib/template/DefaultPage/index.tsx +1 -0
- package/lib/template/ListView/ListView.tsx +152 -157
- package/lib/template/SelfServiceCaseView/SelfServiceCaseView.tsx +145 -0
- package/lib/template/SelfServiceCaseView/index.tsx +1 -0
- package/lib/template/WssNavBar/WssNavBar.tsx +3 -3
- package/lib/template/utils.tsx +58 -0
- package/lib/widget/ToDo/ToDo.tsx +1 -5
- package/package.json +1 -1
|
@@ -157,10 +157,9 @@ export default function ListView(props: ListViewProps) {
|
|
|
157
157
|
width: '100%',
|
|
158
158
|
marginTop: theme.spacing(2),
|
|
159
159
|
marginBottom: theme.spacing(2),
|
|
160
|
-
display: 'grid'
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
padding: '5px 5px'
|
|
160
|
+
display: 'grid',
|
|
161
|
+
borderRadius: 16,
|
|
162
|
+
padding: 20
|
|
164
163
|
},
|
|
165
164
|
table: {
|
|
166
165
|
minWidth: 750
|
|
@@ -189,10 +188,6 @@ export default function ListView(props: ListViewProps) {
|
|
|
189
188
|
position: 'absolute',
|
|
190
189
|
top: 20,
|
|
191
190
|
width: 1
|
|
192
|
-
},
|
|
193
|
-
title: {
|
|
194
|
-
marginTop: theme.spacing(1),
|
|
195
|
-
marginLeft: theme.spacing(1)
|
|
196
191
|
}
|
|
197
192
|
})
|
|
198
193
|
);
|
|
@@ -1065,162 +1060,162 @@ export default function ListView(props: ListViewProps) {
|
|
|
1065
1060
|
<>
|
|
1066
1061
|
{arColumns && arColumns.length > 0 && (
|
|
1067
1062
|
<Paper className={classes.paper}>
|
|
1068
|
-
<
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
<Grid2>
|
|
1074
|
-
<
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
<
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1063
|
+
<Grid2 container justifyContent='space-between'>
|
|
1064
|
+
<Typography variant='h6' color='textPrimary' gutterBottom>
|
|
1065
|
+
{_listTitle()}
|
|
1066
|
+
</Typography>
|
|
1067
|
+
{globalSearch && (
|
|
1068
|
+
<Grid2 container spacing={1} alignItems='flex-end'>
|
|
1069
|
+
<Grid2>
|
|
1070
|
+
<SearchIcon />
|
|
1071
|
+
</Grid2>
|
|
1072
|
+
<Grid2>
|
|
1073
|
+
<TextField
|
|
1074
|
+
label={PCore.getLocaleUtils().getLocaleValue('Search', 'Search')}
|
|
1075
|
+
fullWidth
|
|
1076
|
+
variant='outlined'
|
|
1077
|
+
placeholder=''
|
|
1078
|
+
size='small'
|
|
1079
|
+
id='search'
|
|
1080
|
+
onChange={_onSearch}
|
|
1081
|
+
/>
|
|
1082
|
+
</Grid2>
|
|
1086
1083
|
</Grid2>
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
<
|
|
1092
|
-
<
|
|
1093
|
-
<
|
|
1094
|
-
|
|
1095
|
-
|
|
1084
|
+
)}
|
|
1085
|
+
</Grid2>
|
|
1086
|
+
{!bInForm ? (
|
|
1087
|
+
<TableContainer id='list-view' className={classes.tableInForm}>
|
|
1088
|
+
<Table stickyHeader aria-label='sticky table'>
|
|
1089
|
+
<TableHead>
|
|
1090
|
+
<TableRow>
|
|
1091
|
+
{arColumns.map(column => {
|
|
1092
|
+
return (
|
|
1093
|
+
<TableCell className={classes.cell} key={column.id} sortDirection={orderBy === column.id ? order : false}>
|
|
1094
|
+
<TableSortLabel
|
|
1095
|
+
active={orderBy === column.id}
|
|
1096
|
+
direction={orderBy === column.id ? order : 'asc'}
|
|
1097
|
+
onClick={createSortHandler(column.id)}
|
|
1098
|
+
>
|
|
1099
|
+
{column.label}
|
|
1100
|
+
{_showFilteredIcon(column.id) && <FilterListIcon className={classes.filteredIcon} />}
|
|
1101
|
+
{orderBy === column.id ? (
|
|
1102
|
+
<span className={classes.visuallyHidden}>{order === 'desc' ? 'sorted descending' : 'sorted ascending'}</span>
|
|
1103
|
+
) : null}
|
|
1104
|
+
</TableSortLabel>
|
|
1105
|
+
<MoreIcon
|
|
1106
|
+
className={classes.moreIcon}
|
|
1107
|
+
onClick={event => {
|
|
1108
|
+
_menuClick(event, column.id, column.type, column.label);
|
|
1109
|
+
}}
|
|
1110
|
+
/>
|
|
1111
|
+
</TableCell>
|
|
1112
|
+
);
|
|
1113
|
+
})}
|
|
1114
|
+
</TableRow>
|
|
1115
|
+
</TableHead>
|
|
1116
|
+
<TableBody>
|
|
1117
|
+
{arRows &&
|
|
1118
|
+
stableSort(arRows, getComparator(order, orderBy))
|
|
1119
|
+
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
|
|
1120
|
+
.map(row => {
|
|
1096
1121
|
return (
|
|
1097
|
-
<
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1122
|
+
<TableRow key={row.pxRefObjectInsName || row.pyID}>
|
|
1123
|
+
{arColumns.map(column => {
|
|
1124
|
+
const value = row[column.id];
|
|
1125
|
+
return (
|
|
1126
|
+
<TableCell key={column.id} align={column.align} className={classes.cell}>
|
|
1127
|
+
{_showButton(column.id, row) || column.displayAsLink ? (
|
|
1128
|
+
<Link
|
|
1129
|
+
component='button'
|
|
1130
|
+
onClick={() => {
|
|
1131
|
+
_listViewClick(row, column);
|
|
1132
|
+
}}
|
|
1133
|
+
underline='hover'
|
|
1134
|
+
>
|
|
1135
|
+
{column.format && typeof value === 'number' ? column.format(value) : value}
|
|
1136
|
+
</Link>
|
|
1137
|
+
) : (
|
|
1138
|
+
<>{column.format && typeof value === 'number' ? column.format(value) : value || '---'}</>
|
|
1139
|
+
)}
|
|
1140
|
+
</TableCell>
|
|
1141
|
+
);
|
|
1142
|
+
})}
|
|
1143
|
+
</TableRow>
|
|
1116
1144
|
);
|
|
1117
1145
|
})}
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
</Table>
|
|
1152
|
-
</TableContainer>
|
|
1153
|
-
) : (
|
|
1154
|
-
<TableContainer id='list-view'>
|
|
1155
|
-
<Table>
|
|
1156
|
-
<TableHead>
|
|
1157
|
-
<TableRow>
|
|
1158
|
-
{(selectionMode === SELECTION_MODE.SINGLE || selectionMode === SELECTION_MODE.MULTI) && <TableCell />}
|
|
1159
|
-
{arColumns.map(column => {
|
|
1146
|
+
</TableBody>
|
|
1147
|
+
</Table>
|
|
1148
|
+
</TableContainer>
|
|
1149
|
+
) : (
|
|
1150
|
+
<TableContainer id='list-view'>
|
|
1151
|
+
<Table>
|
|
1152
|
+
<TableHead>
|
|
1153
|
+
<TableRow>
|
|
1154
|
+
{(selectionMode === SELECTION_MODE.SINGLE || selectionMode === SELECTION_MODE.MULTI) && <TableCell />}
|
|
1155
|
+
{arColumns.map(column => {
|
|
1156
|
+
return (
|
|
1157
|
+
<TableCell className={classes.cell} key={column.id} sortDirection={orderBy === column.id ? order : false}>
|
|
1158
|
+
<TableSortLabel
|
|
1159
|
+
active={orderBy === column.id}
|
|
1160
|
+
direction={orderBy === column.id ? order : 'asc'}
|
|
1161
|
+
onClick={createSortHandler(column.id)}
|
|
1162
|
+
>
|
|
1163
|
+
{column.label}
|
|
1164
|
+
{orderBy === column.id ? (
|
|
1165
|
+
<span className={classes.visuallyHidden}>{order === 'desc' ? 'sorted descending' : 'sorted ascending'}</span>
|
|
1166
|
+
) : null}
|
|
1167
|
+
</TableSortLabel>
|
|
1168
|
+
</TableCell>
|
|
1169
|
+
);
|
|
1170
|
+
})}
|
|
1171
|
+
</TableRow>
|
|
1172
|
+
</TableHead>
|
|
1173
|
+
<TableBody>
|
|
1174
|
+
{arRows &&
|
|
1175
|
+
arRows.length > 0 &&
|
|
1176
|
+
stableSort(arRows, getComparator(order, orderBy))
|
|
1177
|
+
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
|
|
1178
|
+
.map(row => {
|
|
1160
1179
|
return (
|
|
1161
|
-
<
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1180
|
+
<TableRow key={row[rowID]}>
|
|
1181
|
+
{selectionMode === SELECTION_MODE.SINGLE && (
|
|
1182
|
+
<TableCell>
|
|
1183
|
+
<Radio
|
|
1184
|
+
onChange={handleChange}
|
|
1185
|
+
value={row[rowID]}
|
|
1186
|
+
name='radio-buttons'
|
|
1187
|
+
inputProps={{ 'aria-label': 'A' }}
|
|
1188
|
+
checked={selectedValue === row[rowID]}
|
|
1189
|
+
/>
|
|
1190
|
+
</TableCell>
|
|
1191
|
+
)}
|
|
1192
|
+
{selectionMode === SELECTION_MODE.MULTI && (
|
|
1193
|
+
<TableCell>
|
|
1194
|
+
<Checkbox
|
|
1195
|
+
onChange={onCheckboxClick}
|
|
1196
|
+
checked={selectedValues.some(selectedValue => selectedValue[rowID] === row[rowID])}
|
|
1197
|
+
value={row[rowID]}
|
|
1198
|
+
/>
|
|
1199
|
+
</TableCell>
|
|
1200
|
+
)}
|
|
1201
|
+
{arColumns.map(column => {
|
|
1202
|
+
const value = row[column.id];
|
|
1203
|
+
return (
|
|
1204
|
+
<TableCell className={classes.cell} key={column.id} align={column.align}>
|
|
1205
|
+
{processColumnValue(column, value)}
|
|
1206
|
+
</TableCell>
|
|
1207
|
+
);
|
|
1208
|
+
})}
|
|
1209
|
+
</TableRow>
|
|
1173
1210
|
);
|
|
1174
1211
|
})}
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
.map(row => {
|
|
1183
|
-
return (
|
|
1184
|
-
<TableRow key={row[rowID]}>
|
|
1185
|
-
{selectionMode === SELECTION_MODE.SINGLE && (
|
|
1186
|
-
<TableCell>
|
|
1187
|
-
<Radio
|
|
1188
|
-
onChange={handleChange}
|
|
1189
|
-
value={row[rowID]}
|
|
1190
|
-
name='radio-buttons'
|
|
1191
|
-
inputProps={{ 'aria-label': 'A' }}
|
|
1192
|
-
checked={selectedValue === row[rowID]}
|
|
1193
|
-
/>
|
|
1194
|
-
</TableCell>
|
|
1195
|
-
)}
|
|
1196
|
-
{selectionMode === SELECTION_MODE.MULTI && (
|
|
1197
|
-
<TableCell>
|
|
1198
|
-
<Checkbox
|
|
1199
|
-
onChange={onCheckboxClick}
|
|
1200
|
-
checked={selectedValues.some(selectedValue => selectedValue[rowID] === row[rowID])}
|
|
1201
|
-
value={row[rowID]}
|
|
1202
|
-
/>
|
|
1203
|
-
</TableCell>
|
|
1204
|
-
)}
|
|
1205
|
-
{arColumns.map(column => {
|
|
1206
|
-
const value = row[column.id];
|
|
1207
|
-
return (
|
|
1208
|
-
<TableCell className={classes.cell} key={column.id} align={column.align}>
|
|
1209
|
-
{processColumnValue(column, value)}
|
|
1210
|
-
</TableCell>
|
|
1211
|
-
);
|
|
1212
|
-
})}
|
|
1213
|
-
</TableRow>
|
|
1214
|
-
);
|
|
1215
|
-
})}
|
|
1216
|
-
</TableBody>
|
|
1217
|
-
</Table>
|
|
1218
|
-
{(!arRows || arRows.length === 0) && (
|
|
1219
|
-
<div className='no-records'>{getGenericFieldsLocalizedValue('CosmosFields.fields.lists', 'No records found.')}</div>
|
|
1220
|
-
)}
|
|
1221
|
-
</TableContainer>
|
|
1222
|
-
)}
|
|
1223
|
-
</>
|
|
1212
|
+
</TableBody>
|
|
1213
|
+
</Table>
|
|
1214
|
+
{(!arRows || arRows.length === 0) && (
|
|
1215
|
+
<div className='no-records'>{getGenericFieldsLocalizedValue('CosmosFields.fields.lists', 'No records found.')}</div>
|
|
1216
|
+
)}
|
|
1217
|
+
</TableContainer>
|
|
1218
|
+
)}
|
|
1224
1219
|
{arRows && arRows.length > 0 && (
|
|
1225
1220
|
<TablePagination
|
|
1226
1221
|
id='pagination'
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { Avatar, Card, CardHeader, Divider, Typography } from '@mui/material';
|
|
2
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
3
|
+
import Grid2 from '@mui/material/Grid2';
|
|
4
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
5
|
+
import { prepareCaseSummaryData, filterUtilities } from '@pega/react-sdk-components/lib/components/template/utils';
|
|
6
|
+
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
7
|
+
|
|
8
|
+
const useStyles = makeStyles(theme => ({
|
|
9
|
+
root: {
|
|
10
|
+
paddingRight: theme.spacing(1),
|
|
11
|
+
paddingLeft: theme.spacing(1),
|
|
12
|
+
paddingTop: theme.spacing(1),
|
|
13
|
+
paddingBottom: theme.spacing(1),
|
|
14
|
+
marginRight: theme.spacing(1),
|
|
15
|
+
marginLeft: theme.spacing(1),
|
|
16
|
+
marginTop: theme.spacing(1),
|
|
17
|
+
marginBottom: theme.spacing(1)
|
|
18
|
+
},
|
|
19
|
+
caseViewHeader: {
|
|
20
|
+
backgroundColor: theme.palette.info.light,
|
|
21
|
+
color: theme.palette.getContrastText(theme.palette.info.light),
|
|
22
|
+
borderRadius: 'inherit'
|
|
23
|
+
},
|
|
24
|
+
caseViewIconBox: {
|
|
25
|
+
backgroundColor: theme.palette.info.dark,
|
|
26
|
+
width: theme.spacing(8),
|
|
27
|
+
height: theme.spacing(8),
|
|
28
|
+
padding: theme.spacing(1)
|
|
29
|
+
},
|
|
30
|
+
caseViewIconImage: {
|
|
31
|
+
filter: 'var(--svg-color)'
|
|
32
|
+
}
|
|
33
|
+
}));
|
|
34
|
+
|
|
35
|
+
export default function SelfServiceCaseView(props) {
|
|
36
|
+
const classes = useStyles();
|
|
37
|
+
const CaseViewActionsMenu = getComponentFromMap('CaseViewActionsMenu');
|
|
38
|
+
const CaseSummary = getComponentFromMap('CaseSummary');
|
|
39
|
+
const {
|
|
40
|
+
icon = '',
|
|
41
|
+
getPConnect,
|
|
42
|
+
header,
|
|
43
|
+
subheader,
|
|
44
|
+
showCaseLifecycle = true,
|
|
45
|
+
showSummaryRegion = true,
|
|
46
|
+
showUtilitiesRegion = true,
|
|
47
|
+
showCaseActions = true,
|
|
48
|
+
children,
|
|
49
|
+
caseClass,
|
|
50
|
+
caseInfo: { availableActions = [], availableProcesses = [], caseTypeID = '', caseTypeName = '' }
|
|
51
|
+
} = props;
|
|
52
|
+
const pConnect = getPConnect();
|
|
53
|
+
const [bShowCaseLifecycle, bShowSummaryRegion, bShowUtilitiesRegion, bShowCaseActions] = [
|
|
54
|
+
showCaseLifecycle,
|
|
55
|
+
showSummaryRegion,
|
|
56
|
+
showUtilitiesRegion,
|
|
57
|
+
showCaseActions
|
|
58
|
+
].map((prop: boolean | string) => prop === true || prop === 'true');
|
|
59
|
+
const isObjectType: boolean = (PCore.getCaseUtils() as any).isObjectCaseType(caseClass);
|
|
60
|
+
const localeKey = pConnect?.getCaseLocaleReference();
|
|
61
|
+
const svgCase = Utils.getImageSrc(icon, Utils.getSDKStaticConentUrl());
|
|
62
|
+
const renderedRegions: any = isObjectType
|
|
63
|
+
? {
|
|
64
|
+
caseSummary: children[0],
|
|
65
|
+
utilities: filterUtilities(children[2])
|
|
66
|
+
}
|
|
67
|
+
: {
|
|
68
|
+
caseSummary: children[0],
|
|
69
|
+
stages: children[1],
|
|
70
|
+
todo: children[2],
|
|
71
|
+
utilities: filterUtilities(children[4])
|
|
72
|
+
};
|
|
73
|
+
const { primarySummaryFields, secondarySummaryFields } = prepareCaseSummaryData(
|
|
74
|
+
renderedRegions.caseSummary,
|
|
75
|
+
(config: any) => config?.availableInChannel?.selfService === true
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
const isUtilitiesRegionNotEmpty: () => boolean = () => {
|
|
79
|
+
const utilitiesElement = renderedRegions.utilities;
|
|
80
|
+
if (utilitiesElement?.props?.getPConnect()?.getChildren()?.length > 0) {
|
|
81
|
+
return utilitiesElement.props
|
|
82
|
+
.getPConnect()
|
|
83
|
+
.getChildren()
|
|
84
|
+
.some((prop: { getPConnect: () => any }) => prop.getPConnect().getConfigProps().visibility !== false);
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<div>
|
|
91
|
+
{bShowCaseActions && (
|
|
92
|
+
<div style={{ display: 'flex', justifyContent: 'space-around', alignItems: 'center', margin: '10px' }}>
|
|
93
|
+
<div>{PCore.getLocaleUtils().getLocaleValue(header, '', localeKey)}</div>
|
|
94
|
+
<CaseViewActionsMenu
|
|
95
|
+
getPConnect={getPConnect}
|
|
96
|
+
availableActions={availableActions}
|
|
97
|
+
availableProcesses={availableProcesses}
|
|
98
|
+
caseTypeName={caseTypeName}
|
|
99
|
+
caseTypeID={caseTypeID}
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
)}
|
|
103
|
+
<div>
|
|
104
|
+
<Grid2 container>
|
|
105
|
+
<Grid2 size={{ xs: 3 }}>
|
|
106
|
+
{bShowSummaryRegion && (primarySummaryFields.length > 0 || secondarySummaryFields.length > 0) && (
|
|
107
|
+
<div>
|
|
108
|
+
<Card className={classes.root}>
|
|
109
|
+
<CardHeader
|
|
110
|
+
className={classes.caseViewHeader}
|
|
111
|
+
title={
|
|
112
|
+
<Typography variant='h6' component='div' id='case-name'>
|
|
113
|
+
{PCore.getLocaleUtils().getLocaleValue(header, '', localeKey)}
|
|
114
|
+
</Typography>
|
|
115
|
+
}
|
|
116
|
+
subheader={
|
|
117
|
+
<Typography variant='body1' component='div' id='caseId'>
|
|
118
|
+
{subheader}
|
|
119
|
+
</Typography>
|
|
120
|
+
}
|
|
121
|
+
avatar={
|
|
122
|
+
<Avatar className={classes.caseViewIconBox} variant='square'>
|
|
123
|
+
<img src={svgCase} className={classes.caseViewIconImage} />
|
|
124
|
+
</Avatar>
|
|
125
|
+
}
|
|
126
|
+
/>
|
|
127
|
+
<Divider />
|
|
128
|
+
<CaseSummary arPrimaryFields={primarySummaryFields} arSecondaryFields={secondarySummaryFields}></CaseSummary>
|
|
129
|
+
<Divider />
|
|
130
|
+
</Card>
|
|
131
|
+
</div>
|
|
132
|
+
)}
|
|
133
|
+
</Grid2>
|
|
134
|
+
|
|
135
|
+
<Grid2 size={{ xs: 6 }}>
|
|
136
|
+
{bShowCaseLifecycle && renderedRegions.stages}
|
|
137
|
+
{renderedRegions.todo}
|
|
138
|
+
</Grid2>
|
|
139
|
+
|
|
140
|
+
{bShowUtilitiesRegion && isUtilitiesRegionNotEmpty() && <Grid2 size={{ xs: 3 }}>{renderedRegions.utilities}</Grid2>}
|
|
141
|
+
</Grid2>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './SelfServiceCaseView';
|
|
@@ -36,8 +36,8 @@ const useStyles = makeStyles(theme => ({
|
|
|
36
36
|
marginRight: theme.spacing(2)
|
|
37
37
|
},
|
|
38
38
|
appListLogo: {
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
maxWidth: '100%',
|
|
40
|
+
height: '3rem'
|
|
41
41
|
},
|
|
42
42
|
appName: {
|
|
43
43
|
marginLeft: theme.spacing(2),
|
|
@@ -85,7 +85,7 @@ export default function WssNavBar(props: WssNavBarProps) {
|
|
|
85
85
|
return (
|
|
86
86
|
<div id='NavBar' className='nav-bar'>
|
|
87
87
|
<AppBar position='static' color='primary'>
|
|
88
|
-
<Container maxWidth=
|
|
88
|
+
<Container maxWidth={false}>
|
|
89
89
|
<Toolbar disableGutters style={{ justifyContent: 'space-between' }}>
|
|
90
90
|
<Button id='appName' style={{ textTransform: 'capitalize' }} onClick={appInfo.onClick}>
|
|
91
91
|
<img src={appInfo.imageSrc} className={classes.appListLogo} />
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { isValidElement } from 'react';
|
|
3
|
+
|
|
4
|
+
export function prepareCaseSummaryData(caseSummaryRegion, portalSpecificVisibilityChecker?) {
|
|
5
|
+
const filterVisibleChildren = children => {
|
|
6
|
+
return children
|
|
7
|
+
?.getPConnect()
|
|
8
|
+
?.getChildren()
|
|
9
|
+
?.filter(child => {
|
|
10
|
+
const configProps = child.getPConnect().getConfigProps();
|
|
11
|
+
const defaultVisibilityCn = !('visibility' in configProps) || configProps.visibility === true;
|
|
12
|
+
return defaultVisibilityCn && (portalSpecificVisibilityChecker?.(configProps) ?? true);
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
const convertChildrenToSummaryData = children => {
|
|
16
|
+
return children?.map(childItem => {
|
|
17
|
+
const childPConnData = childItem.getPConnect().resolveConfigProps(childItem.getPConnect().getRawMetadata());
|
|
18
|
+
return childPConnData;
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const summaryFieldChildren = caseSummaryRegion.props
|
|
23
|
+
.getPConnect()
|
|
24
|
+
.getChildren()[0]
|
|
25
|
+
?.getPConnect()
|
|
26
|
+
?.getReferencedViewPConnect()
|
|
27
|
+
?.getPConnect()
|
|
28
|
+
?.getChildren();
|
|
29
|
+
|
|
30
|
+
const primarySummaryFields =
|
|
31
|
+
summaryFieldChildren && summaryFieldChildren.length > 0
|
|
32
|
+
? convertChildrenToSummaryData(filterVisibleChildren(summaryFieldChildren[0]))
|
|
33
|
+
: undefined;
|
|
34
|
+
const secondarySummaryFields =
|
|
35
|
+
summaryFieldChildren && summaryFieldChildren.length > 1
|
|
36
|
+
? convertChildrenToSummaryData(filterVisibleChildren(summaryFieldChildren[1]))
|
|
37
|
+
: undefined;
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
primarySummaryFields,
|
|
41
|
+
secondarySummaryFields
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const filterUtilities = (utils: ReactNode) => {
|
|
46
|
+
let utilsMeta;
|
|
47
|
+
if (isValidElement(utils)) {
|
|
48
|
+
const pConnect = utils.props.getPConnect();
|
|
49
|
+
utilsMeta = pConnect.getRawMetadata?.();
|
|
50
|
+
if (!utilsMeta?.children?.length) return;
|
|
51
|
+
utilsMeta = {
|
|
52
|
+
...utilsMeta,
|
|
53
|
+
children: utilsMeta.children.filter((child: any) => child.config?.availableInChannel?.selfService === true)
|
|
54
|
+
};
|
|
55
|
+
return utilsMeta.children?.length ? pConnect.createComponent(utilsMeta) : undefined;
|
|
56
|
+
}
|
|
57
|
+
return utilsMeta;
|
|
58
|
+
};
|
package/lib/widget/ToDo/ToDo.tsx
CHANGED
|
@@ -82,19 +82,15 @@ function getID(assignment: any) {
|
|
|
82
82
|
|
|
83
83
|
const useStyles = makeStyles(theme => ({
|
|
84
84
|
root: {
|
|
85
|
-
marginTop: theme.spacing(1),
|
|
86
85
|
marginBottom: theme.spacing(1),
|
|
87
86
|
paddingBottom: theme.spacing(1),
|
|
88
|
-
|
|
89
|
-
borderLeftColor: theme.palette.primary.light
|
|
87
|
+
borderRadius: 16
|
|
90
88
|
},
|
|
91
89
|
avatar: {
|
|
92
90
|
backgroundColor: theme.palette.primary.light,
|
|
93
91
|
color: theme.palette.getContrastText(theme.palette.primary.light)
|
|
94
92
|
},
|
|
95
93
|
todoWrapper: {
|
|
96
|
-
borderLeft: '6px solid',
|
|
97
|
-
borderLeftColor: theme.palette.primary.light,
|
|
98
94
|
padding: theme.spacing(1),
|
|
99
95
|
margin: theme.spacing(1)
|
|
100
96
|
},
|
package/package.json
CHANGED