@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,11 +1,25 @@
1
1
  import React, { createElement } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import Grid from '@material-ui/core/Grid';
4
3
  import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
5
- import FieldGroup from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldGroup';
4
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
6
5
 
7
- export default function DetailsTwoColumn(props) {
8
- const { label, showLabel, getPConnect, showHighlightedData } = props;
6
+ // import type { PConnProps } from '../../../../types/PConnProps';
7
+
8
+
9
+ // Can't use PConnProps until getPConnect().getChildren() type is ok
10
+ // interface DetailsTwoColumnProps extends PConnProps {
11
+ // // If any, enter additional props that only exist on this component
12
+ // showLabel: boolean,
13
+ // label: string,
14
+ // showHighlightedData: boolean
15
+ // }
16
+
17
+
18
+ export default function DetailsTwoColumn(props /* : DetailsTwoColumnProps */) {
19
+ // Get emitted components from map (so we can get any override that may exist)
20
+ const FieldGroup = getComponentFromMap('FieldGroup');
21
+
22
+ const { label, showLabel = true, getPConnect, showHighlightedData = false } = props;
9
23
 
10
24
  // Get the inherited props from the parent to determine label settings
11
25
  const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
@@ -37,7 +51,8 @@ export default function DetailsTwoColumn(props) {
37
51
  field.config.displayAsStatus = true;
38
52
  }
39
53
 
40
- return getPConnect().createComponent(field);
54
+ return getPConnect().createComponent(field,
55
+ '', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
41
56
  });
42
57
  }
43
58
 
@@ -62,16 +77,3 @@ export default function DetailsTwoColumn(props) {
62
77
  </FieldGroup>
63
78
  );
64
79
  }
