@pega/react-sdk-overrides 23.1.10 → 23.1.11

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 (228) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +17 -0
  3. package/SECURITY.md +10 -0
  4. package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +6 -14
  5. package/lib/designSystemExtension/Banner/Banner.tsx +14 -11
  6. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
  7. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +27 -22
  8. package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +14 -20
  9. package/lib/designSystemExtension/DetailsFields/index.tsx +1 -1
  10. package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +44 -19
  11. package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +7 -12
  12. package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +12 -29
  13. package/lib/designSystemExtension/Operator/Operator.tsx +94 -82
  14. package/lib/designSystemExtension/Pulse/Pulse.tsx +14 -16
  15. package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +6 -5
  16. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +14 -14
  17. package/lib/field/AutoComplete/AutoComplete.tsx +24 -26
  18. package/lib/field/AutoComplete/config-ext.json +2 -3
  19. package/lib/field/CancelAlert/CancelAlert.tsx +98 -84
  20. package/lib/field/CancelAlert/index.tsx +1 -1
  21. package/lib/field/Checkbox/Checkbox.tsx +23 -44
  22. package/lib/field/Checkbox/config-ext.json +2 -3
  23. package/lib/field/Currency/Currency.tsx +25 -50
  24. package/lib/field/Currency/config-ext.json +2 -3
  25. package/lib/field/Currency/currency-utils.ts +9 -16
  26. package/lib/field/Date/Date.tsx +15 -11
  27. package/lib/field/Date/config-ext.json +2 -3
  28. package/lib/field/DateTime/DateTime.tsx +9 -9
  29. package/lib/field/DateTime/config-ext.json +1 -2
  30. package/lib/field/Decimal/Decimal.tsx +23 -43
  31. package/lib/field/Decimal/config-ext.json +1 -2
  32. package/lib/field/Decimal/index.tsx +1 -1
  33. package/lib/field/Dropdown/Dropdown.tsx +122 -31
  34. package/lib/field/Dropdown/config-ext.json +1 -2
  35. package/lib/field/Email/Email.tsx +11 -10
  36. package/lib/field/Email/config-ext.json +1 -2
  37. package/lib/field/Email/index.tsx +1 -1
  38. package/lib/field/Group/Group.tsx +39 -0
  39. package/lib/field/Group/config-ext.json +7 -0
  40. package/lib/field/Group/index.tsx +1 -0
  41. package/lib/field/Integer/Integer.tsx +8 -7
  42. package/lib/field/Integer/config-ext.json +1 -2
  43. package/lib/field/Percentage/Percentage.tsx +46 -41
  44. package/lib/field/Percentage/config-ext.json +1 -2
  45. package/lib/field/Phone/Phone.tsx +13 -12
  46. package/lib/field/Phone/index.tsx +1 -1
  47. package/lib/field/RadioButtons/RadioButtons.tsx +20 -18
  48. package/lib/field/RadioButtons/config-ext.json +1 -2
  49. package/lib/field/RichText/RichText.tsx +7 -6
  50. package/lib/field/ScalarList/ScalarList.tsx +3 -13
  51. package/lib/field/ScalarList/config-ext.json +1 -2
  52. package/lib/field/SemanticLink/SemanticLink.tsx +7 -7
  53. package/lib/field/SemanticLink/config-ext.json +1 -2
  54. package/lib/field/SemanticLink/utils.ts +8 -11
  55. package/lib/field/TextArea/TextArea.tsx +7 -6
  56. package/lib/field/TextArea/config-ext.json +1 -2
  57. package/lib/field/TextContent/TextContent.tsx +4 -6
  58. package/lib/field/TextContent/config-ext.json +1 -2
  59. package/lib/field/TextInput/TextInput.tsx +9 -7
  60. package/lib/field/TextInput/config-ext.json +1 -2
  61. package/lib/field/TextInput/index.tsx +1 -1
  62. package/lib/field/Time/Time.tsx +11 -11
  63. package/lib/field/Time/config-ext.json +1 -2
  64. package/lib/field/URL/URL.tsx +9 -8
  65. package/lib/field/URL/config-ext.json +1 -2
  66. package/lib/field/URL/index.tsx +1 -1
  67. package/lib/field/UserReference/UserReference.tsx +18 -16
  68. package/lib/field/UserReference/UserReferenceUtils.ts +2 -2
  69. package/lib/field/UserReference/config-ext.json +1 -2
  70. package/lib/helpers/attachmentHelpers.ts +13 -8
  71. package/lib/helpers/case-utils.tsx +4 -8
  72. package/lib/helpers/common-utils.ts +5 -1
  73. package/lib/helpers/data_page.ts +3 -7
  74. package/lib/helpers/date-format-utils.ts +3 -3
  75. package/lib/helpers/event-utils.ts +3 -3
  76. package/lib/helpers/field-group-utils.ts +1 -1
  77. package/lib/helpers/formatters/Boolean.ts +9 -26
  78. package/lib/helpers/formatters/Currency.ts +15 -21
  79. package/lib/helpers/formatters/CurrencyMap.ts +505 -501
  80. package/lib/helpers/formatters/Date.ts +20 -26
  81. package/lib/helpers/formatters/common.ts +1 -2
  82. package/lib/helpers/formatters/index.ts +26 -19
  83. package/lib/helpers/reactContextHelpers.ts +2 -2
  84. package/lib/helpers/simpleTableHelpers.ts +59 -83
  85. package/lib/helpers/state-utils.tsx +5 -9
  86. package/lib/helpers/template-utils.ts +3 -6
  87. package/lib/helpers/utils.ts +5 -5
  88. package/lib/helpers/versionHelpers.ts +1 -4
  89. package/lib/infra/ActionButtons/ActionButtons.tsx +38 -29
  90. package/lib/infra/ActionButtons/index.tsx +1 -1
  91. package/lib/infra/Assignment/Assignment.tsx +99 -79
  92. package/lib/infra/Assignment/index.tsx +1 -1
  93. package/lib/infra/AssignmentCard/AssignmentCard.tsx +13 -16
  94. package/lib/infra/AssignmentCard/index.tsx +1 -1
  95. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +67 -213
  96. package/lib/infra/Containers/FlowContainer/helpers.ts +34 -45
  97. package/lib/infra/Containers/FlowContainer/index.tsx +1 -1
  98. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +65 -0
  99. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/index.tsx +1 -0
  100. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +227 -218
  101. package/lib/infra/Containers/ModalViewContainer/index.tsx +1 -1
  102. package/lib/infra/Containers/SimpleView/SimpleView.tsx +48 -0
  103. package/lib/infra/Containers/SimpleView/helper.ts +125 -0
  104. package/lib/infra/Containers/SimpleView/index.tsx +1 -0
  105. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +36 -46
  106. package/lib/infra/Containers/helpers.ts +6 -0
  107. package/lib/infra/DashboardFilter/DashboardFilter.tsx +21 -42
  108. package/lib/infra/DashboardFilter/filterUtils.tsx +12 -43
  109. package/lib/infra/DeferLoad/DeferLoad.tsx +22 -28
  110. package/lib/infra/DeferLoad/index.tsx +1 -1
  111. package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +16 -30
  112. package/lib/infra/MultiStep/MultiStep.css +11 -15
  113. package/lib/infra/MultiStep/MultiStep.tsx +176 -212
  114. package/lib/infra/MultiStep/index.tsx +1 -1
  115. package/lib/infra/NavBar/NavBar.css +103 -105
  116. package/lib/infra/NavBar/NavBar.tsx +18 -30
  117. package/lib/infra/Reference/Reference.tsx +15 -17
  118. package/lib/infra/Region/Region.tsx +4 -6
  119. package/lib/infra/RootContainer/RootContainer.tsx +75 -111
  120. package/lib/infra/RootContainer/index.tsx +1 -1
  121. package/lib/infra/Stages/Stages.tsx +32 -39
  122. package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +11 -11
  123. package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +21 -28
  124. package/lib/infra/View/View.tsx +17 -21
  125. package/lib/template/AppShell/AppShell.css +22 -23
  126. package/lib/template/AppShell/AppShell.tsx +39 -74
  127. package/lib/template/BannerPage/BannerPage.tsx +12 -14
  128. package/lib/template/CaseSummary/CaseSummary.tsx +58 -18
  129. package/lib/template/CaseSummary/config-ext.json +1 -2
  130. package/lib/template/CaseView/CaseView.tsx +34 -63
  131. package/lib/template/CaseView/config-ext.json +1 -2
  132. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +63 -19
  133. package/lib/template/Confirmation/Confirmation.tsx +12 -17
  134. package/lib/template/Confirmation/config-ext.json +1 -2
  135. package/lib/template/DataReference/DataReference.tsx +95 -121
  136. package/lib/template/DataReference/config-ext.json +1 -2
  137. package/lib/template/DefaultForm/DefaultForm.css +7 -3
  138. package/lib/template/DefaultForm/DefaultForm.tsx +13 -16
  139. package/lib/template/DefaultForm/config-ext.json +1 -2
  140. package/lib/template/Details/Details/Details.tsx +19 -22
  141. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +9 -13
  142. package/lib/template/Details/DetailsSubTabs/config-ext.json +1 -2
  143. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +19 -24
  144. package/lib/template/Details/DetailsThreeColumn/config-ext.json +1 -2
  145. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +19 -25
  146. package/lib/template/Details/DetailsTwoColumn/config-ext.json +1 -2
  147. package/lib/template/Details/DetailsTwoColumn/index.tsx +1 -1
  148. package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +15 -14
  149. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +15 -22
  150. package/lib/template/InlineDashboard/InlineDashboard.tsx +12 -14
  151. package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +12 -16
  152. package/lib/template/ListPage/ListPage.tsx +5 -10
  153. package/lib/template/ListPage/config-ext.json +1 -2
  154. package/lib/template/ListView/DefaultViewMeta.ts +1 -3
  155. package/lib/template/ListView/ListView.tsx +179 -169
  156. package/lib/template/ListView/config-ext.json +1 -2
  157. package/lib/template/ListView/hooks.ts +24 -26
  158. package/lib/template/ListView/utils.ts +51 -87
  159. package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +20 -20
  160. package/lib/template/NarrowWide/NarrowWide/NarrowWide.css +0 -2
  161. package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +25 -38
  162. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +20 -25
  163. package/lib/template/NarrowWide/NarrowWideDetails/config-ext.json +1 -2
  164. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.css +0 -2
  165. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +14 -24
  166. package/lib/template/NarrowWide/NarrowWideForm/config-ext.json +1 -2
  167. package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +9 -19
  168. package/lib/template/NarrowWide/NarrowWidePage/config-ext.json +1 -2
  169. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +14 -15
  170. package/lib/template/OneColumn/OneColumn/config-ext.json +1 -2
  171. package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +3 -10
  172. package/lib/template/OneColumn/OneColumnPage/config-ext.json +1 -2
  173. package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +6 -10
  174. package/lib/template/OneColumn/OneColumnTab/config-ext.json +1 -2
  175. package/lib/template/PromotedFilters/PromotedFilters.css +1 -1
  176. package/lib/template/PromotedFilters/PromotedFilters.tsx +32 -28
  177. package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +37 -33
  178. package/lib/template/SimpleTable/SimpleTable/config-ext.json +1 -2
  179. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +184 -118
  180. package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +24 -25
  181. package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +30 -30
  182. package/lib/template/SubTabs/SubTabs.tsx +22 -40
  183. package/lib/template/SubTabs/config-ext.json +1 -2
  184. package/lib/template/SubTabs/tabUtils.ts +2 -5
  185. package/lib/template/TwoColumn/TwoColumn/TwoColumn.css +0 -1
  186. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +30 -28
  187. package/lib/template/TwoColumn/TwoColumn/config-ext.json +1 -2
  188. package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +3 -10
  189. package/lib/template/TwoColumn/TwoColumnPage/config-ext.json +1 -2
  190. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +30 -28
  191. package/lib/template/TwoColumn/TwoColumnTab/config-ext.json +1 -2
  192. package/lib/template/WideNarrow/WideNarrow/WideNarrow.css +0 -2
  193. package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +22 -34
  194. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +24 -28
  195. package/lib/template/WideNarrow/WideNarrowDetails/config-ext.json +1 -2
  196. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.css +0 -2
  197. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +13 -21
  198. package/lib/template/WideNarrow/WideNarrowForm/config-ext.json +1 -2
  199. package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +8 -16
  200. package/lib/template/WideNarrow/WideNarrowPage/config-ext.json +1 -2
  201. package/lib/template/WideNarrow/WideNarrowPage/index.tsx +1 -1
  202. package/lib/template/WssNavBar/WssNavBar.tsx +18 -21
  203. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +29 -28
  204. package/lib/widget/AppAnnouncement/config-ext.json +1 -2
  205. package/lib/widget/Attachment/Attachment.css +60 -1
  206. package/lib/widget/Attachment/Attachment.tsx +378 -405
  207. package/lib/widget/Attachment/index.tsx +1 -1
  208. package/lib/widget/CaseHistory/CaseHistory.tsx +64 -66
  209. package/lib/widget/CaseHistory/config-ext.json +1 -2
  210. package/lib/widget/CaseHistory/index.tsx +1 -1
  211. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +16 -18
  212. package/lib/widget/FileUtility/FileUtility/FileUtility.css +2 -2
  213. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +310 -246
  214. package/lib/widget/FileUtility/FileUtility/config-ext.json +1 -2
  215. package/lib/widget/Followers/Followers.tsx +23 -20
  216. package/lib/widget/Followers/config-ext.json +1 -2
  217. package/lib/widget/QuickCreate/QuickCreate.tsx +68 -42
  218. package/lib/widget/SummaryItem/SummaryItem.css +9 -9
  219. package/lib/widget/SummaryItem/SummaryItem.tsx +58 -58
  220. package/lib/widget/SummaryItem/index.tsx +1 -1
  221. package/lib/widget/SummaryList/SummaryList.tsx +7 -10
  222. package/lib/widget/ToDo/ToDo.css +4 -4
  223. package/lib/widget/ToDo/ToDo.tsx +52 -53
  224. package/lib/widget/ToDo/config-ext.json +1 -2
  225. package/package.json +5 -2
  226. package/lib/helpers/auth.js +0 -834
  227. package/lib/helpers/authManager.ts +0 -933
  228. package/lib/helpers/config_access.js +0 -186
