@pega/react-sdk-overrides 0.25.6 → 0.25.7
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/field/SelectableCard/utils.tsx +2 -1
- package/lib/helpers/common-utils.ts +1 -2
- package/lib/infra/Assignment/Assignment.tsx +1 -1
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +2 -2
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +2 -2
- package/lib/infra/NavBar/NavBar.tsx +2 -3
- package/lib/infra/Stages/Stages.tsx +1 -1
- package/lib/template/CaseView/CaseView.tsx +3 -10
- package/lib/template/DataReference/DataReference.tsx +1 -2
- package/lib/template/ListView/ListView.tsx +1 -1
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +1 -1
- package/lib/widget/ToDo/ToDo.tsx +10 -5
- package/package.json +1 -1
|
@@ -9,8 +9,7 @@ export function isEmptyObject(obj: object): boolean {
|
|
|
9
9
|
* @returns The localized string or the key itself if no translation is found
|
|
10
10
|
*/
|
|
11
11
|
export function getGenericFieldsLocalizedValue(path: string, key: string): string {
|
|
12
|
-
const
|
|
13
|
-
const localeStore = PCore.getLocaleUtils().localeStore[GENERIC_BUNDLE_KEY];
|
|
12
|
+
const localeStore = PCore.getLocaleUtils().localeStore;
|
|
14
13
|
|
|
15
14
|
if (!localeStore) return key;
|
|
16
15
|
|
|
@@ -34,7 +34,7 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
|
|
|
34
34
|
const actionsAPI = thePConn.getActionsApi();
|
|
35
35
|
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
36
36
|
const localeCategory = 'Assignment';
|
|
37
|
-
const localeReference =
|
|
37
|
+
const localeReference = getPConnect()?.getCaseLocaleReference();
|
|
38
38
|
|
|
39
39
|
// store off bound functions to above pointers
|
|
40
40
|
const finishAssignment = actionsAPI.finishAssignment.bind(actionsAPI);
|
|
@@ -96,7 +96,7 @@ export const FlowContainer = (props: FlowContainerProps) => {
|
|
|
96
96
|
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
97
97
|
const localeCategory = 'Messages';
|
|
98
98
|
|
|
99
|
-
const key =
|
|
99
|
+
const key = getPConnect()?.getCaseLocaleReference();
|
|
100
100
|
const classes = useStyles();
|
|
101
101
|
|
|
102
102
|
function getBuildName(): string {
|
|
@@ -218,7 +218,7 @@ export const FlowContainer = (props: FlowContainerProps) => {
|
|
|
218
218
|
<CardHeader
|
|
219
219
|
id='assignment-header'
|
|
220
220
|
title={<Typography variant='h6'>{localizedVal(containerName, undefined, key)}</Typography>}
|
|
221
|
-
subheader={`${localizedVal('
|
|
221
|
+
subheader={`${localizedVal('In', 'Todo')} ${caseId} \u2022 ${localizedVal('Priority', 'Todo')} ${urgency}`}
|
|
222
222
|
avatar={<Avatar className={`${classes.avatar} psdk-avatar`}>{operatorInitials}</Avatar>}
|
|
223
223
|
/>
|
|
224
224
|
{displayPageMessages()}
|
|
@@ -131,7 +131,7 @@ export default function ModalViewContainer(props: ModalViewContainerProps) {
|
|
|
131
131
|
const [cancelAlertProps, setCancelAlertProps] = useState({});
|
|
132
132
|
const [isMultiRecordData, setMultiRecordData] = useState(false);
|
|
133
133
|
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
134
|
-
const localeCategory = '
|
|
134
|
+
const localeCategory = 'ModalContainer';
|
|
135
135
|
|
|
136
136
|
const ERROR_WHILE_RENDERING = 'ERROR_WHILE_RENDERING';
|
|
137
137
|
|
|
@@ -255,7 +255,7 @@ export default function ModalViewContainer(props: ModalViewContainerProps) {
|
|
|
255
255
|
const headingValue =
|
|
256
256
|
isDataObject || isMultiRecord
|
|
257
257
|
? getModalHeading(dataObjectAction)
|
|
258
|
-
: determineModalHeaderByAction(actionName, caseTypeName, ID,
|
|
258
|
+
: determineModalHeaderByAction(actionName, caseTypeName, ID, pConnect?.getCaseLocaleReference());
|
|
259
259
|
|
|
260
260
|
let arChildrenAsReact: any[] = [];
|
|
261
261
|
|
|
@@ -126,7 +126,6 @@ export default function NavBar(props: NavBarProps) {
|
|
|
126
126
|
const [bShowOperatorButtons, setBShowOperatorButtons] = useState(false);
|
|
127
127
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
128
128
|
const localeUtils = PCore.getLocaleUtils();
|
|
129
|
-
const localeReference = pConn.getValue('.pyLocaleReference');
|
|
130
129
|
|
|
131
130
|
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
132
131
|
const localeCategory = 'AppShell';
|
|
@@ -241,7 +240,7 @@ export default function NavBar(props: NavBarProps) {
|
|
|
241
240
|
<ListItemIcon>
|
|
242
241
|
<WorkOutlineIcon fontSize='large' />
|
|
243
242
|
</ListItemIcon>
|
|
244
|
-
<ListItemText primary={localeUtils.getLocaleValue(caseType.pyLabel, '',
|
|
243
|
+
<ListItemText primary={localeUtils.getLocaleValue(caseType.pyLabel, '', localeUtils.getCaseLocaleReference(caseType.pyClassName))} />
|
|
245
244
|
</ListItemButton>
|
|
246
245
|
))}
|
|
247
246
|
</List>
|
|
@@ -250,7 +249,7 @@ export default function NavBar(props: NavBarProps) {
|
|
|
250
249
|
{navPages.map(page => (
|
|
251
250
|
<ListItemButton onClick={() => navPanelButtonClick(page)} key={page.pyLabel}>
|
|
252
251
|
<ListItemIcon>{iconMap[page.pxPageViewIcon]}</ListItemIcon>
|
|
253
|
-
<ListItemText primary={localeUtils.getLocaleValue(page.pyLabel, '',
|
|
252
|
+
<ListItemText primary={localeUtils.getLocaleValue(page.pyLabel, '', localeUtils.getCaseLocaleReference(page.pyClassName))} />
|
|
254
253
|
</ListItemButton>
|
|
255
254
|
))}
|
|
256
255
|
</List>
|
|
@@ -57,7 +57,7 @@ export default function Stages(props: StagesProps) {
|
|
|
57
57
|
|
|
58
58
|
const { getPConnect, stages } = props;
|
|
59
59
|
const pConn = getPConnect();
|
|
60
|
-
const key =
|
|
60
|
+
const key = getPConnect()?.getCaseLocaleReference();
|
|
61
61
|
|
|
62
62
|
const filteredStages = getFilteredStages(stages);
|
|
63
63
|
const currentStageID = pConn.getValue(PCore.getConstants().CASE_INFO.STAGEID, ''); // 2nd arg empty string until typedef allows optional
|
|
@@ -9,7 +9,6 @@ import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
|
9
9
|
import StoreContext from '@pega/react-sdk-components/lib/bridge/Context/StoreContext';
|
|
10
10
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
11
11
|
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
12
|
-
import { prepareCaseSummaryData } from '@pega/react-sdk-components/lib/components/template/utils';
|
|
13
12
|
|
|
14
13
|
interface CaseViewProps extends PConnProps {
|
|
15
14
|
// If any, enter additional props that only exist on this component
|
|
@@ -50,7 +49,6 @@ export default function CaseView(props: PropsWithChildren<CaseViewProps>) {
|
|
|
50
49
|
const CaseViewActionsMenu = getComponentFromMap('CaseViewActionsMenu');
|
|
51
50
|
const VerticalTabs = getComponentFromMap('VerticalTabs');
|
|
52
51
|
const DeferLoad = getComponentFromMap('DeferLoad');
|
|
53
|
-
const CaseSummary = getComponentFromMap('CaseSummary');
|
|
54
52
|
|
|
55
53
|
const {
|
|
56
54
|
getPConnect,
|
|
@@ -73,7 +71,7 @@ export default function CaseView(props: PropsWithChildren<CaseViewProps>) {
|
|
|
73
71
|
|
|
74
72
|
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
75
73
|
const localeCategory = 'CaseView';
|
|
76
|
-
const localeKey =
|
|
74
|
+
const localeKey = thePConn?.getCaseLocaleReference();
|
|
77
75
|
/**
|
|
78
76
|
*
|
|
79
77
|
* @param inName the metadata <em>name</em> that will cause a region to be returned
|
|
@@ -90,12 +88,7 @@ export default function CaseView(props: PropsWithChildren<CaseViewProps>) {
|
|
|
90
88
|
return null;
|
|
91
89
|
}
|
|
92
90
|
|
|
93
|
-
const theSummaryRegion =
|
|
94
|
-
|
|
95
|
-
const data = prepareCaseSummaryData(theSummaryRegion);
|
|
96
|
-
const primarySummaryFields = data.primarySummaryFields;
|
|
97
|
-
const secondarySummaryFields = data.secondarySummaryFields;
|
|
98
|
-
|
|
91
|
+
const theSummaryRegion = getChildRegionByName('summary');
|
|
99
92
|
const theStagesRegion = getChildRegionByName('stages');
|
|
100
93
|
const theTodoRegion = getChildRegionByName('todo');
|
|
101
94
|
const theUtilitiesRegion = getChildRegionByName('utilities');
|
|
@@ -237,7 +230,7 @@ export default function CaseView(props: PropsWithChildren<CaseViewProps>) {
|
|
|
237
230
|
/>
|
|
238
231
|
{getActionButtonsHtml()}
|
|
239
232
|
<Divider />
|
|
240
|
-
|
|
233
|
+
{theSummaryRegion}
|
|
241
234
|
<Divider />
|
|
242
235
|
{vertTabInfo.length > 1 && <VerticalTabs tabconfig={vertTabInfo} />}
|
|
243
236
|
</Card>
|
|
@@ -88,8 +88,7 @@ export default function DataReference(props: PropsWithChildren<DataReferenceProp
|
|
|
88
88
|
let firstChildPConnect;
|
|
89
89
|
|
|
90
90
|
const localizedPlaceholderOption = placeholder => {
|
|
91
|
-
const
|
|
92
|
-
const localizedDefaultPlaceholder = pConn.getLocalizedValue('select_placeholder_default', 'CosmosFields', GENERIC_BUNDLE_KEY);
|
|
91
|
+
const localizedDefaultPlaceholder = pConn.getLocalizedValue('select_placeholder_default', '', 'CosmosFields');
|
|
93
92
|
// If we have a placeholder, push that option in the list of items
|
|
94
93
|
if (placeholder === 'Select...' && localizedDefaultPlaceholder !== 'select_placeholder_default') {
|
|
95
94
|
return localizedDefaultPlaceholder;
|
|
@@ -1212,7 +1212,7 @@ export default function ListView(props: ListViewProps) {
|
|
|
1212
1212
|
</TableBody>
|
|
1213
1213
|
</Table>
|
|
1214
1214
|
{(!arRows || arRows.length === 0) && (
|
|
1215
|
-
<div className='no-records'>{getGenericFieldsLocalizedValue('
|
|
1215
|
+
<div className='no-records'>{getGenericFieldsLocalizedValue('COSMOSFIELDS.lists', 'No records found.')}</div>
|
|
1216
1216
|
)}
|
|
1217
1217
|
</TableContainer>
|
|
1218
1218
|
)}
|
|
@@ -715,7 +715,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
715
715
|
</Table>
|
|
716
716
|
{((readOnlyMode && (!rowData || rowData?.length === 0)) || (editableMode && (!referenceList || referenceList?.length === 0))) && (
|
|
717
717
|
<div className='no-records' id='no-records'>
|
|
718
|
-
{getGenericFieldsLocalizedValue('
|
|
718
|
+
{getGenericFieldsLocalizedValue('COSMOSFIELDS.lists', 'No records found.')}
|
|
719
719
|
</div>
|
|
720
720
|
)}
|
|
721
721
|
</TableContainer>
|
package/lib/widget/ToDo/ToDo.tsx
CHANGED
|
@@ -180,7 +180,9 @@ export default function ToDo(props: ToDoProps) {
|
|
|
180
180
|
};
|
|
181
181
|
|
|
182
182
|
const getAssignmentName = assignment => {
|
|
183
|
-
return type === CONSTS.TODO
|
|
183
|
+
return type === CONSTS.TODO
|
|
184
|
+
? localizedVal(assignment.name, '', PCore.getLocaleUtils().getCaseLocaleReference(assignment.classname))
|
|
185
|
+
: localizedVal(assignment.stepName, '', PCore.getLocaleUtils().getCaseLocaleReference(assignment.classname));
|
|
184
186
|
};
|
|
185
187
|
|
|
186
188
|
function showToast(message: string) {
|
|
@@ -263,13 +265,16 @@ export default function ToDo(props: ToDoProps) {
|
|
|
263
265
|
};
|
|
264
266
|
|
|
265
267
|
const getListItemComponent = assignment => {
|
|
268
|
+
const caseLocaleRef = PCore.getLocaleUtils().getCaseLocaleReference(assignment.classname);
|
|
266
269
|
if (isDesktop) {
|
|
267
270
|
return (
|
|
268
271
|
<>
|
|
269
|
-
{localizedVal('
|
|
272
|
+
{localizedVal('In', localeCategory)}
|
|
270
273
|
{renderTaskId(type, getPConnect, showTodoList, assignment)}
|
|
271
274
|
{type === CONSTS.WORKLIST && assignment.status ? `\u2022 ` : undefined}
|
|
272
|
-
{type === CONSTS.WORKLIST && assignment.status ?
|
|
275
|
+
{type === CONSTS.WORKLIST && assignment.status ? (
|
|
276
|
+
<span className='psdk-todo-assignment-status'>{localizedVal(assignment.status, '', caseLocaleRef)}</span>
|
|
277
|
+
) : undefined}
|
|
273
278
|
{` \u2022 ${localizedVal('Urgency', localeCategory)} ${getPriority(assignment)}`}
|
|
274
279
|
</>
|
|
275
280
|
);
|
|
@@ -302,8 +307,8 @@ export default function ToDo(props: ToDoProps) {
|
|
|
302
307
|
{currentUserInitials}
|
|
303
308
|
</Avatar>
|
|
304
309
|
<div style={{ display: 'block' }}>
|
|
305
|
-
<Typography variant='h6'>{assignment?.name}</Typography>
|
|
306
|
-
{`${localizedVal('
|
|
310
|
+
<Typography variant='h6'>{localizedVal(assignment?.name, localeCategory)}</Typography>
|
|
311
|
+
{`${localizedVal('In', localeCategory)} ${getID(assignment)} \u2022 ${localizedVal(
|
|
307
312
|
'Urgency',
|
|
308
313
|
localeCategory
|
|
309
314
|
)} ${getPriority(assignment)}`}
|
package/package.json
CHANGED