65
-
66
- DetailsTwoColumn.defaultProps = {
67
- label: undefined,
68
- showLabel: true,
69
- showHighlightedData: false
70
- };
71
-
72
- DetailsTwoColumn.propTypes = {
73
- showLabel: PropTypes.bool,
74
- label: PropTypes.string,
75
- getPConnect: PropTypes.func.isRequired,
76
- showHighlightedData: PropTypes.bool
77
- };
@@ -0,0 +1,78 @@
1
+ import React, { Children, useState, useMemo } from 'react';
2
+ import { makeStyles, Tab, Tabs } from '@material-ui/core';
3
+ import { TabContext, TabPanel } from '@material-ui/lab';
4
+ import { buildView } from '@pega/react-sdk-components/lib/components/helpers/field-group-utils';
5
+ // import type { PConnProps } from '../../../../types/PConnProps';
6
+
7
+ const useStyles = makeStyles(() => ({
8
+ tab: {
9
+ minWidth: '72px'
10
+ }
11
+ }));
12
+
13
+ // ListViewProps can't be used until getComponentConfig is NOT private
14
+ // interface DynamicTabsProps extends PConnProps {
15
+ // // If any, enter additional props that only exist on this component
16
+ // showLabel: boolean;
17
+ // label: string;
18
+ // referenceList?: Array<any>;
19
+ // }
20
+
21
+ function DynamicTabs(props /*: DynamicTabsProps */) {
22
+ const classes = useStyles();
23
+ const { referenceList, showLabel, label, getPConnect } = props;
24
+ const pConnect = getPConnect();
25
+ // Get the inherited props from the parent to determine label settings
26
+ const propsToUse = { label, showLabel, ...pConnect.getInheritedProps() };
27
+ const defaultTabIndex = 0;
28
+ const { tablabel } = pConnect.getComponentConfig();
29
+ const tablabelProp = PCore.getAnnotationUtils().getPropertyName(tablabel);
30
+ const referenceListData = pConnect.getValue(`${referenceList}.pxResults`, ''); // 2nd arg empty string until typedefs properly allow optional
31
+ const memoisedTabViews = useMemo(() => {
32
+ pConnect.setInheritedProp('displayMode', 'LABELS_LEFT');
33
+ pConnect.setInheritedProp('readOnly', true);
34
+
35
+ return (
36
+ referenceListData &&
37
+ Children.toArray(
38
+ referenceListData.map((item, index) => {
39
+ return <React.Fragment key={item[tablabelProp]}>{buildView(pConnect, index, '')}</React.Fragment>;
40
+ })
41
+ )
42
+ );
43
+ }, [referenceListData]);
44
+ const [panelShown, changePanel] = useState(defaultTabIndex);
45
+ const handleTabClick = (e, id) => {
46
+ changePanel(parseInt(id, 10));
47
+ };
48
+ // Loop over the tab contents and and pull out the labels for the navigation
49
+ const tabItems =
50
+ referenceListData?.map((item, i) => {
51
+ const currentTabLabel = item[tablabelProp] || PCore.getLocaleUtils().getLocaleValue('No label specified in config', 'Generic');
52
+ return {
53
+ name: currentTabLabel,
54
+ id: i
55
+ };
56
+ }) || [];
57
+
58
+ return (
59
+ <>
60
+ {propsToUse.label && <h3 id="dynamic-tabs-title">{propsToUse.label}</h3>}
61
+ <TabContext value={panelShown.toString()}>
62
+ <Tabs onChange={handleTabClick} value={panelShown} variant="scrollable" scrollButtons="auto" indicatorColor="primary" id="dynamic-tabs">
63
+ {tabItems.map((tab: any) => (
64
+ <Tab key={tab.id} label={tab.name} value={tab.id} className={classes.tab} />
65
+ ))}
66
+ </Tabs>
67
+
68
+ {tabItems.map((tab: any) => (
69
+ <TabPanel key={tab.id} value={tab.id.toString()} tabIndex={+tab.id} id="dynamic-tabpanel">
70
+ <div>{memoisedTabViews[parseInt(tab.id, 10)] || 'No content exists'}</div>
71
+ </TabPanel>
72
+ ))}
73
+ </TabContext>
74
+ </>
75
+ );
76
+ }
77
+
78
+ export default DynamicTabs;
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "DynamicTabs",
3
+ "label": "Dynamic tabs (list)",
4
+ "description": "Dynamic tabs (list)",
5
+ "type": "Template",
6
+ "subtype": "DETAILS",
7
+ "icon": "DynamicTabs.svg",
8
+ "hideTemplateEdit": true,
9
+ "hideFromTemplatePicker": true,
10
+ "viewHeadingLabel": "Default heading",
11
+ "properties": [
12
+ {
13
+ "name": "referenceList",
14
+ "label": "Data page",
15
+ "format": "CONTENTPICKERSOURCE"
16
+ },
17
+ {
18
+ "name": "parameters",
19
+ "label": "Parameters",
20
+ "format": "PARAMETERS",
21
+ "showOverride": false
22
+ },
23
+ {
24
+ "name": "tablabel",
25
+ "label": "Tab label",
26
+ "format": "PROPERTY",
27
+ "ofContextClass": true
28
+ },
29
+ {
30
+ "format": "VIEWPICKER",
31
+ "name": "Views",
32
+ "label": "Tab content",
33
+ "ofContextClass": true
34
+ }
35
+ ]
36
+ }
@@ -0,0 +1 @@
1
+ export { default } from './DynamicTabs';
@@ -1,24 +1,35 @@
1
1
  /* eslint-disable react-hooks/rules-of-hooks */
2
2
  import React, { useMemo } from 'react';
3
- import PropTypes from 'prop-types';
4
-
5
- import FieldGroup from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldGroup';
6
- import FieldGroupList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldGroupList';
7
3
  import { getReferenceList, buildView } from '@pega/react-sdk-components/lib/components/helpers/field-group-utils';
4
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
5
+
6
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
7
 