@@ -1,5 +1,3 @@
1
- import React from 'react';
2
-
3
1
  import Grid from '@material-ui/core/Grid';
4
2
  import Divider from '@material-ui/core/Divider';
5
3
  import Link from '@material-ui/core/Link';
@@ -10,19 +8,15 @@ import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
10
8
  // So, no need to extend PConnProps
11
9
  interface FieldGroupListProps {
12
10
  // If any, enter additional props that only exist on this component
13
- items: Array<any> | any,
14
- onDelete: any,
15
- onAdd: any
11
+ items: any[] | any;
12
+ onDelete: any;
13
+ onAdd: any;
16
14
  }
17
15
 
18
-
19
16
  export default function FieldGroupList(props: FieldGroupListProps) {
20
17
  let menuIconOverride$ = 'trash';
21
18
  if (menuIconOverride$) {
22
- menuIconOverride$ = Utils.getImageSrc(
23
- menuIconOverride$,
24
- Utils.getSDKStaticConentUrl()
25
- );
19
+ menuIconOverride$ = Utils.getImageSrc(menuIconOverride$, Utils.getSDKStaticConentUrl());
26
20
  }
27
21
 
28
22
  return (
@@ -38,11 +32,12 @@ export default function FieldGroupList(props: FieldGroupListProps) {
38
32
  style={{ float: 'right' }}
39
33
  className='psdk-utility-button'
40
34
  id={`delete-row-${item.id}`}
35
+ aria-label='Delete Row'
41
36
  onClick={() => {
42
37
  props.onDelete(item.id);
43
38
  }}
44
39
  >
45
- <img className='psdk-utility-card-action-svg-icon' src={menuIconOverride$}></img>
40
+ <img className='psdk-utility-card-action-svg-icon' src={menuIconOverride$} />
46
41
  </button>
47
42
  )}
48
43
  {item.children}
@@ -60,4 +55,4 @@ export default function FieldGroupList(props: FieldGroupListProps) {
60
55
  </Grid>
61
56
  </Grid>
62
57
  );
63
- };
58
+ }
@@ -1,19 +1,16 @@
1
- import React from 'react';
2
-
3
1
  import Grid from '@material-ui/core/Grid';
