@pega/react-sdk-overrides 0.242.1 → 0.242.2
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
|
-
import MuiPhoneNumber from 'material-ui-phone-number
|
|
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';
|
package/lib/widget/ToDo/ToDo.tsx
CHANGED
|
@@ -41,6 +41,7 @@ const fetchMyWorkList = (datapage, fields, numberOfRecords, includeTotalCount, c
|
|
|
41
41
|
select: Object.keys(fields).map(key => ({ field: PCore.getAnnotationUtils().getPropertyName(fields[key]) }))
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
|
+
invalidateCache: true,
|
|
44
45
|
additionalApiParams: {
|
|
45
46
|
includeTotalCount
|
|
46
47
|
}
|
|
@@ -147,7 +148,7 @@ export default function ToDo(props: ToDoProps) {
|
|
|
147
148
|
const showlessLocalizedValue = localizedVal('show_less', 'CosmosFields');
|
|
148
149
|
const showMoreLocalizedValue = localizedVal('show_more', 'CosmosFields');
|
|
149
150
|
const canPerform = assignments?.[0]?.canPerform === 'true' || assignments?.[0]?.canPerform === true;
|
|
150
|
-
const [count, setCount] = useState(
|
|
151
|
+
const [count, setCount] = useState(0);
|
|
151
152
|
|
|
152
153
|
const {
|
|
153
154
|
WORK_BASKET: { MY_WORK_LIST }
|
|
@@ -170,9 +171,11 @@ export default function ToDo(props: ToDoProps) {
|
|
|
170
171
|
);
|
|
171
172
|
|
|
172
173
|
useEffect(() => {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
if (Object.keys(myWorkList).length && myWorkList.datapage) {
|
|
175
|
+
fetchMyWorkList(myWorkList.datapage, getPConnect().getComponentConfig()?.myWorkList.fields, 3, true, context).then(responseData => {
|
|
176
|
+
deferLoadWorklistItems(responseData);
|
|
177
|
+
});
|
|
178
|
+
}
|
|
176
179
|
}, []);
|
|
177
180
|
|
|
178
181
|
const getAssignmentId = assignment => {
|
|
@@ -204,10 +207,12 @@ export default function ToDo(props: ToDoProps) {
|
|
|
204
207
|
|
|
205
208
|
function _showMore() {
|
|
206
209
|
setBShowMore(false);
|
|
207
|
-
if (type === CONSTS.WORKLIST && count && count > assignments.length) {
|
|
210
|
+
if (type === CONSTS.WORKLIST && count && count > assignments.length && !assignmentsSource) {
|
|
208
211
|
fetchMyWorkList(myWorkList.datapage, getPConnect().getComponentConfig()?.myWorkList.fields, count, false, context).then(response => {
|
|
209
212
|
setAssignments(response.data);
|
|
210
213
|
});
|
|
214
|
+
} else {
|
|
215
|
+
setAssignments(assignmentsSource);
|
|
211
216
|
}
|
|
212
217
|
}
|
|
213
218
|
|
|
@@ -285,7 +290,8 @@ export default function ToDo(props: ToDoProps) {
|
|
|
285
290
|
);
|
|
286
291
|
};
|
|
287
292
|
|
|
288
|
-
|
|
293
|
+
// eslint-disable-next-line no-nested-ternary
|
|
294
|
+
const getCount = () => (assignmentsSource ? assignmentsSource.length : type === CONSTS.WORKLIST ? count : 0);
|
|
289
295
|
|
|
290
296
|
const toDoContent = (
|
|
291
297
|
<>
|
package/package.json
CHANGED