9
- import PCoreType from '@pega/pcore-pconnect-typedefs/types/pcore';
8
+ interface FieldGroupTemplateProps extends PConnProps {
9
+ // If any, enter additional props that only exist on this component
10
+ referenceList?: Array<any>,
11
+ contextClass: string,
12
+ renderMode?: string,
13
+ heading?: string,
14
+ lookForChildInConfig?: boolean,
15
+ displayMode?: string,
16
+ fieldHeader?: string,
17
+ allowTableEdit: boolean
18
+ }
10
19
 
11
- declare const PCore: typeof PCoreType;
12
20
 
21
+ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
22
+ // Get emitted components from map (so we can get any override that may exist)
23
+ const FieldGroup = getComponentFromMap('FieldGroup');
24
+ const FieldGroupList = getComponentFromMap('FieldGroupList');
13
25
 
14
- export default function FieldGroupTemplate(props) {
15
26
  const {
16
- referenceList,
27
+ referenceList = [],
17
28
  renderMode,
18
29
  contextClass,
19
30
  getPConnect,
20
31
  lookForChildInConfig,
21
- heading,
32
+ heading = '',
22
33
  displayMode,
23
34
  fieldHeader,
24
35
  allowTableEdit: allowAddEdit
@@ -41,7 +52,7 @@ export default function FieldGroupTemplate(props) {
41
52
  if (PCore.getPCoreVersion()?.includes('8.7')) {
42
53
  pConn.getListActions().insert({ classID: contextClass }, referenceList.length, pageReference);
43
54
  } else {
44
- pConn.getListActions().insert({}, referenceList.length);
55
+ pConn.getListActions().insert({}, referenceList.length, null); // 3rd arg null until typedef marked correctly as optional
45
56
  }
46
57
  };
47
58
 
@@ -53,7 +64,7 @@ export default function FieldGroupTemplate(props) {
53
64
  if (PCore.getPCoreVersion()?.includes('8.7')) {
54
65
  pConn.getListActions().deleteEntry(index, pageReference);
55
66
  } else {
56
- pConn.getListActions().deleteEntry(index);
67
+ pConn.getListActions().deleteEntry(index, null); // 2nd arg null until typedef marked correctly as optional
57
68
  }
58
69
  };
59
70
  if (referenceList.length === 0 && allowAddEdit !== false) {
@@ -97,20 +108,3 @@ export default function FieldGroupTemplate(props) {
97
108
 
98
109
  return <div>{memoisedReadOnlyList}</div>;
99
110
  }
100
-
101
- FieldGroupTemplate.defaultProps = {
102
- referenceList: [],
103
- heading: undefined,
104
- contextClass: null,
105
- displayMode: undefined
106
- };
107
-
108
- FieldGroupTemplate.propTypes = {
109
- referenceList: PropTypes.arrayOf(Object),
110
- contextClass: PropTypes.string,
111
- getPConnect: PropTypes.func.isRequired,
112
- renderMode: PropTypes.string.isRequired,
113
- heading: PropTypes.string,
114
- lookForChildInConfig: PropTypes.bool,
115
- displayMode: PropTypes.string
116
- };
@@ -1,7 +1,16 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import { Grid, Typography } from '@material-ui/core';
4
3
  import { makeStyles } from '@material-ui/core/styles';
4
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
+
6
+ // InlineDashboard does NOT have getPConnect. So, no need to extend from PConnProps
7
+ interface InlineDashboardProps extends PConnProps {
8
+ // If any, enter additional props that only exist on this component
9
+ children: Array<any>,
10
+ title: string,
11
+ filterPosition?: string
12
+ }
13
+
5
14
 
6
15
  const useStyles = makeStyles((/* theme */) => ({
7
16
  headerStyles: {
@@ -30,7 +39,7 @@ const useStyles = makeStyles((/* theme */) => ({
30
39
  }
31
40
  }));
32
41
 
33
- export default function InlineDashboard(props) {
42
+ export default function InlineDashboard(props: InlineDashboardProps) {
34
43
  const classes = useStyles();
35
44
 
36
45
  const { children, title, filterPosition } = props;
@@ -65,8 +74,3 @@ export default function InlineDashboard(props) {
65
74
  </>
66
75
  );
67
76
  }
68
-
69
- InlineDashboard.propTypes = {
70
- children: PropTypes.arrayOf(PropTypes.node).isRequired
71
- // template: PropTypes.string.isRequired
72
- };
@@ -1,18 +1,33 @@
1
1
  import React from 'react';
2
2
  import { useMemo, Children, useEffect, useState } from 'react';
3
- import PropTypes from 'prop-types';
4
3
 
5
4
  import { buildFilterComponents } from '@pega/react-sdk-components/lib/components/infra/DashboardFilter/filterUtils';
6
- import InlineDashboard from '@pega/react-sdk-components/lib/components/template/InlineDashboard';
5
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
7
6
 
8
- export default function InlineDashboardPage(props) {
9
- const { children, getPConnect } = props;
7
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
+
9
+
10
+ interface InlineDashboardPageProps extends PConnProps {
11
+ // If any, enter additional props that only exist on this component
12
+ children: Array<any>,
13
+ title: string,
14
+ icon?: string,
15
+ filterPosition?: string
16
+ }
17
+
18
+
19
+ export default function InlineDashboardPage(props: InlineDashboardPageProps) {
20
+ // Get emitted components from map (so we can get any override that may exist)
21
+ const InlineDashboard = getComponentFromMap("InlineDashboard");
22
+
23
+ // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
24
+ const { children, getPConnect, icon = '', filterPosition = 'block-start' } = props;
10
25
  const [filterComponents, setFilterComponents] = useState([]);
11
26
  const childArray = useMemo(() => {
12
27
  return Children.toArray(children);
13
28
  }, [children]);
14
29
 
15
- const allFilters = getPConnect().getRawMetadata().children[1];
30
+ const allFilters = getPConnect().getRawMetadata()["children"][1];
16
31
 
17
32
  useEffect(() => {
18
33
  setFilterComponents(buildFilterComponents(getPConnect, allFilters));
@@ -26,16 +41,3 @@ export default function InlineDashboardPage(props) {
26
41
 
27
42
  return <InlineDashboard {...inlineProps} />;
28
43
  }
29
-
30
- InlineDashboardPage.propTypes = {
31
- children: PropTypes.arrayOf(PropTypes.node).isRequired,
32
- getPConnect: PropTypes.func.isRequired,
33
- title: PropTypes.string.isRequired,
34
- icon: PropTypes.string,
35
- filterPosition: PropTypes.string
36
- };
37
-
38
- InlineDashboardPage.defaultProps = {
39
- icon: '',
40
- filterPosition: 'block-start'
41
- };
@@ -1,20 +1,21 @@
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 ListView from '@pega/react-sdk-components/lib/components/template/ListView';
4
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
5
 
6
- export default function ListPage(props) {
6
+ interface ListPageProps extends PConnProps {
7
+ // If any, enter additional props that only exist on this component
8
+ parameters: object
9
+ }
10
+
11
+
12
+ export default function ListPage(props: ListPageProps) {
13
+ // Get emitted components from map (so we can get any override that may exist)
14
+ const ListView = getComponentFromMap('ListView');
7
15
 
16
+ // special case for ListView - add in a prop
17
+ const listViewProps = {...props, bInForm: false};
8
18
  return (
9
- <ListView {...props}></ListView>
19
+ <ListView {...listViewProps}></ListView>
10
20
  )
11
21
  }
12
-
13
- ListPage.defaultProps = {
14
- parameters: undefined
15
- };
16
-
17
- ListPage.propTypes = {
18
- getPConnect: PropTypes.func.isRequired,
19
- parameters: PropTypes.objectOf(PropTypes.any)
20
- };