@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.
@@ -13,6 +13,5 @@
13
13
 
14
14
  .psdk-case-summary-fields {
15
15
  padding: calc(2 * 0.5rem);
16
- display: grid;
17
16
  grid-row-gap: calc(2 * 0.5rem);
18
17
  }
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState } from 'react';
2
- import MuiPhoneNumber from 'material-ui-phone-number-2';
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';
@@ -18,7 +18,8 @@ interface LeftAlignVerticalTabsProps {
18
18
  const LeftAlignVerticalTabs: any = withStyles((/* theme */) => ({
19
19
  root: {
20
20
  width: '100%',
21
- maxWidth: '100%'
21
+ maxWidth: '100%',
22
+ alignItems: 'flex-start'
22
23
  },
23
24
  wrapper: {
24
25
  display: 'block',
@@ -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(null);
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
- fetchMyWorkList(myWorkList.datapage, getPConnect().getComponentConfig()?.myWorkList.fields, 3, true, context).then(responseData => {
174
- deferLoadWorklistItems(responseData);
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
- const getCount = () => (type === CONSTS.WORKLIST ? (count ?? assignments.length) : assignments.length);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/react-sdk-overrides",
3
- "version": "0.242.1",
3
+ "version": "0.242.2",
4
4
  "description": "React SDK - Code for overriding components",
5
5
  "_filesComment": "During packing, npm ignores everything NOT in the files list",
6
6
  "files": [