@pega/react-sdk-overrides 8.23.11 → 23.1.10

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.
Files changed (132) hide show
  1. package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +13 -9
  2. package/lib/designSystemExtension/Banner/Banner.tsx +12 -1
  3. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +15 -10
  4. package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +10 -11
  5. package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +10 -3
  6. package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +11 -3
  7. package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +11 -3
  8. package/lib/designSystemExtension/Operator/Operator.tsx +16 -12
  9. package/lib/designSystemExtension/Pulse/Pulse.tsx +11 -7
  10. package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +121 -0
  11. package/lib/designSystemExtension/RichTextEditor/index.tsx +1 -0
  12. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +10 -1
  13. package/lib/field/AutoComplete/AutoComplete.tsx +38 -19
  14. package/lib/field/CancelAlert/CancelAlert.tsx +9 -4
  15. package/lib/field/Checkbox/Checkbox.tsx +39 -7
  16. package/lib/field/Currency/Currency.tsx +24 -16
  17. package/lib/field/Currency/currency-utils.ts +1 -5
  18. package/lib/field/Date/Date.tsx +23 -16
  19. package/lib/field/DateTime/DateTime.tsx +26 -15
  20. package/lib/field/Decimal/Decimal.tsx +26 -15
  21. package/lib/field/Dropdown/Dropdown.tsx +34 -28
  22. package/lib/field/Email/Email.tsx +17 -9
  23. package/lib/field/Integer/Integer.tsx +15 -7
  24. package/lib/field/Percentage/Percentage.tsx +15 -7
  25. package/lib/field/Phone/Phone.tsx +19 -11
  26. package/lib/field/RadioButtons/RadioButtons.tsx +28 -38
  27. package/lib/field/RichText/RichText.tsx +95 -0
  28. package/lib/field/RichText/index.tsx +1 -0
  29. package/lib/field/ScalarList/ScalarList.tsx +73 -0
  30. package/lib/field/ScalarList/config-ext.json +8 -0
  31. package/lib/field/ScalarList/index.tsx +1 -0
  32. package/lib/field/SemanticLink/SemanticLink.tsx +26 -25
  33. package/lib/field/TextArea/TextArea.tsx +14 -5
  34. package/lib/field/TextContent/TextContent.tsx +10 -1
  35. package/lib/field/TextInput/TextInput.tsx +16 -7
  36. package/lib/field/Time/Time.tsx +22 -27
  37. package/lib/field/URL/URL.tsx +16 -8
  38. package/lib/field/UserReference/UserReference.tsx +50 -60
  39. package/lib/helpers/attachmentHelpers.ts +4 -4
  40. package/lib/helpers/auth.js +752 -401
  41. package/lib/helpers/authManager.ts +933 -0
  42. package/lib/helpers/case-utils.tsx +8 -9
  43. package/lib/helpers/common-utils.ts +1 -1
  44. package/lib/helpers/config_access.js +0 -73
  45. package/lib/helpers/date-format-utils.ts +1 -1
  46. package/lib/helpers/event-utils.ts +1 -1
  47. package/lib/helpers/field-group-utils.ts +7 -9
  48. package/lib/helpers/formatters/Currency.ts +11 -11
  49. package/lib/helpers/formatters/CurrencyMap.ts +8 -5
  50. package/lib/helpers/formatters/Date.ts +1 -1
  51. package/lib/helpers/formatters/common.ts +2 -6
  52. package/lib/helpers/formatters/index.ts +3 -3
  53. package/lib/helpers/simpleTableHelpers.ts +7 -7
  54. package/lib/helpers/state-utils.tsx +0 -3
  55. package/lib/helpers/template-utils.ts +3 -6
  56. package/lib/helpers/versionHelpers.ts +0 -3
  57. package/lib/infra/ActionButtons/ActionButtons.tsx +9 -19
  58. package/lib/infra/Assignment/Assignment.tsx +28 -32
  59. package/lib/infra/AssignmentCard/AssignmentCard.tsx +15 -19
  60. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +57 -58
  61. package/lib/infra/Containers/FlowContainer/helpers.ts +0 -3
  62. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +14 -17
  63. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +20 -27
  64. package/lib/infra/DashboardFilter/DashboardFilter.tsx +13 -21
  65. package/lib/infra/DashboardFilter/filterUtils.tsx +2 -1
  66. package/lib/infra/DeferLoad/DeferLoad.tsx +14 -20
  67. package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +11 -15
  68. package/lib/infra/MultiStep/MultiStep.tsx +22 -22
  69. package/lib/infra/NavBar/NavBar.tsx +14 -21
  70. package/lib/infra/Reference/Reference.tsx +14 -18
  71. package/lib/infra/Region/Region.tsx +8 -6
  72. package/lib/infra/RootContainer/RootContainer.tsx +16 -25
  73. package/lib/infra/Stages/Stages.tsx +10 -8
  74. package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +8 -1
  75. package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +12 -12
  76. package/lib/infra/View/View.tsx +23 -23
  77. package/lib/template/AppShell/AppShell.tsx +36 -25
  78. package/lib/template/BannerPage/BannerPage.tsx +26 -31
  79. package/lib/template/CaseSummary/CaseSummary.tsx +15 -8
  80. package/lib/template/CaseView/CaseView.tsx +24 -25
  81. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +10 -19
  82. package/lib/template/Confirmation/Confirmation.tsx +27 -53
  83. package/lib/template/DataReference/DataReference.tsx +49 -53
  84. package/lib/template/DefaultForm/DefaultForm.tsx +14 -12
  85. package/lib/template/Details/Details/Details.tsx +16 -17
  86. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +13 -16
  87. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +19 -18
  88. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +20 -18
  89. package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +78 -0
  90. package/lib/template/Details/DynamicTabs/config.json +36 -0
  91. package/lib/template/Details/DynamicTabs/index.tsx +1 -0
  92. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +22 -28
  93. package/lib/template/InlineDashboard/InlineDashboard.tsx +11 -7
  94. package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +20 -18
  95. package/lib/template/ListPage/ListPage.tsx +14 -13
  96. package/lib/template/ListView/ListView.tsx +242 -314
  97. package/lib/template/ListView/utils.ts +170 -23
  98. package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +10 -19
  99. package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +16 -1
  100. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +19 -18
  101. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +9 -1
  102. package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +17 -17
  103. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +8 -7
  104. package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +10 -10
  105. package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +5 -7
  106. package/lib/template/PromotedFilters/PromotedFilters.tsx +16 -14
  107. package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +102 -8
  108. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +25 -8
  109. package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +23 -33
  110. package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +33 -36
  111. package/lib/template/SubTabs/SubTabs.tsx +10 -11
  112. package/lib/template/SubTabs/tabUtils.ts +0 -4
  113. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +10 -15
  114. package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +10 -10
  115. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +10 -12
  116. package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +17 -3
  117. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +35 -25
  118. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +7 -1
  119. package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +15 -17
  120. package/lib/template/WssNavBar/WssNavBar.tsx +18 -1
  121. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +13 -21
  122. package/lib/widget/Attachment/Attachment.tsx +28 -16
  123. package/lib/widget/CaseHistory/CaseHistory.tsx +12 -10
  124. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +13 -1
  125. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +35 -22
  126. package/lib/widget/Followers/Followers.tsx +10 -11
  127. package/lib/widget/QuickCreate/QuickCreate.tsx +11 -5
  128. package/lib/widget/SummaryItem/SummaryItem.tsx +11 -1
  129. package/lib/widget/SummaryList/SummaryList.tsx +17 -3
  130. package/lib/widget/ToDo/ToDo.tsx +62 -105
  131. package/package.json +1 -1
  132. package/lib/helpers/authManager.js +0 -634
