@pega/react-sdk-overrides 23.1.10 → 23.1.12

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 (232) 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 +21 -32
  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 +120 -63
  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 +33 -44
  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/MultiSelect/Multiselect.tsx +244 -0
  44. package/lib/field/MultiSelect/index.tsx +1 -0
  45. package/lib/field/MultiSelect/utils.ts +230 -0
  46. package/lib/field/Percentage/Percentage.tsx +46 -41
  47. package/lib/field/Percentage/config-ext.json +1 -2
  48. package/lib/field/Phone/Phone.tsx +13 -12
  49. package/lib/field/Phone/index.tsx +1 -1
  50. package/lib/field/RadioButtons/RadioButtons.tsx +20 -18
  51. package/lib/field/RadioButtons/config-ext.json +1 -2
  52. package/lib/field/RichText/RichText.tsx +8 -7
  53. package/lib/field/ScalarList/ScalarList.tsx +3 -13
  54. package/lib/field/ScalarList/config-ext.json +1 -2
  55. package/lib/field/SemanticLink/SemanticLink.tsx +7 -7
  56. package/lib/field/SemanticLink/config-ext.json +1 -2
  57. package/lib/field/SemanticLink/utils.ts +8 -11
  58. package/lib/field/TextArea/TextArea.tsx +7 -6
  59. package/lib/field/TextArea/config-ext.json +1 -2
  60. package/lib/field/TextContent/TextContent.tsx +4 -6
  61. package/lib/field/TextContent/config-ext.json +1 -2
  62. package/lib/field/TextInput/TextInput.tsx +9 -7
  63. package/lib/field/TextInput/config-ext.json +1 -2
  64. package/lib/field/TextInput/index.tsx +1 -1
  65. package/lib/field/Time/Time.tsx +11 -11
  66. package/lib/field/Time/config-ext.json +1 -2
  67. package/lib/field/URL/URL.tsx +9 -8
  68. package/lib/field/URL/config-ext.json +1 -2
  69. package/lib/field/URL/index.tsx +1 -1
  70. package/lib/field/UserReference/UserReference.tsx +18 -16
  71. package/lib/field/UserReference/UserReferenceUtils.ts +2 -2
  72. package/lib/field/UserReference/config-ext.json +1 -2
  73. package/lib/helpers/attachmentHelpers.ts +13 -8
  74. package/lib/helpers/case-utils.tsx +4 -8
  75. package/lib/helpers/common-utils.ts +5 -1
  76. package/lib/helpers/data_page.ts +3 -7
  77. package/lib/helpers/date-format-utils.ts +3 -3
  78. package/lib/helpers/event-utils.ts +3 -3
  79. package/lib/helpers/field-group-utils.ts +1 -1
  80. package/lib/helpers/formatters/Boolean.ts +9 -26
  81. package/lib/helpers/formatters/Currency.ts +15 -21
  82. package/lib/helpers/formatters/CurrencyMap.ts +505 -501
  83. package/lib/helpers/formatters/Date.ts +20 -26
  84. package/lib/helpers/formatters/common.ts +1 -2
  85. package/lib/helpers/formatters/index.ts +26 -19
  86. package/lib/helpers/instructions-utils.ts +38 -0
  87. package/lib/helpers/reactContextHelpers.ts +2 -2
  88. package/lib/helpers/simpleTableHelpers.ts +59 -83
  89. package/lib/helpers/state-utils.tsx +5 -9
  90. package/lib/helpers/template-utils.ts +3 -6
  91. package/lib/helpers/utils.ts +5 -5
  92. package/lib/helpers/versionHelpers.ts +1 -4
  93. package/lib/infra/ActionButtons/ActionButtons.tsx +38 -29
  94. package/lib/infra/ActionButtons/index.tsx +1 -1
  95. package/lib/infra/Assignment/Assignment.tsx +99 -79
  96. package/lib/infra/Assignment/index.tsx +1 -1
  97. package/lib/infra/AssignmentCard/AssignmentCard.tsx +13 -16
  98. package/lib/infra/AssignmentCard/index.tsx +1 -1
  99. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +67 -213
  100. package/lib/infra/Containers/FlowContainer/helpers.ts +34 -45
  101. package/lib/infra/Containers/FlowContainer/index.tsx +1 -1
  102. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +65 -0
  103. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/index.tsx +1 -0
  104. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +227 -218
  105. package/lib/infra/Containers/ModalViewContainer/index.tsx +1 -1
  106. package/lib/infra/Containers/SimpleView/SimpleView.tsx +48 -0
  107. package/lib/infra/Containers/SimpleView/helper.ts +125 -0
  108. package/lib/infra/Containers/SimpleView/index.tsx +1 -0
  109. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +36 -46
  110. package/lib/infra/Containers/helpers.ts +6 -0
  111. package/lib/infra/DashboardFilter/DashboardFilter.tsx +21 -42
  112. package/lib/infra/DashboardFilter/filterUtils.tsx +12 -43
  113. package/lib/infra/DeferLoad/DeferLoad.tsx +22 -28
  114. package/lib/infra/DeferLoad/index.tsx +1 -1
  115. package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +16 -30
  116. package/lib/infra/MultiStep/MultiStep.css +11 -15
  117. package/lib/infra/MultiStep/MultiStep.tsx +176 -212
  118. package/lib/infra/MultiStep/index.tsx +1 -1
  119. package/lib/infra/NavBar/NavBar.css +103 -105
  120. package/lib/infra/NavBar/NavBar.tsx +19 -31
  121. package/lib/infra/Reference/Reference.tsx +16 -18
  122. package/lib/infra/Region/Region.tsx +4 -6
  123. package/lib/infra/RootContainer/RootContainer.tsx +75 -111
  124. package/lib/infra/RootContainer/index.tsx +1 -1
  125. package/lib/infra/Stages/Stages.tsx +32 -39
  126. package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +11 -11
  127. package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +21 -28
  128. package/lib/infra/View/View.tsx +17 -21
  129. package/lib/template/AppShell/AppShell.css +22 -23
  130. package/lib/template/AppShell/AppShell.tsx +39 -74
  131. package/lib/template/BannerPage/BannerPage.tsx +12 -14
  132. package/lib/template/CaseSummary/CaseSummary.tsx +58 -18
  133. package/lib/template/CaseSummary/config-ext.json +1 -2
  134. package/lib/template/CaseView/CaseView.tsx +34 -63
  135. package/lib/template/CaseView/config-ext.json +1 -2
  136. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +63 -19
  137. package/lib/template/Confirmation/Confirmation.tsx +12 -17
  138. package/lib/template/Confirmation/config-ext.json +1 -2
  139. package/lib/template/DataReference/DataReference.tsx +95 -121
  140. package/lib/template/DataReference/config-ext.json +1 -2
  141. package/lib/template/DefaultForm/DefaultForm.css +7 -3
  142. package/lib/template/DefaultForm/DefaultForm.tsx +13 -16
  143. package/lib/template/DefaultForm/config-ext.json +1 -2
  144. package/lib/template/Details/Details/Details.tsx +19 -22
  145. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +9 -13
  146. package/lib/template/Details/DetailsSubTabs/config-ext.json +1 -2
  147. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +19 -24
  148. package/lib/template/Details/DetailsThreeColumn/config-ext.json +1 -2
  149. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +19 -25
  150. package/lib/template/Details/DetailsTwoColumn/config-ext.json +1 -2
  151. package/lib/template/Details/DetailsTwoColumn/index.tsx +1 -1
  152. package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +15 -14
  153. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +15 -22
  154. package/lib/template/InlineDashboard/InlineDashboard.tsx +12 -14
  155. package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +12 -16
  156. package/lib/template/ListPage/ListPage.tsx +5 -10
  157. package/lib/template/ListPage/config-ext.json +1 -2
  158. package/lib/template/ListView/DefaultViewMeta.ts +1 -3
  159. package/lib/template/ListView/ListView.tsx +185 -175
  160. package/lib/template/ListView/config-ext.json +1 -2
  161. package/lib/template/ListView/hooks.ts +24 -26
  162. package/lib/template/ListView/utils.ts +51 -87
  163. package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +20 -20
  164. package/lib/template/NarrowWide/NarrowWide/NarrowWide.css +0 -2
  165. package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +25 -38
  166. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +20 -25
  167. package/lib/template/NarrowWide/NarrowWideDetails/config-ext.json +1 -2
  168. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.css +0 -2
  169. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +14 -24
  170. package/lib/template/NarrowWide/NarrowWideForm/config-ext.json +1 -2
  171. package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +9 -19
  172. package/lib/template/NarrowWide/NarrowWidePage/config-ext.json +1 -2
  173. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +14 -15
  174. package/lib/template/OneColumn/OneColumn/config-ext.json +1 -2
  175. package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +3 -10
  176. package/lib/template/OneColumn/OneColumnPage/config-ext.json +1 -2
  177. package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +6 -10
  178. package/lib/template/OneColumn/OneColumnTab/config-ext.json +1 -2
  179. package/lib/template/PromotedFilters/PromotedFilters.css +1 -1
  180. package/lib/template/PromotedFilters/PromotedFilters.tsx +32 -28
  181. package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +37 -33
  182. package/lib/template/SimpleTable/SimpleTable/config-ext.json +1 -2
  183. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +187 -121
  184. package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +24 -25
  185. package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +30 -30
  186. package/lib/template/SubTabs/SubTabs.tsx +22 -40
  187. package/lib/template/SubTabs/config-ext.json +1 -2
  188. package/lib/template/SubTabs/tabUtils.ts +2 -5
  189. package/lib/template/TwoColumn/TwoColumn/TwoColumn.css +0 -1
  190. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +30 -28
  191. package/lib/template/TwoColumn/TwoColumn/config-ext.json +1 -2
  192. package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +3 -10
  193. package/lib/template/TwoColumn/TwoColumnPage/config-ext.json +1 -2
  194. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +30 -28
  195. package/lib/template/TwoColumn/TwoColumnTab/config-ext.json +1 -2
  196. package/lib/template/WideNarrow/WideNarrow/WideNarrow.css +0 -2
  197. package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +22 -34
  198. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +24 -28
  199. package/lib/template/WideNarrow/WideNarrowDetails/config-ext.json +1 -2
  200. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.css +0 -2
  201. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +13 -21
  202. package/lib/template/WideNarrow/WideNarrowForm/config-ext.json +1 -2
  203. package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +8 -16
  204. package/lib/template/WideNarrow/WideNarrowPage/config-ext.json +1 -2
  205. package/lib/template/WideNarrow/WideNarrowPage/index.tsx +1 -1
  206. package/lib/template/WssNavBar/WssNavBar.tsx +18 -21
  207. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +29 -28
  208. package/lib/widget/AppAnnouncement/config-ext.json +1 -2
  209. package/lib/widget/Attachment/Attachment.css +60 -1
  210. package/lib/widget/Attachment/Attachment.tsx +378 -405
  211. package/lib/widget/Attachment/index.tsx +1 -1
  212. package/lib/widget/CaseHistory/CaseHistory.tsx +64 -66
  213. package/lib/widget/CaseHistory/config-ext.json +1 -2
  214. package/lib/widget/CaseHistory/index.tsx +1 -1
  215. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +16 -18
  216. package/lib/widget/FileUtility/FileUtility/FileUtility.css +2 -2
  217. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +310 -246
  218. package/lib/widget/FileUtility/FileUtility/config-ext.json +1 -2
  219. package/lib/widget/Followers/Followers.tsx +23 -20
  220. package/lib/widget/Followers/config-ext.json +1 -2
  221. package/lib/widget/QuickCreate/QuickCreate.tsx +68 -42
  222. package/lib/widget/SummaryItem/SummaryItem.css +9 -9
  223. package/lib/widget/SummaryItem/SummaryItem.tsx +58 -58
  224. package/lib/widget/SummaryItem/index.tsx +1 -1
  225. package/lib/widget/SummaryList/SummaryList.tsx +7 -10
  226. package/lib/widget/ToDo/ToDo.css +4 -4
  227. package/lib/widget/ToDo/ToDo.tsx +52 -53
  228. package/lib/widget/ToDo/config-ext.json +1 -2
  229. package/package.json +5 -2
  230. package/lib/helpers/auth.js +0 -834
  231. package/lib/helpers/authManager.ts +0 -933
  232. package/lib/helpers/config_access.js +0 -186
