@pega/dx-component-builder-sdk 0.242.8 → 0.242.9
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/src/tasks/create/templates/Constellation/field/Decimal/index.tsx.mustache +3 -6
- package/src/tasks/create/templates/Constellation/field/Decimal-Currency/index.tsx.mustache +1 -3
- package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/index.tsx.mustache +2 -5
- package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/index.tsx.mustache +10 -52
- package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/utils.ts.mustache +1 -1
- package/src/tasks/create/templates/Constellation/template/DETAILS/Avatar.tsx.mustache +5 -7
- package/src/tasks/create/templates/Constellation/template/DETAILS-region/Avatar.tsx.mustache +5 -7
- package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/Avatar.tsx.mustache +5 -7
- package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.ts.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/template/FORM-region/demo.stories.tsx.mustache +21 -19
- package/src/tasks/map/map.js +2 -1
- 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/NavBar/NavBar.css +0 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/ListView.tsx +28 -29
- package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +5 -10
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyCurrency/index.tsx +1 -3
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDecimal/index.tsx +3 -6
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPercentage/index.tsx +2 -5
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/index.tsx +10 -52
- 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/Avatar.tsx +5 -7
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +5 -7
- package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +5 -7
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +1 -1
- 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/template/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +8 -21
- 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/NavBar/NavBar.css +0 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/ListView.tsx +28 -29
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +5 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import MuiPhoneNumber from 'material-ui-phone-number';
|
|
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
|
+
<MuiPhoneNumber
|
|
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
|
+
<MuiPhoneNumber
|
|
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}
|
|
@@ -1034,35 +1034,34 @@ export default function ListView(props: ListViewProps) {
|
|
|
1034
1034
|
</TableRow>
|
|
1035
1035
|
</TableHead>
|
|
1036
1036
|
<TableBody>
|
|
1037
|
-
{arRows
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
) :
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
})}
|
|
1037
|
+
{stableSort(arRows, getComparator(order, orderBy))
|
|
1038
|
+
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
|
|
1039
|
+
.map(row => {
|
|
1040
|
+
return (
|
|
1041
|
+
<TableRow key={row.pxRefObjectInsName || row.pyID}>
|
|
1042
|
+
{arColumns.map(column => {
|
|
1043
|
+
const value = row[column.id];
|
|
1044
|
+
return (
|
|
1045
|
+
<TableCell key={column.id} align={column.align} className={classes.cell}>
|
|
1046
|
+
{_showButton(column.id, row) || column.displayAsLink ? (
|
|
1047
|
+
<Link
|
|
1048
|
+
component='button'
|
|
1049
|
+
onClick={() => {
|
|
1050
|
+
_listViewClick(row, column);
|
|
1051
|
+
}}
|
|
1052
|
+
underline='hover'
|
|
1053
|
+
>
|
|
1054
|
+
{column.format && typeof value === 'number' ? column.format(value) : value}
|
|
1055
|
+
</Link>
|
|
1056
|
+
) : (
|
|
1057
|
+
<>{column.format && typeof value === 'number' ? column.format(value) : value || '---'}</>
|
|
1058
|
+
)}
|
|
1059
|
+
</TableCell>
|
|
1060
|
+
);
|
|
1061
|
+
})}
|
|
1062
|
+
</TableRow>
|
|
1063
|
+
);
|
|
1064
|
+
})}
|
|
1066
1065
|
</TableBody>
|
|
1067
1066
|
</Table>
|
|
1068
1067
|
</TableContainer>
|
|
@@ -258,16 +258,11 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
258
258
|
function generateRowsData() {
|
|
259
259
|
// if referenceList is empty and dataPageName property value exists then make a datapage fetch call and get the list of data.
|
|
260
260
|
if (!referenceList.length && dataPageName) {
|
|
261
|
-
getDataPage(dataPageName, parameters, context)
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
})
|
|
267
|
-
.catch(e => {
|
|
268
|
-
// eslint-disable-next-line no-console
|
|
269
|
-
console.log(e);
|
|
270
|
-
});
|
|
261
|
+
getDataPage(dataPageName, parameters, context).then(listData => {
|
|
262
|
+
const data = formatRowsData(listData);
|
|
263
|
+
myRows = data;
|
|
264
|
+
setRowData(data);
|
|
265
|
+
});
|
|
271
266
|
} else {
|
|
272
267
|
// The referenceList prop has the JSON data for each row to be displayed
|
|
273
268
|
// in the table. So, iterate over referenceList to create the dataRows that
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import { useState, useEffect } from 'react';
|
|
3
2
|
import {
|
|
4
3
|
CurrencyInput as CosmosCurrency,
|
|
@@ -262,9 +261,8 @@ function PegaDxilMyCurrency(props: PegaDxilMyCurrencyProps) {
|
|
|
262
261
|
});
|
|
263
262
|
}}
|
|
264
263
|
onBlur={(enteredValue) => {
|
|
265
|
-
const parsedValue = enteredValue !== '' ? Number(enteredValue) : enteredValue;
|
|
264
|
+
const parsedValue = enteredValue !== '' ? Number(enteredValue).toString() : enteredValue;
|
|
266
265
|
if (!readOnly && (!value || value !== parsedValue)) {
|
|
267
|
-
// @ts-ignore
|
|
268
266
|
handleEvent(actions, 'changeNblur', propName, parsedValue);
|
|
269
267
|
if (hasSuggestions) {
|
|
270
268
|
pConn.ignoreSuggestion('');
|
|
@@ -88,9 +88,8 @@ function PegaDxilMyDecimal(props: PegaDxilMyDecimalProps) {
|
|
|
88
88
|
}, [validatemessage, hasSuggestions, status]);
|
|
89
89
|
|
|
90
90
|
const { decimalPrecision, currencyDecimalPrecision } = props;
|
|
91
|
-
let numberOfDecimals = parseInt(decimalPrecision, 10);
|
|
91
|
+
let numberOfDecimals: number | undefined = parseInt(decimalPrecision, 10);
|
|
92
92
|
if (Number.isNaN(numberOfDecimals)) {
|
|
93
|
-
// @ts-ignore
|
|
94
93
|
numberOfDecimals = decimalPrecision === '' ? undefined : 2;
|
|
95
94
|
}
|
|
96
95
|
let noOfFractionDigits = currencyDecimalPrecision === 'auto' ? undefined : parseInt(currencyDecimalPrecision, 10);
|
|
@@ -223,15 +222,13 @@ function PegaDxilMyDecimal(props: PegaDxilMyDecimalProps) {
|
|
|
223
222
|
}
|
|
224
223
|
setDecimalValue(enteredValue);
|
|
225
224
|
if (value !== (enteredValue !== '' ? Number(enteredValue) : '')) {
|
|
226
|
-
|
|
227
|
-
handleEvent(actions, 'change', propName, enteredValue !== '' ? Number(enteredValue) : '');
|
|
225
|
+
handleEvent(actions, 'change', propName, enteredValue !== '' ? Number(enteredValue).toString() : '');
|
|
228
226
|
hasValueChange.current = true;
|
|
229
227
|
}
|
|
230
228
|
}}
|
|
231
229
|
onBlur={() => {
|
|
232
230
|
if (!value || hasValueChange.current) {
|
|
233
|
-
|
|
234
|
-
handleEvent(actions, 'blur', propName, decimalValue !== '' ? Number(decimalValue) : '');
|
|
231
|
+
handleEvent(actions, 'blur', propName, decimalValue !== '' ? Number(decimalValue).toString() : '');
|
|
235
232
|
if (hasSuggestions) {
|
|
236
233
|
pConn.ignoreSuggestion("");
|
|
237
234
|
}
|
|
@@ -94,9 +94,8 @@ function PegaDxilMyPercentage(props: PegaDxilMyPercentageProps) {
|
|
|
94
94
|
}
|
|
95
95
|
}, [validatemessage, hasSuggestions, status]);
|
|
96
96
|
|
|
97
|
-
let numberOfDecimals = parseInt(decimalPrecision, 10);
|
|
97
|
+
let numberOfDecimals : number | undefined = parseInt(decimalPrecision, 10);
|
|
98
98
|
if (Number.isNaN(numberOfDecimals)) {
|
|
99
|
-
// @ts-ignore
|
|
100
99
|
numberOfDecimals = decimalPrecision === '' ? undefined : 2;
|
|
101
100
|
}
|
|
102
101
|
|
|
@@ -241,15 +240,13 @@ function PegaDxilMyPercentage(props: PegaDxilMyPercentageProps) {
|
|
|
241
240
|
}
|
|
242
241
|
setPercentageValue(enteredValue);
|
|
243
242
|
if (value !== enteredValue) {
|
|
244
|
-
// @ts-ignore
|
|
245
243
|
handleEvent(actions, 'change', propName, enteredValue);
|
|
246
244
|
hasValueChange.current = true;
|
|
247
245
|
}
|
|
248
246
|
}}
|
|
249
247
|
onBlur={() => {
|
|
250
|
-
const parsedValue = percentageValue !== '' ? Number(percentageValue) : '';
|
|
248
|
+
const parsedValue = percentageValue !== '' ? Number(percentageValue).toString() : '';
|
|
251
249
|
if (!value || hasValueChange.current) {
|
|
252
|
-
// @ts-ignore
|
|
253
250
|
handleEvent(actions, 'blur', propName, parsedValue);
|
|
254
251
|
if (hasSuggestions) {
|
|
255
252
|
pConn.ignoreSuggestion("");
|
|
@@ -497,14 +497,14 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
497
497
|
const pConn = getPConnect();
|
|
498
498
|
const contextName = getPConnect().getContextName();
|
|
499
499
|
const actions = pConn.getActionsApi();
|
|
500
|
-
const [dataApiObj, setDataApiObj] = useState(() => ({}));
|
|
500
|
+
const [dataApiObj, setDataApiObj] = useState(() => ({} as any));
|
|
501
501
|
const [filterValue, setFilterValue] = useState('');
|
|
502
502
|
const [loading, setLoading] = useState(listType !== 'associated');
|
|
503
503
|
// const selected = useMemo(() => menuHelpers.getSelected(items)[0], [items]);
|
|
504
504
|
const [selected, setSelected] = useState();
|
|
505
505
|
const hasMoreResults = useRef(true);
|
|
506
506
|
const inputValueRef = useRef('');
|
|
507
|
-
const displayFieldMeta = useRef(null);
|
|
507
|
+
const displayFieldMeta: any = useRef(null);
|
|
508
508
|
const [actualValue, setActualValue] = useState();
|
|
509
509
|
const [newRecordCreated, setNewRecordCreated] = useState();
|
|
510
510
|
|
|
@@ -645,15 +645,13 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
645
645
|
}
|
|
646
646
|
PCore.getDataApi()
|
|
647
647
|
.init(dataConfig, contextName)
|
|
648
|
-
.then(dataObj => {
|
|
649
|
-
// @ts-ignore
|
|
648
|
+
.then((dataObj: any) => {
|
|
650
649
|
setDataApiObj(dataObj);
|
|
651
650
|
// To avoid calling doSearch if someone types/pastes value before the API call is made
|
|
652
651
|
if (!filterValue)
|
|
653
652
|
doSearch(
|
|
654
653
|
'',
|
|
655
654
|
getDisplayFieldsMetaData(dataConfig.columns),
|
|
656
|
-
// @ts-ignore
|
|
657
655
|
dataObj,
|
|
658
656
|
setItems as any,
|
|
659
657
|
setLoading,
|
|
@@ -679,12 +677,10 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
679
677
|
if (!dataRefMount && !displayMode && listType === 'datapage') {
|
|
680
678
|
PCore.getDataApi()
|
|
681
679
|
.init(dataConfig, contextName)
|
|
682
|
-
.then(dataObj => {
|
|
683
|
-
// @ts-ignore
|
|
680
|
+
.then((dataObj: any) => {
|
|
684
681
|
setDataApiObj(dataObj);
|
|
685
682
|
// To avoid calling doSearch if someone types/pastes value before the API call is made
|
|
686
683
|
if (!filterValue) {
|
|
687
|
-
// @ts-ignore
|
|
688
684
|
if (displayFieldMeta?.current?.key === displayFieldMeta?.current?.primary) {
|
|
689
685
|
const displayItem = {
|
|
690
686
|
id: value,
|
|
@@ -696,7 +692,6 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
696
692
|
doSearch(
|
|
697
693
|
'',
|
|
698
694
|
getDisplayFieldsMetaData(dataConfig.columns),
|
|
699
|
-
// @ts-ignore
|
|
700
695
|
dataObj,
|
|
701
696
|
setItems as any,
|
|
702
697
|
setLoading,
|
|
@@ -716,7 +711,6 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
716
711
|
doSearch(
|
|
717
712
|
'',
|
|
718
713
|
getDisplayFieldsMetaData(dataConfig.columns),
|
|
719
|
-
// @ts-ignore
|
|
720
714
|
dataObj,
|
|
721
715
|
setItems as any,
|
|
722
716
|
setLoading,
|
|
@@ -775,22 +769,16 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
775
769
|
) {
|
|
776
770
|
PCore.getDataApi()
|
|
777
771
|
.init(dataConfig, contextName)
|
|
778
|
-
.then(dataObj => {
|
|
779
|
-
// @ts-ignore
|
|
772
|
+
.then((dataObj: any) => {
|
|
780
773
|
setDataApiObj(dataObj);
|
|
781
|
-
// @ts-ignore
|
|
782
774
|
buildColumnForDisplayValue(dataObj);
|
|
783
775
|
// SET matchPosition to EQUALS to return exact matching record
|
|
784
|
-
// @ts-ignore
|
|
785
776
|
dataObj.matchPosition = 'equals';
|
|
786
|
-
// @ts-ignore
|
|
787
777
|
dataObj
|
|
788
778
|
.fetchData(value)
|
|
789
779
|
.then((displayResponse: { data: Array<never> }) => {
|
|
790
780
|
let columnsWithSetProperty: string | Array<any> = [];
|
|
791
|
-
// @ts-ignore
|
|
792
781
|
if (dataApiObj.columns) {
|
|
793
|
-
// @ts-ignore
|
|
794
782
|
columnsWithSetProperty = dataApiObj.columns
|
|
795
783
|
.filter(
|
|
796
784
|
(col: { setProperty: string }) =>
|
|
@@ -805,12 +793,9 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
805
793
|
const searchedItem = displayResponseData.map((entry: { [x: string]: any }) => {
|
|
806
794
|
const secondaryArr: Array<any> = [];
|
|
807
795
|
const secondaryFieldValues: Array<any> = [];
|
|
808
|
-
// @ts-ignore
|
|
809
796
|
displayFieldMeta.current.secondary.forEach((col: string) => {
|
|
810
|
-
// @ts-ignore
|
|
811
797
|
if (!displayFieldMeta.hidden.includes(col)) secondaryArr.push(entry[col]);
|
|
812
798
|
if (columnsWithSetProperty.includes(col)) {
|
|
813
|
-
// @ts-ignore
|
|
814
799
|
if (dataApiObj.isQueryable) {
|
|
815
800
|
secondaryFieldValues.push(entry[col]);
|
|
816
801
|
} else {
|
|
@@ -819,9 +804,7 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
819
804
|
}
|
|
820
805
|
});
|
|
821
806
|
return {
|
|
822
|
-
// @ts-ignore
|
|
823
807
|
id: entry[displayFieldMeta.current.key],
|
|
824
|
-
// @ts-ignore
|
|
825
808
|
primary: entry[displayFieldMeta.current.primary],
|
|
826
809
|
secondary: secondaryArr,
|
|
827
810
|
secondaryFieldValues
|
|
@@ -832,13 +815,11 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
832
815
|
setSelected(searchedItem[0]);
|
|
833
816
|
setActualValue(value);
|
|
834
817
|
// RESET matchPosition
|
|
835
|
-
// @ts-ignore
|
|
836
818
|
dataObj.matchPosition = dataConfig.matchPosition;
|
|
837
819
|
})
|
|
838
820
|
.catch(() => {
|
|
839
821
|
setActualValue(value);
|
|
840
822
|
// RESET matchPosition
|
|
841
|
-
// @ts-ignore
|
|
842
823
|
dataObj.matchPosition = dataConfig.matchPosition;
|
|
843
824
|
});
|
|
844
825
|
});
|
|
@@ -856,21 +837,17 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
856
837
|
};
|
|
857
838
|
})
|
|
858
839
|
);
|
|
859
|
-
|
|
860
|
-
setSelected(null);
|
|
840
|
+
setSelected(undefined);
|
|
861
841
|
inputValueRef.current = '';
|
|
862
842
|
};
|
|
863
843
|
|
|
864
844
|
const onChangeHandler = (ev: { target: { value: any } }) => {
|
|
865
845
|
if (hasSuggestions) {
|
|
866
|
-
|
|
867
|
-
pConn.ignoreSuggestion();
|
|
846
|
+
pConn.ignoreSuggestion('');
|
|
868
847
|
setStatus(undefined);
|
|
869
848
|
}
|
|
870
849
|
|
|
871
|
-
// @ts-ignore
|
|
872
850
|
dataApiObj.columns = dataConfig.columns;
|
|
873
|
-
// @ts-ignore
|
|
874
851
|
dataApiObj.matchPosition = dataConfig.matchPosition;
|
|
875
852
|
const searchText = ev.target.value;
|
|
876
853
|
inputValueRef.current = searchText;
|
|
@@ -879,15 +856,14 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
879
856
|
clearSelections();
|
|
880
857
|
}
|
|
881
858
|
setFilterValue(searchText);
|
|
882
|
-
// @ts-ignore
|
|
883
859
|
if (listType === 'datapage' && dataApiObj.isQueryable) {
|
|
884
860
|
hasMoreResults.current = true;
|
|
885
861
|
if (searchText.length < 5) {
|
|
886
862
|
searchHandlerThrottled(
|
|
887
863
|
searchText,
|
|
888
|
-
// @ts-ignore
|
|
889
864
|
displayFieldMeta.current,
|
|
890
865
|
dataApiObj,
|
|
866
|
+
// @ts-ignore
|
|
891
867
|
setItems,
|
|
892
868
|
setLoading,
|
|
893
869
|
hasMoreResults
|
|
@@ -895,9 +871,9 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
895
871
|
} else {
|
|
896
872
|
searchHandlerDebounced(
|
|
897
873
|
searchText,
|
|
898
|
-
// @ts-ignore
|
|
899
874
|
displayFieldMeta.current,
|
|
900
875
|
dataApiObj,
|
|
876
|
+
// @ts-ignore
|
|
901
877
|
setItems,
|
|
902
878
|
setLoading,
|
|
903
879
|
hasMoreResults
|
|
@@ -905,14 +881,12 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
905
881
|
}
|
|
906
882
|
} else if (
|
|
907
883
|
listType === 'associated' ||
|
|
908
|
-
// @ts-ignore
|
|
909
884
|
(listType === 'datapage' && dataApiObj?.isQueryable === false)
|
|
910
885
|
) {
|
|
911
886
|
paginateHelperApis.resetIndexes();
|
|
912
887
|
const progressivePaginatedRecords = paginateHelperApis.fetchData(
|
|
913
888
|
inputValueRef.current,
|
|
914
889
|
false,
|
|
915
|
-
// @ts-ignore
|
|
916
890
|
dataApiObj.columns
|
|
917
891
|
);
|
|
918
892
|
setItems(progressivePaginatedRecords);
|
|
@@ -939,21 +913,19 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
939
913
|
|
|
940
914
|
setFilterValue('');
|
|
941
915
|
if (!selected && inputValueRef.current !== '') {
|
|
942
|
-
// @ts-ignore
|
|
943
916
|
if (listType === 'datapage' && dataApiObj.isQueryable) {
|
|
944
917
|
hasMoreResults.current = true;
|
|
945
918
|
searchHandlerThrottled(
|
|
946
919
|
'',
|
|
947
|
-
// @ts-ignore
|
|
948
920
|
displayFieldMeta.current,
|
|
949
921
|
dataApiObj,
|
|
922
|
+
// @ts-ignore
|
|
950
923
|
setItems,
|
|
951
924
|
setLoading,
|
|
952
925
|
hasMoreResults
|
|
953
926
|
);
|
|
954
927
|
} else if (
|
|
955
928
|
listType === 'associated' ||
|
|
956
|
-
// @ts-ignore
|
|
957
929
|
(listType === 'datapage' && dataApiObj?.isQueryable === false)
|
|
958
930
|
) {
|
|
959
931
|
paginateHelperApis.resetIndexes();
|
|
@@ -976,7 +948,6 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
976
948
|
// @ts-ignore
|
|
977
949
|
setSelected(menuHelpers.getSelected(updatedItems)[0]);
|
|
978
950
|
// const { id: itemId } = menuHelpers.getSelected(updatedItems)[0];
|
|
979
|
-
// @ts-ignore
|
|
980
951
|
const assocProp = pConn.getStateProps().value;
|
|
981
952
|
const propValue = setValueToAssocProp(
|
|
982
953
|
assocProp,
|
|
@@ -1009,7 +980,6 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
1009
980
|
const loadMore = () => {
|
|
1010
981
|
if (
|
|
1011
982
|
(listType === 'associated' ||
|
|
1012
|
-
// @ts-ignore
|
|
1013
983
|
(listType === 'datapage' && dataApiObj?.isQueryable === false)) &&
|
|
1014
984
|
paginateHelperApis.hasMoreResults(inputValueRef.current)
|
|
1015
985
|
) {
|
|
@@ -1019,23 +989,18 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
1019
989
|
progressivePaginatedRecords = removeDuplicates(previousItems, progressivePaginatedRecords);
|
|
1020
990
|
return [...previousItems, ...progressivePaginatedRecords];
|
|
1021
991
|
});
|
|
1022
|
-
// @ts-ignore
|
|
1023
992
|
} else if (listType === 'datapage' && dataApiObj.isQueryable && hasMoreResults.current) {
|
|
1024
993
|
setLoading(true);
|
|
1025
994
|
dataApiObj
|
|
1026
|
-
// @ts-ignore
|
|
1027
995
|
.fetchPaginatedData(inputValueRef.current)
|
|
1028
996
|
.then((response: { pageSize: number; data: Array<never> }) => {
|
|
1029
997
|
setLoading(false);
|
|
1030
|
-
// @ts-ignore
|
|
1031
998
|
if (response.pageSize === 0 || response.pageSize < dataApiObj.pageSize) {
|
|
1032
999
|
hasMoreResults.current = false;
|
|
1033
1000
|
}
|
|
1034
1001
|
const listObjData = response.data || [];
|
|
1035
1002
|
let columnsWithSetProperty: string | Array<any> = [];
|
|
1036
|
-
// @ts-ignore
|
|
1037
1003
|
if (dataApiObj.columns) {
|
|
1038
|
-
// @ts-ignore
|
|
1039
1004
|
columnsWithSetProperty = dataApiObj.columns
|
|
1040
1005
|
.filter(
|
|
1041
1006
|
(col: { setProperty: string }) =>
|
|
@@ -1049,12 +1014,9 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
1049
1014
|
const searchedItems = listObjData.map((entry: { [x: string]: any }) => {
|
|
1050
1015
|
const secondaryArr: Array<any> = [];
|
|
1051
1016
|
const secondaryFieldValues: Array<any> = [];
|
|
1052
|
-
// @ts-ignore
|
|
1053
1017
|
displayFieldMeta.current.secondary.forEach((col: string) => {
|
|
1054
|
-
// @ts-ignore
|
|
1055
1018
|
if (!displayFieldMeta.current.hidden.includes(col)) secondaryArr.push(entry[col]);
|
|
1056
1019
|
if (columnsWithSetProperty.includes(col)) {
|
|
1057
|
-
// @ts-ignore
|
|
1058
1020
|
if (dataApiObj.isQueryable) {
|
|
1059
1021
|
secondaryFieldValues.push(entry[col]);
|
|
1060
1022
|
} else {
|
|
@@ -1063,9 +1025,7 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
1063
1025
|
}
|
|
1064
1026
|
});
|
|
1065
1027
|
return {
|
|
1066
|
-
// @ts-ignore
|
|
1067
1028
|
id: entry[displayFieldMeta.current.key],
|
|
1068
|
-
// @ts-ignore
|
|
1069
1029
|
primary: entry[displayFieldMeta.current.primary],
|
|
1070
1030
|
secondary: secondaryArr,
|
|
1071
1031
|
secondaryFieldValues
|
|
@@ -1076,7 +1036,6 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
1076
1036
|
})
|
|
1077
1037
|
.catch(() => {
|
|
1078
1038
|
setLoading(false);
|
|
1079
|
-
// @ts-ignore
|
|
1080
1039
|
dataApiObj.pageSize -= 1;
|
|
1081
1040
|
});
|
|
1082
1041
|
}
|
|
@@ -1160,7 +1119,6 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
1160
1119
|
selected: item.items ? undefined : !!item.selected || item.id === selected?.id
|
|
1161
1120
|
})),
|
|
1162
1121
|
onItemClick: selectItem,
|
|
1163
|
-
// @ts-ignore
|
|
1164
1122
|
emptyText: pConn.getLocalizedValue('No items'),
|
|
1165
1123
|
loading,
|
|
1166
1124
|
loadMore,
|
|
@@ -187,7 +187,7 @@ export const updatePropertiesForNewRecord = (
|
|
|
187
187
|
dataObj
|
|
188
188
|
.fetchData(newCaseId)
|
|
189
189
|
// @ts-ignore
|
|
190
|
-
.then(displayResponse => {
|
|
190
|
+
.then((displayResponse: any) => {
|
|
191
191
|
let columnsWithSetProperty = [];
|
|
192
192
|
if (dataApiObj.columns) {
|
|
193
193
|
columnsWithSetProperty = dataApiObj.columns
|
|
@@ -22,8 +22,8 @@ function Avatar(props: PegaDxilMyDetailsAvatarProps) {
|
|
|
22
22
|
// TODO Below if conditions can be removed once we have apis to get worklist/mywork info
|
|
23
23
|
// This is non CaseView case (Dashboard, MyWork etc)
|
|
24
24
|
if (!metaObj) {
|
|
25
|
-
userName = PCore.getEnvironmentInfo().getOperatorName();
|
|
26
|
-
userIdentifier = PCore.getEnvironmentInfo().getOperatorIdentifier();
|
|
25
|
+
userName = PCore.getEnvironmentInfo().getOperatorName() ?? "";
|
|
26
|
+
userIdentifier = PCore.getEnvironmentInfo().getOperatorIdentifier() ?? "";
|
|
27
27
|
} else {
|
|
28
28
|
userName = metaObj.name;
|
|
29
29
|
userIdentifier = metaObj.ID;
|
|
@@ -46,22 +46,20 @@ function Avatar(props: PegaDxilMyDetailsAvatarProps) {
|
|
|
46
46
|
const currentState = PCore.getMessagingServiceManager().getUserPresence().getUserState(userIdentifier);
|
|
47
47
|
const [userState, setUserState]: any = useState(currentState === 'online' ? 'active' : 'inactive');
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
const handleUserStateChange = ({ state }) => {
|
|
49
|
+
const handleUserStateChange = ({ state }: any) => {
|
|
51
50
|
setUserState(state === 'online' ? 'active' : 'inactive');
|
|
52
51
|
};
|
|
53
52
|
|
|
54
53
|
useEffect(() => {
|
|
55
54
|
const subId = PCore.getMessagingServiceManager()
|
|
56
55
|
.getUserPresence()
|
|
57
|
-
|
|
58
|
-
.subscribe(userIdentifier, handleUserStateChange);
|
|
56
|
+
.subscribe(userIdentifier, handleUserStateChange, '');
|
|
59
57
|
|
|
60
58
|
return function cleanup() {
|
|
61
59
|
PCore.getMessagingServiceManager().getUserPresence().unsubscribe(userIdentifier, subId);
|
|
62
60
|
};
|
|
63
61
|
}, [userIdentifier, handleUserStateChange]);
|
|
64
|
-
|
|
62
|
+
|
|
65
63
|
return <CosmosAvatar name={userName} imageSrc={imageBlobUrl as React.SetStateAction<any>} status={userState} />;
|
|
66
64
|
}
|
|
67
65
|
|
|
@@ -22,8 +22,8 @@ function Avatar(props: PegaDxilMyTwoColumnDetailsAvatarProps) {
|
|
|
22
22
|
// TODO Below if conditions can be removed once we have apis to get worklist/mywork info
|
|
23
23
|
// This is non CaseView case (Dashboard, MyWork etc)
|
|
24
24
|
if (!metaObj) {
|
|
25
|
-
userName = PCore.getEnvironmentInfo().getOperatorName();
|
|
26
|
-
userIdentifier = PCore.getEnvironmentInfo().getOperatorIdentifier();
|
|
25
|
+
userName = PCore.getEnvironmentInfo().getOperatorName() ?? "";
|
|
26
|
+
userIdentifier = PCore.getEnvironmentInfo().getOperatorIdentifier() ?? "";
|
|
27
27
|
} else {
|
|
28
28
|
userName = metaObj.name;
|
|
29
29
|
userIdentifier = metaObj.ID;
|
|
@@ -46,22 +46,20 @@ function Avatar(props: PegaDxilMyTwoColumnDetailsAvatarProps) {
|
|
|
46
46
|
const currentState = PCore.getMessagingServiceManager().getUserPresence().getUserState(userIdentifier);
|
|
47
47
|
const [userState, setUserState]: any = useState(currentState === 'online' ? 'active' : 'inactive');
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
const handleUserStateChange = ({ state }) => {
|
|
49
|
+
const handleUserStateChange = ({ state }: any) => {
|
|
51
50
|
setUserState(state === 'online' ? 'active' : 'inactive');
|
|
52
51
|
};
|
|
53
52
|
|
|
54
53
|
useEffect(() => {
|
|
55
54
|
const subId = PCore.getMessagingServiceManager()
|
|
56
55
|
.getUserPresence()
|
|
57
|
-
|
|
58
|
-
.subscribe(userIdentifier, handleUserStateChange);
|
|
56
|
+
.subscribe(userIdentifier, handleUserStateChange, '');
|
|
59
57
|
|
|
60
58
|
return function cleanup() {
|
|
61
59
|
PCore.getMessagingServiceManager().getUserPresence().unsubscribe(userIdentifier, subId);
|
|
62
60
|
};
|
|
63
61
|
}, [userIdentifier, handleUserStateChange]);
|
|
64
|
-
|
|
62
|
+
|
|
65
63
|
return <CosmosAvatar name={userName} imageSrc={imageBlobUrl as React.SetStateAction<any>} status={userState} />;
|
|
66
64
|
}
|
|
67
65
|
|
|
@@ -22,8 +22,8 @@ function Avatar(props: PegaDxilMyPageCaseWidgetAvatarProps) {
|
|
|
22
22
|
// TODO Below if conditions can be removed once we have apis to get worklist/mywork info
|
|
23
23
|
// This is non CaseView case (Dashboard, MyWork etc)
|
|
24
24
|
if (!metaObj) {
|
|
25
|
-
userName = PCore.getEnvironmentInfo().getOperatorName();
|
|
26
|
-
userIdentifier = PCore.getEnvironmentInfo().getOperatorIdentifier();
|
|
25
|
+
userName = PCore.getEnvironmentInfo().getOperatorName() ?? "";
|
|
26
|
+
userIdentifier = PCore.getEnvironmentInfo().getOperatorIdentifier() ?? "";
|
|
27
27
|
} else {
|
|
28
28
|
userName = metaObj.name;
|
|
29
29
|
userIdentifier = metaObj.ID;
|
|
@@ -46,22 +46,20 @@ function Avatar(props: PegaDxilMyPageCaseWidgetAvatarProps) {
|
|
|
46
46
|
const currentState = PCore.getMessagingServiceManager().getUserPresence().getUserState(userIdentifier);
|
|
47
47
|
const [userState, setUserState]: any = useState(currentState === 'online' ? 'active' : 'inactive');
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
const handleUserStateChange = ({ state }) => {
|
|
49
|
+
const handleUserStateChange = ({ state }: any) => {
|
|
51
50
|
setUserState(state === 'online' ? 'active' : 'inactive');
|
|
52
51
|
};
|
|
53
52
|
|
|
54
53
|
useEffect(() => {
|
|
55
54
|
const subId = PCore.getMessagingServiceManager()
|
|
56
55
|
.getUserPresence()
|
|
57
|
-
|
|
58
|
-
.subscribe(userIdentifier, handleUserStateChange);
|
|
56
|
+
.subscribe(userIdentifier, handleUserStateChange, '');
|
|
59
57
|
|
|
60
58
|
return function cleanup() {
|
|
61
59
|
PCore.getMessagingServiceManager().getUserPresence().unsubscribe(userIdentifier, subId);
|
|
62
60
|
};
|
|
63
61
|
}, [userIdentifier, handleUserStateChange]);
|
|
64
|
-
|
|
62
|
+
|
|
65
63
|
return <CosmosAvatar name={userName} imageSrc={imageBlobUrl as React.SetStateAction<any>} status={userState} />;
|
|
66
64
|
}
|
|
67
65
|
|
package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx
CHANGED
|
@@ -62,7 +62,7 @@ export default function PegaDxilMyCurrency(props: PegaDxilMyCurrencyProps) {
|
|
|
62
62
|
const theCurrSep = theSymbols.theDigitGroupSeparator;
|
|
63
63
|
|
|
64
64
|
const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
|
|
65
|
-
const formattedValue = format(value, pConn.getComponentName()
|
|
65
|
+
const formattedValue = format(value, pConn.getComponentName()?.toLowerCase(), theCurrencyOptions);
|
|
66
66
|
|
|
67
67
|
let readOnlyProp = {}; // Note: empty if NOT ReadOnly
|
|
68
68
|
|
package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx
CHANGED
|
@@ -73,7 +73,7 @@ export default function PegaDxilMyDecimal(props: PegaDxilMyDecimalProps) {
|
|
|
73
73
|
if (formatter === 'Currency') {
|
|
74
74
|
formattedValue = format(value, formatter.toLowerCase(), theCurrencyOptions);
|
|
75
75
|
} else {
|
|
76
|
-
formattedValue = format(value, pConn.getComponentName()
|
|
76
|
+
formattedValue = format(value, pConn.getComponentName()?.toLowerCase(), theCurrencyOptions);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
if (displayMode === 'DISPLAY_ONLY') {
|
package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx
CHANGED
|
@@ -54,7 +54,7 @@ export default function PegaDxilMyPercentage(props: PegaDxilMyPercentageProps) {
|
|
|
54
54
|
const helperTextToDisplay = validatemessage || helperText;
|
|
55
55
|
|
|
56
56
|
const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
|
|
57
|
-
const formattedValue = format(value, pConn.getComponentName()
|
|
57
|
+
const formattedValue = format(value, pConn.getComponentName()?.toLowerCase(), theCurrencyOptions);
|
|
58
58
|
|
|
59
59
|
let readOnlyProp = {}; // Note: empty if NOT ReadOnly
|
|
60
60
|
|