@@ -1,14 +1,30 @@
1
1
  import React from "react";
2
- import PropTypes from "prop-types";
3
-
2
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
4
3
  import './MultiStep.css';
5
4
 
6
- import AssignmentCard from '@pega/react-sdk-components/lib/components/infra/AssignmentCard';
7
-
8
5
  // import { useConstellationContext } from "../../bridge/Context/StoreContext";
9
6
 
10
- export default function MultiStep(props) {
11
- const { getPConnect, children, itemKey, actionButtons, onButtonPress} = props;
7
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
+
9
+
10
+ interface MultiStepProps extends PConnProps {
11
+ // If any, enter additional props that only exist on this component
12
+ children: Array<any>,
13
+ itemKey: string,
14
+ actionButtons: Array<any>,
15
+ onButtonPress: any,
16
+ bIsVertical: boolean,
17
+ arNavigationSteps: Array<any>,
18
+ // eslint-disable-next-line react/no-unused-prop-types
19
+ arCurrentStepIndicies?: Array<any>
20
+ }
21
+
22
+
23
+ export default function MultiStep(props: MultiStepProps) {
24
+ // Get emitted components from map (so we can get any override that may exist)
25
+ const AssignmentCard = getComponentFromMap("AssignmentCard");
26
+
27
+ const { getPConnect, children, itemKey = '', actionButtons, onButtonPress} = props;
12
28
  const { bIsVertical, arNavigationSteps } = props;
13
29
 
14
30
  // const svgCurrent = Utils.getImageSrc("circle-solid", Utils.getSDKStaticConentUrl());
@@ -207,19 +223,3 @@ export default function MultiStep(props) {
207
223
 
208
224
  )
209
225
  }
210
-
211
- MultiStep.propTypes = {
212
- children: PropTypes.node.isRequired,
213
- getPConnect: PropTypes.func.isRequired,
214
- itemKey: PropTypes.string,
215
- actionButtons: PropTypes.object,
216
- onButtonPress: PropTypes.func,
217
- bIsVertical: PropTypes.bool,
218
- // eslint-disable-next-line react/no-unused-prop-types
219
- arCurrentStepIndicies: PropTypes.array,
220
- arNavigationSteps: PropTypes.array
221
- };
222
-
223
- MultiStep.defaultProps = {
224
- itemKey: null
225
- };
@@ -1,7 +1,6 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { makeStyles, useTheme } from '@material-ui/core/styles';
3
3
  import clsx from 'clsx';
4
- import PropTypes from 'prop-types';
5
4
  import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
6
5
  import './NavBar.css';
7
6
  import {
@@ -35,14 +34,23 @@ import useMediaQuery from '@material-ui/core/useMediaQuery';
35
34
  import { useNavBar } from '@pega/react-sdk-components/lib/components/helpers/reactContextHelpers';
36
35
  import { logout } from '@pega/react-sdk-components/lib/components/helpers/authManager';
37
36
 
38
- import PCoreType from '@pega/pcore-pconnect-typedefs/types/pcore';
37
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
39
38
 
40
- declare const PCore: typeof PCoreType;
39
+
40
+ interface NavBarProps extends PConnProps {
41
+ // If any, enter additional props that only exist on this component
42
+ // eslint-disable-next-line react/no-unused-prop-types
43
+ appName?: string,
44
+ pages?: Array<any>,
45
+ caseTypes: Array<any>,
46
+ pConn?: any
47
+ }
41
48
 
42
49
 
43
50
  const iconMap = {
44
51
  'pi pi-headline': <HomeOutlinedIcon fontSize='large' />,
45
- 'pi pi-flag-solid': <FlagOutlinedIcon fontSize='large' />
52
+ 'pi pi-flag-solid': <FlagOutlinedIcon fontSize='large' />,
53
+ 'pi pi-home-solid': <HomeOutlinedIcon fontSize='large' />
46
54
  };
47
55
 
48
56
  const drawerWidth = 300;
@@ -98,8 +106,8 @@ const useStyles = makeStyles(theme => ({
98
106
  }
99
107
  }));
100
108
 
101
- export default function NavBar(props) {
102
- const { pConn, pages, caseTypes } = props;
109
+ export default function NavBar(props: NavBarProps) {
110
+ const { pConn, pages = [], caseTypes = [] } = props;
103
111
 
104
112
  const classes = useStyles();
105
113
  const theme = useTheme();
@@ -292,18 +300,3 @@ export default function NavBar(props) {
292
300
  </Drawer>
293
301
  );
294
302
  }
295
-
296
- NavBar.defaultProps = {
297
- pConn: null,
298
- appName: '',
299
- pages: [],
300
- caseTypes: []
301
- };
302
-
303
- NavBar.propTypes = {
304
- pConn: PropTypes.object,
305
- // eslint-disable-next-line react/no-unused-prop-types
306
- appName: PropTypes.string,
307
- pages: PropTypes.arrayOf(PropTypes.object),
308
- caseTypes: PropTypes.arrayOf(PropTypes.object)
309
- };
@@ -1,8 +1,19 @@
1
1
  import React from "react";
2
- import PropTypes from "prop-types";
3
2
 
4
- export default function Reference(props) {
5
- const { visibility, context, getPConnect, readOnly, displayMode } = props;
3
+ // import type { PConnProps } from '../../../types/PConnProps';
4
+
5
+ // ReferenceProps can't be used until getComponentConfig() is NOT private
6
+ // interface ReferenceProps extends PConnProps {
7
+ // // If any, enter additional props that only exist on this component
8
+ // visibility?: boolean,
9
+ // context?: string,
10
+ // readOnly?: boolean,
11
+ // displayMode?: string
12
+ // }
13
+
14
+
15
+ export default function Reference(props /*: ReferenceProps */) {
16
+ const { visibility = true, context = '', getPConnect, readOnly = false, displayMode = '' } = props;
6
17
 
7
18
  const pConnect = getPConnect();
8
19
  const referenceConfig = { ...pConnect.getComponentConfig() } || {};
@@ -41,18 +52,3 @@ export default function Reference(props) {
41
52
  }
42
53
  return null;
43
54
  }
44
-
45
- Reference.defaultProps = {
46
- visibility: true,
47
- context: null,
48
- readOnly: false,
49
- displayMode: null
50
- };
51
-
52
- Reference.propTypes = {
53
- getPConnect: PropTypes.func.isRequired,
54
- visibility: PropTypes.bool,
55
- context: PropTypes.string,
56
- readOnly: PropTypes.bool,
57
- displayMode: PropTypes.string
58
- };
@@ -1,7 +1,13 @@
1
1
  import React from "react";
2
- import PropTypes from "prop-types";
3
2
 
4
- export default function Region(props) {
3
+ // Region does NOT have getPConnect. So, no need to extend from PConnProps
4
+ interface RegionProps {
5
+ // If any, enter additional props that only exist on this component
6
+ children: Array<any>
7
+ }
8
+
9
+
10
+ export default function Region(props: RegionProps) {
5
11
  const { children } = props;
6
12
 
7
13
  return <React.Fragment>
@@ -11,7 +17,3 @@ export default function Region(props) {
11
17
  </>
12
18
  </React.Fragment>;
13
19
  }
14
-
15
- Region.propTypes = {
16
- children: PropTypes.arrayOf(PropTypes.node).isRequired
17
- };
@@ -1,6 +1,5 @@
1
1
  import React, { useMemo, useRef, useState, useEffect, useContext, createElement } from "react";
2
2
  // import { Banner, ModalManager } from "@pega/cosmos-react-core";
3
- import PropTypes, { object } from "prop-types";
4
3
  import isEqual from 'lodash.isequal';
5
4
  // import ReAuthMessageModal from "../ReAuthenticationModal";
6
5
  import { Box, CircularProgress } from "@material-ui/core";
@@ -9,6 +8,18 @@ import { LazyMap as LazyComponentMap } from "@pega/react-sdk-components/lib/comp
9
8
  import StoreContext from "@pega/react-sdk-components/lib/bridge/Context/StoreContext";
10
9
  import { isEmptyObject } from '@pega/react-sdk-components/lib/components/helpers/common-utils';
11
10
 
11
+ // import type { PConnProps } from '../../../types/PConnProps';
12
+
13
+ // Can't use RootContainerProps until getChildren() typedef is fixes to not return an array of 'never'
14
+ // interface RootContainerProps extends PConnProps {
15
+ // // If any, enter additional props that only exist on this component
16
+ // renderingMode?: string,
17
+ // routingInfo: { type: string, accessedOrder: Array<any>, items: any },
18
+ // children: Array<any>,
19
+ // skeleton: any,
20
+ // httpMessages: Array<any>
21
+ // }
22
+
12
23
  // Remove this and use "real" PCore type once .d.ts is fixed (currently shows 1 error)
13
24
  declare const PCore: any;
14
25
 
@@ -48,13 +59,13 @@ function getItemView(routingInfo, renderingMode) {
48
59
  return viewConfigs;
49
60
  }
50
61
 
51
- const RootContainer = (props) => {
62
+ export default function RootContainer(props /* : RootContainerProps */) {
52
63
  const {
53
64
  getPConnect,
54
- renderingMode,
55
- children,
65
+ renderingMode = '',
66
+ children = [],
56
67
  skeleton,
57
- httpMessages,
68
+ httpMessages = [],
58
69
  routingInfo
59
70
  } = props;
60
71
 
@@ -264,23 +275,3 @@ const RootContainer = (props) => {
264
275
  );
265
276
  }
266
277
  };
267
-
268
- RootContainer.defaultProps = {
269
- getPConnect: null,
270
- renderingMode: null,
271
- children: null,
272
- routingInfo: object
273
- };
274
-
275
- RootContainer.propTypes = {
276
- getPConnect: PropTypes.func,
277
- renderingMode: PropTypes.string,
278
- routingInfo: PropTypes.shape({
279
- type: PropTypes.string,
280
- accessedOrder: PropTypes.array,
281
- items: PropTypes.object
282
- }),
283
- children: PropTypes.arrayOf(PropTypes.oneOfType( [PropTypes.object, PropTypes.string ]))
284
- };
285
-
286
- export default RootContainer;
@@ -1,9 +1,16 @@
1
1
  import React from "react";
2
- import PropTypes from "prop-types";
3
2
  import { Breadcrumbs, Card, Typography } from "@material-ui/core";
4
3
  import DoubleArrowIcon from '@material-ui/icons/DoubleArrow';
5
4
  import DoneIcon from '@material-ui/icons/Done';
6
5
  import { makeStyles } from '@material-ui/core/styles';
6
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
+
8
+
9
+ interface StagesProps extends PConnProps {
10
+ // If any, enter additional props that only exist on this component
11
+ stages: Array<any>
12
+ }
13
+
7
14
 
8
15
  // Remove this and use "real" PCore type once .d.ts is fixed (currently shows 1 error)
9
16
  declare const PCore: any;
@@ -57,7 +64,7 @@ function getFilteredStages(stages) {
57
64
 
58
65
  /* TODO - this component should be refactored and not exposed as top level DX Component -
59
66
  the stages should be created as part of the CaseView */
60
- export default function Stages(props) {
67
+ export default function Stages(props: StagesProps) {
61
68
  const classes = useStyles();
62
69
 
63
70
  const { getPConnect, stages } = props;
@@ -66,7 +73,7 @@ export default function Stages(props) {
66
73
 
67
74
 
68
75
  const filteredStages = getFilteredStages(stages);
69
- const currentStageID = pConn.getValue(PCore.getConstants().CASE_INFO.STAGEID);
76
+ const currentStageID = pConn.getValue(PCore.getConstants().CASE_INFO.STAGEID, ''); // 2nd arg empty string until typedef allows optional
70
77
  const stagesObj = filteredStages.map((stage, index, arr) => {
71
78
  const theID = stage.ID || stage.id;
72
79
  return {
@@ -116,8 +123,3 @@ export default function Stages(props) {
116
123
  </Card>
117
124
  )
118
125
  }
119
-
120
- Stages.propTypes = {
121
- getPConnect: PropTypes.func.isRequired,
122
- stages: PropTypes.arrayOf(PropTypes.object).isRequired
123
- };
@@ -5,6 +5,13 @@ import {
5
5
  Divider,
6
6
  } from '@material-ui/core';
7
7
 
8
+ // LeftAlignVerticalTabs does NOT have getPConnect. So, no need to extend from PConnProps
9
+
10
+ interface LeftAlignVerticalTabsProps {
11
+ // If any, enter additional props that only exist on this component
12
+ }
13
+
14
+
8
15
  // LeftAlignVerticalTab is a specialized Tab that has styles to make it
9
16
  // left aligned and full width of the container Tabs
10
17
 
@@ -22,6 +29,6 @@ const LeftAlignVerticalTabs: any = withStyles((/* theme */) => ({
22
29
  display: 'block',
23
30
  textAlign: 'left',
24
31
  },
25
- }))((props) => <div><Tab {...props} /><Divider /></div>);
32
+ }))((props: LeftAlignVerticalTabsProps) => <div><Tab {...props} /><Divider /></div>);
26
33
 
27
34
  export default LeftAlignVerticalTabs;
@@ -1,9 +1,14 @@
1
1
  import React, { useState, useEffect } from "react";
2
- import PropTypes from "prop-types";
3
2
  import { makeStyles } from '@material-ui/core/styles'
4
3
 
5
4
  import Tabs from '@material-ui/core/Tabs';
6
- import LeftAlignVerticalTab from '@pega/react-sdk-components/lib/components/infra/VerticalTabs/LeftAlignVerticalTabs';
5
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
6
+
7
+ // VerticalTabs does NOT have getPConnect. So, no need to extend from PConnProps
8
+ interface VerticalTabsProps {
9
+ // If any, enter additional props that only exist on this component
10
+ tabconfig: Array<any>
11
+ }
7
12
 
8
13
 
9
14
  // The MuiTabs-indicator class is in a span whose parent is div (under the Tabs root component)
@@ -31,9 +36,12 @@ const createCustomEvent = (eventName: string, additionalData: {[key: string]: st
31
36
  };
32
37
 
33
38
 
34
- export default function VerticalTabs(props) {
39
+ export default function VerticalTabs(props: VerticalTabsProps) {
40
+ // Get emitted components from map (so we can get any override that may exist)
41
+ const LeftAlignVerticalTab = getComponentFromMap("LeftAlignVerticalTabs");
42
+
35
43
  // Get a React warning when we use tabConfig as mixed case. So all lowercase tabconfig
36
- const { tabconfig } = props;
44
+ const { tabconfig = [] } = props;
37
45
  const classes = useStyles();
38
46
  const [value, setValue] = useState(0);
39
47
 
@@ -65,11 +73,3 @@ export default function VerticalTabs(props) {
65
73
  </div>
66
74
  )
67
75
  }
68
-
69
- VerticalTabs.defaultProps = {
70
- tabconfig: []
71
- };
72
-
73
- VerticalTabs.propTypes = {
74
- tabconfig: PropTypes.arrayOf(PropTypes.object)
75
- };
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  // import { FieldGroup } from "@pega/cosmos-react-core";
4
3
  // import { LazyMap as LazyComponentMap } from "../../components_map";
5
4
 
@@ -10,6 +9,24 @@ import { getAllFields } from '@pega/react-sdk-components/lib/components/helpers/
10
9
  // Need to import any templates that we might render
11
10
 
12
11
  import './View.css';
12
+
13
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
14
+
15
+
16
+ interface ViewProps extends PConnProps {
17
+ // If any, enter additional props that only exist on this component
18
+ children: Array<any>,
19
+ template?: string,
20
+ label?: string,
21
+ showLabel: boolean,
22
+ mode?: string,
23
+ title?: string,
24
+ visibility?: boolean,
25
+ name?: string,
26
+ bInForm?: boolean
27
+ }
28
+
29
+
13
30
  //
14
31
  // WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
15
32
  // Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
@@ -25,17 +42,18 @@ const NO_HEADER_TEMPLATES = [
25
42
  'DetailsThreeColumn',
26
43
  'NarrowWideDetails',
27
44
  'WideNarrowDetails',
28
- 'Confirmation'
45
+ 'Confirmation',
46
+ 'DynamicTabs'
29
47
  ];
30
48
 
31
- export default function View(props) {
49
+ export default function View(props: ViewProps) {
32
50
  const { children, template, getPConnect, mode, visibility, name: pageName } = props;
33
- let { label, showLabel = false } = props;
51
+ let { label = '', showLabel = false } = props;
34
52
 
35
53
  // Get the inherited props from the parent to determine label settings. For 8.6, this is only for embedded data form views
36
54
  // Putting this logic here instead of copy/paste in every Form template index.js
37
55
 
38
- const inheritedProps = getPConnect().getInheritedProps();
56
+ const inheritedProps: any = getPConnect().getInheritedProps(); // try to remove any when getInheritedProps typedefs are fixed
39
57
  label = inheritedProps.label || label;
40
58
  showLabel = inheritedProps.showLabel || showLabel;
41
59
 
@@ -112,24 +130,6 @@ export default function View(props) {
112
130
  return null;
113
131
  }
114
132
 
115
- View.defaultProps = {
116
- label: undefined,
117
- showLabel: undefined,
118
- mode: undefined
119
- };
120
-
121
- View.propTypes = {
122
- children: PropTypes.oneOfType([
123
- PropTypes.arrayOf(PropTypes.node),
124
- PropTypes.array
125
- ]) /* array might be empty */,
126
- template: PropTypes.string /* .isRequired */,
127
- getPConnect: PropTypes.func.isRequired,
128
- label: PropTypes.string,
129
- showLabel: PropTypes.bool,
130
- mode: PropTypes.string,
131
- title: PropTypes.string
132
- };
133
133
 
134
134
  // Adapted from Constellation DX Component to add in additional props for some templates
135
135
  View.additionalProps = (state, getPConnect) => {
@@ -1,14 +1,32 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import { makeStyles } from '@material-ui/core/styles';
4
3
  import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
5
4
  import Avatar from '@material-ui/core/Avatar';
6
5
  import { NavContext } from '@pega/react-sdk-components/lib/components/helpers/reactContextHelpers';
7
6
  import './AppShell.css';
7
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
8
+
9
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
10
+
11
+ interface AppShellProps extends PConnProps {
12
+ // If any, enter additional props that only exist on this component
13
+ showAppName: boolean,
14
+ pages: Array<{
15
+ pxPageViewIcon: string,
16
+ pyClassName: string,
17
+ pyLabel: string,
18
+ pyRuleName: string,
19
+ pyURLContent: string,
20
+
21
+ }>,
22
+ caseTypes?:Array<object>,
23
+ children?: Array<any>,
24
+ portalTemplate: string,
25
+ portalName: string,
26
+ portalLogo : string,
27
+ navDisplayOptions: { alignment: string, position: string }
28
+ }
8
29
 
9
- // AppShell can emit NavBar or WssNavBar
10
- import NavBar from '@pega/react-sdk-components/lib/components/infra/NavBar';
11
- import WssNavBar from '@pega/react-sdk-components/lib/components/template/WssNavBar';
12
30
 
13
31
  const useStyles = makeStyles(theme => ({
14
32
  root: {
@@ -33,18 +51,23 @@ const useStyles = makeStyles(theme => ({
33
51
  declare const PCore: any;
34
52
 
35
53
 
36
- export default function AppShell(props) {
54
+ export default function AppShell(props:AppShellProps) {
55
+ // Get emitted components from map (so we can get any override that may exist)
56
+ const NavBar = getComponentFromMap("NavBar");
57
+ const WssNavBar = getComponentFromMap("WssNavBar");
58
+
37
59
  const {
38
- pages,
39
- caseTypes,
60
+ pages = [],
61
+ caseTypes = [],
40
62
  showAppName,
41
- children,
63
+ children = [],
42
64
  getPConnect,
43
65
  portalTemplate,
44
66
  portalName,
45
67
  portalLogo,
46
68
  navDisplayOptions
47
69
  } = props;
70
+
48
71
  const [open, setOpen] = useState(true);
49
72
  // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
50
73
  const [activeTab, setActiveTab] = useState(!pages ? null : pages[0]?.pyRuleName);
@@ -54,13 +77,13 @@ export default function AppShell(props) {
54
77
  const userName = envInfo.getOperatorName();
55
78
  const currentUserInitials = Utils.getInitials(userName);
56
79
  const appNameToDisplay = showAppName ? envInfo.getApplicationLabel() : '';
57
- const portalClass = pConn.getValue('.classID');
80
+ const portalClass = pConn.getValue('.classID', ''); // 2nd arg empty string until typedef marked correctly
58
81
  const envPortalName = envInfo.getPortalName();
59
82
  const localizedVal = PCore.getLocaleUtils().getLocaleValue;
60
83
 
61
84
  const classes = useStyles();
62
85
  const actionsAPI = pConn.getActionsApi();
63
- const localeReference = pConn.getValue('.pyLocaleReference');
86
+ const localeReference = pConn.getValue('.pyLocaleReference', ''); // 2nd arg empty string until typedef marked correctly
64
87
  const [imageBlobUrl, setImageBlobUrl] = useState(null);
65
88
  // useState for appName and mapChildren - note these are ONLY updated once (on component mount!)
66
89
  // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
@@ -72,7 +95,7 @@ export default function AppShell(props) {
72
95
  useEffect(() => {
73
96
  setAppName(PCore.getEnvironmentInfo().getApplicationName());
74
97
 
75
- const tempMap = pConn.getChildren().map((child, index) => {
98
+ const tempMap: any = pConn.getChildren()?.["map"]((child: any, index) => {
76
99
  const theChildComp = child.getPConnect().getComponentName();
77
100
  const theKey = `.${index}`;
78
101
  return (
@@ -187,7 +210,7 @@ export default function AppShell(props) {
187
210
  '',
188
211
  `${portalClass}!PORTAL!${envPortalName}`.toUpperCase()
189
212
  ),
190
- onClick: links[0] && links[0].onClick ? links[0].onClick : undefined
213
+ onClick: links[0] && /* links[0].onClick ? */ links[0].onClick /* : undefined */
191
214
  }}
192
215
  navLinks={links.filter((link, index) => {
193
216
  return index !== 0;
@@ -205,6 +228,7 @@ export default function AppShell(props) {
205
228
  <NavContext.Provider value={{ open, setOpen }}>
206
229
  <div id='AppShell' className={classes.root}>
207
230
  <NavBar
231
+ getPConnect={getPConnect}
208
232
  pConn={getPConnect()}
209
233
  appName={localizedVal(
210
234
  appNameToDisplay,
@@ -219,16 +243,3 @@ export default function AppShell(props) {
219
243
  </NavContext.Provider>
220
244
  );
221
245
  }
222
-
223
- AppShell.defaultProps = {
224
- pages: [],
225
- caseTypes: [],
226
- children: []
227
- };
228
- AppShell.propTypes = {
229
- showAppName: PropTypes.bool /* .isRequired */,
230
- pages: PropTypes.arrayOf(PropTypes.object),
231
- caseTypes: PropTypes.arrayOf(PropTypes.object),
232
- children: PropTypes.arrayOf(PropTypes.node),
233
- getPConnect: PropTypes.func.isRequired
234
- };
@@ -1,21 +1,37 @@
1
1
  import { useMemo, Children } from 'react';
2
- import PropTypes from 'prop-types';
3
- import Banner from '@pega/react-sdk-components/lib/components/designSystemExtension/Banner';
4
2
  import React from 'react';
3
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
4
+
5
+ // BannerPage does NOT have getPConnect. So, no need to extend from PConnProps
6
+
7
+ interface BannerPageProps {
8
+ // If any, enter additional props that only exist on this component
9
+ children: Array<any>,
10
+ layout?: string,
11
+ heading?: string,
12
+ message?: string,
13
+ imageTheme?: string,
14
+ backgroundImage?: string,
15
+ backgroundColor?: string,
16
+ tintImage?: boolean
17
+ }
5
18
 
6
19
  /*
7
20
  * BannerPage template.
8
21
  */
9
- export default function BannerPage(props) {
22
+ export default function BannerPage(props: BannerPageProps) {
23
+ // Get emitted components from map (so we can get any override that may exist)
24
+ const Banner = getComponentFromMap('Banner');
25
+
10
26
  const {
11
27
  children,
12
- layout,
13
- heading,
14
- message,
15
- imageTheme,
16
- backgroundImage,
17
- backgroundColor,
18
- tintImage
28
+ layout = 'two-column',
29
+ heading = '',
30
+ message = '',
31
+ imageTheme = 'light',
32
+ backgroundImage = '',
33
+ backgroundColor = '',
34
+ tintImage = false
19
35
  } = props;
20
36
 
21
37
  const childArray = useMemo(() => {
@@ -38,24 +54,3 @@ export default function BannerPage(props) {
38
54
  />
39
55
  );
40
56
  }
41
-
42
- BannerPage.propTypes = {
43
- children: PropTypes.arrayOf(PropTypes.node).isRequired,
44
- layout: PropTypes.string,
45
- heading: PropTypes.string,
46
- message: PropTypes.string,
47
- imageTheme: PropTypes.string,
48
- backgroundImage: PropTypes.string,
49
- backgroundColor: PropTypes.string,
50
- tintImage: PropTypes.bool
51
- };
52
-
53
- BannerPage.defaultProps = {
54
- layout: 'two-column',
55
- heading: '',
56
- message: '',
57
- imageTheme: 'light',
58
- backgroundImage: '',
59
- backgroundColor: '',
60
- tintImage: false
61
- };
@@ -1,13 +1,24 @@
1
1
  import React from "react";
2
- import PropTypes from "prop-types";
2
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
3
3
 
4
- import CaseSummaryFields from '@pega/react-sdk-components/lib/components/designSystemExtension/CaseSummaryFields';
4
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
+
6
+ interface CaseSummaryProps extends PConnProps {
7
+ // If any, enter additional props that only exist on this component
8
+ children: Array<any>
9
+ }
10
+
11
+
12
+ export default function CaseSummary(props: CaseSummaryProps) {
13
+ // Get emitted components from map (so we can get any override that may exist)
14
+ const CaseSummaryFields = getComponentFromMap('CaseSummaryFields');
5
15
 
6
- export default function CaseSummary(props) {
7
16
  const { getPConnect, children } = props;
8
17
  const thePConn = getPConnect();
9
18
  const theConfigProps = thePConn.getConfigProps();
10
- const { status, showStatus } = theConfigProps;
19
+ // const { status, showStatus } = theConfigProps;
20
+ const status = theConfigProps["status"];
21
+ const showStatus = theConfigProps["showStatus"];
11
22
 
12
23
  // from Constellation DX Components
13
24
  // get the primary and secondary fields with the raw data (which has the non-resolved property values)
@@ -44,7 +55,3 @@ export default function CaseSummary(props) {
44
55
  </div>
45
56
  )
46
57
  }
47
-
48
- CaseSummary.propTypes = {
49
- getPConnect: PropTypes.func.isRequired
50
- };