@pega/react-sdk-overrides 0.23.21 → 0.23.22

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.
@@ -74,11 +74,12 @@ export default function Currency(props) {
74
74
  return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant='stacked' />;
75
75
  }
76
76
 
77
+ // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
77
78
  function currOnChange(event, inValue) {
78
79
  // console.log(`Currency currOnChange inValue: ${inValue}`);
79
80
 
80
81
  // update internal value
81
- setCurrValue(inValue);
82
+ setCurrValue(event?.target?.value);
82
83
  }
83
84
 
84
85
  function currOnBlur(event, inValue) {
@@ -15,7 +15,7 @@ import StoreContext from '@pega/react-sdk-components/lib/bridge/Context/StoreCon
15
15
  import DayjsUtils from '@date-io/dayjs';
16
16
  import { MuiPickersUtilsProvider } from '@material-ui/pickers';
17
17
 
18
- import { addContainerItem, getToDoAssignments } from './helpers';
18
+ import { addContainerItem, getToDoAssignments, showBanner } from './helpers';
19
19
 
20
20
  declare const PCore;
21
21
 
@@ -312,7 +312,6 @@ export default function FlowContainer(props) {
312
312
  }
313
313
  }
314
314
 
315
-
316
315
  // if have caseMessage show message and end
317
316
  const theCaseMessages = thePConn.getValue('caseMessages');
318
317
 
@@ -337,70 +336,70 @@ export default function FlowContainer(props) {
337
336
  }
338
337
 
339
338
  // this check in routingInfo, mimic React to check and get the internals of the