4
2
  import Typography from '@material-ui/core/Typography';
5
3
  import { makeStyles } from '@material-ui/core/styles';
6
4
 
7
5
  // FieldValueList is one of the few components that does NOT have getPConnect.
8
6
  // So, no need to extend PConnProps
9
- interface FieldValueListProps{
7
+ interface FieldValueListProps {
10
8
  // If any, enter additional props that only exist on this component
11
- name?: string,
12
- value: any,
13
- variant?: string
9
+ name?: string;
10
+ value: any;
11
+ variant?: string;
14
12
  }
15
13
 
16
-
17
14
  const useStyles = makeStyles(theme => ({
18
15
  root: {
19
16
  marginRight: theme.spacing(1),
@@ -53,11 +50,7 @@ export default function FieldValueList(props: FieldValueListProps) {
53
50
 
54
51
  function getGridItemLabel() {
55
52
  return (
56
- <Grid
57
- item
58
- xs={variant === 'stacked' ? 12 : 6}
59
- className={variant === 'stacked' ? classes.noPaddingBottom : ''}
60
- >
53
+ <Grid item xs={variant === 'stacked' ? 12 : 6} className={variant === 'stacked' ? classes.noPaddingBottom : ''}>
61
54
  <Typography variant='body2' component='span' className={`${classes.fieldLabel}`}>
62
55
  {name}
63
56
  </Typography>
@@ -69,16 +62,8 @@ export default function FieldValueList(props: FieldValueListProps) {
69
62
  const formattedValue = formatItemValue(value);
70
63
 
71
64
  return (
72
- <Grid
73
- item
74
- xs={variant === 'stacked' ? 12 : 6}
75
- className={variant === 'stacked' ? classes.noPaddingTop : ''}
76
- >
77
- <Typography
78
- variant={variant === 'stacked' ? 'h6' : 'body2'}
79
- component='span'
80
- className={classes.fieldValue}
81
- >
65
+ <Grid item xs={variant === 'stacked' ? 12 : 6} className={variant === 'stacked' ? classes.noPaddingTop : ''}>
66
+ <Typography variant={variant === 'stacked' ? 'h6' : 'body2'} component='span' className={classes.fieldValue}>
82
67
  {formattedValue}
83
68
  </Typography>
84
69
  </Grid>
@@ -86,11 +71,9 @@ export default function FieldValueList(props: FieldValueListProps) {
86
71
  }
87
72
 
88
73
  return (
89
- <React.Fragment>
90
- <Grid container spacing={4} justifyContent='space-between'>
91
- {getGridItemLabel()}
92
- {getGridItemValue()}
93
- </Grid>
94
- </React.Fragment>
74
+ <Grid container spacing={4} justifyContent='space-between'>
75
+ {getGridItemLabel()}
76
+ {getGridItemValue()}
77
+ </Grid>
95
78
  );
96
- };
79
+ }
@@ -1,142 +1,144 @@
1
- import React, {useState} from "react";
1
+ import React, { useState } from 'react';
2
2
  import TextField from '@material-ui/core/TextField';
3
3
  import Popover from '@material-ui/core/Popover';
4
4
  import Grid from '@material-ui/core/Grid';
5
5
  import Typography from '@material-ui/core/Typography';
6
-
7
6
  import { makeStyles } from '@material-ui/core/styles';
8
7
 
9
8
  import Utils from '@pega/react-sdk-components/lib/components/helpers/utils';
9
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
10
10
 
11
11
  // Operator is one of the few components that does NOT have getPConnect.
12
12
  // So, no need to extend PConnProps
13
- interface OperatorProps{
13
+ interface OperatorProps extends PConnProps {
14
14
  // If any, enter additional props that only exist on this component
15
- caseOpConfig: {
16
- label: string,
17
- createDateTime: string,
18
- createLabel: string,
19
- createOperator: { userName: string, userId: string },
20
- updateDateTime: string,
21
- updateLabel: string,
22
- updateOperator: { userName: string, userId: string }
23
- }
15
+ label: string;
16
+ createDateTime: string;
17
+ createLabel: string;
18
+ createOperator: { userName: string; userId: string };
19
+ updateDateTime: string;
20
+ updateLabel: string;
21
+ updateOperator: { userName: string; userId: string };
22
+ displayLabel?: any;
24
23
  }
25
24
 
26
-
27
-
28
- const useStyles = makeStyles((theme) => ({
25
+ const useStyles = makeStyles(theme => ({
29
26
  root: {
30
27
  padding: theme.spacing(1),
31
- margin: theme.spacing(1),
28
+ margin: theme.spacing(1)
32
29
  },
33
30
  popover: {
34
31
  padding: theme.spacing(1),
35
- margin: theme.spacing(1),
32
+ margin: theme.spacing(1)
36
33
  }
37
34
  }));
38
35
 
39
36
  export default function Operator(props: OperatorProps) {
40
37
  // const componentName = "Operator";
41
- const { caseOpConfig } = props;
42
38
  const classes = useStyles();
43
39
 
44
- const fieldLabel = caseOpConfig.label.toLowerCase();
45
- let caseOpLabel = "---";
46
- let caseOpName = "---";
47
- let caseOpId = "";
48
- let caseTime = "";
49
-
50
- if (fieldLabel === "create operator") {
51
- caseOpLabel = caseOpConfig.createLabel;
52
- caseOpName = caseOpConfig.createOperator.userName;
53
- caseTime = caseOpConfig.createDateTime;
54
- caseOpId = caseOpConfig.createOperator.userId;
55
- } else if (fieldLabel === "update operator") {
56
- caseOpLabel = caseOpConfig.updateLabel;
57
- caseOpName = caseOpConfig.updateOperator.userName;
58
- caseTime = caseOpConfig.updateDateTime;
59
- caseOpId = caseOpConfig.updateOperator.userId;
40
+ const fieldLabel = props?.label?.toLowerCase();
41
+ const displayLabel = props?.displayLabel?.toLowerCase();
42
+ let caseOpLabel = '---';
43
+ let caseOpName = '---';
44
+ let caseOpId = '';
45
+ let caseTime = '';
46
+
47
+ if (fieldLabel === 'create operator' || displayLabel === 'create operator') {
48
+ caseOpLabel = props.createLabel;
49
+ caseOpName = props.createOperator.userName;
50
+ caseTime = props.createDateTime;
51
+ caseOpId = props.createOperator.userId;
52
+ } else if (fieldLabel === 'update operator' || displayLabel === 'update operator') {
53
+ caseOpLabel = props.updateLabel;
54
+ caseOpName = props.updateOperator.userName;
55
+ caseTime = props.updateDateTime;
56
+ caseOpId = props.updateOperator.userId;
60
57
  }
61
58
 
62
59
  // Popover-related
63
60
  const [popoverAnchorEl, setPopoverAnchorEl] = useState(null);
64
- const [popoverFields, setPopoverFields] = useState<Array<any>>([]);
61
+ const [popoverFields, setPopoverFields] = useState<any[]>([]);
65
62
 
66
63
  const popoverOpen = Boolean(popoverAnchorEl);
67
64
  const popoverId = popoverOpen ? 'operator-details-popover' : undefined;
68
65
 
69
- const handlePopoverClose = (() => {
66
+ const handlePopoverClose = () => {
70
67
  setPopoverAnchorEl(null);
71
- })
68
+ };
72
69
 
73
70
  function showOperatorDetails(event) {
74
-
75
71
  const operatorPreviewPromise = PCore.getUserApi().getOperatorDetails(caseOpId);
76
72
  const localizedVal = PCore.getLocaleUtils().getLocaleValue;
77
73
  const localeCategory = 'Operator';
78
74
 
79
- operatorPreviewPromise.then((res) => {
80
- const fillerString = "---";
75
+ operatorPreviewPromise.then((res: any) => {
76
+ const fillerString = '---';
81
77
  let fields: any = [];
82
- if (
83
- res.data &&
84
- res.data.pyOperatorInfo &&
85
- res.data.pyOperatorInfo.pyUserName
86
- ) {
78
+ if (res.data && res.data.pyOperatorInfo && res.data.pyOperatorInfo.pyUserName) {
87
79
  fields = [
88
80
  {
89
- id: "pyPosition",
90
- name: localizedVal("Position", localeCategory),
81
+ id: 'pyPosition',
82
+ name: localizedVal('Position', localeCategory),
91
83
  value: res.data.pyOperatorInfo.pyPosition ? res.data.pyOperatorInfo.pyPosition : fillerString
92
84
  },
93
85
  {
94
- id: "pyOrganization",
95
- name: localizedVal("Organization", localeCategory),
86
+ id: 'pyOrganization',
87
+ name: localizedVal('Organization', localeCategory),
96
88
  value: res.data.pyOperatorInfo.pyOrganization ? res.data.pyOperatorInfo.pyOrganization : fillerString
97
89
  },
98
90
  {
99
- id: "ReportToUserName",
91
+ id: 'ReportToUserName',
100
92
  name: localizedVal('Reports to', localeCategory),
101
93
  value: res.data.pyOperatorInfo.pyReportToUserName ? res.data.pyOperatorInfo.pyReportToUserName : fillerString
102
94
  },
103
95
  {
104
- id: "pyTelephone",
96
+ id: 'pyTelephone',
105
97
  name: localizedVal('Telephone', localeCategory),
106
- value: res.data.pyOperatorInfo.pyTelephone ? <a href={`tel:${res.data.pyOperatorInfo.pyTelephone}`}>{res.data.pyOperatorInfo.pyTelephone}</a> : fillerString
98
+ value: res.data.pyOperatorInfo.pyTelephone ? (
99
+ <a href={`tel:${res.data.pyOperatorInfo.pyTelephone}`}>{res.data.pyOperatorInfo.pyTelephone}</a>
100
+ ) : (
101
+ fillerString
102
+ )
107
103
  },
108
104
  {
109
- id: "pyEmailAddress",
105
+ id: 'pyEmailAddress',
110
106
  name: localizedVal('Email address', localeCategory),
111
- value: res.data.pyOperatorInfo.pyEmailAddress ? <a href={`mailto:${res.data.pyOperatorInfo.pyEmailAddress}`}>{res.data.pyOperatorInfo.pyEmailAddress}</a> : fillerString
107
+ value: res.data.pyOperatorInfo.pyEmailAddress ? (
108
+ <a href={`mailto:${res.data.pyOperatorInfo.pyEmailAddress}`}>{res.data.pyOperatorInfo.pyEmailAddress}</a>
109
+ ) : (
110
+ fillerString
111
+ )
112
112
  }
113
113
  ];
114
114
  } else {
115
115
  // eslint-disable-next-line no-console
116
- console.log(`Operator: PCore.getUserApi().getOperatorDetails(${caseOpId}); returned empty res.data.pyOperatorInfo.pyUserName - adding default`);
116
+ console.log(
117
+ `Operator: PCore.getUserApi().getOperatorDetails(${caseOpId}); returned empty res.data.pyOperatorInfo.pyUserName - adding default`
118
+ );
117
119
  fields = [
118
120
  {
119
- id: "pyPosition",
120
- name: localizedVal("Position", localeCategory),
121
+ id: 'pyPosition',
122
+ name: localizedVal('Position', localeCategory),
121
123
  value: fillerString
122
124
  },
123
125
  {
124
- id: "pyOrganization",
125
- name: localizedVal("Organization", localeCategory),
126
+ id: 'pyOrganization',
127
+ name: localizedVal('Organization', localeCategory),
126
128
  value: fillerString
127
129
  },
128
130
  {
129
- id: "ReportToUserName",
131
+ id: 'ReportToUserName',
130
132
  name: localizedVal('Reports to', localeCategory),
131
133
  value: fillerString
132
134
  },
133
135
  {
134
- id: "pyTelephone",
136
+ id: 'pyTelephone',
135
137
  name: localizedVal('Telephone', localeCategory),
136
138
  value: fillerString
137
139
  },
138
140
  {
139
- id: "pyEmailAddress",
141
+ id: 'pyEmailAddress',
140
142
  name: localizedVal('Email address', localeCategory),
141
143
  value: fillerString
142
144
  }
@@ -159,23 +161,33 @@ export default function Operator(props: OperatorProps) {
159
161
  }
160
162
 
161
163
  // There are fields, so build the grid.
162
- return <Grid container className={classes.popover} spacing={1}>
163
- <Grid item xs={12}><Typography variant="h6">{caseOpName}</Typography></Grid>
164
- {popoverFields.map((field) => {
165
- return <React.Fragment key={field.id}>
166
- <Grid container item xs={12} spacing={1}>
167
- <Grid item xs={6}><Typography variant="caption">{field.name}</Typography></Grid>
168
- <Grid item xs={6}><Typography variant="subtitle2">{field.value}</Typography></Grid>
169
- </Grid>
170
- </React.Fragment>
171
- })}
172
- </Grid>
173
-
164
+ return (
165
+ <Grid container className={classes.popover} spacing={1}>
166
+ <Grid item xs={12}>
167
+ <Typography variant='h6'>{caseOpName}</Typography>
168
+ </Grid>
169
+ {popoverFields.map(field => {
170
+ return (
171
+ <React.Fragment key={field.id}>
172
+ <Grid container item xs={12} spacing={1}>
173
+ <Grid item xs={6}>
174
+ <Typography variant='caption'>{field.name}</Typography>
175
+ </Grid>
176
+ <Grid item xs={6}>
177
+ <Typography variant='subtitle2'>{field.value}</Typography>
178
+ </Grid>
179
+ </Grid>
180
+ </React.Fragment>
181
+ );
182
+ })}
183
+ </Grid>
184
+ );
174
185
  }
175
186
 
176
187
  // End of popover-related
177
188
 
178
- return <React.Fragment>
189
+ return (
190
+ <>
179
191
  <TextField
180
192
  defaultValue={caseOpName}
181
193
  label={caseOpLabel}
@@ -183,23 +195,23 @@ export default function Operator(props: OperatorProps) {
183
195
  InputProps={{
184
196
  readOnly: true,
185
197
  disableUnderline: true,
186
- inputProps: {style: {cursor: 'pointer'}}
198
+ inputProps: { style: { cursor: 'pointer' } }
187
199
  }}
188
200
  />
189
201
  <br />
190
- {Utils.generateDateTime(caseTime, "DateTime-Since")}
202
+ {Utils.generateDateTime(caseTime, 'DateTime-Since')}
191
203
 
192
204
  <Popover
193
205
  id={popoverId}
194
206
  open={popoverOpen}
195
207
  anchorEl={popoverAnchorEl}
196
208
  onClose={handlePopoverClose}
197
- anchorOrigin={{ vertical: 'bottom', horizontal: 'center'}}
198
- transformOrigin={{ vertical: 'top', horizontal: 'center'}}
199
- PaperProps={{ style: {maxWidth: '45ch'}}}
209
+ anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}
210
+ transformOrigin={{ vertical: 'top', horizontal: 'center' }}
211
+ PaperProps={{ style: { maxWidth: '45ch' } }}
200
212
  >
201
213
  {getPopoverGrid()}
202
214
  </Popover>
203
- </React.Fragment>;
204
-
215
+ </>
216
+ );
205
217
  }
@@ -1,35 +1,33 @@
1
- import React from "react";
2
- import { Card, CardContent, CardHeader, Typography } from "@material-ui/core";
1
+ import { PropsWithChildren } from 'react';
2
+ import { Card, CardContent, CardHeader, Typography } from '@material-ui/core';
3
3
  import { makeStyles } from '@material-ui/core/styles';
4
4
 
5
5
  // Pulse is one of the few components that does NOT have getPConnect.
6
6
  // So, no need to extend PConnProps
7
7
  interface PulseProps {
8
8
  // If any, enter additional props that only exist on this component
9
- children?: Array<any>
10
9
  }
11
10
 
12
-
13
- const useStyles = makeStyles((theme) => ({
11
+ const useStyles = makeStyles(theme => ({
14
12
  root: {
15
13
  marginTop: theme.spacing(1),
16
14
  marginBottom: theme.spacing(1),
17
- borderLeft: "6px solid",
15
+ borderLeft: '6px solid',
18
16
  borderLeftColor: theme.palette.primary.light
19
- },
17
+ }
20
18
  }));
21
19
 
22
- export default function Pulse(props: PulseProps) {
23
- // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
20
+ export default function Pulse(props: PropsWithChildren<PulseProps>) {
21
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
24
22
  const { children } = props;
25
23
  const classes = useStyles();
26
24
 
27
25
  return (
28
- <Card className={classes.root}>
29
- <CardHeader title={<Typography variant="h6">Pulse</Typography>} />
30
- <CardContent>
31
- <Typography>Pulse</Typography>
32
- </CardContent>
33
- </Card>
34
- );
26
+ <Card className={classes.root}>
27
+ <CardHeader title={<Typography variant='h6'>Pulse</Typography>} />
28
+ <CardContent>
29
+ <Typography>Pulse</Typography>
30
+ </CardContent>
31
+ </Card>
32
+ );
35
33
  }
@@ -1,9 +1,10 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { Editor } from '@tinymce/tinymce-react';
3
3
  import { FormControl, FormHelperText, InputLabel, makeStyles } from '@material-ui/core';
4
+
4
5
  import { useAfterInitialEffect, useConsolidatedRef, useUID } from '@pega/react-sdk-components/lib/hooks';
5
6
 
6
- const useStyles = makeStyles((theme) => ({
7
+ const useStyles = makeStyles(theme => ({
7
8
  fieldLabel: {
8
9
  position: 'relative',
9
10
  transform: 'translate(0, 0px) scale(1)',
@@ -40,7 +41,7 @@ const RichTextEditor = forwardRef(function RichTextEditor(props: RichTextEditorP
40
41
  editorRef?.current.mode.set(readOnly || disabled ? 'readonly' : 'design');
41
42
  }, [readOnly, disabled]);
42
43
 
43
- const filePickerCallback = (cb) => {
44
+ const filePickerCallback = cb => {
44
45
  const input = document.createElement('input');
45
46
  input.setAttribute('type', 'file');
46
47
  input.setAttribute('accept', 'image/*');
@@ -73,11 +74,11 @@ const RichTextEditor = forwardRef(function RichTextEditor(props: RichTextEditorP
73
74
  if (readOnly) {
74
75
  const value = defaultValue || '--';
75
76
  // eslint-disable-next-line react/no-danger
76
- richTextComponent = <div key={id} id={id} className="readonly-richtext-editor" dangerouslySetInnerHTML={{ __html: value }} />;
77
+ richTextComponent = <div key={id} id={id} className='readonly-richtext-editor' dangerouslySetInnerHTML={{ __html: value }} />;
77
78
  } else {
78
79
  richTextComponent = (
79
80
  <Editor
80
- tinymceScriptSrc="tinymce/tinymce.min.js"
81
+ tinymceScriptSrc='tinymce/tinymce.min.js'
81
82
  onInit={(_evt, editor) => {
82
83
  editorRef.current = editor;
83
84
  }}
@@ -108,7 +109,7 @@ const RichTextEditor = forwardRef(function RichTextEditor(props: RichTextEditorP
108
109
  return (
109
110
  <FormControl data-test-id={testId} error={error} required={required}>
110
111
  {!labelHidden && (
111
- <InputLabel id="demo-simple-select-error-label" className={classes.fieldLabel}>
112
+ <InputLabel id='demo-simple-select-error-label' className={classes.fieldLabel}>
112
113
  {label}
113
114
  </InputLabel>
114
115
  )}
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { Button } from '@material-ui/core';
3
2
  import './WssQuickCreate.css';
4
3
 
@@ -6,29 +5,30 @@ import './WssQuickCreate.css';
6
5
  // So, no need to extend PConnProps
7
6
  interface WssQuickCreateProps {
8
7
  // If any, enter additional props that only exist on this component
9
- heading: string,
10
- actions?: Array<any>
8
+ heading: string;
9
+ actions?: any[];
11
10
  }
12
11
 
13
-
14
12
  export default function WssQuickCreate(props: WssQuickCreateProps) {
15
13
  const { heading, actions } = props;
16
14
 
17
15
  return (
18
16
  <div>
19
- <h1 id="quick-links-heading" className='quick-link-heading'>{heading}</h1>
20
- <ul id="quick-links" className='quick-link-ul-list'>
17
+ <h1 id='quick-links-heading' className='quick-link-heading'>
18
+ {heading}
19
+ </h1>
20
+ <ul id='quick-links' className='quick-link-ul-list'>
21
21
  {actions &&
22
22
  actions.map(element => {
23
23
  return (
24
- <li className='quick-link-list' key={element.label}>
25
- <Button className='quick-link-button' onClick={element.onClick}>
26
- <span className='quick-link-button-span'>
27
- {element.icon && <img className='quick-link-icon' src={element.icon}/>}
28
- <span>{element.label}</span>
29
- </span>
30
- </Button>
31
- </li>
24
+ <li className='quick-link-list' key={element.label}>
25
+ <Button className='quick-link-button' onClick={element.onClick}>
26
+ <span className='quick-link-button-span'>
27
+ {element.icon && <img className='quick-link-icon' src={element.icon} />}
28
+ <span>{element.label}</span>
29
+ </span>
30
+ </Button>
31
+ </li>
32
32
  );
33
33
  })}
34
34
  </ul>