@@ -4,6 +4,5 @@
4
4
  "description": "Attachments",
5
5
  "type": "Widget",
6
6
  "subtype": "CASE",
7
- "properties": [
8
- ]
7
+ "properties": []
9
8
  }
@@ -1,16 +1,13 @@
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
- // import { green } from "@material-ui/core/colors";
4
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
5
 
6
- // Followers does NOT have getPConnect. So, no need to extend from PConnProps
7
- interface FollowersProps {
6
+ interface FollowersProps extends PConnProps {
8
7
  // If any, enter additional props that only exist on this component
9
- children: Array<any>
10
8
  }
11
9
 
12
-
13
- const useStyles = makeStyles((theme) => ({
10
+ const useStyles = makeStyles(theme => ({
14
11
  root: {
15
12
  paddingRight: theme.spacing(1),
16
13
  paddingLeft: theme.spacing(1),
@@ -19,24 +16,30 @@ const useStyles = makeStyles((theme) => ({
19
16
  marginRight: theme.spacing(1),
20
17
  marginLeft: theme.spacing(1),
21
18
  marginTop: theme.spacing(1),
22
- marginBottom: theme.spacing(1),
19
+ marginBottom: theme.spacing(1)
23
20
  // borderLeft: "6px solid",
24
21
  // borderLeftColor: green[300]
25
- },
22
+ }
26
23
  }));
27
24
 
28
- export default function Followers(props: FollowersProps) {
29
- const componentName = "Followers";
30
- // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
25
+ export default function Followers(props: PropsWithChildren<FollowersProps>) {
26
+ const componentName = 'Followers';
27
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
31
28
  const { children } = props;
32
29
  const classes = useStyles();
33
30
 
34
31
  return (
35
- <Card className={classes.root}>
36
- <CardHeader title={<Typography variant="h6" component="div">{componentName} - <em>unsupported</em></Typography>} />
37
- <CardContent>
38
- <Typography>{componentName} content</Typography>
39
- </CardContent>
40
- </Card>
41
- );
32
+ <Card className={classes.root}>
33
+ <CardHeader
34
+ title={
35
+ <Typography variant='h6' component='div'>
36
+ {componentName} - <em>unsupported</em>
37
+ </Typography>
38
+ }
39
+ />
40
+ <CardContent>
41
+ <Typography>{componentName} content</Typography>
42
+ </CardContent>
43
+ </Card>
44
+ );
42
45
  }
@@ -4,6 +4,5 @@
4
4
  "description": "Followers",
5
5
  "type": "Widget",
6
6
  "subtype": "CASE",
7
- "properties": [
8
- ]
7
+ "properties": []
9
8
  }
@@ -1,63 +1,89 @@
1
- import React from "react";
1
+ import { useEffect, useState } from 'react';
2
2
  import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
3
3
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
4
- // import type { PConnProps } from '../../../types/PConnProps';
5
-
6
- // Can't add PConnTypes until we can resolve type problems with
7
- // 2nd arg to createWork
8
- // interface QuickCreateProps extends PConnProps {
9
- // // If any, enter additional props that only exist on this component
10
- // }
4
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
11
5
 
6
+ interface QuickCreateProps extends PConnProps {
7
+ // If any, enter additional props that only exist on this component
8
+ heading: string;
9
+ showCaseIcons: boolean;
10
+ classFilter: any[];
11
+ }
12
12
 
13
- export default function QuickCreate(props /* : QuickCreateProps */) {
13
+ export default function QuickCreate(props: QuickCreateProps) {
14
14
  // Get emitted components from map (so we can get any override that may exist)
15
15
  const WssQuickCreate = getComponentFromMap('WssQuickCreate');
16
16
 
17
17
  const { getPConnect, heading, showCaseIcons, classFilter } = props;
18
18
  const pConn = getPConnect();
19
- const createCase = (className) => {
19
+ const createCase = className => {
20
20
  pConn
21
21
  .getActionsApi()
22
- .createWork(className, { })
23
- .catch((error) => {
22
+ .createWork(className, {} as any)
23
+ .catch(error => {
24
24
  // eslint-disable-next-line no-console
25
- console.log('Error in case creation: ', error?.message)
25
+ console.log('Error in case creation: ', error?.message);
26
26
  });
27
27
  };
28
28
 
29
- const cases: any = [];
30
- const envInfo = PCore.getEnvironmentInfo();
31
- if (
32
- classFilter &&
33
- envInfo.environmentInfoObject &&
34
- envInfo.environmentInfoObject.pyCaseTypeList &&
35
- envInfo.environmentInfoObject.pyCaseTypeList.length > 0
36
- ) {
37
- classFilter.forEach((item) => {
38
- let icon = Utils.getImageSrc('polaris-solid', Utils.getSDKStaticConentUrl());
39
- let label = '';
40
- envInfo.environmentInfoObject.pyCaseTypeList.forEach((casetype) => {
41
- if (casetype.pyWorkTypeImplementationClassName === item) {
42
- icon = casetype.pxIcon && Utils.getImageSrc(casetype?.pxIcon, Utils.getSDKStaticConentUrl());
43
- label = casetype.pyWorkTypeName ?? '';
29
+ const [quickCreatecases, setCases] = useState([]);
30
+
31
+ /* If the classFilter is empty and has no entries - we will default to the default set of case types
32
+ It will usually come from the envInfo but for Launchpad, this is not populated - instead get the list of cases from the store */
33
+ useEffect(() => {
34
+ const cases: any = [];
35
+ const defaultCases: any = [];
36
+ const envInfo = PCore.getEnvironmentInfo();
37
+ if (envInfo?.environmentInfoObject?.pyCaseTypeList) {
38
+ envInfo.environmentInfoObject.pyCaseTypeList.forEach(casetype => {
39
+ if (casetype.pyWorkTypeName && casetype.pyWorkTypeImplementationClassName) {
40
+ defaultCases.push({
41
+ classname: casetype.pyWorkTypeImplementationClassName,
42
+ onClick: () => {
43
+ createCase(casetype.pyWorkTypeImplementationClassName);
44
+ },
45
+ ...(showCaseIcons && { icon: Utils.getImageSrc(casetype?.pxIcon, Utils.getSDKStaticConentUrl()) }),
46
+ label: casetype.pyWorkTypeName
47
+ });
44
48
  }
45
49
  });
46
- if (label !== '') {
47
- cases.push({
48
- label,
49
- onClick: () => {
50
- createCase(item);
51
- },
52
- ...(showCaseIcons && { icon })
50
+ } else {
51
+ const pConnectInAppContext = PCore.createPConnect({
52
+ options: { context: PCore.getConstants().APP.APP }
53
+ }).getPConnect();
54
+ const pyPortalInAppContext = pConnectInAppContext.getValue('pyPortal') as any;
55
+ pyPortalInAppContext?.pyCaseTypesAvailableToCreate?.forEach(casetype => {
56
+ if (casetype.pyClassName && casetype.pyLabel) {
57
+ defaultCases.push({
58
+ classname: casetype.pyClassName,
59
+ onClick: () => {
60
+ createCase(casetype.pyClassName);
61
+ },
62
+ ...(showCaseIcons && { icon: Utils.getImageSrc(casetype?.pxIcon, Utils.getSDKStaticConentUrl()) }),
63
+ label: casetype.pyLabel
64
+ });
65
+ }
66
+ });
67
+ }
68
+
69
+ /* If classFilter is not empty - filter from the list of defaultCases */
70
+ if (classFilter?.length > 0) {
71
+ classFilter.forEach(item => {
72
+ defaultCases.forEach(casetype => {
73
+ if (casetype.classname === item) {
74
+ cases.push(casetype);
75
+ }
53
76
  });
54
- }
55
- });
56
- }
77
+ });
78
+ setCases(cases);
79
+ } else {
80
+ setCases(defaultCases);
81
+ }
82
+ }, []);
57
83
 
58
84
  return (
59
- <div>
60
- <WssQuickCreate heading={heading} actions={cases}></WssQuickCreate>
61
- </div>
62
- );
85
+ <div>
86
+ <WssQuickCreate heading={heading} actions={quickCreatecases} />
87
+ </div>
88
+ );
63
89
  }
@@ -10,7 +10,7 @@
10
10
  display: flex;
11
11
  flex-direction: row;
12
12
  padding: 0.25rem 0rem 0.25rem 0.25rem;
13
- margin-bottom: 0.5rem
13
+ margin-bottom: 0.5rem;
14
14
  }
15
15
 
16
16
  .psdk-utility-card-icon {
@@ -43,17 +43,17 @@
43
43
  }
44
44
 
45
45
  .psdk-utility-card {
46
- display: flex;
47
- align-items: center;
48
- border: 0.0625rem solid rgb(207, 207, 207);
49
- border-radius: calc(0.25rem);
50
- min-height: 3rem;
46
+ display: flex;
47
+ align-items: center;
48
+ border: 0.0625rem solid rgb(207, 207, 207);
49
+ border-radius: calc(0.25rem);
50
+ min-height: 3rem;
51
51
  }
52
52
 
53
53
  .psdk-utility-button {
54
- background: none;
55
- border: none;
56
- cursor: pointer;
54
+ background: none;
55
+ border: none;
56
+ cursor: pointer;
57
57
  }
58
58
 
59
59
  .psdk-utility-action {
@@ -1,37 +1,36 @@
1
- import React, { useState } from "react";
2
- import { Utils } from "@pega/react-sdk-components/lib/components/helpers/utils";
3
- import './SummaryItem.css'
4
- import { IconButton, Menu, MenuItem } from '@material-ui/core';
1
+ import { useState } from 'react';
2
+ import { IconButton, Menu, MenuItem } from '@material-ui/core';
5
3
  import MoreVertIcon from '@material-ui/icons/MoreVert';
4
+ import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
5
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
6
 
7
- // SummaryItem does NOT have getPConnect. So, no need to extend from PConnProps
7
+ import './SummaryItem.css';
8
8
 
9
- interface SummaryItemProps {
9
+ interface SummaryItemProps extends PConnProps {
10
10
  // If any, enter additional props that only exist on this component
11
- menuIconOverride$: string,
12
- menuIconOverrideAction$: any,
13
- arItems$: Array<any> | any
11
+ menuIconOverride$: string;
12
+ menuIconOverrideAction$: any;
13
+ arItems$: any[] | any;
14
14
  }
15
15
 
16
-
17
- export default function SummaryItem(props:SummaryItemProps) {
18
- let imagePath$ = "";
16
+ export default function SummaryItem(props: SummaryItemProps) {
17
+ let imagePath$ = '';
19
18
  let menuIconOverride$;
20
- menuIconOverride$ = props.menuIconOverride$
19
+ menuIconOverride$ = props.menuIconOverride$;
21
20
  imagePath$ = Utils.getIconPath(Utils.getSDKStaticConentUrl());
22
21
  const item = props.arItems$;
23
- const srcImg = `${imagePath$}${item.visual.icon}.svg`
22
+ const srcImg = `${imagePath$}${item.visual.icon}.svg`;
24
23
  const [anchorEl, setAnchorEl] = useState(null);
25
24
  const open = Boolean(anchorEl);
26
25
  if (menuIconOverride$) {
27
- menuIconOverride$ = Utils.getImageSrc(menuIconOverride$ , Utils.getSDKStaticConentUrl());
26
+ menuIconOverride$ = Utils.getImageSrc(menuIconOverride$, Utils.getSDKStaticConentUrl());
28
27
  }
29
28
 
30
29
  function removeAttachment() {
31
- props.menuIconOverrideAction$(item)
30
+ props.menuIconOverrideAction$(item);
32
31
  }
33
32
 
34
- const handleClick = (event) => {
33
+ const handleClick = event => {
35
34
  setAnchorEl(event.currentTarget);
36
35
  };
37
36
 
@@ -40,49 +39,50 @@ export default function SummaryItem(props:SummaryItemProps) {
40
39
  };
41
40
 
42
41
  return (
43
- <div className="psdk-utility-card">
44
- <div className="psdk-utility-card-icon">
45
- <img className="psdk-utility-card-svg-icon" src={srcImg}></img>
42
+ <div className='psdk-utility-card'>
43
+ <div className='psdk-utility-card-icon'>
44
+ <img className='psdk-utility-card-svg-icon' src={srcImg} />
46
45
  </div>
47
- <div className="psdk-utility-card-main">
48
- {item.primary.type !== 'URL' && (<div className="psdk-utility-card-main-primary-label">{item.primary.name}</div>)}
49
- {item.primary.type === 'URL' && (<div className="psdk-utility-card-main-primary-url">
50
- <button type="button" className="psdk-link-button">
51
- {item.primary.name}&nbsp;
52
- <img className="psdk-utility-card-actions-svg-icon" src={`${imagePath$}${item.primary.icon}.svg`}></img>
53
- </button>
54
- </div>)}
55
- {item.secondary.text && (<div style={{ color: item.secondary.error ? 'red' : undefined }}>{item.secondary.text}</div>)}
46
+ <div className='psdk-utility-card-main'>
47
+ {item.primary.type !== 'URL' && <div className='psdk-utility-card-main-primary-label'>{item.primary.name}</div>}
48
+ {item.primary.type === 'URL' && (
49
+ <div className='psdk-utility-card-main-primary-url'>
50
+ <button type='button' className='psdk-link-button'>
51
+ {item.primary.name}&nbsp;
52
+ <img className='psdk-utility-card-actions-svg-icon' src={`${imagePath$}${item.primary.icon}.svg`} />
53
+ </button>
54
+ </div>
55
+ )}
56
+ {item.secondary.text && <div style={{ color: item.secondary.error ? 'red' : undefined }}>{item.secondary.text}</div>}
56
57
  </div>
57
- <div className="psdk-utility-action">
58
- {menuIconOverride$ && (<button type="button" className="psdk-utility-button" onClick={removeAttachment}>
59
- <img className="psdk-utility-card-action-svg-icon" src={menuIconOverride$}></img>
60
- </button>)}
61
- {!menuIconOverride$ && (<div>
62
- <IconButton
63
- id="setting-button"
64
- aria-controls={open ? 'file-menu' : undefined}
65
- aria-expanded={open ? 'true' : undefined}
66
- aria-haspopup="true"
67
- onClick={handleClick}
68
- >
69
- <MoreVertIcon />
70
- </IconButton>
71
- <Menu style={{marginTop: '3rem'}}
72
- id="file-menu"
73
- anchorEl={anchorEl}
74
- keepMounted
75
- open={Boolean(anchorEl)}
76
- onClose={handleClose}
77
- >
78
- {item.actions && item.actions.map((option) => (
79
- <MenuItem style={{fontSize: '14px'}} key={option.id || option.text} onClick={option.onClick}>
80
- {option.text}
81
- </MenuItem>
82
- ))}
83
- </Menu>
84
- </div>)}
58
+ <div className='psdk-utility-action'>
59
+ {menuIconOverride$ && (
60
+ <button type='button' className='psdk-utility-button' aria-label='Delete Attachment' onClick={removeAttachment}>
61
+ <img className='psdk-utility-card-action-svg-icon' src={menuIconOverride$} />
62
+ </button>
63
+ )}
64
+ {!menuIconOverride$ && (
65
+ <div>
66
+ <IconButton
67
+ id='setting-button'
68
+ aria-controls={open ? 'file-menu' : undefined}
69
+ aria-expanded={open ? 'true' : undefined}
70
+ aria-haspopup='true'
71
+ onClick={handleClick}
72
+ >
73
+ <MoreVertIcon />
74
+ </IconButton>
75
+ <Menu style={{ marginTop: '3rem' }} id='file-menu' anchorEl={anchorEl} keepMounted open={Boolean(anchorEl)} onClose={handleClose}>
76
+ {item.actions &&
77
+ item.actions.map(option => (
78
+ <MenuItem style={{ fontSize: '14px' }} key={option.id || option.text} onClick={option.onClick}>
79
+ {option.text}
80
+ </MenuItem>
81
+ ))}
82
+ </Menu>
83
+ </div>
84
+ )}
85
85
  </div>
86
86
  </div>
87
- )
87
+ );
88
88
  }
@@ -1 +1 @@
1
- export { default } from './SummaryItem';
1
+ export { default } from './SummaryItem';
@@ -1,25 +1,22 @@
1
- import React from "react";
2
1
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
2
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
3
 
4
- // SummaryList does NOT have getPConnect. So, no need to extend from PConnProps
5
-
6
- interface SummaryListProps {
4
+ interface SummaryListProps extends PConnProps {
7
5
  // If any, enter additional props that only exist on this component
8
- arItems$: Array<any>,
9
- menuIconOverride$?: string,
10
- menuIconOverrideAction$?: any
6
+ arItems$: any[];
7
+ menuIconOverride$?: string;
8
+ menuIconOverrideAction$?: any;
11
9
  }
12
10
 
13
-
14
11
  export default function SummaryList(props: SummaryListProps) {
15
12
  // Get emitted components from map (so we can get any override that may exist)
16
13
  const SummaryItem = getComponentFromMap('SummaryItem');
17
14
 
18
- const { menuIconOverride$: menuOverride = ""} = props;
15
+ const { menuIconOverride$: menuOverride = '' } = props;
19
16
  return (
20
17
  <div>
21
18
  {props.arItems$.map(file => (
22
- <SummaryItem key={file.id} menuIconOverride$={menuOverride} arItems$={file} menuIconOverrideAction$={props.menuIconOverrideAction$}></SummaryItem>
19
+ <SummaryItem key={file.id} menuIconOverride$={menuOverride} arItems$={file} menuIconOverrideAction$={props.menuIconOverrideAction$} />
23
20
  ))}
24
21
  </div>
25
22
  );
@@ -18,9 +18,9 @@
18
18
 
19
19
  .psdk-assignment-count {
20
20
  background-color: var(--app-primary-light-color);
21
- margin: .5rem;
21
+ margin: 0.5rem;
22
22
  border-radius: 45%;
23
- padding: 0.15rem .4rem;
23
+ padding: 0.15rem 0.4rem;
24
24
  }
25
25
 
26
26
  .psdk-todo-id {
@@ -48,7 +48,7 @@
48
48
 
49
49
  .psdk-todo-assignment {
50
50
  display: inline-flex;
51
- width:100%;
51
+ width: 100%;
52
52
  padding: 0.625rem 0rem;
53
53
  }
54
54
 
@@ -86,7 +86,7 @@
86
86
  text-align: center;
87
87
  }
88
88
 
89
- .psdk-todo-avatar-header{
89
+ .psdk-todo-avatar-header {
90
90
  display: flex;
91
91
  align-items: center;
92
92
  padding: 16px;