340
- // flowContainer and force updates to pConnect/redux
341
- if (routingInfo && loadingInfo !== undefined) {
342
- // debugging/investigation help
343
- // console.log(`${thePConn.getComponentName()}: >>routingInfo: ${JSON.stringify(routingInfo)}`);
344
-
345
- const currentOrder = routingInfo.accessedOrder;
346
- const currentItems = routingInfo.items;
347
- const type = routingInfo.type;
348
- if (currentOrder && currentItems) {
349
- // JA - making more similar to React version
350
- const key = currentOrder[currentOrder.length - 1];
351
-
352
- // save off itemKey to be used for finishAssignment, etc.
353
- // debugger;
354
- setItemKey(key);
355
-
356
- if (
357
- currentOrder.length > 0 &&
358
- currentItems[key] &&
359
- currentItems[key].view &&
360
- type === 'single' &&
361
- !Utils.isEmptyObject(currentItems[key].view)
362
- ) {
363
- const currentItem = currentItems[key];
364
- const rootView = currentItem.view;
365
- const { context } = rootView.config;
366
- const config = { meta: rootView };
367
-
368
- config['options'] = {
369
- context: currentItem.context,
370
- pageReference: context || localPConn.getPageReference(),
371
- hasForm: true,
372
- isFlowContainer: true,
373
- containerName: localPConn.getContainerName(),
374
- containerItemName: key,
375
- parentPageReference: localPConn.getPageReference()
376
- };
377
-
378
- const configObject = PCore.createPConnect(config);
379
-
380
- // Since we're setting an array, need to add in an appropriate key
381
- // to remove React warning.
382
- configObject['key'] = config['options'].parentPageReference;
383
-
384
- // keep track of these changes
385
- const theNewChildren: Array<Object> = [];
386
- theNewChildren.push(configObject);
387
- setArNewChildren(theNewChildren);
388
-
389
- // JEA - adapted from Constellation DX Components FlowContainer since we want to render children that are React components
390
- const root = createElement(createPConnectComponent(), configObject);
391
- setArNewChildrenAsReact([root]);
392
-
393
- const oWorkItem = configObject.getPConnect(); // was theNewChildren[0].getPConnect()
394
- const oWorkData = oWorkItem.getDataObject();
395
-
396
- // check if have oWorkData, there are times due to timing of state change, when this
397
- // may not be available
398
- if (oWorkData) {
399
- setContainerName(getActiveViewLabel() || oWorkData.caseInfo.assignments?.[0].name);
400
- }
339
+ // flowContainer and force updates to pConnect/redux
340
+ if (routingInfo && loadingInfo !== undefined) {
341
+ // debugging/investigation help
342
+ // console.log(`${thePConn.getComponentName()}: >>routingInfo: ${JSON.stringify(routingInfo)}`);
343
+
344
+ const currentOrder = routingInfo.accessedOrder;
345
+ const currentItems = routingInfo.items;
346
+ const type = routingInfo.type;
347
+ if (currentOrder && currentItems) {
348
+ // JA - making more similar to React version
349
+ const key = currentOrder[currentOrder.length - 1];
350
+
351
+ // save off itemKey to be used for finishAssignment, etc.
352
+ // debugger;
353
+ setItemKey(key);
354
+
355
+ if (
356
+ currentOrder.length > 0 &&
357
+ currentItems[key] &&
358
+ currentItems[key].view &&
359
+ type === 'single' &&
360
+ !Utils.isEmptyObject(currentItems[key].view)
361
+ ) {
362
+ const currentItem = currentItems[key];
363
+ const rootView = currentItem.view;
364
+ const { context } = rootView.config;
365
+ const config = { meta: rootView };
366
+
367
+ config['options'] = {
368
+ context: currentItem.context,
369
+ pageReference: context || localPConn.getPageReference(),
370
+ hasForm: true,
371
+ isFlowContainer: true,
372
+ containerName: localPConn.getContainerName(),
373
+ containerItemName: key,
374
+ parentPageReference: localPConn.getPageReference()
375
+ };
376
+
377
+ const configObject = PCore.createPConnect(config);
378
+
379
+ // Since we're setting an array, need to add in an appropriate key
380
+ // to remove React warning.
381
+ configObject['key'] = config['options'].parentPageReference;
382
+
383
+ // keep track of these changes
384
+ const theNewChildren: Array<Object> = [];
385
+ theNewChildren.push(configObject);
386
+ setArNewChildren(theNewChildren);
387
+
388
+ // JEA - adapted from Constellation DX Components FlowContainer since we want to render children that are React components
389
+ const root = createElement(createPConnectComponent(), configObject);
390
+ setArNewChildrenAsReact([root]);
391
+
392
+ const oWorkItem = configObject.getPConnect(); // was theNewChildren[0].getPConnect()
393
+ const oWorkData = oWorkItem.getDataObject();
394
+
395
+ // check if have oWorkData, there are times due to timing of state change, when this
396
+ // may not be available
397
+ if (oWorkData) {
398
+ setContainerName(getActiveViewLabel() || oWorkData.caseInfo.assignments?.[0].name);
401
399
  }
402
400
  }
403
401
  }
402
+ }
404
403
  }, [props]);
405
404
 
406
405
  const caseId = thePConn.getCaseSummary().content.pyID;
@@ -413,6 +412,8 @@ export default function FlowContainer(props) {
413
412
  instructionText = '';
414
413
  }
415
414
 
415
+ const bShowBanner = showBanner(getPConnect);
416
+
416
417
  return (
417
418
  <div style={{ textAlign: 'left' }} id={buildName} className='psdk-flow-container-top'>
418
419
  {!bShowConfirm &&
@@ -465,7 +466,7 @@ export default function FlowContainer(props) {
465
466
  <Alert severity='success'>{caseMessages}</Alert>
466
467
  </div>
467
468
  )}
468
- {bShowConfirm && <div>{arNewChildrenAsReact}</div>}
469
+ {bShowConfirm && bShowBanner && <div>{arNewChildrenAsReact}</div>}
469
470
  </div>
470
471
  );
471
472
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/react-sdk-overrides",
3
- "version": "0.23.21",
3
+ "version": "0.23.22",
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": [